Add device type plugins and features related to emm with IoTS base feature.

revert-dabc3590
charithag 9 years ago
parent 4f5b5188ea
commit f74a8ddf0d

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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,
~ Version 2.0 (the "License"); you may not use this file except
@ -13,10 +13,11 @@
~ 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
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -78,8 +79,6 @@
javax.xml.bind.annotation.*;resolution:=optional,
javax.xml.parsers.*;resolution:=optional,
javax.crypto,
javax.ws.rs.core,
javax.xml,
org.apache.tomcat.util.codec.binary,
org.w3c.dom;resolution:=optional,
org.wso2.carbon.core;version="${carbon.kernel.version.range}",

@ -1,5 +1,5 @@
<!--
~ 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,
~ Version 2.0 (the "License"); you may not use this file except
@ -28,7 +28,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.agent</artifactId>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.api</artifactId>
<name>WSO2 Carbon - Android JAX-RS API</name>
<description>Android JAX-RS API</description>
<packaging>war</packaging>

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,5 +1,5 @@
/*
* 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,
* Version 2.0 (the "License"); you may not use this file except
@ -11,7 +11,7 @@
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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,
~ 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
~ 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,
~ 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
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2014, 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,
~ Version 2.0 (the "License"); you may not use this file except
@ -13,10 +13,10 @@
~ 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
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
-->
<!--
This file defines class loading policy of the whole container. But this behaviour can be overridden by individual webapps by putting this file into the META-INF/ directory.

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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,
~ Version 2.0 (the "License"); you may not use this file except
@ -12,10 +12,10 @@
~ 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
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,3 +1,21 @@
/*
* 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.
*/
@CHARSET "ISO-8859-1";
/* http://meyerweb.com/eric/tools/css/reset/

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.android.ui</artifactId>
<version>2.1.0-SNAPSHOT</version>
<name>WSO2 Carbon - Mobile Android UI</name>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<finalName>${project.artifactId}-${carbon.device.mgt.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/src.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,36 @@
<!--
~ 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.
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>src</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<baseDirectory>${basedir}/src</baseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src/main/resources/jaggeryapps/devicemgt</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
</fileSets>
</assembly>

@ -0,0 +1,174 @@
{{#zone "device-opetations"}}
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
Operations
</div>
<div class="add-margin-top-4x">
{{unit "mdm.unit.device.operation-bar"}}
</div>
{{/zone}}
{{#zone "device-detail-properties"}}
<div class="media">
<div class="media-left col-xs-12 col-sm-2 col-md-2 col-lg-2">
<ul class="list-group" role="tablist">
<li class="active"><a class="list-group-item"
href="#device_details"
role="tab" data-toggle="tab"
aria-controls="device_details">Device
Details</a>
</li>
<li><a class="list-group-item" href="#policies"
role="tab"
data-toggle="tab" aria-controls="policies">Policies</a>
</li>
<li><a class="list-group-item" href="#policy_compliance"
role="tab"
data-toggle="tab" aria-controls="policy_compliance">Policy
Compliance</a>
</li>
<li><a class="list-group-item" href="#device_location"
role="tab"
data-toggle="tab" aria-controls="device_location">Device
Location</a>
</li>
<li><a class="list-group-item" href="#installed_applications" role="tab"
data-toggle="tab" aria-controls="installed_applications">Installed
Applications</a>
</li>
<li><a class="list-group-item" href="#event_log" role="tab"
data-toggle="tab" aria-controls="event_log">Operations
Log</a></li>
</ul>
</div>
<div class="media-body add-padding-left-5x remove-padding-xs tab-content">
<div class="panel-group tab-content">
<div class="panel panel-default tab-pane active"
id="device_details" role="tabpanel"
aria-labelledby="device_details">
{{unit "cdmf.unit.device.details" device=device}}
</div>
<div class="panel panel-default tab-pane" id="policies" role="tabpanel"
aria-labelledby="policies">
<div class="panel-heading">Policies</div>
<div class="panel-body">
<div id="policy-spinner" class="wr-advance-operations-init hidden">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;
Loading Policies . . .
<br>
<br>
</div>
<div id="policy-list-container">
<div class="panel-body">
No policies found
</div>
<br class="c-both"/>
</div>
</div>
<a class="padding-left"
href="{{@app.context}}/policy/add/{{device.type}}?deviceId={{device.deviceIdentifier}}">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-policy fw-stack-1x"></i>
</span> Add device specific policy</a>
</div>
<div class="panel panel-default tab-pane" id="policy_compliance"
role="tabpanel" aria-labelledby="policy_compliance">
<div class="panel-heading">Policy Compliance <span><a
href="#" id="refresh-policy"><i
class="fw fw-refresh"></i></a></span></div>
<div class="panel-body">
<div id="policy-spinner"
class="wr-advance-operations-init hidden">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;
Loading Policy Compliance . . .
<br>
<br>
</div>
<div id="policy-list-container">
<div class="panel-body">
Not available yet
</div>
<br class="c-both"/>
</div>
</div>
</div>
<div class="panel panel-default tab-pane" id="device_location"
role="tabpanel" aria-labelledby="device_location">
<div class="panel-heading">Device Location</div>
<div class="panel-body">
<div id="device-location"
data-lat="{{device.viewModel.location.latitude}}"
data-long="{{device.viewModel.location.longitude}}"
style="height:450px" class="panel-body">
</div>
<div id="map-error" class="panel-body">
Not available yet
</div>
<br class="c-both"/>
</div>
</div>
<div class="panel panel-default tab-pane" id="installed_applications"
role="tabpanel" aria-labelledby="installed_applications">
<div class="panel-heading">Installed Applications <span><a href="#"
id="refresh-apps"><i
class="fw fw-refresh"></i></a></span></div>
<div class="panel-body">
<div id="apps-spinner" class="wr-advance-operations-init hidden">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;
Loading App List . . .
<br>
<br>
</div>
<div id="applications-list-container">
<div class="panel-body">
Not available yet
</div>
<br class="c-both"/>
</div>
</div>
</div>
<div class="panel panel-default tab-pane" id="event_log"
role="tabpanel" aria-labelledby="event_log">
<div class="panel-heading">Operations Log <span><a href="#"
id="refresh-operations"><i
class="fw fw-refresh"></i></a></span></div>
<div class="panel-body">
<div id="operations-spinner"
class="wr-advance-operations-init hidden">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;
Loading Operations Log . . .
<br>
<br>
</div>
<div id="operations-log-container">
<div class="panel-body">
Not available yet
</div>
<br class="c-both"/>
</div>
</div>
</div>
</div>
</div>
</div>
{{/zone}}
{{#zone "bottomJs"}}
{{js "js/device-detail.js"}}
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
{{js "js/load-map.js"}}
{{/zone}}

@ -0,0 +1,66 @@
/*
* 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.
*/
function onRequest(context) {
var log = new Log("detail.js");
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id");
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId);
if (device) {
var viewModel = {};
var deviceInfo = device.properties.DEVICE_INFO;
if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0) {
deviceInfo = parse(stringify(deviceInfo));
viewModel.imei = device.properties.IMEI;
viewModel.model = device.properties.DEVICE_MODEL;
viewModel.vendor = device.properties.VENDOR;
viewModel.internal_memory = {};
viewModel.external_memory = {};
viewModel.location = {
latitude: device.properties.LATITUDE,
longitude: device.properties.LONGITUDE
};
var info = {};
var infoList = parse(deviceInfo);
if (infoList != null && infoList != undefined) {
for (var j = 0; j < infoList.length; j++) {
info[infoList[j].name] = infoList[j].value;
}
}
deviceInfo = info;
viewModel.BatteryLevel = deviceInfo.BATTERY_LEVEL;
viewModel.internal_memory.FreeCapacity = Math.round(deviceInfo.INTERNAL_AVAILABLE_MEMORY * 100) / 100;
viewModel.internal_memory.DeviceCapacityPercentage = Math.round(deviceInfo.INTERNAL_AVAILABLE_MEMORY
/ deviceInfo.INTERNAL_TOTAL_MEMORY * 10000) / 100;
viewModel.external_memory.FreeCapacity = Math.round(deviceInfo.EXTERNAL_AVAILABLE_MEMORY * 100) / 100;
viewModel.external_memory.DeviceCapacityPercentage = Math.round(deviceInfo.EXTERNAL_AVAILABLE_MEMORY
/ deviceInfo.EXTERNAL_TOTAL_MEMORY * 10000) / 100;
device.viewModel = viewModel;
}
}
log.info(device);
var utility = require("/app/modules/utility.js").utility;
var configs = utility.getDeviceTypeConfig(deviceType);
return {"device": device, "label": configs["deviceType"]["label"]};
}
}

@ -0,0 +1,77 @@
/*
* 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.
*/
(function () {
var deviceId = $(".device-id");
var deviceIdentifier = deviceId.data("deviceid");
var deviceType = deviceId.data("type");
var payload = [deviceIdentifier];
var serviceUrl = "/mdm-android-agent/operation/device-info";
invokerUtil.post(serviceUrl, payload,
function (message) {
console.log(message);
}, function (message) {
console.log(message);
});
$(document).ready(function () {
$(".panel-body").removeClass("hidden");
$("#loading-content").remove();
loadApplicationsList();
$("#refresh-apps").click(function () {
$('#apps-spinner').removeClass('hidden');
loadApplicationsList();
});
loadOperationBar(deviceType);
});
function loadApplicationsList() {
var applicationsList = $("#applications-list");
var deviceListingSrc = applicationsList.attr("src");
var deviceId = applicationsList.data("device-id");
var deviceType = applicationsList.data("device-type");
$.template("application-list", deviceListingSrc, function (template) {
var serviceURL = "/devicemgt_admin/operations/" + deviceType + "/" + deviceId + "/apps";
var successCallback = function (data) {
data = JSON.parse(data);
$('#apps-spinner').addClass('hidden');
var viewModel = {};
if (data != null && data.length > 0) {
for (var i = 0; i < data.length; i++) {
data[i].name = data[i].name.replace(/[^\w\s]/gi, ' ');
data[i].name = data[i].name.replace(/[0-9]/g, ' ');
}
}
viewModel.applications = data;
viewModel.deviceType = deviceType;
if (data.length > 0) {
var content = template(viewModel);
$("#applications-list-container").html(content);
}
};
invokerUtil.get(serviceURL,
successCallback, function (message) {
console.log(message);
});
});
}
}());

