Making the plug-in implementations compatible with the changes introduced to DeviceManagementService SPI

revert-dabc3590
prabathabey 9 years ago
parent 84942194ae
commit cfbc36ff2d

@ -16,19 +16,16 @@
package org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl; package org.wso2.carbon.device.mgt.iot.androidsense.plugin.impl;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.iot.androidsense.plugin.constants.AndroidSenseConstants; import org.wso2.carbon.device.mgt.iot.androidsense.plugin.constants.AndroidSenseConstants;
import java.util.List;
public class AndroidSenseManagerService implements DeviceManagementService { public class AndroidSenseManagerService implements DeviceManagementService {
private DeviceManager deviceManager; private DeviceManager deviceManager;
@Override @Override
@ -36,16 +33,6 @@ public class AndroidSenseManagerService implements DeviceManagementService {
return AndroidSenseConstants.DEVICE_TYPE; return AndroidSenseConstants.DEVICE_TYPE;
} }
@Override
public String getProviderTenantDomain() {
return AndroidSenseConstants.DEVICE_TYPE_PROVIDER_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
this.deviceManager=new AndroidSenseManager(); this.deviceManager=new AndroidSenseManager();
@ -61,9 +48,14 @@ public class AndroidSenseManagerService implements DeviceManagementService {
return null; return null;
} }
@Override public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> list) @Override
throws DeviceManagementException { public ProvisioningConfig getProvisioningConfig() {
return new ProvisioningConfig(AndroidSenseConstants.DEVICE_TYPE_PROVIDER_DOMAIN, true);
}
} @Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
}
} }

@ -18,19 +18,16 @@
package org.wso2.carbon.device.mgt.iot.arduino.plugin.impl; package org.wso2.carbon.device.mgt.iot.arduino.plugin.impl;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.iot.arduino.plugin.constants.ArduinoConstants; import org.wso2.carbon.device.mgt.iot.arduino.plugin.constants.ArduinoConstants;
import java.util.List;
public class ArduinoManagerService implements DeviceManagementService { public class ArduinoManagerService implements DeviceManagementService {
private DeviceManager deviceManager; private DeviceManager deviceManager;
private final static String DEVICE_TYPE_PROVIDER_DOMAIN = "carbon.super"; private final static String DEVICE_TYPE_PROVIDER_DOMAIN = "carbon.super";
@ -39,16 +36,6 @@ public class ArduinoManagerService implements DeviceManagementService {
return ArduinoConstants.DEVICE_TYPE; return ArduinoConstants.DEVICE_TYPE;
} }
@Override
public String getProviderTenantDomain() {
return DEVICE_TYPE_PROVIDER_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
deviceManager=new ArduinoManager(); deviceManager=new ArduinoManager();
@ -65,10 +52,14 @@ public class ArduinoManagerService implements DeviceManagementService {
return null; return null;
} }
@Override @Override
public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIds) public ProvisioningConfig getProvisioningConfig() {
throws DeviceManagementException { return new ProvisioningConfig(DEVICE_TYPE_PROVIDER_DOMAIN, true);
}
} @Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
}
} }

@ -18,18 +18,14 @@
package org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl; package org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.impl;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.constants.RaspberrypiConstants; import org.wso2.carbon.device.mgt.iot.raspberrypi.plugin.constants.RaspberrypiConstants;
import java.util.List;
public class RaspberrypiManagerService implements DeviceManagementService { public class RaspberrypiManagerService implements DeviceManagementService {
private DeviceManager deviceManager; private DeviceManager deviceManager;
@ -39,16 +35,6 @@ public class RaspberrypiManagerService implements DeviceManagementService {
return RaspberrypiConstants.DEVICE_TYPE; return RaspberrypiConstants.DEVICE_TYPE;
} }
@Override
public String getProviderTenantDomain() {
return RaspberrypiConstants.DEVICE_TYPE_PROVIDER_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
deviceManager = new RaspberrypiManager(); deviceManager = new RaspberrypiManager();
@ -64,10 +50,15 @@ public class RaspberrypiManagerService implements DeviceManagementService {
return null; return null;
} }
@Override @Override
public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIds) public ProvisioningConfig getProvisioningConfig() {
throws DeviceManagementException { return new ProvisioningConfig(RaspberrypiConstants.DEVICE_TYPE_PROVIDER_DOMAIN, true);
}
@Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
}
}
} }

