Changing the policy interface and test case

4.x.x
Geeth Munasinghe 10 years ago
parent 9c04828935
commit eb734a4b14

@ -18,23 +18,20 @@
package org.wso2.carbon.device.mgt.core; package org.wso2.carbon.device.mgt.core;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.junit.Test;
public class DeviceManagementTestCase extends TestCase { import static org.junit.Assert.assertEquals;
public class DeviceManagementTestCase {
private static final Log log = LogFactory.getLog(DeviceManagementTestCase.class); private static final Log log = LogFactory.getLog(DeviceManagementTestCase.class);
/** @Test
* @return the suite of tests being tested public void setUp() throws Exception {
*/ log.info("Testing started.");
public static Test suite() { assertEquals("A", "A");
return new TestSuite(DeviceManagementTestCase.class);
} }
} }

@ -20,11 +20,64 @@ package org.wso2.carbon.policy.mgt.common.spi;
import org.wso2.carbon.policy.mgt.common.Policy; import org.wso2.carbon.policy.mgt.common.Policy;
/**
* This interface defines the policy management which should be implemented by the plugins
*/
public interface PolicyManagerService { public interface PolicyManagerService {
void addPolicy(Policy policy); // void addPolicy(Policy policy);
/**
* This method adds a policy per device which should be implemented by the related plugins.
* @param deviceId
* @param deviceType
* @param policy
*/
void addPolicyToDevice(String deviceId, String deviceType, Policy policy);
/**
* This method adds a policy to device type by the related device type plugins.
* @param deviceType
* @param policy
*/
void addPolicyToDeviceType(String deviceType,Policy policy);
/**
* This method adds the policy to specific role.
* @param roleName
* @param policy
*/
void addPolicyToRole(String roleName, Policy policy);
// Policy getPolicy();
/**
* This method gives the device specific policy.
* @param deviceId
* @param deviceType
* @return Policy
*/
Policy getPolicyOfDevice(String deviceId, String deviceType);
/**
* This method returns the device type specific policy.
* @param deviceType
* @return Policy
*/
Policy getPolicyOfDeviceType(String deviceType);
/**
* This method returns the role specific policy.
* @param roleName
* @return
*/
Policy getPolicyOfRole(String roleName);
void addPolicy(String deviceId, String deviceType, Policy policy);
void addPolicy(String deviceType,Policy policy);
} }

Loading…
Cancel
Save