@Override public void onAcknowledgement() { // we wait the response is acknowledged. // TODO should we modify SendableResponse by adding an acknowledged method ? sendableResponse.sent(); } });
@Override public void onResponse(Observation observation, Registration registration, ObserveResponse response) { handleNotification(observation, response.getContent()); }
@Override public boolean isSuccess() { return getCode() == ResponseCode.CHANGED; }
@Override public ObserveResponse observe(int resourceid) { // Perform a read by default ReadResponse readResponse = this.read(resourceid); return new ObserveResponse(readResponse.getCode(), readResponse.getContent(), null, null, readResponse.getErrorMessage()); }
public static CreateResponse internalServerError(String errorMessage) { return new CreateResponse(ResponseCode.INTERNAL_SERVER_ERROR, null, errorMessage); } }
public static ObserveResponse internalServerError(String errorMessage) { return new ObserveResponse(ResponseCode.INTERNAL_SERVER_ERROR, null, null, null, errorMessage); } }
@Override public boolean isSuccess() { return getCode() == ResponseCode.DELETED; }
@Override public boolean isSuccess() { return getCode() == ResponseCode.CHANGED; }
@Override public boolean isSuccess() { return getCode() == ResponseCode.CHANGED; }
public static WriteAttributesResponse internalServerError(String errorMessage) { return new WriteAttributesResponse(ResponseCode.INTERNAL_SERVER_ERROR, errorMessage); } }
public static DiscoverResponse internalServerError(String errorMessage) { return new DiscoverResponse(ResponseCode.INTERNAL_SERVER_ERROR, null, errorMessage); } }
public static ExecuteResponse internalServerError(String errorMessage) { return new ExecuteResponse(ResponseCode.INTERNAL_SERVER_ERROR, errorMessage); } }
@Override public boolean isSuccess() { return getCode() == ResponseCode.CHANGED; }
public static DeleteResponse internalServerError(String errorMessage) { return new DeleteResponse(ResponseCode.INTERNAL_SERVER_ERROR, errorMessage); } }
public static UpdateResponse internalServerError(String errorMessage) { return new UpdateResponse(ResponseCode.INTERNAL_SERVER_ERROR, errorMessage); } }
public static BootstrapFinishResponse internalServerError(String errorMessage) { return new BootstrapFinishResponse(ResponseCode.INTERNAL_SERVER_ERROR, errorMessage); } }
protected ExecuteResponse doExecute(ExecuteRequest request) { // This should be a not implemented error, but this is not defined in the spec. return ExecuteResponse.internalServerError("not implemented"); }
@Override public synchronized WriteAttributesResponse writeAttributes(ServerIdentity identity, WriteAttributesRequest request) { // TODO should be implemented here to be available for all object enabler // This should be a not implemented error, but this is not defined in the spec. return WriteAttributesResponse.internalServerError("not implemented"); }
@Override public boolean isFailure() { return !isSuccess(); } }
public BootstrapDeleteResponse doDelete(BootstrapDeleteRequest request) { // This should be a not implemented error, but this is not defined in the spec. return BootstrapDeleteResponse.internalServerError("not implemented"); }