Interface GenDeviceApi4Rest
-
- All Superinterfaces:
GenDeviceApi
- All Known Implementing Classes:
SGrRestApiDevice
public interface GenDeviceApi4Rest extends GenDeviceApi
Defines the communication interface API for HTTP/REST devices.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidauthenticate()Deprecated, for removal: This API element is subject to removal in a future version.Since version 2.2.0ValuegetVal(java.lang.String profileName, java.lang.String dataPointName)Reads a value in its string representation from the REST API device.ValuegetVal(java.lang.String profileName, java.lang.String dataPointName, java.util.Properties parameters)Reads a value in its string representation from the REST API device.voidsetVal(java.lang.String profileName, java.lang.String dataPointName, Value value)Writes a value to the REST API device.-
Methods inherited from interface com.smartgridready.communicator.common.api.GenDeviceApi
canSubscribe, connect, disconnect, getDataPoint, getDataPoints, getDeviceConfigurationInfo, getDeviceInfo, getFunctionalProfile, getFunctionalProfiles, getValues, isConnected, subscribe, unsubscribe
-
-
-
-
Method Detail
-
authenticate
@Deprecated(since="2.2.0", forRemoval=true) void authenticate() throws RestApiAuthenticationException, java.io.IOException, RestApiServiceCallException, RestApiResponseParseExceptionDeprecated, for removal: This API element is subject to removal in a future version.Since version 2.2.0Authenticates the REST API client. Authenticate uses the authentication method and credentials given within the external interface description XML of the device. The credentials may be given as parameters when loading theSGrRestApiDeviceusing the properties parameter of theDeviceDescriptionLoader.- Throws:
RestApiAuthenticationException- If the authentication failed.java.io.IOException- If the communication with the server failed.RestApiServiceCallException- If the service call could not be executed on the remote side.RestApiResponseParseException- If parsing of the service response failed.- See Also:
SGrRestApiDevice,DeviceDescriptionLoader
-
getVal
Value getVal(java.lang.String profileName, java.lang.String dataPointName) throws java.io.IOException, RestApiServiceCallException, RestApiResponseParseException, com.smartgridready.driver.api.common.GenDriverException
Reads a value in its string representation from the REST API device.- Specified by:
getValin interfaceGenDeviceApi- Parameters:
profileName- The name of the functional profile.dataPointName- The name of the data point within the functional profile.- Returns:
- The value read from the device.
- Throws:
java.io.IOException- If the communication with the server failed.RestApiServiceCallException- If the service call could not be executed on the remote side.RestApiResponseParseException- If parsing of the service response failed.com.smartgridready.driver.api.common.GenDriverException- If a common error occured.
-
getVal
Value getVal(java.lang.String profileName, java.lang.String dataPointName, java.util.Properties parameters) throws java.io.IOException, RestApiServiceCallException, RestApiResponseParseException, com.smartgridready.driver.api.common.GenDriverException
Reads a value in its string representation from the REST API device.- Specified by:
getValin interfaceGenDeviceApi- Parameters:
profileName- The name of the functional profile.dataPointName- The name of the data point within the functional profile.parameters- Key value pairs with request parameters- Returns:
- The value read from the device.
- Throws:
java.io.IOException- If the communication with the server failed.RestApiServiceCallException- If the service call could not be executed on the remote side.RestApiResponseParseException- If parsing of the service response failed.com.smartgridready.driver.api.common.GenDriverException- If a common error occurred.
-
setVal
void setVal(java.lang.String profileName, java.lang.String dataPointName, Value value) throws java.io.IOException, RestApiServiceCallException, RestApiResponseParseException, com.smartgridready.driver.api.common.GenDriverExceptionWrites a value to the REST API device. The value may be provided as:- single string value
- http request body on json or XML
- Specified by:
setValin interfaceGenDeviceApi- Parameters:
profileName- The name of the functional profile.dataPointName- The name of the data point within the functional profile.value- The value to be written. Will replace the value tagged with[[value]]within the external interfaceRestApiServiceCallelement for the given data point.- Throws:
java.io.IOException- If the communication with the server failed.RestApiServiceCallException- If the service call could not be executed on the remote side.RestApiResponseParseException- If parsing of the service response failed.com.smartgridready.driver.api.common.GenDriverException- If a common error occurred.
-
-