Adding initial key SPIs and other related dependencies

revert-70aa11f8
prabathabey 10 years ago
parent e98fc6c48d
commit 3ebb14acdd

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon</groupId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Device Management Commons</name>
<description>WSO2 Carbon - Device Management Commons</description>
<url>http://wso2.org</url>
<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>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Description>Device Management Common Bundle</Bundle-Description>
<Private-Package>org.wso2.carbon.device.mgt.common</Private-Package>
<Import-Package>
org.apache.commons.logging
</Import-Package>
<Export-Package>
org.wso2.carbon.device.mgt.common.*
</Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,133 @@
/**
* Copyright (c) 2012, 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.
* 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.device.mgt.common;
import java.util.Date;
import java.util.List;
public class Device {
private int id;
private String description;
private String name;
private Date dateOfEnrolment;
private Date dateOfLastUpdate;
private String ownership;
private boolean status;
private int deviceTypeId;
private String deviceIdentifier;
private String owner;
private List<Feature> features;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getDateOfEnrolment() {
return dateOfEnrolment;
}
public void setDateOfEnrolment(Date dateOfEnrolment) {
this.dateOfEnrolment = dateOfEnrolment;
}
public Date getDateOfLastUpdate() {
return dateOfLastUpdate;
}
public void setDateOfLastUpdate(Date dateOfLastUpdate) {
this.dateOfLastUpdate = dateOfLastUpdate;
}
public String getOwnership() {
return ownership;
}
public void setOwnership(String ownership) {
this.ownership = ownership;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
public int getDeviceTypeId() {
return deviceTypeId;
}
public void setDeviceTypeId(int deviceTypeId) {
this.deviceTypeId = deviceTypeId;
}
public String getDeviceIdentifier() {
return deviceIdentifier;
}
public void setDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public List<Feature> getFeatures() {
return features;
}
public void setFeatures(List<Feature> features) {
this.features = features;
}
}

@ -0,0 +1,19 @@
/**
* Copyright (c) 2012, 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.
* 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.device.mgt.common;
public final class DeviceManagementConstants {
}

@ -0,0 +1,55 @@
/**
* Copyright (c) 2014, 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.
* 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.device.mgt.common;
public class DeviceManagementException extends Exception {
private static final long serialVersionUID = -3151279311929070297L;
private String errorMessage;
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public DeviceManagementException(String msg, Exception nestedEx) {
super(msg, nestedEx);
setErrorMessage(msg);
}
public DeviceManagementException(String message, Throwable cause) {
super(message, cause);
setErrorMessage(message);
}
public DeviceManagementException(String msg) {
super(msg);
setErrorMessage(msg);
}
public DeviceManagementException() {
super();
}
public DeviceManagementException(Throwable cause) {
super(cause);
}
}

@ -0,0 +1,72 @@
/**
* Copyright (c) 2012, 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.
* 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.device.mgt.common;
import java.util.List;
public class Feature {
private int id;
private String name;
private List<MetadataEntry> metadataEntries;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<MetadataEntry> getMetadataEntries() {
return metadataEntries;
}
public void setMetadataEntries(List<MetadataEntry> metadataEntries) {
this.metadataEntries = metadataEntries;
}
public static class MetadataEntry {
private int id;
private Object value;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
}
}

@ -0,0 +1,49 @@
/**
* 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/>
* 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.device.mgt.common.spi;
import org.wso2.carbon.device.mgt.common.Device;
import java.util.List;
/**
* This represents the service provider interface that has to be implemented by any of new
* device type plugin implementation intended to be managed through CDM.
*/
public interface DeviceManagerService {
/*
Method corresponding to enrolling a particular device of type mobile, IoT, etc within CDM
*/
void enrolDevice();
void modifyEnrolment();
void disEnrollDevice();
boolean isRegistered();
boolean isActive();
boolean setActive();
List<Device> getAllDeviceInfo();
Device getDeviceInfo();
void setOwnership();
}

@ -36,22 +36,6 @@
<build>
<plugins>
<!--plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-java2wsdl-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java2wsdl</goal>
</goals>
</execution>
</executions>
<configuration>
<className>
</className>
</configuration>
</plugin-->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
@ -86,6 +70,24 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
</dependency>
</dependencies>
</project>

@ -15,6 +15,31 @@
*/
package org.wso2.carbon.device.mgt.core.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
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"
* policy="dynamic" bind="setDeviceManagerService" unbind="unsetDeviceManagerService"
*/
public class DeviceMgtServiceComponent {
private static Log log = LogFactory.getLog(DeviceMgtServiceComponent.class);
protected void setDeviceManagerService(DeviceManagerService deviceManager) {
if (log.isDebugEnabled()) {
log.debug("Setting Data Sources Service");
}
}
protected void unsetDeviceManagerService(DeviceManagerService deviceManager) {
if (log.isDebugEnabled()) {
log.debug("Unsetting Data Sources Service");
}
}
}

@ -38,6 +38,32 @@
<modules>
<module>org.wso2.carbon.device.mgt.core</module>
<module>org.wso2.carbon.device.mgt.common</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.8.1.v20120830-144521</version>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.6.100.v20120522-1841</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<version>4.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

Loading…
Cancel
Save