@ -0,0 +1,56 @@
/*
* 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.
*/
$(document).ready(function () {
if (document.getElementById('device-location')) {
loadMap();
}
});
function loadMap() {
var map;
function initialize() {
var mapOptions = {
zoom: 18
};
var lat = $("#device-location").data("lat");
var long = $("#device-location").data("long");
if (lat != null && lat != undefined && lat != "" && long != null && long != undefined && long != "") {
$("#map-error").hide();
$("#device-location").show();
map = new google.maps.Map(document.getElementById('device-location'),
mapOptions);
var pos = new google.maps.LatLng(lat, long);
var marker = new google.maps.Marker({
position: pos,
map: map
});
map.setCenter(pos);
} else {
$("#device-location").hide();
$("#map-error").show();
}
}
google.maps.event.addDomListener(window, 'load', initialize);
}

@ -0,0 +1,146 @@
<div class="col-lg-12 margin-top-double">
<h1 class="grey ">Android Mobile</h1>
<hr>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 padding-top">
<img src="{{@unit.publicUri}}/images/android-icon.png" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
<h4 class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS100/Android"
target="_blank">[ here ]</a> for latest instructions and troubleshooting.</h4>
</div>
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
<h3 class="uppercase">What it Does</h3>
<hr>
<p class="grey margin-top">Connect and manage your Android device with WSO2 IoT Server.</p>
<br>
<h3 class="uppercase">What You Need</h3>
<hr>
<ul class="list-unstyled">
<li class="padding-top-double"><span class="circle">STEP 01</span>&nbsp;&nbsp;&nbsp;Android
Mobile.
</li>
<li class="padding-top-double"><span class="circle">STEP 02</span>&nbsp;&nbsp;&nbsp;Go ahead
and click [Enroll Device].
</li>
<li class="padding-top-double"><span class="circle">STEP 03</span>&nbsp;&nbsp;&nbsp;Proceed
to the [Prepare] section.
</li>
</ul>
<br>
<a href="#" class="download-link btn-operations"><i class="fw fw-mobile fw-inverse fw-lg"></i> Enroll Device</a>
<br/><br/>
</div>
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-12 padding-double grey-bg">
<h3 class="uppercase">Prepare</h3><hr>
<ul class="list-unstyled">
<li class="padding-top-double"><span class="circle">01</span> Download Device Agent into your Android Mobile.</li>
<li class="padding-top-double"><span class="circle">02</span> Install Agent APK file.</li>
<li class="padding-top-double"><span class="circle">03</span> Configure Agent App</li>
</ul>
<br>
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 padding-double">
<p class="grey margin-top">Click on the image to zoom</p>
<center>
<a href="{{@unit.publicUri}}/images/android_device.png" target="_blank">
<img src="{{@unit.publicUri}}/images/android_device.png" class="img-responsive">
</a>
</center>
</div>
<br/>
<div id="qr-code-modal"
data-enrollment-url="{{hostName}}{{@unit.publicUri}}/asset/android-agent.apk" class="hidden">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Scan QR code to start enrollment</h3>
<p>Please scan the QR code using your mobile device to retrieve enrollment URL.</p>
<div class="panel panel-default">
<div class="panel-body col-centered">
<div class="qr-code"></div>
</div>
</div>
</div>
</div>
</div>
</div>
{{#zone "topCss"}}
<style type="text/css">
.circle {
background: none repeat scroll 0 0 #191919;
border-radius: 50px;
height: 50px;
padding: 10px;
width: 50px;
color: #fff;
}
.padding-top-double {
padding-top: 20px;
}
.padding-double {
padding: 20px;
}
.grey {
color: #333;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #7f7f7f;
margin: 1em 0;
padding: 0;
opacity: 0.2;
}
.light-grey {
color: #7c7c7c;
}
.uppercase {
text-transform: uppercase;
}
.grey-bg {
background-color: #f6f4f4;
}
.doc-link {
background: #11375B;
padding: 20px;
color: white;
margin-top: 0;
}
.doc-link a {
color: white;
}
</style>
{{/zone}}
{{#zone "bottomJs"}}
<script type="text/javascript">
$(".download-link").click(function(){
toggleEnrollment();
});
function toggleEnrollment(){
$(".modalpopup-content").html($("#qr-code-modal").html());
generateQRCode(".modalpopup-content .qr-code");
showPopup();
}
</script>
{{/zone}}

@ -0,0 +1,24 @@
/*
* 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.
*/
function onRequest(context){
var viewModel = {};
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
viewModel.hostName = devicemgtProps["httpsURL"];
return viewModel;
}

@ -0,0 +1,246 @@
<div class="row no-gutter">
<div class="wr-hidden-operations-nav col-lg-4">
<a href="javascript:void(0)" onclick="showAdvanceOperation('security', this)" class="selected">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-padlock fw-stack-2x"></i>
</span>
Security
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('restriction', this)">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-settings fw-stack-2x"></i>
</span>
Restrictions
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('application', this)">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-padlock fw-stack-2x"></i>
</span>
Applications
</a>
<a href="javascript:void(0)" onclick="showAdvanceOperation('wifi', this)">
<span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-wifi fw-stack-2x"></i>
</span>
Wi-fi
</a>
</div>
<div class="wr-hidden-operations-content col-lg-8">
<!-- security -->
<div class="wr-hidden-operation" data-operation="security" style="display: block">
<div class="panel panel-default operation-data" data-operation="{{features.ENCRYPT_STORAGE.code}}">
<div class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#enableEncryptionTab" aria-expanded="true" aria-controls="enableEncryptionTab">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Encryption Enable/Disable
</a>
</h2>
</div>
<div id="enableEncryptionTab" class="panel-collapse panel-body collapse in" role="tabpanel" aria-labelledby="enableEncryptionTab">
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input type="checkbox" class="operationDataKeys" id="enableEncryption" data-key="enableEncryption" />
<span class="helper" title="Enable Encryption">Enable Encryption<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>
</label>
</div>
<a href="javascript:runOperation('{{features.ENCRYPT_STORAGE.code}}')" class="btn-operations">Configure</a>
</div>
</div>
<div class="panel panel-default operation-data" data-operation="{{features.PASSCODE_POLICY.code}}">
<div class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#passCodePolicy" aria-expanded="false" aria-controls="passCodePolicy" class="collapsed">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Passcode Policy
</a>
</h2>
</div>
<div id="passCodePolicy" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="passCodePolicy">
<label class="wr-input-label col-sm-4" for="maxFailedAttempts">Maximum Failed Attempts</label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="maxFailedAttempts" data-key="maxFailedAttempts" placeholder="Enter maximum Failed Attempts">
</div>
<label class="wr-input-label col-sm-4" for="minLength">Minimum Length</label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="minLength" data-key="minLength" placeholder="Enter minimum Length">
</div>
<label class="wr-input-label col-sm-4" for="pinHistory">PIN History</label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="pinHistory" data-key="pinHistory" placeholder="Enter PIN History">
</div>
<label class="wr-input-label col-sm-4" for="minComplexChars">Minimum complex characters</label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="minComplexChars" data-key="minComplexChars" placeholder="Enter minimum complex characters">
</div>
<label class="wr-input-label col-sm-4" for="lockcode">Minimum PIN Age in days</label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="maxPINAgeInDays" data-key="maxPINAgeInDays" placeholder="Enter minimum PIN age in days">
</div>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input type="checkbox" class="operationDataKeys" id="requireAlphanumeric" data-key="requireAlphanumeric" />
<span class="helper" title="Require Alphanumeric">Require Alphanumeric<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>
</label>
</div>
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input type="checkbox" class="operationDataKeys" id="allowSimple" data-key="allowSimple" />
<span class="helper" title="Allow simple PIN">Allow simple PIN<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>
</label>
</div>
<a href="javascript:runOperation('{{features.PASSCODE_POLICY.code}}')" class="btn-operations">Configure</a>
</div>
</div>
</div>
<!-- /security -->
<!-- wi-fi -->
<div class="wr-hidden-operation panel-body" data-operation="wifi">
<div class="operation-data" data-operation="{{features.WIFI.code}}">
<label class="wr-input-label" title="Identification of the wireless network to connect to">Service Set Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<!--span>Identification of the wireless network to connect to</span-->
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="ssid" data-key="ssid" placeholder="Enter SSID"/>
</div>
<label class="wr-input-label" title="Password for the wireless network">Password<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<!--span>Password for the wireless network</span-->
<div class="wr-input-control">
<input type="password" class="form-control operationDataKeys" id="password" data-key="password" placeholder="Password"/>
</div>
<a href="javascript:runOperation('{{features.WIFI.code}}')" class="btn-operations">Configure</a>
</div>
</div>
<!-- /wi-fi -->
<!-- application -->
<div class="wr-hidden-operation" data-operation="application">
<div class="panel panel-default operation-data" data-operation="{{features.INSTALL_APPLICATION.code}}">
<div class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#installApp" aria-expanded="true" aria-controls="installApp">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Install App
</a>
</h2>
</div>
<div id="installApp" class="panel-collapse panel-body collapse in" role="tabpanel" aria-labelledby="installApp">
<label class="wr-input-label" title="Application Identifier">App Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="package-name" data-key="packageName" placeholder="Enter App Identifer"/>
</div>
<div class="wr-input-control">
<label class="wr-input-control dropdown">
<span class="helper" title="App Type">App Type<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>
<select class="form-control col-sm-8 operationDataKeys appTypesInput" id="type" data-key="type">
<option>Public</option>
<option>Enterprise</option>
</select>
</label>
</div>
<label class="wr-input-label" title="URL">URL<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="url" data-key="url" placeholder="Enter URL"/>
</div>
<a href="javascript:runOperation('{{features.INSTALL_APPLICATION.code}}')" class="btn-operations">Install</a>
</div>
</div>
<div class="panel panel-default operation-data" data-operation="{{features.WEBCLIP.code}}">
<div class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#installWebClip" aria-expanded="true" aria-controls="installWebClip" class="collapsed">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Install Web Clip
</a>
</h2>
</div>
<div id="installWebClip" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="installWebClip">
<label class="wr-input-label" title="Title of the web clip">Title<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="title" data-key="title" placeholder="Enter Title"/>
</div>
<label class="wr-input-label" title="URL">URL<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="url" data-key="url" placeholder="Enter URL"/>
</div>
<a href="javascript:runOperation('{{features.WEBCLIP.code}}')" class="btn-operations">Install</a>
</div>
</div>
<div class="panel panel-default operation-data" data-operation="{{features.UNINSTALL_APPLICATION.code}}">
<div class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#uninstallApp" aria-expanded="true" aria-controls="uninstallApp" class="collapsed">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Uninstall App
</a>
</h2>
</div>
<div id="uninstallApp" class="panel-collapse panel-body collapse" role="tabpanel" aria-labelledby="uninstallApp">
<label class="wr-input-label" title="Application Identifier">App Identifier<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></label>
<!--span>Identification of the wireless network to connect to</span-->
<div class="wr-input-control">
<input type="text" class="form-control operationDataKeys" id="package-name" data-key="packageName" placeholder="Enter App Identifer"/>
</div>
<a href="javascript:runOperation('{{features.UNINSTALL_APPLICATION.code}}')" class="btn-operations">Uninstall</a>
</div>
</div>
</div>
<!-- /application -->
<!-- Restriction -->
<div class="wr-hidden-operation" data-operation="restriction">
<div class="panel panel-default operation-data" data-operation="{{features.CAMERA.code}}">
<div class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#cameraDisable" aria-expanded="true" aria-controls="cameraDisable">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Camera Enable/Disable
</a>
</h2>
</div>
<div id="cameraDisable" class="panel-collapse panel-body collapse in" role="tabpanel" aria-labelledby="cameraDisable">
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input type="checkbox" class="operationDataKeys" id="enableCamera" data-key="enableCamera" checked />
<span class="helper" title="Remove App upon dis-enrollment">Enable Camera<span class="wr-help-tip glyphicon glyphicon-question-sign"></span></span>
</label>
</div>
<a href="javascript:runOperation('{{features.CAMERA.code}}')" class="btn-operations">Configure</a>
</div>
</div>
</div>
<!-- /Restriction -->
</div>
</div>

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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,
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@ -36,23 +36,12 @@ public class AndroidDeviceManagementService implements DeviceManagementService {
private DeviceManager deviceManager;
public static final String DEVICE_TYPE_ANDROID = "android";
public static final String DEVICE_TYPE_TENANT = "carbon.super";
@Override
public String getType() {
return AndroidDeviceManagementService.DEVICE_TYPE_ANDROID;
}
@Override
public String getProviderTenantDomain() {
return DEVICE_TYPE_TENANT;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override
public void init() throws DeviceManagementException {
this.deviceManager = new AndroidDeviceManager();

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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.
-->
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -34,7 +34,8 @@
<modules>
<module>org.wso2.carbon.device.mgt.mobile.android</module>
<module>org.wso2.carbon.device.mgt.mobile.android.agent</module>
<module>org.wso2.carbon.device.mgt.mobile.android.api</module>
<module>org.wso2.carbon.device.mgt.mobile.android.ui</module>
</modules>
<build>

@ -1,18 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2016, 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.
~ 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.
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
@ -200,6 +202,11 @@
<artifactId>commons-codec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,197 @@
/*
* 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.mdm.api;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.mdm.api.common.MDMAPIException;
import org.wso2.carbon.mdm.api.util.MDMAPIUtils;
import org.wso2.carbon.mdm.beans.EnrollmentCertificate;
import org.wso2.carbon.mdm.exception.BadRequestException;
import org.wso2.carbon.mdm.exception.Message;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
/**
* All the certificate related tasks such as saving certificates, can be done through this endpoint.
*/
@SuppressWarnings("NonJaxWsWebServices")
@Produces({"application/json", "application/xml" })
@Consumes({ "application/json", "application/xml" })
public class Certificate {
private static Log log = LogFactory.getLog(Operation.class);
/**
* Save a list of certificates and relevant information in the database.
*
* @param enrollmentCertificates List of all the certificates which includes the tenant id, certificate as
* a pem and a serial number.
* @return Status of the data persist operation.
* @throws MDMAPIException
*/
@POST
@Path("saveCertificate")
public Response saveCertificate(@HeaderParam("Accept") String acceptHeader,
EnrollmentCertificate[] enrollmentCertificates) throws MDMAPIException {
MediaType responseMediaType = MDMAPIUtils.getResponseMediaType(acceptHeader);
CertificateManagementService certificateService;
List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
org.wso2.carbon.certificate.mgt.core.bean.Certificate certificate;
certificateService = MDMAPIUtils.getCertificateManagementService();
try {
for (EnrollmentCertificate enrollmentCertificate : enrollmentCertificates) {
certificate = new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificate.setSerial(enrollmentCertificate.getSerial());
certificate.setCertificate(certificateService.pemToX509Certificate(enrollmentCertificate.getPem()));
certificates.add(certificate);
}
certificateService.saveCertificate(certificates);
return Response.status(Response.Status.CREATED).entity("Added successfully.").
type(responseMediaType).build();
} catch (KeystoreException e) {
String msg = "Error occurred while converting PEM file to X509Certificate.";
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
/**
* Get a certificate when the serial number is given.
*
* @param serialNumber serial of the certificate needed.
* @return certificate response.
* @throws MDMAPIException
*/
@GET
@Path("{serialNumber}")
public Response getCertificate(@HeaderParam("Accept") String acceptHeader,
@PathParam("serialNumber") String serialNumber) throws MDMAPIException {
MediaType responseMediaType = MDMAPIUtils.getResponseMediaType(acceptHeader);
Message message = new Message();
if (serialNumber == null || serialNumber.isEmpty()) {
message.setErrorMessage("Invalid serial number");
message.setDiscription("Serial number is missing or invalid.");
throw new BadRequestException(message, responseMediaType);
}
CertificateManagementService certificateService = MDMAPIUtils.getCertificateManagementService();
CertificateResponse certificateResponse;
try {
certificateResponse = certificateService.getCertificateBySerial(serialNumber);
if(certificateResponse != null) {
certificateResponse.setCertificate(null); //avoid sending byte array in response.
}
return Response.status(Response.Status.OK).entity(certificateResponse).type(responseMediaType).build();
} catch (KeystoreException e) {
String msg = "Error occurred while converting PEM file to X509Certificate";
log.error(msg, e);
return Response.serverError().build();
}
}
/**
* Get all certificates in a paginated manner.
*
* @param startIndex index of the first record to be fetched
* @param length number of records to be fetched starting from the start index.
* @return paginated result of certificate.
* @throws MDMAPIException
*/
@GET
@Path("paginate")
public Response getAllCertificates(@HeaderParam("Accept") String acceptHeader,
@QueryParam("start") int startIndex,
@QueryParam("length") int length)
throws MDMAPIException {
MediaType responseMediaType = MDMAPIUtils.getResponseMediaType(acceptHeader);
Message message = new Message();
if (startIndex < 0) {
message.setErrorMessage("Invalid start index.");
message.setDiscription("Start index cannot be less that 0.");
throw new BadRequestException(message, responseMediaType);
} else if (length <= 0) {
message.setErrorMessage("Invalid length value.");
message.setDiscription("Length should be a positive integer.");
throw new BadRequestException(message, responseMediaType);
}
CertificateManagementService certificateService = MDMAPIUtils.getCertificateManagementService();
PaginationRequest paginationRequest = new PaginationRequest(startIndex, length);
try {
PaginationResult certificates = certificateService.getAllCertificates(paginationRequest);
return Response.status(Response.Status.OK).entity(certificates).type(responseMediaType).build();
} catch (CertificateManagementDAOException e) {
String msg = "Error occurred while fetching all certificates.";
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
@DELETE
@Path("{serialNumber}")
public Response removeCertificate(@HeaderParam("Accept") String acceptHeader,
@PathParam("serialNumber") String serialNumber) throws MDMAPIException {
MediaType responseMediaType = MDMAPIUtils.getResponseMediaType(acceptHeader);
Message message = new Message();
if (serialNumber == null || serialNumber.isEmpty()) {
message.setErrorMessage("Invalid serial number");
message.setDiscription("Serial number is missing or invalid.");
throw new BadRequestException(message, responseMediaType);
}
CertificateManagementService certificateService = MDMAPIUtils.getCertificateManagementService();
boolean deleted;
try {
deleted = certificateService.removeCertificate(serialNumber);
if(deleted){
return Response.status(Response.Status.OK).entity(true).type(responseMediaType).build();
} else {
return Response.status(Response.Status.GONE).entity(false).type(responseMediaType).build();
}
} catch (CertificateManagementDAOException e) {
String msg = "Error occurred while converting PEM file to X509Certificate";
log.error(msg, e);
return Response.serverError().build();
}
}
}

@ -21,16 +21,20 @@ package org.wso2.carbon.mdm.api;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
import org.wso2.carbon.mdm.api.common.MDMAPIException;
import org.wso2.carbon.mdm.api.util.MDMAPIUtils;
import org.wso2.carbon.mdm.api.util.MDMAppConstants;
import org.wso2.carbon.mdm.api.util.ResponsePayload;
import org.wso2.carbon.policy.mgt.core.util.PolicyManagerUtil;
import javax.jws.WebService;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
/**
* General Tenant Configuration REST-API implementation.
@ -67,8 +71,19 @@ public class Configuration {
public TenantConfiguration getConfiguration() throws MDMAPIException {
String msg;
try {
return MDMAPIUtils.getTenantConfigurationManagementService().getConfiguration(MDMAppConstants.
RegistryConstants.GENERAL_CONFIG_RESOURCE_PATH);
TenantConfiguration tenantConfiguration = MDMAPIUtils.getTenantConfigurationManagementService().
getConfiguration(MDMAppConstants.RegistryConstants.GENERAL_CONFIG_RESOURCE_PATH);
ConfigurationEntry configurationEntry = new ConfigurationEntry();
configurationEntry.setContentType("text");
configurationEntry.setName("notifierFrequency");
configurationEntry.setValue(PolicyManagerUtil.getMonitoringFequency());
List<ConfigurationEntry> configList = tenantConfiguration.getConfiguration();
if (configList == null) {
configList = new ArrayList<>();
}
configList.add(configurationEntry);
tenantConfiguration.setConfiguration(configList);
return tenantConfiguration;
} catch (ConfigurationManagementException e) {
msg = "Error occurred while retrieving the tenant configuration.";
log.error(msg, e);

@ -54,7 +54,7 @@ import java.util.List;
public class Operation {
private static Log log = LogFactory.getLog(Operation.class);
/* @deprecated */
@GET
public List<? extends org.wso2.carbon.device.mgt.common.operation.mgt.Operation> getAllOperations()
throws MDMAPIException {
@ -115,6 +115,7 @@ public class Operation {
return operations;
}
/* @deprecated */
@POST
public ResponsePayload addOperation(DeviceOperationContext operationContext) throws MDMAPIException {
DeviceManagementProviderService dmService;
@ -182,6 +183,8 @@ public class Operation {
}
appManagerConnector.installApplicationForDevices(operation, applicationWrapper.getDeviceIdentifiers());
}
Response.status(HttpStatus.SC_CREATED);
responseMsg.setMessageFromServer("Application installation request has been sent to the device.");
return responseMsg;
} catch (ApplicationManagementException e) {
String msg = "Error occurred while saving the operation";
@ -215,6 +218,8 @@ public class Operation {
}
appManagerConnector.installApplicationForDevices(operation, applicationWrapper.getDeviceIdentifiers());
}
Response.status(HttpStatus.SC_CREATED);
responseMsg.setMessageFromServer("Application removal request has been sent to the device.");
return responseMsg;
} catch (ApplicationManagementException e) {
String msg = "Error occurred while saving the operation";

@ -173,24 +173,6 @@ public class Policy {
@Path("{id}")
public ResponsePayload updatePolicy(PolicyWrapper policyWrapper, @PathParam("id") int policyId)
throws MDMAPIException {
// PolicyManagerService policyManagementService = MDMAPIUtils.getPolicyManagementService();
// ResponsePayload responseMsg = new ResponsePayload();
// try {
// PolicyAdministratorPoint pap = policyManagementService.getPAP();
// org.wso2.carbon.policy.mgt.common.Policy previousPolicy = pap.getPolicy(policyId);
// policy.setProfile(pap.getProfile(previousPolicy.getProfileId()));
// policy.setId(previousPolicy.getId());
// pap.updatePolicy(policy);
// Response.status(HttpStatus.SC_OK);
// responseMsg.setMessageFromServer("Policy has been updated successfully.");
// return responseMsg;
// } catch (PolicyManagementException e) {
// String error = "Policy Management related exception";
// log.error(error, e);
// throw new MDMAPIException(error, e);
// }
PolicyManagerService policyManagementService = MDMAPIUtils.getPolicyManagementService();
ResponsePayload responseMsg = new ResponsePayload();
@ -205,16 +187,12 @@ public class Policy {
policy.setUsers(policyWrapper.getUsers());
policy.setTenantId(policyWrapper.getTenantId());
policy.setCompliance(policyWrapper.getCompliance());
// policy.setActive(true);
try {
PolicyAdministratorPoint pap = policyManagementService.getPAP();
// pap.addPolicy(policy);
pap.updatePolicy(policy);
// Response.status(HttpStatus.SC_CREATED);
Response.status(HttpStatus.SC_OK);
responseMsg.setStatusCode(HttpStatus.SC_CREATED);
// responseMsg.setMessageFromServer("Policy has been added successfully.");
responseMsg.setMessageFromServer("Policy has been updated successfully.");
return responseMsg;
} catch (PolicyManagementException e) {
@ -293,23 +271,6 @@ public class Policy {
}
}
// @GET
// @Path("task/{mf}")
// public int taskService(@PathParam("mf") int monitoringFrequency) throws MDMAPIException {
// int policyCount = 0;
// PolicyManagerService policyManagementService = MDMAPIUtils.getPolicyManagementService();
// try {
// TaskScheduleService taskScheduleService = policyManagementService.getTaskScheduleService();
// taskScheduleService.startTask(monitoringFrequency);
// return policyCount;
// } catch (PolicyMonitoringTaskException e) {
// String error = "Policy Management related exception";
// log.error(error, e);
// throw new MDMAPIException(error, e);
// }
// }
@PUT
@Produces("application/json")
@Path("activate")
@ -333,7 +294,6 @@ public class Policy {
}
@PUT
@Produces("application/json")
@Path("inactivate")
@ -356,7 +316,6 @@ public class Policy {
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@PUT
@Produces("application/json")
@Path("apply-changes")
@ -400,7 +359,6 @@ public class Policy {
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@GET
@Path("update-task/{milliseconds}")
public Response updateTaskService(@PathParam("milliseconds") int monitoringFrequency) throws MDMAPIException {
@ -421,7 +379,6 @@ public class Policy {
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@GET
@Path("stop-task")
public Response stopTaskService() throws MDMAPIException {
@ -442,7 +399,6 @@ public class Policy {
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@GET
@Path("{type}/{id}")
public ComplianceData getComplianceDataOfDevice(@PathParam("type") String type, @PathParam("id") String id) throws

@ -419,4 +419,36 @@ public class Role {
}
return list;
}
/**
* This method is used to retrieve the role count of the system.
*
* @return returns the count.
* @throws MDMAPIException
*/
@GET
@Path("count")
public int getRoleCount() throws MDMAPIException {
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
String[] roles;
try {
if (log.isDebugEnabled()) {
log.debug("Getting the list of user roles");
}
roles = userStoreManager.getRoleNames();
} catch (UserStoreException e) {
String msg = "Error occurred while retrieving the list of user roles.";
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
// removing all internal roles and roles created for Service-providers
List<String> filteredRoles = new ArrayList<String>();
for (String role : roles) {
if (!(role.startsWith("Internal/") || role.startsWith("Application/"))) {
filteredRoles.add(role);
}
}
return filteredRoles.size();
}
}

@ -25,10 +25,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.EmailMessageProperties;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.EmailMetaInfo;
import org.wso2.carbon.mdm.api.common.MDMAPIException;
import org.wso2.carbon.mdm.api.util.CredentialManagementResponseBuilder;
import org.wso2.carbon.mdm.api.util.MDMAPIUtils;
import org.wso2.carbon.mdm.api.util.ResponsePayload;
import org.wso2.carbon.mdm.beans.UserCredentialWrapper;
@ -37,6 +38,7 @@ import org.wso2.carbon.mdm.util.Constants;
import org.wso2.carbon.mdm.util.SetReferenceTransformer;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@ -50,14 +52,7 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeSet;
import java.util.*;
/**
* This class represents the JAX-RS services of User related functionality.
@ -65,7 +60,7 @@ import java.util.TreeSet;
public class User {
private static Log log = LogFactory.getLog(User.class);
private String ROLE_EVERYONE = "Internal/everyone";
private static final String ROLE_EVERYONE = "Internal/everyone";
/**
* Method to add user to emm-user-store.
@ -85,22 +80,22 @@ public class User {
// if user already exists
if (log.isDebugEnabled()) {
log.debug("User by username: " + userWrapper.getUsername() +
" already exists. Therefore, request made to add user was refused.");
" already exists. Therefore, request made to add user was refused.");
}
// returning response with bad request state
responsePayload.setStatusCode(HttpStatus.SC_CONFLICT);
responsePayload.
setMessageFromServer("User by username: " + userWrapper.getUsername() +
" already exists. Therefore, request made to add user was refused.");
" already exists. Therefore, request made to add user was refused.");
return Response.status(HttpStatus.SC_CONFLICT).entity(responsePayload).build();
} else {
String initialUserPassword = generateInitialUserPassword();
Map<String, String> defaultUserClaims =
buildDefaultUserClaims(userWrapper.getFirstname(), userWrapper.getLastname(),
userWrapper.getEmailAddress());
userWrapper.getEmailAddress());
// calling addUser method of carbon user api
userStoreManager.addUser(userWrapper.getUsername(), initialUserPassword,
userWrapper.getRoles(), defaultUserClaims, null);
userWrapper.getRoles(), defaultUserClaims, null);
// invite newly added user to enroll device
inviteNewlyAddedUserToEnrollDevice(userWrapper.getUsername(), initialUserPassword);
// Outputting debug message upon successful addition of user
@ -110,17 +105,13 @@ public class User {
// returning response with success state
responsePayload.setStatusCode(HttpStatus.SC_CREATED);
responsePayload.setMessageFromServer("User by username: " + userWrapper.getUsername() +
" was successfully added.");
" was successfully added.");
return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build();
}
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to add user by username: " + userWrapper.getUsername();
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
} catch (DeviceManagementException e) {
String errorMsg = "Exception in trying to add user by username: " + userWrapper.getUsername();
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
String msg = "Exception in trying to add user by username: " + userWrapper.getUsername();
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
@ -164,9 +155,9 @@ public class User {
return Response.status(HttpStatus.SC_NOT_FOUND).entity(responsePayload).build();
}
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to retrieve user by username: " + username;
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
String msg = "Exception in trying to retrieve user by username: " + username;
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
@ -188,12 +179,12 @@ public class User {
if (userStoreManager.isExistingUser(userWrapper.getUsername())) {
Map<String, String> defaultUserClaims =
buildDefaultUserClaims(userWrapper.getFirstname(), userWrapper.getLastname(),
userWrapper.getEmailAddress());
userWrapper.getEmailAddress());
if (StringUtils.isNotEmpty(userWrapper.getPassword())) {
// Decoding Base64 encoded password
byte[] decodedBytes = Base64.decodeBase64(userWrapper.getPassword());
userStoreManager.updateCredentialByAdmin(userWrapper.getUsername(),
new String(decodedBytes, "UTF-8"));
new String(decodedBytes, "UTF-8"));
log.debug("User credential of username: " + userWrapper.getUsername() + " has been changed");
}
List<String> listofFilteredRoles = getFilteredRoles(userStoreManager, userWrapper.getUsername());
@ -204,16 +195,16 @@ public class User {
The difference of roles in existingRolesSet and newRolesSet needed to be deleted
new roles to add = newRolesSet - The intersection of roles in existingRolesSet and newRolesSet
*/
final TreeSet<String> existingRolesSet = new TreeSet<String>();
final TreeSet<String> existingRolesSet = new TreeSet<>();
Collections.addAll(existingRolesSet, existingRoles);
final TreeSet<String> newRolesSet = new TreeSet<String>();
final TreeSet<String> newRolesSet = new TreeSet<>();
Collections.addAll(newRolesSet, userWrapper.getRoles());
existingRolesSet.removeAll(newRolesSet);
// Now we have the roles to delete
String[] rolesToDelete = existingRolesSet.toArray(new String[existingRolesSet.size()]);
List<String> roles = new ArrayList<String>(Arrays.asList(rolesToDelete));
List<String> roles = new ArrayList<>(Arrays.asList(rolesToDelete));
roles.remove(ROLE_EVERYONE);
rolesToDelete = roles.toArray(new String[0]);
rolesToDelete = new String[0];
// Clearing and re-initializing the set
existingRolesSet.clear();
Collections.addAll(existingRolesSet, existingRoles);
@ -229,28 +220,24 @@ public class User {
// returning response with success state
responsePayload.setStatusCode(HttpStatus.SC_CREATED);
responsePayload.setMessageFromServer("User by username: " + userWrapper.getUsername() +
" was successfully updated.");
" was successfully updated.");
return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build();
} else {
if (log.isDebugEnabled()) {
log.debug("User by username: " + userWrapper.getUsername() +
" doesn't exists. Therefore, request made to update user was refused.");
" doesn't exists. Therefore, request made to update user was refused.");
}
// returning response with bad request state
responsePayload.setStatusCode(HttpStatus.SC_CONFLICT);
responsePayload.
setMessageFromServer("User by username: " + userWrapper.getUsername() +
" doesn't exists. Therefore, request made to update user was refused.");
" doesn't exists. Therefore, request made to update user was refused.");
return Response.status(HttpStatus.SC_CONFLICT).entity(responsePayload).build();
}
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to update user by username: " + userWrapper.getUsername();
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
} catch (UnsupportedEncodingException e) {
String errorMsg = "Exception in trying to update user by username: " + userWrapper.getUsername();
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
} catch (UserStoreException | UnsupportedEncodingException e) {
String msg = "Exception in trying to update user by username: " + userWrapper.getUsername();
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
@ -270,7 +257,7 @@ public class User {
Random randomGenerator = new Random();
String totalCharset = lowerCaseCharset + upperCaseCharset + numericCharset;
int totalCharsetLength = totalCharset.length();
StringBuffer initialUserPassword = new StringBuffer();
StringBuilder initialUserPassword = new StringBuilder();
for (int i = 0; i < passwordLength; i++) {
initialUserPassword
.append(totalCharset.charAt(randomGenerator.nextInt(totalCharsetLength)));
@ -290,7 +277,7 @@ public class User {
* @return {Object} Default user claims to be provided
*/
private Map<String, String> buildDefaultUserClaims(String firstname, String lastname, String emailAddress) {
Map<String, String> defaultUserClaims = new HashMap<String, String>();
Map<String, String> defaultUserClaims = new HashMap<>();
defaultUserClaims.put(Constants.USER_CLAIM_FIRST_NAME, firstname);
defaultUserClaims.put(Constants.USER_CLAIM_LAST_NAME, lastname);
defaultUserClaims.put(Constants.USER_CLAIM_EMAIL_ADDRESS, emailAddress);
@ -337,24 +324,24 @@ public class User {
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build();
}
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to remove user by username: " + username;
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
String msg = "Exception in trying to remove user by username: " + username;
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
/**
* get all the roles except for the internal/xxx and application/xxx
*
* @param userStoreManager
* @param username
* @param userStoreManager User Store Manager associated with the currently logged in user
* @param username Username of the currently logged in user
* @return the list of filtered roles
* @throws UserStoreException
*/
private List<String> getFilteredRoles(UserStoreManager userStoreManager, String username)
throws UserStoreException {
String[] roleListOfUser = userStoreManager.getRoleListOfUser(username);
List<String> filteredRoles = new ArrayList<String>();
List<String> filteredRoles = new ArrayList<>();
for (String role : roleListOfUser) {
if (!(role.startsWith("Internal/") || role.startsWith("Application/"))) {
filteredRoles.add(role);
@ -400,9 +387,9 @@ public class User {
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build();
}
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to retrieve roles for user by username: " + username;
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
String msg = "Exception in trying to retrieve roles for user by username: " + username;
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
@ -419,10 +406,10 @@ public class User {
log.debug("Getting the list of users with all user-related information");
}
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ArrayList<UserWrapper> userList;
List<UserWrapper> userList;
try {
String[] users = userStoreManager.listUsers("*", -1);
userList = new ArrayList<UserWrapper>(users.length);
userList = new ArrayList<>(users.length);
UserWrapper user;
for (String username : users) {
user = new UserWrapper();
@ -439,12 +426,10 @@ public class User {
}
ResponsePayload responsePayload = new ResponsePayload();
responsePayload.setStatusCode(HttpStatus.SC_OK);
int count = 0;
if (userList != null) {
count = userList.size();
}
int count;
count = userList.size();
responsePayload.setMessageFromServer("All users were successfully retrieved. " +
"Obtained user count: " + count);
"Obtained user count: " + count);
responsePayload.setResponseContent(userList);
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@ -463,10 +448,10 @@ public class User {
log.debug("Getting the list of users with all user-related information using the filter : " + filter);
}
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ArrayList<UserWrapper> userList;
List<UserWrapper> userList;
try {
String[] users = userStoreManager.listUsers(filter + "*", -1);
userList = new ArrayList<UserWrapper>(users.length);
userList = new ArrayList<>(users.length);
UserWrapper user;
for (String username : users) {
user = new UserWrapper();
@ -483,12 +468,10 @@ public class User {
}
ResponsePayload responsePayload = new ResponsePayload();
responsePayload.setStatusCode(HttpStatus.SC_OK);
int count = 0;
if (userList != null) {
count = userList.size();
}
int count;
count = userList.size();
responsePayload.setMessageFromServer("All users were successfully retrieved. " +
"Obtained user count: " + count);
"Obtained user count: " + count);
responsePayload.setResponseContent(userList);
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@ -506,10 +489,10 @@ public class User {
log.debug("Getting the list of users by name");
}
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ArrayList<UserWrapper> userList;
List<UserWrapper> userList;
try {
String[] users = userStoreManager.listUsers("*" + userName + "*", -1);
userList = new ArrayList<UserWrapper>(users.length);
userList = new ArrayList<>(users.length);
UserWrapper user;
for (String username : users) {
user = new UserWrapper();
@ -526,12 +509,10 @@ public class User {
}
ResponsePayload responsePayload = new ResponsePayload();
responsePayload.setStatusCode(HttpStatus.SC_OK);
int count = 0;
if (userList != null) {
count = userList.size();
}
int count;
count = userList.size();
responsePayload.setMessageFromServer("All users by username were successfully retrieved. " +
"Obtained user count: " + count);
"Obtained user count: " + count);
responsePayload.setResponseContent(userList);
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@ -549,14 +530,11 @@ public class User {
log.debug("Getting the list of users by name");
}
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ArrayList<String> userList;
List<String> userList;
try {
String[] users = userStoreManager.listUsers("*" + userName + "*", -1);
userList = new ArrayList<String>(users.length);
UserWrapper user;
for (String username : users) {
userList.add(username);
}
userList = new ArrayList<>(users.length);
Collections.addAll(userList, users);
} catch (UserStoreException e) {
String msg = "Error occurred while retrieving the list of users";
log.error(msg, e);
@ -564,12 +542,10 @@ public class User {
}
ResponsePayload responsePayload = new ResponsePayload();
responsePayload.setStatusCode(HttpStatus.SC_OK);
int count = 0;
if (userList != null) {
count = userList.size();
}
int count;
count = userList.size();
responsePayload.setMessageFromServer("All users by username were successfully retrieved. " +
"Obtained user count: " + count);
"Obtained user count: " + count);
responsePayload.setResponseContent(userList);
return Response.status(HttpStatus.SC_OK).entity(responsePayload).build();
}
@ -582,9 +558,14 @@ public class User {
* @return A list of usernames
* @throws MDMAPIException, UserStoreException
*/
private String getClaimValue(String username, String claimUri) throws MDMAPIException, UserStoreException {
private String getClaimValue(String username, String claimUri) throws MDMAPIException {
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
return userStoreManager.getUserClaimValue(username, claimUri, null);
try {
return userStoreManager.getUserClaimValue(username, claimUri, null);
} catch (UserStoreException e) {
throw new MDMAPIException("Error occurred while retrieving value assigned to the claim '" +
claimUri + "'", e);
}
}
/**
@ -593,31 +574,37 @@ public class User {
* @param username Username of the user
* @throws MDMAPIException, UserStoreException, DeviceManagementException
*/
private void inviteNewlyAddedUserToEnrollDevice(String username, String password) throws
MDMAPIException,
UserStoreException,
DeviceManagementException {
private void inviteNewlyAddedUserToEnrollDevice(
String username, String password) throws MDMAPIException {
if (log.isDebugEnabled()) {
log.debug("Sending invitation mail to user by username: " + username);
}
String tennentDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
if (tennentDomain.equalsIgnoreCase("carbon.super")) {
tennentDomain = "";
String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equalsIgnoreCase(tenantDomain)) {
tenantDomain = "";
}
if (!username.contains("/")) {
username = "/" + username;
}
String[] usernameBits = username.split("/");
DeviceManagementProviderService deviceManagementProviderService = MDMAPIUtils.getDeviceManagementService();
EmailMessageProperties emailMessageProperties = new EmailMessageProperties();
emailMessageProperties.setUserName(usernameBits[1]);
emailMessageProperties.setDomainName(tennentDomain);
emailMessageProperties.setFirstName(getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME));
emailMessageProperties.setPassword(password);
String[] mailAddress = new String[1];
mailAddress[0] = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS);
emailMessageProperties.setMailTo(mailAddress);
deviceManagementProviderService.sendRegistrationEmail(emailMessageProperties);
Properties props = new Properties();
props.setProperty("username", usernameBits[1]);
props.setProperty("domain-name", tenantDomain);
props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME));
props.setProperty("password", password);
String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS);
EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props);
try {
deviceManagementProviderService.sendRegistrationEmail(metaInfo);
} catch (DeviceManagementException e) {
String msg = "Error occurred while sending registration email to user '" + username + "'";
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
/**
@ -635,26 +622,20 @@ public class User {
}
DeviceManagementProviderService deviceManagementProviderService = MDMAPIUtils.getDeviceManagementService();
try {
for (int i = 0; i < usernames.size(); i++) {
EmailMessageProperties emailMessageProperties = new EmailMessageProperties();
emailMessageProperties
.setFirstName(getClaimValue(usernames.get(i), Constants.USER_CLAIM_FIRST_NAME));
emailMessageProperties.setUserName(usernames.get(i));
String[] mailAddress = new String[1];
mailAddress[0] = getClaimValue(usernames.get(i), Constants.USER_CLAIM_EMAIL_ADDRESS);
if (StringUtils.isNotEmpty(mailAddress[0])) {
emailMessageProperties.setMailTo(mailAddress);
deviceManagementProviderService.sendEnrolmentInvitation(emailMessageProperties);
}
for (String username : usernames) {
String recipient = getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS);
Properties props = new Properties();
props.setProperty("first-name", getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME));
props.setProperty("username", username);
EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props);
deviceManagementProviderService.sendEnrolmentInvitation(metaInfo);
}
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to invite user.";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
} catch (DeviceManagementException e) {
String errorMsg = "Exception in trying to invite user.";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
String msg = "Error occurred while inviting user to enrol their device";
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
ResponsePayload responsePayload = new ResponsePayload();
responsePayload.setStatusCode(HttpStatus.SC_OK);
@ -685,9 +666,9 @@ public class User {
}
return dmService.getDevicesOfUser(username);
} catch (DeviceManagementException e) {
String errorMsg = "Device management error";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
String msg = "Device management error";
log.error(msg, e);
throw new MDMAPIException(msg, e);
}
}
@ -734,7 +715,7 @@ public class User {
}
SetReferenceTransformer transformer = new SetReferenceTransformer();
transformer.transform(Arrays.asList(userStoreManager.getRoleListOfUser(username)),
userList);
userList);
final String[] rolesToAdd = (String[])
transformer.getObjectsToAdd().toArray(new String[transformer.getObjectsToAdd().size()]);
final String[] rolesToDelete = (String[])
@ -757,30 +738,26 @@ public class User {
* @throws MDMAPIException
*/
@POST
@Path("reset-password")
@Path("change-password")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
public Response resetPassword(UserCredentialWrapper credentials) throws MDMAPIException {
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ResponsePayload responsePayload = new ResponsePayload();
try {
byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword());
userStoreManager.updateCredentialByAdmin(credentials.getUsername(), new String(
decodedNewPassword, "UTF-8"));
responsePayload.setStatusCode(HttpStatus.SC_CREATED);
responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() +
" was successfully changed.");
return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build();
} catch (UserStoreException e) {
String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername();
log.error(errorMsg, e);
responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST);
responsePayload.setMessageFromServer("Old password does not match.");
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build();
} catch (UnsupportedEncodingException e) {
String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername();
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
}
return CredentialManagementResponseBuilder.buildChangePasswordResponse(credentials);
}
}
/**
* Method to change the user password.
*
* @param credentials Wrapper object representing user credentials.
* @return {Response} Status of the request wrapped inside Response object.
* @throws MDMAPIException
*/
@POST
@Path("reset-password")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
public Response resetPasswordByAdmin(UserCredentialWrapper credentials) throws MDMAPIException {
return CredentialManagementResponseBuilder.buildResetPasswordResponse(credentials);
}
}

@ -0,0 +1,105 @@
/*
* 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.mdm.api.util;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.mdm.api.common.MDMAPIException;
import org.wso2.carbon.mdm.beans.UserCredentialWrapper;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
import javax.ws.rs.core.Response;
import java.io.UnsupportedEncodingException;
/**
* This class builds Credential modification related Responses
*/
public class CredentialManagementResponseBuilder {
private static Log log = LogFactory.getLog(CredentialManagementResponseBuilder.class);
private ResponsePayload responsePayload;
/**
* Builds the response to change the password of a user
* @param credentials - User credentials
* @return Response Object
* @throws MDMAPIException
*/
public static Response buildChangePasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException {
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ResponsePayload responsePayload = new ResponsePayload();
try {
byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword());
byte[] decodedOldPassword = Base64.decodeBase64(credentials.getOldPassword());
userStoreManager.updateCredential(credentials.getUsername(), new String(
decodedNewPassword, "UTF-8"), new String(decodedOldPassword, "UTF-8"));
responsePayload.setStatusCode(HttpStatus.SC_CREATED);
responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() +
" was successfully changed.");
return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build();
} catch (UserStoreException e) {
log.error(e.getMessage(), e);
responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST);
responsePayload.setMessageFromServer("Old password does not match.");
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build();
} catch (UnsupportedEncodingException e) {
String errorMsg = "Could not change the password of the user: " + credentials.getUsername() +
". The Character Encoding is not supported.";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
}
}
/**
* Builds the response to reset the password of a user
* @param credentials - User credentials
* @return Response Object
* @throws MDMAPIException
*/
public static Response buildResetPasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException {
UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager();
ResponsePayload responsePayload = new ResponsePayload();
try {
byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword());
userStoreManager.updateCredentialByAdmin(credentials.getUsername(), new String(
decodedNewPassword, "UTF-8"));
responsePayload.setStatusCode(HttpStatus.SC_CREATED);
responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() +
" was successfully changed.");
return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build();
} catch (UserStoreException e) {
log.error(e.getMessage(), e);
responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST);
responsePayload.setMessageFromServer("Could not change the password.");
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build();
} catch (UnsupportedEncodingException e) {
String errorMsg = "Could not change the password of the user: " + credentials.getUsername() +
". The Character Encoding is not supported.";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
}
}
}

@ -20,6 +20,7 @@ package org.wso2.carbon.mdm.api.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
@ -43,6 +44,7 @@ import org.wso2.carbon.user.api.UserStoreManager;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import javax.ws.rs.core.MediaType;
import java.util.List;
/**
@ -51,6 +53,7 @@ import java.util.List;
public class MDMAPIUtils {
private static final String NOTIFIER_FREQUENCY = "notifierFrequency";
public static final MediaType DEFAULT_CONTENT_TYPE = MediaType.APPLICATION_JSON_TYPE;
private static Log log = LogFactory.getLog(MDMAPIUtils.class);
@ -252,4 +255,31 @@ public class MDMAPIUtils {
pagingResponse.setData(data);
return pagingResponse;
}
public static CertificateManagementService getCertificateManagementService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
CertificateManagementService certificateManagementService = (CertificateManagementService)
ctx.getOSGiService(CertificateManagementService.class, null);
if (certificateManagementService == null) {
String msg = "Certificate Management service not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return certificateManagementService;
}
public static MediaType getResponseMediaType(String acceptHeader) {
MediaType responseMediaType;
if (acceptHeader == null || MediaType.WILDCARD.equals(acceptHeader)) {
responseMediaType = DEFAULT_CONTENT_TYPE;
} else {
responseMediaType = MediaType.valueOf(acceptHeader);
}
return responseMediaType;
}
}

@ -0,0 +1,50 @@
/*
* 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.mdm.beans;
public class EnrollmentCertificate {
String serial;
String pem;
int tenantId;
public int getTenantId() {
return tenantId;
}
public void setTenantId(int tenantId) {
this.tenantId = tenantId;
}
public String getSerial() {
return serial;
}
public void setSerial(String serial) {
this.serial = serial;
}
public String getPem() {
return pem;
}
public void setPem(String pem) {
this.pem = pem;
}
}

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* "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.
*/
@ -84,4 +84,4 @@ public class UserWrapper {
public void setPassword(String password) {
this.password = password;
}
}
}

@ -0,0 +1,31 @@
/*
* 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.mdm.exception;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
public class BadRequestException extends WebApplicationException {
public BadRequestException(Message message, MediaType mediaType) {
super(Response.status(Response.Status.BAD_REQUEST).entity(message).type(mediaType).build());
}
}

@ -0,0 +1,41 @@
/*
* 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.mdm.exception;
public class Message {
private String errorMessage;
private String discription;
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getDiscription() {
return discription;
}
public void setDiscription(String discription) {
this.discription = discription;
}
}

@ -30,165 +30,305 @@
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
<name>Device Management</name>
<path>/device-mgt</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Device Management Admin</name>
<path>/device-mgt/emm-admin</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Device Management User</name>
<path>/device-mgt/user</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Devices</name>
<path>/device-mgt/emm-admin/devices</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Policies</name>
<path>/device-mgt/emm-admin/policies</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Notifications</name>
<path>/device-mgt/emm-admin/notifications</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Users</name>
<path>/device-mgt/emm-admin/users</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Operations</name>
<path>/device-mgt/emm-admin/operations</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Applications</name>
<path>/device-mgt/emm-admin/operations/applications</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Get all devices</name>
<path>/device-mgt/devices/list</path>
<name>Roles</name>
<path>/device-mgt/emm-admin/roles</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>Configurations</name>
<path>/device-mgt/emm-admin/platform-configs</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>View Dashboard</name>
<path>/device-mgt/emm-admin/dashboard</path>
<url>/</url>
<method>GET</method>
</Permission>
<Permission>
<name>List devices</name>
<path>/device-mgt/emm-admin/devices/list</path>
<url>/devices</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get all device types</name>
<path>/device-mgt/devices/types</path>
<name>List devices</name>
<path>/device-mgt/emm-admin/devices/list</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/devices/types</url>
<method>GET</method>
</Permission>
<Permission>
<name>Edit policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/devices/types</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/devices/view</path>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get device</name>
<path>/device-mgt/devices/view</path>
<url>/devices/*/*</url>
<name>View device</name>
<path>/device-mgt/user/devices/view</path>
<url>/devices/view</url>
<method>GET</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<!--<Permission>-->
<!--<name>Get device</name>-->
<!--<path>/device-mgt/devices/view</path>-->
<!--<url>/devices/*/*</url>-->
<!--<method>GET</method>-->
<!--<scope>emm_admin,emm_user</scope>-->
<!--</Permission>-->
<Permission>
<name>Get users' devices</name>
<path>/device-mgt/devices/view</path>
<name>View device</name>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/devices/user/*/*</url>
<method>GET</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<Permission>
<name>Get device count</name>
<path>/device-mgt/devices/count</path>
<name>List devices</name>
<path>/device-mgt/emm-admin/devices/list</path>
<url>/devices/count</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get all users' devices</name>
<path>/device-mgt/devices/list</path>
<name>List devices</name>
<path>/device-mgt/emm-admin/devices/list</path>
<url>/devices/name/*/*</url>
<method>GET</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<!-- End of Device related APIs -->
<!-- Notification related APIs -->
<Permission>
<name>Get all notifications</name>
<path>/device-mgt/notifications/view</path>
<name>View notifications</name>
<path>/device-mgt/emm-admin/notifications/view</path>
<url>/notifications</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add notification</name>
<path>/device-mgt/notifications/add</path>
<path>/device-mgt/emm-admin/notifications/add</path>
<url>/notifications</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update notification</name>
<path>/device-mgt/notifications/view</path>
<path>/device-mgt/emm-admin/notifications/update</path>
<url>/notifications/*/*</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get new notifications</name>
<path>/device-mgt/notifications/view</path>
<name>View notifications</name>
<path>/device-mgt/emm-admin/notifications/view</path>
<url>/notifications/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<!-- End of Notification related APIs -->
<!-- Operations related APIs -->
<Permission>
<name>Get all operations</name>
<path>/device-mgt/operations/view</path>
<name>View user</name>
<path>/device-mgt/emm-admin/users/view</path>
<url>/operations</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add Operation</name>
<path>/device-mgt/operations/add</path>
<name>Install application</name>
<path>/device-mgt/emm-admin/operations/applications/install-applications</path>
<url>/operations</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Install Application</name>
<path>/device-mgt/operations/application/install</path>
<name>Install application</name>
<path>/device-mgt/emm-admin/operations/applications/install-applications</path>
<url>/operations/installApp/*</url>
<method>POST</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<Permission>
<name>Uninstall Application</name>
<path>/device-mgt/operations/application/uninstall</path>
<name>Uninstall application</name>
<path>/device-mgt/emm-admin/operations/applications/uninstall-applications</path>
<url>/operations/uninstallApp/*</url>
<method>POST</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<Permission>
<name>Get Applications For Devices</name>
<path>/device-mgt/operations/application/view</path>
<name>View application</name>
<path>/device-mgt/emm-admin/operations/applications/view-applications</path>
<url>/operations/*/*/*</url>
<method>GET</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<Permission>
<name>Get Device Operations</name>
<path>/device-mgt/operations/view</path>
<name>View devices</name>
<path>/device-mgt/user/devices/view</path>
<url>/operations/*/*/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/operations/*/*/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/operations/*/*</url>
<method>GET</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<Permission>
<name>Get Applications For Device Type</name>
<path>/device-mgt/operations/application/view</path>
<url>/operations/*</url>
<name>View device</name>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/operations/paginate/*/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/user/devices/view</path>
<url>/operations/*/*</url>
<method>GET</method>
<scope>emm_admin,emm_user</scope>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/user/devices/view</path>
<url>/operations/paginate/*/*</url>
<method>GET</method>
</Permission>
<!--<Permission>-->
<!--<name>Get Applications For Device Type</name>-->
<!--<path>/device-mgt/operations/application/view</path>-->
<!--<url>/operations/*</url>-->
<!--<method>GET</method>-->
<!--<scope>emm_admin,emm_user</scope>-->
<!--</Permission>-->
<!-- End of Operations related APIs -->
<!-- Feature related APIs -->
<Permission>
<name>Get features</name>
<path>/device-mgt/features/view</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/features/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get all features</name>
<path>/device-mgt/features/view</path>
<name>View device</name>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/features/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/user/devices/view</path>
<url>/features/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/user/devices/view</path>
<url>/features</url>
<method>GET</method>
<scope>emm_admin</scope>
@ -197,328 +337,438 @@
<!-- Role related APIs -->
<Permission>
<name>Get all roles</name>
<path>/device-mgt/roles</path>
<name>List roles</name>
<path>/device-mgt/emm-admin/roles/list</path>
<url>/roles</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get role permissions</name>
<path>/device-mgt/roles</path>
<url>/roles/permissions</url>
<name>View user</name>
<path>/device-mgt/emm-admin/users/view</path>
<url>/roles</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get User roles</name>
<path>/device-mgt/roles</path>
<url>/roles/*</url>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/roles</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update User roles</name>
<path>/device-mgt/roles/update</path>
<name>Update policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/roles</url>
<method>PUT</method>
<scope>emm_admin</scope>
<method>GET</method>
</Permission>
<Permission>
<name>List roles</name>
<path>/device-mgt/emm-admin/roles/list</path>
<url>/roles/permissions</url>
<method>GET</method>
</Permission>
<Permission>
<name>Update a specific role</name>
<path>/device-mgt/roles/update</path>
<name>List roles</name>
<path>/device-mgt/emm-admin/roles/list</path>
<url>/roles/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add user</name>
<path>/device-mgt/emm-admin/users/add</path>
<url>/roles/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>Update role</name>
<path>/device-mgt/emm-admin/roles/update</path>
<url>/roles</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<!--<Permission>-->
<!--<name>Update a specific role</name>-->
<!--<path>/device-mgt/roles/update</path>-->
<!--<url>/roles/*</url>-->
<!--<method>PUT</method>-->
<!--<scope>emm_admin</scope>-->
<!--</Permission>-->
<Permission>
<name>Update User roles</name>
<path>/device-mgt/roles</path>
<url>/roles/*/users</url>
<name>Update role</name>
<path>/device-mgt/emm-admin/roles/update</path>
<url>/roles/users</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Save User roles</name>
<path>/device-mgt/roles/add</path>
<name>Add role</name>
<path>/device-mgt/emm-admin/roles/add</path>
<url>/roles</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Delete User roles</name>
<path>/device-mgt/roles/delete</path>
<name>Remove role</name>
<path>/device-mgt/emm-admin/roles/remove</path>
<url>/roles</url>
<method>DELETE</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>List roles</name>
<path>/device-mgt/emm-admin/roles/list</path>
<url>/roles/count</url>
<method>GET</method>
</Permission>
<!-- End of Role related APIs -->
<!-- User related APIs -->
<Permission>
<name>Get all users</name>
<path>/device-mgt/users/view</path>
<name>List users</name>
<path>/device-mgt/emm-admin/users/list</path>
<url>/users</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add user</name>
<path>/device-mgt/users/add</path>
<path>/device-mgt/emm-admin/users/add</path>
<url>/users</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get user</name>
<path>/device-mgt/users/view</path>
<name>View user</name>
<path>/device-mgt/emm-admin/users/view</path>
<url>/users/view</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update user</name>
<path>/device-mgt/users/update</path>
<path>/device-mgt/emm-admin/users/update</path>
<url>/users</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Change user password</name>
<path>/device-mgt/users/reset-password</path>
<url>/users/reset-password</url>
<path>/login</path>
<url>/users/change-password</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Reset password</name>
<path>/device-mgt/emm-admin/users/password-reset</path>
<url>/users/reset-password</url>
<method>POST</method>
</Permission>
<Permission>
<name>Delete user</name>
<path>/device-mgt/users/delete</path>
<name>Remove user</name>
<path>/device-mgt/emm-admin/users/remove</path>
<url>/users</url>
<method>DELETE</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get user roles by name</name>
<path>/device-mgt/users/roles</path>
<name>View user</name>
<path>/device-mgt/emm-admin/users/view</path>
<url>/users/roles</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<!--<Permission>-->
<!--<name>Get user roles by name</name>-->
<!--<path>/device-mgt/emm-admin/users/view</path>-->
<!--<url>/roles</url>-->
<!--<method>GET</method>-->
<!--</Permission>-->
<Permission>
<name>Get user roles by name</name>
<path>/device-mgt/users/roles</path>
<name>Add user</name>
<path>/device-mgt/emm-admin/users/add</path>
<url>/roles</url>
<method>GET</method>
<scope>emm_admin</scope>
<method>POST</method>
</Permission>
<Permission>
<name>Save Roles</name>
<path>/device-mgt/users/roles</path>
<url>/roles</url>
<method>POST</method>
<scope>emm_admin</scope>
<name>List devices</name>
<path>/device-mgt/user/devices/list</path>
<url>/users/devices</url>
<method>GET</method>
</Permission>
<Permission>
<name>Get all devices of user</name>
<path>/device-mgt/users/devices</path>
<name>List devices</name>
<path>/device-mgt/emm-admin/devices/list</path>
<url>/users/devices</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get user roles</name>
<path>/device-mgt/users/roles</path>
<name>View user</name>
<path>/device-mgt/emm-admin/users/view</path>
<url>/users/*/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get user count</name>
<path>/device-mgt/users/view</path>
<name>List users</name>
<path>/device-mgt/emm-admin/users/list</path>
<url>/users/count</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get all user names</name>
<path>/device-mgt/users/view</path>
<name>List users</name>
<path>/device-mgt/emm-admin/users/list</path>
<url>/users/view-users</url>
<method>GET</method>
</Permission>
<Permission>
<name>Add role</name>
<path>/device-mgt/emm-admin/roles/add</path>
<url>/users/view-users</url>
<method>GET</method>
</Permission>
<Permission>
<name>Update role</name>
<path>/device-mgt/emm-admin/roles/update</path>
<url>/users/view-users</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get all usernames</name>
<path>/device-mgt/users/view</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/users/view-users</url>
<method>GET</method>
</Permission>
<Permission>
<name>Update policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/users/view-users</url>
<method>GET</method>
</Permission>
<Permission>
<name>List users</name>
<path>/device-mgt/emm-admin/users/list</path>
<url>/users/users-by-username</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get filtered usernames</name>
<path>/device-mgt/users/view</path>
<name>List users</name>
<path>/device-mgt/emm-admin/users/list</path>
<url>/users/users-by-username/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Send invitation</name>
<path>/device-mgt/users/invite</path>
<name>Invite user</name>
<path>/device-mgt/emm-admin/users/invite</path>
<url>/users/email-invitation</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Authorize user</name>
<path>/login</path>
<url>/users/authorize</url>
<method>POST</method>
</Permission>
<!-- End of User related APIs -->
<!-- Policy related APIs -->
<Permission>
<name>Add Policy</name>
<path>/device-mgt/policies/add</path>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/inactive-policy</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get Policy For Device</name>
<path>/device-mgt/policies/view</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/policies/*/*</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get Policy For Device By Type</name>
<path>/device-mgt/policies/view</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/policies/*/*/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/emm-admin/devices/view</path>
<url>/policies/*/*/*</url>
<method>GET</method>
</Permission>
<Permission>
<name>View device</name>
<path>/device-mgt/user/devices/view</path>
<url>/policies/*/*/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add Active Policy</name>
<path>/device-mgt/policies/add</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/active-policy</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Bulk Policy Removal</name>
<path>/device-mgt/policies/bulk-remove</path>
<name>Remove policy</name>
<path>/device-mgt/emm-admin/policies/remove</path>
<url>/policies/bulk-remove</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get Policies</name>
<path>/device-mgt/policies/view</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/policies</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get Policy</name>
<path>/device-mgt/policies/view</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/policies/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update Policy</name>
<path>/device-mgt/policies/update</path>
<name>Update policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/policies/*</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Delete Policy</name>
<path>/device-mgt/policies/delete</path>
<name>Remove policy</name>
<path>/device-mgt/emm-admin/policies/remove</path>
<url>/policies</url>
<method>DELETE</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Policy Count</name>
<path>/device-mgt/policies/view</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/policies/count</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Policy priorities</name>
<path>/device-mgt/policies/update</path>
<name>Edit policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/policies/priorities</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Activate Policy</name>
<path>/device-mgt/policies/update</path>
<name>Edit policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/policies/activate</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Inactivate Policy</name>
<path>/device-mgt/policies/update</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/activate</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Edit policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/policies/inactivate</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/inactivate</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Apply Policy changes</name>
<path>/device-mgt/policies/update</path>
<name>Edit policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/policies/apply-changes</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Start Task</name>
<path>/device-mgt/policies/task</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/start-task/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update Task</name>
<path>/device-mgt/policies/task</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/update-task/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Stop Task</name>
<path>/device-mgt/policies/task</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/policies/stop-task</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Get Policy Compliance</name>
<path>/device-mgt/policies/compliance</path>
<name>List policies</name>
<path>/device-mgt/emm-admin/policies/list</path>
<url>/policies/*/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<!-- End of Policy related APIs -->
<!-- Profile related APIs -->
<Permission>
<name>Add profile</name>
<path>/device-mgt/profiles/add</path>
<name>Add policy</name>
<path>/device-mgt/emm-admin/policies/add</path>
<url>/profiles</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update profile</name>
<path>/device-mgt/profiles/update</path>
<name>Edit policy</name>
<path>/device-mgt/emm-admin/policies/update</path>
<url>/profiles/*</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add profile</name>
<path>/device-mgt/profiles/delete</path>
<name>Remove policy</name>
<path>/device-mgt/emm-admin/policies/remove</path>
<url>/profiles/*</url>
<method>DELETE</method>
<scope>emm_admin</scope>
</Permission>
<!-- End of Profile related APIs -->
@ -541,25 +791,49 @@
<!-- Configuration related APIs -->
<Permission>
<name>Get configuration</name>
<path>/device-mgt/tenant/configuration/view</path>
<name>View configuration</name>
<path>/device-mgt/emm-admin/platform-configs/view</path>
<url>/configuration</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Add configuration</name>
<path>/device-mgt/tenant/configuration/modify</path>
<path>/device-mgt/emm-admin/platform-configs/add</path>
<url>/configuration</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>Update configuration</name>
<path>/device-mgt/tenant/configuration/modify</path>
<path>/device-mgt/emm-admin/platform-configs/modify</path>
<url>/configuration</url>
<method>PUT</method>
<scope>emm_admin</scope>
</Permission>
<!-- End of Configuration related APIs -->
<!-- Certificate related APIs -->
<Permission>
<name>Save certificate in the database</name>
<path>/device-mgt/android/certificate/save</path>
<url>/certificates/saveCertificate</url>
<method>POST</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>get certificate in the database</name>
<path>/device-mgt/android/certificate/Get</path>
<url>/certificates/*</url>
<method>GET</method>
<scope>emm_admin</scope>
</Permission>
<Permission>
<name>get certificate in the database</name>
<path>/device-mgt/android/certificate/Get</path>
<url>/certificates/*</url>
<method>DELETE</method>
<scope>emm_admin</scope>
</Permission>
<!-- End of Certificate related APIs -->
</PermissionConfiguration>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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,
~ Version 2.0 (the "License"); you may not use this file except
@ -12,7 +12,7 @@
~ 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
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
@ -105,6 +105,15 @@
<ref bean="errorHandler"/>
</jaxrs:providers>
</jaxrs:server>
<jaxrs:server id="certificateService" address="/certificates">
<jaxrs:serviceBeans>
<ref bean="certificateServiceBean"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="jsonProvider"/>
<ref bean="errorHandler"/>
</jaxrs:providers>
</jaxrs:server>
<jaxrs:server id="notificationService" address="/notifications">
<jaxrs:serviceBeans>
<ref bean="notificationServiceBean"/>
@ -133,6 +142,7 @@
<bean id="configurationServiceBean" class="org.wso2.carbon.mdm.api.Configuration"/>
<bean id="notificationServiceBean" class="org.wso2.carbon.mdm.api.DeviceNotification"/>
<bean id="licenseServiceBean" class="org.wso2.carbon.mdm.api.License"/>
<bean id="certificateServiceBean" class="org.wso2.carbon.mdm.api.Certificate"/>
<!--
<bean id="authenticationServiceBean" class="org.wso2.carbon.mdm.api.Authentication"/>
-->

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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.
-->
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -34,8 +34,8 @@
<modules>
<module>org.wso2.carbon.device.mgt.mobile</module>
<!--<module>org.wso2.carbon.device.mgt.mobile.api</module>-->
<!--<module>org.wso2.carbon.device.mgt.mobile.ui</module>-->
<module>org.wso2.carbon.device.mgt.mobile.api</module>
<module>org.wso2.carbon.device.mgt.mobile.ui</module>
<module>org.wso2.carbon.device.mgt.mobile.url.printer</module>
</modules>

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, 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.
-->
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -33,8 +33,8 @@
<url>http://wso2.org</url>
<modules>
<!--<module>android-plugin</module>-->
<!--<module>windows-plugin</module>-->
<module>android-plugin</module>
<module>windows-plugin</module>
<module>mobile-base-plugin</module>
</modules>

@ -1,22 +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.
*/
@javax.xml.bind.annotation.XmlSchema(namespace =
"http://schemas.microsoft.com/windows/management/2012/01/enrollment",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.wso2.carbon.mdm.mobileservices.windows.services.discovery.beans;

@ -1,27 +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.
*/
@XmlSchema(namespace = "http://www.w3.org/2003/05/soap-envelope",
xmlns = {
@XmlNs(prefix = "", namespaceURI = "http://www.w3.org/2003/05/soap-envelope")
}, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.wso2.carbon.mdm.mobileservices.windows.services.wstep.beans;
import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlSchema;

@ -1,23 +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.
*/
@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.microsoft" +
".com/windows/pki/2009/01/enrollmentpolicy",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.wso2.carbon.mdm.mobileservices.windows.services.xcep.beans;

@ -1,26 +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.
-->
<WindowsPlugin>
<AuthPolicy>Federated</AuthPolicy>
<Password>wso2carbon</Password>
<PrivateKeyPassword>cacert</PrivateKeyPassword>
<SignedCertCN>CN=mdmcn</SignedCertCN>
<SignedCertNotBefore>3</SignedCertNotBefore>
<SignedCertNotAfter>300</SignedCertNotAfter>
<domain>wso2.com</domain>
</WindowsPlugin>

@ -1,5 +1,5 @@
<!--
~ 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,
~ Version 2.0 (the "License"); you may not use this file except
@ -28,7 +28,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.agent</artifactId>
<artifactId>org.wso2.carbon.device.mgt.mobile.windows.api</artifactId>
<name>WSO2 Carbon - Windows JAX-RS API</name>
<description>Windows JAX-RS API</description>
<packaging>war</packaging>

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@ -1,17 +1,17 @@
/*
* 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,
* 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
* 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
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save