use of org.openmuc.jdlms.IllegalAttributeAccessException in project open-smart-grid-platform by OSGP.
the class DefinableLoadProfile method reinitializeCaptureObjects.
private void reinitializeCaptureObjects(final List<DataObject> captureObjectList) throws IllegalAttributeAccessException {
final List<CaptureObject> captureObjectInitList = new ArrayList<>();
for (final DataObject captureObject : captureObjectList) {
final CaptureObject initCaptureObject;
try {
initCaptureObject = CaptureObject.newCaptureObject(captureObject);
} catch (final RuntimeException e) {
LOGGER.error("Unable to create capture object from: {}", captureObject, e);
throw new IllegalAttributeAccessException(AccessResultCode.OTHER_REASON, new IllegalArgumentException("Unable to create capture object from: " + captureObject, e));
}
if (!PROCESSORS_BY_CAPTURE_OBJECT.containsKey(initCaptureObject)) {
LOGGER.error("No data processor configured for {}", initCaptureObject);
throw new IllegalAttributeAccessException(AccessResultCode.OTHER_REASON, new IllegalArgumentException("No data processor configured for " + initCaptureObject));
}
captureObjectInitList.add(initCaptureObject);
}
this.captureObjectDefinitionCollection = DefinableLoadProfile.initCaptureObjects(captureObjectInitList);
}
use of org.openmuc.jdlms.IllegalAttributeAccessException in project open-smart-grid-platform by OSGP.
the class Clock method setTime.
public void setTime(final DataObject time) throws IllegalAttributeAccessException {
try {
final CosemDateTime dateTime = CosemDateTime.decode(time.getValue());
this.setInternalUtcDateTime(this.fromCosemDateTime(dateTime));
} catch (final Exception e) {
LOGGER.error("An error occured while setting the time attribute of CurrentClock.", e);
throw new IllegalAttributeAccessException(AccessResultCode.OTHER_REASON);
}
}
Aggregations