forked from community/device-mgt-core
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt
commit
2133762792
@ -1,20 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Unless required by applicable law or agreed to in writing,
|
||||||
*
|
* software distributed under the License is distributed on an
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* KIND, either express or implied. See the License for the
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* specific language governing permissions and limitations
|
||||||
* See the License for the specific language governing permissions and
|
* under the License.
|
||||||
* limitations under the License.
|
|
||||||
*/
|
*/
|
||||||
package org.wso2.carbon.mdm.api.util;
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.api.util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class holds all the constants used for IOS and Android.
|
* This class holds all the constants used for IOS and Android.
|
@ -1,23 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Unless required by applicable law or agreed to in writing,
|
||||||
*
|
* software distributed under the License is distributed on an
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* software distributed under the License is distributed on an
|
* KIND, either express or implied. See the License for the
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* specific language governing permissions and limitations
|
||||||
* KIND, either express or implied. See the License for the
|
* under the License.
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.beans;
|
package org.wso2.carbon.device.mgt.jaxrs.beans;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,22 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.beans;
|
package org.wso2.carbon.device.mgt.jaxrs.beans;
|
||||||
|
|
||||||
public class PriorityUpdatedPolicyWrapper {
|
public class PriorityUpdatedPolicyWrapper {
|
||||||
|
|
@ -1,22 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.beans;
|
package org.wso2.carbon.device.mgt.jaxrs.beans;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,26 +1,25 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.beans;
|
package org.wso2.carbon.device.mgt.jaxrs.beans;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
|
|
||||||
public class ProfileFeature implements Serializable {
|
public class ProfileFeature implements Serializable {
|
||||||
|
|
@ -1,24 +1,25 @@
|
|||||||
package org.wso2.carbon.mdm.beans;
|
|
||||||
|
|
||||||
import org.wso2.carbon.user.mgt.common.UIPermissionNode;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.beans;
|
||||||
|
|
||||||
|
import org.wso2.carbon.user.mgt.common.UIPermissionNode;
|
||||||
|
|
||||||
public class RoleWrapper {
|
public class RoleWrapper {
|
||||||
private String roleName;
|
private String roleName;
|
||||||
private String[] permissions;
|
private String[] permissions;
|
@ -1,22 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.beans;
|
package org.wso2.carbon.device.mgt.jaxrs.beans;
|
||||||
|
|
||||||
public class UserCredentialWrapper {
|
public class UserCredentialWrapper {
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.beans.android;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents the Appstore Application information.
|
||||||
|
*/
|
||||||
|
public class AppStoreApplication implements Serializable {
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
private String appIdentifier;
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppIdentifier() {
|
||||||
|
return appIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppIdentifier(String appIdentifier) {
|
||||||
|
this.appIdentifier = appIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toJSON() throws MDMAPIException {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
return gson.toJson(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.beans.android;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents the Enterprise Application information.
|
||||||
|
*/
|
||||||
|
public class EnterpriseApplication implements Serializable {
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
private String url;
|
||||||
|
private String appIdentifier;
|
||||||
|
|
||||||
|
public String getAppIdentifier() {
|
||||||
|
return appIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppIdentifier(String appIdentifier) {
|
||||||
|
this.appIdentifier = appIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toJSON() throws MDMAPIException {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
return gson.toJson(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.beans.android;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents the Web Application information.
|
||||||
|
*/
|
||||||
|
public class WebApplication implements Serializable {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String url;
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toJSON() throws MDMAPIException {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
return gson.toJson(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.beans.ios;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class RemoveApplication implements Serializable {
|
||||||
|
|
||||||
|
private String bundleId;
|
||||||
|
|
||||||
|
public String getBundleId() {
|
||||||
|
return bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBundleId(String bundleId) {
|
||||||
|
this.bundleId = bundleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toJSON() throws MDMAPIException {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
return gson.toJson(this);
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,25 @@
|
|||||||
package org.wso2.carbon.mdm.beans.ios;
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.device.mgt.jaxrs.beans.ios;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import org.wso2.carbon.mdm.api.common.MDMAPIException;
|
import org.wso2.carbon.device.mgt.jaxrs.api.common.MDMAPIException;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class WebClip {
|
public class WebClip {
|
||||||
|
|
@ -1,23 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Unless required by applicable law or agreed to in writing,
|
||||||
*
|
* software distributed under the License is distributed on an
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* software distributed under the License is distributed on an
|
* KIND, either express or implied. See the License for the
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* specific language governing permissions and limitations
|
||||||
* KIND, either express or implied. See the License for the
|
* under the License.
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.mdm.common;
|
package org.wso2.carbon.device.mgt.jaxrs.common;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.wso2.carbon.mdm.beans.android;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import org.wso2.carbon.mdm.api.common.MDMAPIException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class represents the Appstore Application information.
|
|
||||||
*/
|
|
||||||
public class AppStoreApplication implements Serializable {
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
private String appIdentifier;
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppIdentifier() {
|
|
||||||
return appIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppIdentifier(String appIdentifier) {
|
|
||||||
this.appIdentifier = appIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toJSON() throws MDMAPIException {
|
|
||||||
Gson gson = new Gson();
|
|
||||||
return gson.toJson(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.wso2.carbon.mdm.beans.android;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import org.wso2.carbon.mdm.api.common.MDMAPIException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class represents the Enterprise Application information.
|
|
||||||
*/
|
|
||||||
public class EnterpriseApplication implements Serializable {
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
private String url;
|
|
||||||
private String appIdentifier;
|
|
||||||
|
|
||||||
public String getAppIdentifier() {
|
|
||||||
return appIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppIdentifier(String appIdentifier) {
|
|
||||||
this.appIdentifier = appIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUrl(String url) {
|
|
||||||
this.url = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toJSON() throws MDMAPIException {
|
|
||||||
Gson gson = new Gson();
|
|
||||||
return gson.toJson(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.wso2.carbon.mdm.beans.android;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import org.wso2.carbon.mdm.api.common.MDMAPIException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class represents the Web Application information.
|
|
||||||
*/
|
|
||||||
public class WebApplication implements Serializable {
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
private String url;
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUrl(String url) {
|
|
||||||
this.url = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toJSON() throws MDMAPIException {
|
|
||||||
Gson gson = new Gson();
|
|
||||||
return gson.toJson(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
package org.wso2.carbon.mdm.beans.ios;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import org.wso2.carbon.mdm.api.common.MDMAPIException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class RemoveApplication implements Serializable {
|
|
||||||
|
|
||||||
private String bundleId;
|
|
||||||
|
|
||||||
public String getBundleId() {
|
|
||||||
return bundleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBundleId(String bundleId) {
|
|
||||||
this.bundleId = bundleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toJSON() throws MDMAPIException {
|
|
||||||
Gson gson = new Gson();
|
|
||||||
return gson.toJson(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,133 +0,0 @@
|
|||||||
<%
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
||||||
* either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var uri = request.getRequestURI();
|
|
||||||
var uriMatcher = new URIMatcher(String(uri));
|
|
||||||
|
|
||||||
var log = new Log("apis/group-api.jag");
|
|
||||||
|
|
||||||
var constants = require("/app/modules/constants.js");
|
|
||||||
|
|
||||||
var utility = require("/app/modules/utility.js").utility;
|
|
||||||
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
|
|
||||||
var responseProcessor = require('utils').response;
|
|
||||||
|
|
||||||
var deviceCloudService = devicemgtProps["httpsURL"] + "/common/group_manager";
|
|
||||||
|
|
||||||
var user = session.get(constants.USER_SESSION_KEY);
|
|
||||||
|
|
||||||
var groupModule = require("/app/modules/group.js").groupModule;
|
|
||||||
|
|
||||||
var result, endPoint, data, groupId, group, role;
|
|
||||||
|
|
||||||
if (!user) {
|
|
||||||
response = responseProcessor.buildErrorResponse(response, 401, "Unauthorized");
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (uriMatcher.match("/{context}/api/group/add")) {
|
|
||||||
group = request.getContent();
|
|
||||||
result = groupModule.addGroup(group);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/update")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
group = request.getContent();
|
|
||||||
result = groupModule.updateGroup(groupId, group);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/remove")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
result = groupModule.removeGroup(groupId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
result = groupModule.getGroup(groupId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/name/{groupName}")) {
|
|
||||||
var groupName = uriMatcher.elements().groupName;
|
|
||||||
result = groupModule.findGroups(groupName);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/all")) {
|
|
||||||
result = groupModule.getGroups();
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/all/count")) {
|
|
||||||
result = groupModule.getGroupCount();
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/share")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
var shareUser = request.getContent()["shareUser"];
|
|
||||||
role = request.getContent()["role"];
|
|
||||||
result = groupModule.shareGroup(groupId, shareUser, role);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/unshare")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
var unShareUser = request.getContent()["unShareUser"];
|
|
||||||
role = request.getContent()["role"];
|
|
||||||
result = groupModule.unshareGroup(groupId, unShareUser, role);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/role/add")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
var permissions = request.getContent()["permissions"];
|
|
||||||
role = request.getContent()["role"];
|
|
||||||
result = groupModule.addRole(groupId, role, permissions);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/role/delete")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
role = request.getContent()["role"];
|
|
||||||
endPoint = deviceCloudService + "/group/id/" + groupId + "/role/" + role;
|
|
||||||
result = groupModule.deleteRole(groupId, role);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/role/all")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
result = groupModule.getGroupRoles(groupId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/{userId}/role/all")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
var userId = uriMatcher.elements().userId;
|
|
||||||
result = groupModule.getUserRoles(groupId, userId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/{userId}/rolemapping")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
userId = uriMatcher.elements().userId;
|
|
||||||
result = groupModule.getRoleMapping(groupId, userId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/{userId}/roleupdate")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
userId = uriMatcher.elements().userId;
|
|
||||||
var roleMap = request.getContent();
|
|
||||||
result = groupModule.setRoleMapping(groupId, userId, roleMap);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/user/all")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
result = groupModule.getUsers(groupId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/device/all")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
result = groupModule.getDevices(groupId);
|
|
||||||
|
|
||||||
} else if (uriMatcher.match("/{context}/api/group/id/{groupId}/assign")) {
|
|
||||||
groupId = uriMatcher.elements().groupId;
|
|
||||||
var deviceId = request.getContent()["deviceId"];
|
|
||||||
var deviceType = request.getContent()["deviceType"];
|
|
||||||
result = groupModule.assignDevice(groupId, deviceId, deviceType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// returning the result.
|
|
||||||
if (result) {
|
|
||||||
print(result);
|
|
||||||
}
|
|
||||||
%>
|
|
Loading…
Reference in new issue