|
|
@ -243,7 +243,6 @@ public class OperationHandler {
|
|
|
|
|
|
|
|
|
|
|
|
public void updateDeviceLocationStatus(SyncmlDocument syncmlDocument) throws OperationManagementException {
|
|
|
|
public void updateDeviceLocationStatus(SyncmlDocument syncmlDocument) throws OperationManagementException {
|
|
|
|
List<? extends Operation> pendingDataOperations;
|
|
|
|
List<? extends Operation> pendingDataOperations;
|
|
|
|
List<StatusTag> statuses = syncmlDocument.getBody().getStatus();
|
|
|
|
|
|
|
|
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(
|
|
|
|
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(
|
|
|
|
syncmlDocument.getHeader().getSource().getLocURI());
|
|
|
|
syncmlDocument.getHeader().getSource().getLocURI());
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -253,13 +252,16 @@ public class OperationHandler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (Operation operation : pendingDataOperations) {
|
|
|
|
for (Operation operation : pendingDataOperations) {
|
|
|
|
if (PluginConstants.OperationCodes.DEVICE_LOCATION.equals(operation.getCode())) {
|
|
|
|
if (PluginConstants.OperationCodes.DEVICE_LOCATION.equals(operation.getCode())) {
|
|
|
|
for (StatusTag statusTag : statuses) {
|
|
|
|
if (syncmlDocument.getBody().getResults() != null) {
|
|
|
|
if (Constants.GET.equals(statusTag.getCommand()) && statusTag.getTargetReference() != null
|
|
|
|
List<ItemTag> items = syncmlDocument.getBody().getResults().getItem();
|
|
|
|
&& OperationCode.Command.LATITUDE.getCode().equals(statusTag.getTargetReference())) {
|
|
|
|
for (ItemTag itemTag : items) {
|
|
|
|
if (Constants.SyncMLResponseCodes.ACCEPTED.equals(statusTag.getData())) {
|
|
|
|
if (OperationCode.Command.LATITUDE.getCode().equals(itemTag.getSource().getLocURI())) {
|
|
|
|
operation.setStatus(Operation.Status.COMPLETED);
|
|
|
|
// at this moment we can't get accepted value 200 from the device.
|
|
|
|
} else {
|
|
|
|
if (itemTag.getData() != null) {
|
|
|
|
operation.setStatus(Operation.Status.ERROR);
|
|
|
|
operation.setStatus(Operation.Status.COMPLETED);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
operation.setStatus(Operation.Status.ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -282,16 +284,13 @@ public class OperationHandler {
|
|
|
|
SyncmlBody syncmlBody = syncmlDocument.getBody();
|
|
|
|
SyncmlBody syncmlBody = syncmlDocument.getBody();
|
|
|
|
List<? extends Operation> pendingOperations;
|
|
|
|
List<? extends Operation> pendingOperations;
|
|
|
|
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlHeader.getSource().getLocURI());
|
|
|
|
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlHeader.getSource().getLocURI());
|
|
|
|
List<StatusTag> statuses = syncmlBody.getStatus();
|
|
|
|
if (syncmlBody.getResults() != null) {
|
|
|
|
for (StatusTag status : statuses ) {
|
|
|
|
List<ItemTag> items = syncmlBody.getResults().getItem();
|
|
|
|
if (OperationCode.Command.LATITUDE.getCode().equals(status.getTargetReference()) &&
|
|
|
|
for (ItemTag itemTag : items) {
|
|
|
|
Constants.SyncMLResponseCodes.ACCEPTED.equals(status.getData())) {
|
|
|
|
if (OperationCode.Command.LATITUDE.getCode().equals(itemTag.getSource().getLocURI())) {
|
|
|
|
updateLocation(syncmlDocument);
|
|
|
|
updateLocation(syncmlDocument);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (OperationCode.Command.TOTAL_RAM.getCode().equals(itemTag.getSource().getLocURI())) {
|
|
|
|
if (OperationCode.Command.TOTAL_RAM.getCode().equals(status.getTargetReference()) &&
|
|
|
|
|
|
|
|
Constants.SyncMLResponseCodes.ACCEPTED.equals(status.getData())) {
|
|
|
|
|
|
|
|
if ((syncmlBody.getResults() != null)) {
|
|
|
|
|
|
|
|
updateDeviceInfo(syncmlDocument);
|
|
|
|
updateDeviceInfo(syncmlDocument);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -363,6 +362,9 @@ public class OperationHandler {
|
|
|
|
operation.getId() == status.getCommandReference()) {
|
|
|
|
operation.getId() == status.getCommandReference()) {
|
|
|
|
operation.setStatus(Operation.Status.COMPLETED);
|
|
|
|
operation.setStatus(Operation.Status.COMPLETED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (PluginConstants.OperationCodes.POLICY_REVOKE.equals(operation.getCode())) {
|
|
|
|
|
|
|
|
operation.setStatus(Operation.Status.COMPLETED);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateStatus(syncmlDocument.getHeader().getSource().getLocURI(),
|
|
|
|
updateStatus(syncmlDocument.getHeader().getSource().getLocURI(),
|
|
|
|
pendingDataOperations);
|
|
|
|
pendingDataOperations);
|
|
|
@ -377,6 +379,9 @@ public class OperationHandler {
|
|
|
|
operation.getId() == status.getCommandReference()) {
|
|
|
|
operation.getId() == status.getCommandReference()) {
|
|
|
|
operation.setStatus(Operation.Status.ERROR);
|
|
|
|
operation.setStatus(Operation.Status.ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (PluginConstants.OperationCodes.POLICY_REVOKE.equals(operation.getCode())) {
|
|
|
|
|
|
|
|
operation.setStatus(Operation.Status.COMPLETED);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateStatus(syncmlDocument.getHeader().getSource().getLocURI(),
|
|
|
|
updateStatus(syncmlDocument.getHeader().getSource().getLocURI(),
|
|
|
|
pendingDataOperations);
|
|
|
|
pendingDataOperations);
|
|
|
|