Merge remote-tracking branch 'origin/master'

revert-dabc3590
harshanL 10 years ago
commit e656ec54f6

@ -19,10 +19,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

@ -1,12 +1,12 @@
/**
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* <p/>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
*
* 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.
@ -26,23 +26,31 @@ import java.util.List;
*/
public interface DeviceManagerService {
/**
* Method to retrieve the provider type that implements DeviceManagerService interface
* @return Returns provider type
*/
String getProviderType();
/**
* Method to enrolling a particular device of type mobile, IoT, etc within CDM.
* @param device Metadata corresponding to the device being enrolled
*
* @param device Metadata corresponding to the device being enrolled
* @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device
*/
void enrollDevice(Device device) throws DeviceManagementException;
/**
* Method to modify the metadata corresponding to device enrollment
*
* @param device Modified device enrollment related metadata
* @throws DeviceManagementException If some unusual behaviour is observed while modify the enrollment of a
* device
* @throws DeviceManagementException If some unusual behaviour is observed while modify the enrollment of a
* device
*/
void modifyEnrollment(Device device) throws DeviceManagementException;
/**
* Method to disenroll a particular device from CDM.
*
* @param type Device Type
* @param deviceId Device Identifier
* @throws DeviceManagementException
@ -51,6 +59,7 @@ public interface DeviceManagerService {
/**
* Method to retrieve the status of the registration process of a particular device.
*
* @param type Device Type
* @param deviceId Device Identifier
* @return Status of enrollment
@ -60,6 +69,7 @@ public interface DeviceManagerService {
/**
* Method to retrieve the status of a particular device.
*
* @param type Device Type
* @param deviceId Device Identifier
* @return Returns if the device is active
@ -70,6 +80,7 @@ public interface DeviceManagerService {
/**
* Method to set the status indicating whether a particular device registered within CDM is enabled at a given
* moment.
*
* @param status Indicates whether the device is active
* @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device
*/
@ -77,6 +88,7 @@ public interface DeviceManagerService {
/**
* Method to retrieve metadata of all devices registered within CDM corresponding to a particular device type.
*
* @param type Device Type
* @return List of metadata corresponding to all devices registered within CDM
*/
@ -84,9 +96,10 @@ public interface DeviceManagerService {
/**
* Method to retrieve metadata of a device corresponding to a particular type that carries a specific identifier.
*
* @param type Device Type
* @param deviceId Device Identifier
* @return Metadata corresponding to a particular device
* @return Metadata corresponding to a particular device
* @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device
*/
Device getDeviceInfo(String type, String deviceId) throws DeviceManagementException;
@ -100,7 +113,8 @@ public interface DeviceManagerService {
/**
* Method to set the ownership type of a particular device. i.e. BYOD, COPE
* @param ownershipType Type of ownership
*
* @param ownershipType Type of ownership
* @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device
*/
void setOwnership(String ownershipType) throws DeviceManagementException;

@ -53,8 +53,7 @@
<Bundle-Description>Device Management Core Bundle</Bundle-Description>
<Private-Package>org.wso2.carbon.device.mgt.core.internal</Private-Package>
<Import-Package>
org.apache.axis2.*;
version="${axis2.osgi.version.range}",
org.apache.axis2.*;version="${axis2.osgi.version.range}",
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
@ -90,7 +89,6 @@
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<version>${carbon.kernel.version}</version>
</dependency>
</dependencies>

@ -22,7 +22,7 @@ import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
/**
* @scr.component name="org.wso2.carbon.device.manager" immediate="true"
* @scr.reference name="device.manager.service"
* interface="org.wso2.carbon.device.mgt.common.spi.DeviceManager" cardinality="1..n"
* interface="org.wso2.carbon.device.mgt.common.spi.DeviceManagerService" cardinality="1..n"
* policy="dynamic" bind="setDeviceManagerService" unbind="unsetDeviceManagerService"
*/
public class DeviceMgtServiceComponent {

@ -27,7 +27,14 @@ import java.util.List;
*/
public class AndroidDeviceManagerService implements DeviceManagerService {
@Override
private static final String DEVICE_MANAGER_ANDROID = "android";
@Override
public String getProviderType() {
return DEVICE_MANAGER_ANDROID;
}
@Override
public void enrollDevice(Device device) throws DeviceManagementException {
}

@ -26,7 +26,15 @@ import java.util.List;
* This represents the iOS implementation of DeviceManagerService. *
*/
public class IOSDeviceManagerService implements DeviceManagerService {
@Override
private static final String DEVICE_MANAGER_IOS = "ios";
@Override
public String getProviderType() {
return DEVICE_MANAGER_IOS;
}
@Override
public void enrollDevice(Device device) throws DeviceManagementException {
}

@ -25,8 +25,16 @@ import java.util.List;
/**
* This represents the Windows implementation of DeviceManagerService.
*/
public class WindowsDeviceManagerService implements DeviceManagerService{
@Override
public class WindowsDeviceManagerService implements DeviceManagerService {
private static final String DEVICE_MANAGER_WINDOWS = "windows";
@Override
public String getProviderType() {
return DEVICE_MANAGER_WINDOWS;
}
@Override
public void enrollDevice(Device device) throws DeviceManagementException {
}

@ -64,7 +64,32 @@
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<version>3.3.100.v20120522-1822</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

@ -78,11 +78,6 @@
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<version>${carbon.kernel.version}</version>
</dependency>
</dependencies>
</project>

@ -18,5 +18,37 @@
package org.wso2.carbon.policy.evaluator;
public class PDPException {
public class PDPException extends Exception {
private String pdpErrorMessage;
public String getPdpErrorMessage() {
return pdpErrorMessage;
}
public void setPdpErrorMessage(String pdpErrorMessage) {
this.pdpErrorMessage = pdpErrorMessage;
}
public PDPException(String message) {
setPdpErrorMessage(message);
}
public PDPException(String message, Exception ex) {
super(message, ex);
setPdpErrorMessage(message);
}
public PDPException(String message, Throwable cause) {
super(message, cause);
setPdpErrorMessage(message);
}
public PDPException(Throwable cause) {
super(cause);
}
public PDPException(){
super();
}
}

@ -0,0 +1,27 @@
/*
* Copyright (c) 2005-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.
*/
package org.wso2.carbon.policy.mgt.common;
public class Feature {
private String code;
private String name;
private Object attribute;
}

@ -0,0 +1,55 @@
/*
* 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.
*/
package org.wso2.carbon.policy.mgt.common;
public class FeatureManagementException extends Exception{
private String errorMessage;
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public FeatureManagementException(String message) {
super(message);
setErrorMessage(message);
}
public FeatureManagementException(String message, Exception ex) {
super(message, ex);
setErrorMessage(message);
}
public FeatureManagementException(String message, Throwable cause) {
super(message, cause);
setErrorMessage(message);
}
public FeatureManagementException() {
super();
}
public FeatureManagementException(Throwable cause) {
super(cause);
}
}

@ -18,15 +18,11 @@
package org.wso2.carbon.policy.mgt.common;
import java.util.List;
public class Policy {
private int id;
private String policyName;
private List<Feature> featuresList;
public static class Features {
private String code;
private String name;
private Object attribute;
}
}

@ -45,7 +45,6 @@ public class PolicyManagementException extends Exception {
setPolicyErrorMessage(message);
}
public PolicyManagementException() {
super();
}

Loading…
Cancel
Save