mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Android Services Refactor
This commit is contained in:
parent
d015b9a960
commit
1db2b40790
@ -21,6 +21,7 @@ import org.wso2.carbon.device.mgt.common.Device;
|
|||||||
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.OperationManager;
|
import org.wso2.carbon.device.mgt.common.OperationManager;
|
||||||
|
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@ -58,8 +58,7 @@ public class DeviceManagerImpl implements DeviceManager {
|
|||||||
this.getDeviceDAO().addDevice(deviceDto);
|
this.getDeviceDAO().addDevice(deviceDto);
|
||||||
|
|
||||||
} catch (DeviceManagementDAOException e) {
|
} catch (DeviceManagementDAOException e) {
|
||||||
throw new DeviceManagementException("Error occurred while enrolling the device '" + device.getId() + "'",
|
throw new DeviceManagementException("Error occurred while enrolling the device '" + device.getId() + "'", e);
|
||||||
e);
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,8 +71,4 @@ public class DeviceConfigurationManager {
|
|||||||
return currentDeviceConfig;
|
return currentDeviceConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSourceConfig getDataSourceConfig() {
|
|
||||||
return currentDeviceConfig.getDeviceMgtRepository().getDataSourceConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,6 @@ import org.wso2.carbon.device.mgt.common.Device;
|
|||||||
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.OperationManager;
|
import org.wso2.carbon.device.mgt.common.OperationManager;
|
||||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
|
|
||||||
import org.wso2.carbon.device.mgt.core.DeviceManager;
|
import org.wso2.carbon.device.mgt.core.DeviceManager;
|
||||||
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
|
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
|
||||||
|
|
||||||
@ -54,10 +53,8 @@ public class DeviceManagementService implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setActive(DeviceIdentifier deviceId, boolean status)
|
public boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException {
|
||||||
throws DeviceManagementException {
|
return DeviceManagementDataHolder.getInstance().getDeviceManager().setActive(deviceId, status);
|
||||||
return DeviceManagementDataHolder.getInstance().getDeviceManager()
|
|
||||||
.setActive(deviceId, status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -66,8 +63,11 @@ public class DeviceManagementService implements DeviceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
|
public org.wso2.carbon.device.mgt.common.Device getDevice(DeviceIdentifier deviceId)
|
||||||
return DeviceManagementDataHolder.getInstance().getDeviceManager().getDevice(deviceId);
|
throws DeviceManagementException {
|
||||||
|
|
||||||
|
Device device = DeviceManagementDataHolder.getInstance().getDeviceManager().getDevice(deviceId);
|
||||||
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
//org.wso2.carbon....
|
||||||
package cdm.api.android;
|
package cdm.api.android;
|
||||||
|
|
||||||
import cdm.api.android.common.AndroidAgentException;
|
import cdm.api.android.common.AndroidAgentException;
|
||||||
@ -65,7 +66,6 @@ public class Device {
|
|||||||
} catch (DeviceManagementException e) {
|
} catch (DeviceManagementException e) {
|
||||||
msg = "Error occurred while fetching the device list.";
|
msg = "Error occurred while fetching the device list.";
|
||||||
LOG.error(msg, e);
|
LOG.error(msg, e);
|
||||||
Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR);
|
|
||||||
throw new AndroidAgentException(msg, e);
|
throw new AndroidAgentException(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,7 +80,6 @@ public class Device {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
dmService = AndroidAPIUtils.getDeviceManagementService();
|
dmService = AndroidAPIUtils.getDeviceManagementService();
|
||||||
|
|
||||||
} catch (DeviceManagementServiceException deviceMgtServiceEx) {
|
} catch (DeviceManagementServiceException deviceMgtServiceEx) {
|
||||||
String errorMsg = "Device management service error";
|
String errorMsg = "Device management service error";
|
||||||
LOG.error(errorMsg, deviceMgtServiceEx);
|
LOG.error(errorMsg, deviceMgtServiceEx);
|
||||||
@ -94,7 +93,6 @@ public class Device {
|
|||||||
Response.status(HttpStatus.SC_NOT_FOUND);
|
Response.status(HttpStatus.SC_NOT_FOUND);
|
||||||
}
|
}
|
||||||
return device;
|
return device;
|
||||||
|
|
||||||
} catch (DeviceManagementException deviceMgtEx) {
|
} catch (DeviceManagementException deviceMgtEx) {
|
||||||
msg = "Error occurred while fetching the device information.";
|
msg = "Error occurred while fetching the device information.";
|
||||||
LOG.error(msg, deviceMgtEx);
|
LOG.error(msg, deviceMgtEx);
|
||||||
|
|||||||
@ -101,9 +101,9 @@ public class Enrollment {
|
|||||||
}
|
}
|
||||||
return responseMsg;
|
return responseMsg;
|
||||||
} catch (DeviceManagementException deviceMgtEx) {
|
} catch (DeviceManagementException deviceMgtEx) {
|
||||||
String errormsg = "Error occurred while enrollment of the device.";
|
String errorMsg = "Error occurred while enrollment of the device.";
|
||||||
log.error(errormsg, deviceMgtEx);
|
log.error(errorMsg, deviceMgtEx);
|
||||||
throw new AndroidAgentException(errormsg, deviceMgtEx);
|
throw new AndroidAgentException(errorMsg, deviceMgtEx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -153,12 +153,19 @@
|
|||||||
<featureArtifactDef>
|
<featureArtifactDef>
|
||||||
org.wso2.carbon:org.wso2.carbon.identity.provider.server.feature:${carbon.platform.version}
|
org.wso2.carbon:org.wso2.carbon.identity.provider.server.feature:${carbon.platform.version}
|
||||||
</featureArtifactDef>
|
</featureArtifactDef>
|
||||||
<featureArtifactDef>
|
|
||||||
org.wso2.carbon:org.wso2.carbon.governance.metadata.server.feature:${carbon.platform.version}
|
<!-- Registry Features -->
|
||||||
</featureArtifactDef>
|
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.registry.extensions.feature:${carbon.platform.version}</featureArtifactDef>
|
||||||
<featureArtifactDef>
|
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.registry.ws.feature:${carbon.platform.version}</featureArtifactDef>
|
||||||
org.wso2.carbon:org.wso2.carbon.registry.extensions.server.feature:${carbon.platform.version}
|
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.registry.ui.menu.governance.feature:${carbon.platform.version}</featureArtifactDef>
|
||||||
</featureArtifactDef>
|
|
||||||
|
<!--Governance Feature-->
|
||||||
|
<!--featureArtifactDef>org.wso2.carbon:org.wso2.carbon.gadget.initializer.feature:${carbon.platform.version}</featureArtifactDef-->
|
||||||
|
<!--featureArtifactDef>org.wso2.carbon:org.wso2.carbon.gadget.editor.feature:${carbon.platform.version}</featureArtifactDef>
|
||||||
|
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.gadget.editor.ui.feature:${carbon.platform.version}</featureArtifactDef-->
|
||||||
|
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.governance.metadata.feature:4.2.2</featureArtifactDef>
|
||||||
|
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.governance.lifecycle.management.feature:4.2.1</featureArtifactDef>
|
||||||
|
|
||||||
<featureArtifactDef>
|
<featureArtifactDef>
|
||||||
org.wso2.carbon:org.wso2.carbon.identity.core.server.feature:${carbon.platform.version}
|
org.wso2.carbon:org.wso2.carbon.identity.core.server.feature:${carbon.platform.version}
|
||||||
</featureArtifactDef>
|
</featureArtifactDef>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user