mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Added license headers with changes
This commit is contained in:
parent
b7ca60d802
commit
207a51a269
@ -1,18 +1,19 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright (c) 2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2014 - 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.wso2.carbon.device.mgt.mobile;
|
package org.wso2.carbon.device.mgt.mobile;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.common.*;
|
import org.wso2.carbon.device.mgt.common.*;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao;
|
package org.wso2.carbon.device.mgt.mobile.dao;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.mobile.dto.DeviceOperation;
|
import org.wso2.carbon.device.mgt.mobile.dto.DeviceOperation;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao;
|
package org.wso2.carbon.device.mgt.mobile.dao;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.mobile.dto.Feature;
|
import org.wso2.carbon.device.mgt.mobile.dto.Feature;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao;
|
package org.wso2.carbon.device.mgt.mobile.dao;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.mobile.dto.FeatureProperty;
|
import org.wso2.carbon.device.mgt.mobile.dto.FeatureProperty;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao;
|
package org.wso2.carbon.device.mgt.mobile.dao;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.mobile.dto.Operation;
|
import org.wso2.carbon.device.mgt.mobile.dto.Operation;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao;
|
package org.wso2.carbon.device.mgt.mobile.dao;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.mobile.dto.OperationProperty;
|
import org.wso2.carbon.device.mgt.mobile.dto.OperationProperty;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao.impl;
|
package org.wso2.carbon.device.mgt.mobile.dao.impl;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@ -40,9 +56,9 @@ public class DeviceOperationDAOImpl implements DeviceOperationDAO {
|
|||||||
|
|
||||||
stmt = conn.prepareStatement(createDBQuery);
|
stmt = conn.prepareStatement(createDBQuery);
|
||||||
stmt.setString(1, deviceOperation.getDeviceId());
|
stmt.setString(1, deviceOperation.getDeviceId());
|
||||||
stmt.setInt(2, deviceOperation.getOperationId());
|
stmt.setLong(2, deviceOperation.getOperationId());
|
||||||
stmt.setInt(3, deviceOperation.getSentDate());
|
stmt.setLong(3, deviceOperation.getSentDate());
|
||||||
stmt.setInt(4, deviceOperation.getReceivedDate());
|
stmt.setLong(4, deviceOperation.getReceivedDate());
|
||||||
int rows = stmt.executeUpdate();
|
int rows = stmt.executeUpdate();
|
||||||
if (rows > 0) {
|
if (rows > 0) {
|
||||||
status = true;
|
status = true;
|
||||||
@ -71,8 +87,8 @@ public class DeviceOperationDAOImpl implements DeviceOperationDAO {
|
|||||||
String updateDBQuery =
|
String updateDBQuery =
|
||||||
"UPDATE MBL_DEVICE_OPERATION SET SENT_DATE = ?, RECEIVED_DATE = ? WHERE DEVICE_ID = ? and OPERATION_ID=?";
|
"UPDATE MBL_DEVICE_OPERATION SET SENT_DATE = ?, RECEIVED_DATE = ? WHERE DEVICE_ID = ? and OPERATION_ID=?";
|
||||||
stmt = conn.prepareStatement(updateDBQuery);
|
stmt = conn.prepareStatement(updateDBQuery);
|
||||||
stmt.setInt(1, deviceOperation.getSentDate());
|
stmt.setLong(1, deviceOperation.getSentDate());
|
||||||
stmt.setInt(2, deviceOperation.getReceivedDate());
|
stmt.setLong(2, deviceOperation.getReceivedDate());
|
||||||
stmt.setString(3, deviceOperation.getDeviceId());
|
stmt.setString(3, deviceOperation.getDeviceId());
|
||||||
stmt.setInt(4, deviceOperation.getOperationId());
|
stmt.setInt(4, deviceOperation.getOperationId());
|
||||||
int rows = stmt.executeUpdate();
|
int rows = stmt.executeUpdate();
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao.impl;
|
package org.wso2.carbon.device.mgt.mobile.dao.impl;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao.impl;
|
package org.wso2.carbon.device.mgt.mobile.dao.impl;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|||||||
@ -222,4 +222,4 @@ public class MobileDeviceDAOImpl implements MobileDeviceDAO {
|
|||||||
throw new MobileDeviceManagementDAOException(msg, e);
|
throw new MobileDeviceManagementDAOException(msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao.impl;
|
package org.wso2.carbon.device.mgt.mobile.dao.impl;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@ -38,7 +54,7 @@ public class OperationDAOImpl implements OperationDAO {
|
|||||||
|
|
||||||
stmt = conn.prepareStatement(createDBQuery, new String[] { "OPERATION_ID" });
|
stmt = conn.prepareStatement(createDBQuery, new String[] { "OPERATION_ID" });
|
||||||
stmt.setString(1, operation.getFeatureCode());
|
stmt.setString(1, operation.getFeatureCode());
|
||||||
stmt.setInt(2, operation.getCreatedDate());
|
stmt.setLong(2, operation.getCreatedDate());
|
||||||
int rows = stmt.executeUpdate();
|
int rows = stmt.executeUpdate();
|
||||||
if (rows > 0) {
|
if (rows > 0) {
|
||||||
ResultSet rs = stmt.getGeneratedKeys();
|
ResultSet rs = stmt.getGeneratedKeys();
|
||||||
@ -69,7 +85,7 @@ public class OperationDAOImpl implements OperationDAO {
|
|||||||
"UPDATE MBL_OPERATION SET FEATURE_CODE = ?, CREATED_DATE = ? WHERE OPERATION_ID = ?";
|
"UPDATE MBL_OPERATION SET FEATURE_CODE = ?, CREATED_DATE = ? WHERE OPERATION_ID = ?";
|
||||||
stmt = conn.prepareStatement(updateDBQuery);
|
stmt = conn.prepareStatement(updateDBQuery);
|
||||||
stmt.setString(1, operation.getFeatureCode());
|
stmt.setString(1, operation.getFeatureCode());
|
||||||
stmt.setInt(2, operation.getCreatedDate());
|
stmt.setLong(2, operation.getCreatedDate());
|
||||||
stmt.setInt(3, operation.getOperationId());
|
stmt.setInt(3, operation.getOperationId());
|
||||||
int rows = stmt.executeUpdate();
|
int rows = stmt.executeUpdate();
|
||||||
if (rows > 0) {
|
if (rows > 0) {
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dao.impl;
|
package org.wso2.carbon.device.mgt.mobile.dao.impl;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|||||||
@ -1,13 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dto;
|
package org.wso2.carbon.device.mgt.mobile.dto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO of Operations.
|
* DTO of Operations.
|
||||||
*/
|
*/
|
||||||
public class DeviceOperation {
|
public class DeviceOperation {
|
||||||
String deviceId;
|
|
||||||
int operationId;
|
private String deviceId;
|
||||||
int sentDate;
|
private int operationId;
|
||||||
int receivedDate;
|
private long sentDate;
|
||||||
|
private long receivedDate;
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
return deviceId;
|
return deviceId;
|
||||||
@ -25,19 +42,19 @@ public class DeviceOperation {
|
|||||||
this.operationId = operationId;
|
this.operationId = operationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSentDate() {
|
public long getSentDate() {
|
||||||
return sentDate;
|
return sentDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSentDate(int sentDate) {
|
public void setSentDate(long sentDate) {
|
||||||
this.sentDate = sentDate;
|
this.sentDate = sentDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getReceivedDate() {
|
public long getReceivedDate() {
|
||||||
return receivedDate;
|
return receivedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReceivedDate(int receivedDate) {
|
public void setReceivedDate(long receivedDate) {
|
||||||
this.receivedDate = receivedDate;
|
this.receivedDate = receivedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.mobile.dto;
|
package org.wso2.carbon.device.mgt.mobile.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -6,10 +22,11 @@ import java.io.Serializable;
|
|||||||
* DTO of features.
|
* DTO of features.
|
||||||
*/
|
*/
|
||||||
public class Feature implements Serializable {
|
public class Feature implements Serializable {
|
||||||
int id;
|
|
||||||
String code;
|
private int id;
|
||||||
String name;
|
private String code;
|
||||||
String description;
|
private String name;
|
||||||
|
private String description;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|||||||
@ -1,12 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014 - 2015, 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.mobile.dto;
|
package org.wso2.carbon.device.mgt.mobile.dto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO of feature property. Represents a property of a feature.
|
* DTO of feature property. Represents a property of a feature.
|
||||||
*/
|
*/
|
||||||
public class FeatureProperty {
|
public class FeatureProperty {
|
||||||
int propertyId;
|
|
||||||
String property;
|
private int propertyId;
|
||||||
String featureID;
|
private String property;
|
||||||
|
private String featureID;
|
||||||
|
|
||||||
public String getFeatureID() {
|
public String getFeatureID() {
|
||||||
return featureID;
|
return featureID;
|
||||||
@ -32,4 +49,4 @@ public class FeatureProperty {
|
|||||||
this.property = property;
|
this.property = property;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,12 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014 - 2015, 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.mobile.dto;
|
package org.wso2.carbon.device.mgt.mobile.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO of operation.
|
* DTO of operation.
|
||||||
*/
|
*/
|
||||||
public class Operation {
|
public class Operation {
|
||||||
int operationId;
|
|
||||||
String featureCode;
|
private int operationId;
|
||||||
int createdDate;
|
private String featureCode;
|
||||||
|
private long createdDate;
|
||||||
|
private List<OperationProperty> properties;
|
||||||
|
|
||||||
public int getOperationId() {
|
public int getOperationId() {
|
||||||
return operationId;
|
return operationId;
|
||||||
@ -16,6 +36,14 @@ public class Operation {
|
|||||||
this.operationId = operationId;
|
this.operationId = operationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<OperationProperty> getProperties() {
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperties(List<OperationProperty> properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
public String getFeatureCode() {
|
public String getFeatureCode() {
|
||||||
return featureCode;
|
return featureCode;
|
||||||
}
|
}
|
||||||
@ -24,13 +52,11 @@ public class Operation {
|
|||||||
this.featureCode = featureCode;
|
this.featureCode = featureCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCreatedDate() {
|
public long getCreatedDate() {
|
||||||
return createdDate;
|
return createdDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreatedDate(int createdDate) {
|
public void setCreatedDate(long createdDate) {
|
||||||
this.createdDate = createdDate;
|
this.createdDate = createdDate;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,13 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014 - 2015, 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.mobile.dto;
|
package org.wso2.carbon.device.mgt.mobile.dto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO of operation property.
|
* DTO of operation property.
|
||||||
*/
|
*/
|
||||||
public class OperationProperty {
|
public class OperationProperty {
|
||||||
int operationPropertyId;
|
|
||||||
int getOperationId;
|
private int operationPropertyId;
|
||||||
int propertyId;
|
private int operationId;
|
||||||
String value;
|
private int propertyId;
|
||||||
|
private String value;
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
@ -26,11 +43,11 @@ public class OperationProperty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getOperationId() {
|
public int getOperationId() {
|
||||||
return getOperationId;
|
return operationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOperationId(int getOperationId) {
|
public void setOperationId(int operationId) {
|
||||||
this.getOperationId = getOperationId;
|
this.operationId = operationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPropertyId() {
|
public int getPropertyId() {
|
||||||
@ -41,4 +58,4 @@ public class OperationProperty {
|
|||||||
this.propertyId = propertyId;
|
this.propertyId = propertyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,18 +15,40 @@
|
|||||||
*/
|
*/
|
||||||
package org.wso2.carbon.device.mgt.mobile.impl.android;
|
package org.wso2.carbon.device.mgt.mobile.impl.android;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
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.Operation;
|
import org.wso2.carbon.device.mgt.common.Operation;
|
||||||
import org.wso2.carbon.device.mgt.common.OperationManagementException;
|
import org.wso2.carbon.device.mgt.common.OperationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager;
|
import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.dto.DeviceOperation;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.dto.OperationProperty;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AndroidMobileOperationManager extends AbstractMobileOperationManager {
|
public class AndroidMobileOperationManager extends AbstractMobileOperationManager {
|
||||||
|
|
||||||
|
private static final Log log = LogFactory.getLog(AndroidMobileOperationManager.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addOperation(Operation operation, List<DeviceIdentifier> devices) throws
|
public boolean addOperation(Operation operation, List<DeviceIdentifier> devices) throws
|
||||||
OperationManagementException {
|
OperationManagementException {
|
||||||
|
try {
|
||||||
|
MobileDeviceManagementDAOFactory.getOperationDAO().addOperation(
|
||||||
|
new org.wso2.carbon.device.mgt.mobile.dto.Operation());
|
||||||
|
MobileDeviceManagementDAOFactory.geOperationPropertyDAO()
|
||||||
|
.addOperationProperty(new OperationProperty());
|
||||||
|
MobileDeviceManagementDAOFactory.getDeviceOperationDAO()
|
||||||
|
.addDeviceOperation(new DeviceOperation());
|
||||||
|
} catch (MobileDeviceManagementDAOException e) {
|
||||||
|
String msg = "Error while updating the enrollment of the Android device : " +
|
||||||
|
devices.get(0).getId();
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new OperationManagementException(msg, e);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,12 +22,13 @@ import org.w3c.dom.Document;
|
|||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice;
|
import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.dto.Operation;
|
||||||
|
import org.wso2.carbon.device.mgt.mobile.dto.OperationProperty;
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides utility methods required by the mobile device management bundle.
|
* Provides utility methods required by the mobile device management bundle.
|
||||||
@ -112,4 +113,16 @@ public class MobileDeviceManagementUtil {
|
|||||||
}
|
}
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Operation convertToOperation(org.wso2.carbon.device.mgt.common.Operation operation){
|
||||||
|
Operation mobileOperation = new Operation();
|
||||||
|
List<OperationProperty> properties = new LinkedList<OperationProperty>();
|
||||||
|
mobileOperation.setFeatureCode(operation.getCode());
|
||||||
|
mobileOperation.setCreatedDate(new Date().getTime());
|
||||||
|
Properties operationProperties = operation.getProperties();
|
||||||
|
for(String key : operationProperties.stringPropertyNames()) {
|
||||||
|
String value = operationProperties.getProperty(key);
|
||||||
|
}
|
||||||
|
return mobileOperation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user