@ -18,56 +18,46 @@
package org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.impl; package org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.impl;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants; import org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin.constants.VirtualFireAlarmConstants;
import java.util.List; public class VirtualFireAlarmManagerService implements DeviceManagementService {
public class VirtualFireAlarmManagerService implements DeviceManagementService{ private DeviceManager deviceManager;
private DeviceManager deviceManager;
@Override @Override
public String getType() { public String getType() {
return VirtualFireAlarmConstants.DEVICE_TYPE; return VirtualFireAlarmConstants.DEVICE_TYPE;
} }
@Override
public void init() throws DeviceManagementException {
this.deviceManager = new VirtualFireAlarmManager();
}
@Override @Override
public String getProviderTenantDomain() { public DeviceManager getDeviceManager() {
return VirtualFireAlarmConstants.DEVICE_TYPE_PROVIDER_DOMAIN; return deviceManager;
} }
@Override @Override
public boolean isSharedWithAllTenants() { public ApplicationManager getApplicationManager() {
return true; return null;
} }
@Override @Override
public void init() throws DeviceManagementException { public ProvisioningConfig getProvisioningConfig() {
this.deviceManager=new VirtualFireAlarmManager(); return new ProvisioningConfig(VirtualFireAlarmConstants.DEVICE_TYPE_PROVIDER_DOMAIN, true);
} }
@Override @Override
public DeviceManager getDeviceManager() { public PushNotificationConfig getPushNotificationConfig() {
return deviceManager; return null;
} }
@Override
public ApplicationManager getApplicationManager() {
return null;
}
@Override
public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIds)
throws DeviceManagementException {
}
} }

@ -21,10 +21,12 @@ package org.wso2.carbon.device.mgt.mobile.android.impl;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import java.util.List; import java.util.List;
@ -43,16 +45,6 @@ public class AndroidDeviceManagementService implements DeviceManagementService {
return AndroidDeviceManagementService.DEVICE_TYPE_ANDROID; return AndroidDeviceManagementService.DEVICE_TYPE_ANDROID;
} }
@Override
public String getProviderTenantDomain() {
return SUPER_TENANT_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return false;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
this.deviceManager = new AndroidDeviceManager(); this.deviceManager = new AndroidDeviceManager();
@ -69,9 +61,13 @@ public class AndroidDeviceManagementService implements DeviceManagementService {
} }
@Override @Override
public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIdentifiers) public ProvisioningConfig getProvisioningConfig() {
throws DeviceManagementException { return new ProvisioningConfig(SUPER_TENANT_DOMAIN, true);
}
@Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
} }
} }

@ -23,6 +23,7 @@ import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import java.util.List; import java.util.List;
@ -41,16 +42,6 @@ public class AndroidDeviceManagementService implements DeviceManagementService {
return AndroidDeviceManagementService.DEVICE_TYPE_ANDROID; return AndroidDeviceManagementService.DEVICE_TYPE_ANDROID;
} }
@Override
public String getProviderTenantDomain() {
return SUPER_TENANT_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
this.deviceManager = new AndroidDeviceManager(); this.deviceManager = new AndroidDeviceManager();
@ -67,9 +58,13 @@ public class AndroidDeviceManagementService implements DeviceManagementService {
} }
@Override @Override
public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIdentifiers) public ProvisioningConfig getProvisioningConfig() {
throws DeviceManagementException { return new ProvisioningConfig(SUPER_TENANT_DOMAIN, true);
}
@Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
} }
} }

@ -21,10 +21,12 @@ package org.wso2.carbon.device.mgt.mobile.impl.windows;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import java.util.List; import java.util.List;
@ -43,16 +45,6 @@ public class WindowsDeviceManagementService implements DeviceManagementService {
return WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS; return WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS;
} }
@Override
public String getProviderTenantDomain() {
return SUPER_TENANT_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
this.deviceManager = new WindowsDeviceManager(); this.deviceManager = new WindowsDeviceManager();
@ -68,9 +60,14 @@ public class WindowsDeviceManagementService implements DeviceManagementService {
return null; return null;
} }
@Override public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIdentifiers) @Override
throws DeviceManagementException { public ProvisioningConfig getProvisioningConfig() {
return new ProvisioningConfig(SUPER_TENANT_DOMAIN, true);
}
@Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
} }
} }

@ -21,10 +21,12 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import java.util.List; import java.util.List;
@ -43,16 +45,6 @@ public class WindowsDeviceManagementService implements DeviceManagementService {
return WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS; return WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS;
} }
@Override
public String getProviderTenantDomain() {
return DEVICE_TYPE_PROVIDER_DOMAIN;
}
@Override
public boolean isSharedWithAllTenants() {
return true;
}
@Override @Override
public void init() throws DeviceManagementException { public void init() throws DeviceManagementException {
this.deviceManager = new WindowsDeviceManager(); this.deviceManager = new WindowsDeviceManager();
@ -68,9 +60,14 @@ public class WindowsDeviceManagementService implements DeviceManagementService {
return null; return null;
} }
@Override public void notifyOperationToDevices(Operation operation, List<DeviceIdentifier> deviceIdentifiers) @Override
throws DeviceManagementException { public ProvisioningConfig getProvisioningConfig() {
return new ProvisioningConfig(DEVICE_TYPE_PROVIDER_DOMAIN, true);
}
@Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
} }
} }

Loading…
Cancel
Save