|
|
|
@ -209,14 +209,27 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
throw new UnauthorizedDeviceAccessException("User '" + getUser() + "' is not authorized to " +
|
|
|
|
|
"fetch operations on device '" + deviceId.getId() + "'");
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user : " +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
enrolmentId = deviceDAO.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE, tenantId);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving metadata of '" +
|
|
|
|
|
deviceId.getType() + "' device carrying the identifier '" +
|
|
|
|
|
deviceId.getId() + "'");
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (enrolmentId < 0) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -233,20 +246,12 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the list of " +
|
|
|
|
|
"operations assigned for '" + deviceId.getType() +
|
|
|
|
|
"' device '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving metadata of '" +
|
|
|
|
|
deviceId.getType() + "' device carrying the identifier '" +
|
|
|
|
|
deviceId.getId() + "'");
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user : " +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
return operations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -259,16 +264,31 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
try {
|
|
|
|
|
boolean isUserAuthorized = DeviceManagementDataHolder.getInstance().getDeviceAccessAuthorizationService().
|
|
|
|
|
isUserAuthorized(deviceId, DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS);
|
|
|
|
|
if (isUserAuthorized) {
|
|
|
|
|
try {
|
|
|
|
|
if (!isUserAuthorized) {
|
|
|
|
|
log.error("User : " + getUser() + " is not authorized to fetch operations on device : " +
|
|
|
|
|
deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user : " +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
enrolmentId = deviceDAO.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE, tenantId);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving metadata of '" +
|
|
|
|
|
deviceId.getType() + "' device carrying the identifier '" +
|
|
|
|
|
deviceId.getId() + "'");
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.openConnection();
|
|
|
|
|
if (enrolmentId < 0) {
|
|
|
|
|
throw new OperationManagementException("Device not found for given device " +
|
|
|
|
@ -290,23 +310,12 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the list of " +
|
|
|
|
|
"operations assigned for '" + deviceId.getType() +
|
|
|
|
|
"' device '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving metadata of '" +
|
|
|
|
|
deviceId.getType() + "' device carrying the identifier '" +
|
|
|
|
|
deviceId.getId() + "'");
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to fetch operations on device : " + deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user : " +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return paginationResult;
|
|
|
|
|
}
|
|
|
|
@ -323,15 +332,31 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
try {
|
|
|
|
|
boolean isUserAuthorized = DeviceManagementDataHolder.getInstance().getDeviceAccessAuthorizationService().
|
|
|
|
|
isUserAuthorized(deviceId, DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS);
|
|
|
|
|
if (isUserAuthorized) {
|
|
|
|
|
try {
|
|
|
|
|
if (!isUserAuthorized) {
|
|
|
|
|
log.error("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
enrolmentId = deviceDAO.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE, tenantId);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId() + "'", e);
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.openConnection();
|
|
|
|
|
if (enrolmentId < 0) {
|
|
|
|
|
throw new OperationManagementException("Device not found for the given device Identifier:" +
|
|
|
|
@ -356,24 +381,12 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the list of " +
|
|
|
|
|
"pending operations assigned for '" + deviceId.getType() +
|
|
|
|
|
"' device '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
return operations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -387,15 +400,31 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
try {
|
|
|
|
|
boolean isUserAuthorized = DeviceManagementDataHolder.getInstance().getDeviceAccessAuthorizationService().
|
|
|
|
|
isUserAuthorized(deviceId, DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS);
|
|
|
|
|
if (isUserAuthorized) {
|
|
|
|
|
try {
|
|
|
|
|
if (!isUserAuthorized) {
|
|
|
|
|
log.error("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user : " +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
enrolmentId = deviceDAO.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE, tenantId);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId(), e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.openConnection();
|
|
|
|
|
if (enrolmentId < 0) {
|
|
|
|
|
throw new OperationManagementException("Device not found for given device " +
|
|
|
|
@ -426,24 +455,12 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
}
|
|
|
|
|
} catch (OperationManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving next pending operation", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId(), e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user : " +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
return operation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -457,8 +474,15 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
try {
|
|
|
|
|
boolean isUserAuthorized = DeviceManagementDataHolder.getInstance().getDeviceAccessAuthorizationService().
|
|
|
|
|
isUserAuthorized(deviceId, DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS);
|
|
|
|
|
if (isUserAuthorized) {
|
|
|
|
|
try {
|
|
|
|
|
if (!isUserAuthorized) {
|
|
|
|
|
log.error("User : " + getUser() + " is not authorized to update operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
@ -466,9 +490,16 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while opening a connection to the" +
|
|
|
|
|
" data source", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
OperationManagementDAOFactory.rollbackTransaction();
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while fetching the device for device identifier: " + deviceId.getId() +
|
|
|
|
|
"type:" + deviceId.getType(), e);
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.beginTransaction();
|
|
|
|
|
boolean isUpdated = false;
|
|
|
|
|
if (operation.getStatus() != null) {
|
|
|
|
@ -485,24 +516,11 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while updating the operation: " + operationId + " status:" +
|
|
|
|
|
operation.getStatus(), e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
OperationManagementDAOFactory.rollbackTransaction();
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while fetching the device for device identifier: " + deviceId.getId() +
|
|
|
|
|
"type:" + deviceId.getType(), e);
|
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while initiating a transaction", e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to update operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -538,16 +556,31 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
try {
|
|
|
|
|
boolean isUserAuthorized = DeviceManagementDataHolder.getInstance().getDeviceAccessAuthorizationService().
|
|
|
|
|
isUserAuthorized(deviceId, DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS);
|
|
|
|
|
if (isUserAuthorized) {
|
|
|
|
|
try {
|
|
|
|
|
if (!isUserAuthorized) {
|
|
|
|
|
log.error("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
enrolmentId = deviceDAO.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE, tenantId);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while opening connection to the data source",
|
|
|
|
|
e);
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.openConnection();
|
|
|
|
|
if (enrolmentId < 0) {
|
|
|
|
|
throw new OperationManagementException("Device not found for given device identifier: " +
|
|
|
|
@ -582,24 +615,13 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the list of " +
|
|
|
|
|
"operations assigned for '" + deviceId.getType() +
|
|
|
|
|
"' device '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId() + "'", e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while opening connection to the data source",
|
|
|
|
|
e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return operation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -612,15 +634,31 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
try {
|
|
|
|
|
boolean isUserAuthorized = DeviceManagementDataHolder.getInstance().getDeviceAccessAuthorizationService().
|
|
|
|
|
isUserAuthorized(deviceId, DeviceGroupConstants.Permissions.DEFAULT_OPERATOR_PERMISSIONS);
|
|
|
|
|
if (isUserAuthorized) {
|
|
|
|
|
try {
|
|
|
|
|
if (!isUserAuthorized) {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DeviceManagementDAOFactory.openConnection();
|
|
|
|
|
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
|
|
|
|
|
enrolmentId = deviceDAO.getEnrolmentByStatus(deviceId, EnrolmentInfo.Status.ACTIVE, tenantId);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId(), e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
DeviceManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.openConnection();
|
|
|
|
|
|
|
|
|
|
if (enrolmentId < 0) {
|
|
|
|
@ -651,24 +689,12 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
"operations assigned for '" + deviceId.getType() +
|
|
|
|
|
"' device '" +
|
|
|
|
|
deviceId.getId() + "' and status:" + status.toString(), e);
|
|
|
|
|
} catch (DeviceManagementDAOException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while retrieving the device " +
|
|
|
|
|
"for device Identifier type -'" + deviceId.getType() +
|
|
|
|
|
"' and device Id '" + deviceId.getId(), e);
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementException(
|
|
|
|
|
"Error occurred while opening a connection to the data source", e);
|
|
|
|
|
} finally {
|
|
|
|
|
OperationManagementDAOFactory.closeConnection();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("User : " + getUser() + " is not authorized to fetch operations on device : "
|
|
|
|
|
+ deviceId.getId());
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceAccessAuthorizationException e) {
|
|
|
|
|
throw new OperationManagementException("Error occurred while authorizing access to the devices for user :" +
|
|
|
|
|
this.getUser(), e);
|
|
|
|
|
}
|
|
|
|
|
return operations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -809,7 +835,8 @@ public class OperationManagerImpl implements OperationManager {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Activity> getActivitiesUpdatedAfter(long timestamp, int limit, int offset) throws OperationManagementException {
|
|
|
|
|
public List<Activity> getActivitiesUpdatedAfter(long timestamp, int limit,
|
|
|
|
|
int offset) throws OperationManagementException {
|
|
|
|
|
try {
|
|
|
|
|
OperationManagementDAOFactory.openConnection();
|
|
|
|
|
return operationDAO.getActivitiesUpdatedAfter(timestamp, limit, offset);
|
|
|
|
|