@ProviderType
public interface Asset
AssetRecord
,
AssetConfiguration
Modifier and Type | Method and Description |
---|---|
AssetConfiguration |
getAssetConfiguration()
Gets the asset configuration.
|
java.util.List<ChannelRecord> |
read(java.util.Set<java.lang.String> channelNames)
Reads the communication channels identified by the set of channel names provided as argument.
|
java.util.List<ChannelRecord> |
readAllChannels()
Performs a read on all READ or READ_WRITE channels that are defined on this asset and returns
the result as a list of
ChannelRecord instances. |
void |
registerChannelListener(java.lang.String channelName,
ChannelListener channelListener)
Registers a channel listener for the provided channel name for a monitor
operation on it.
|
void |
unregisterChannelListener(ChannelListener channelListener)
Unregisters a already registered channel listener which has been registered
for a monitor operation
|
void |
write(java.util.List<ChannelRecord> channelRecords)
Writes the data to the provided communication channels that correspond to
the given channel records.
|
AssetConfiguration getAssetConfiguration()
java.util.List<ChannelRecord> read(java.util.Set<java.lang.String> channelNames) throws KuraException
KuraException
shall be
thrown.channelNames
- the set of channel names which are to be read. The channel name
must be unique for every channel belonging to an asset.
Channel names are case sensitive.KuraRuntimeException
- if the method is not implemented by the asset then specific
error code KuraErrorCode#OPERATION_NOT_SUPPORTED
needs to be set in the thrown KuraRuntimeException
KuraException
- if the connection to the asset was interrupted, then error
code KuraErrorCode#CONNECTION_FAILED
needs to be set
in the thrown KuraException
.java.lang.NullPointerException
- if argument is nulljava.util.List<ChannelRecord> readAllChannels() throws KuraException
ChannelRecord
instances.KuraRuntimeException
- if the method is not implemented by the asset then specific
error code KuraErrorCode#OPERATION_NOT_SUPPORTED
needs to be set in the thrown KuraRuntimeException
KuraException
- if the connection to the asset was interrupted, then error
code KuraErrorCode#CONNECTION_FAILED
needs to be set
in the thrown KuraException
.Asset#read(List)
void registerChannelListener(java.lang.String channelName, ChannelListener channelListener) throws KuraException
channelName
- the channel name. The channel name
must be unique for every channel belonging to an asset.
Channel names are case sensitive.channelListener
- the channel listenerKuraRuntimeException
- if the method is not implemented by the asset then specific
error code KuraErrorCode.OPERATION_NOT_SUPPORTED
needs to be set in the thrown KuraRuntimeException
KuraException
- if the connection to the asset was interrupted, then error
code KuraErrorCode.CONNECTION_FAILED
needs to be set
in the thrown KuraException
and if the channel is not
present, error code KuraErrorCode.INTERNAL_ERROR
needs to be set in the thrown KuraException
. For any
other internal exception, then error code
KuraErrorCode.INTERNAL_ERROR
will be set.java.lang.NullPointerException
- if any of the arguments is nulljava.lang.IllegalArgumentException
- If the provided channel name is not present in the configuration
of this assetvoid unregisterChannelListener(ChannelListener channelListener) throws KuraException
channelListener
- the channel listener to unregisterKuraRuntimeException
- if the method is not implemented by the asset then specific
error code KuraErrorCode#OPERATION_NOT_SUPPORTED
needs to be set in the thrown KuraRuntimeException
KuraException
- For any other internal exception, then error code
KuraErrorCode#INTERNAL_ERROR
will be set.java.lang.NullPointerException
- if argument is nullvoid write(java.util.List<ChannelRecord> channelRecords) throws KuraException
ChannelFlag.SUCCESS
in the provided channel
records. If the connection to the asset is interrupted, then any
necessary resources that correspond to this connection should be cleaned
up and a KuraException
with a suitable error code shall be
thrown.channelRecords
- the channel records hold the information of what channels are to
be written and the values that are to be written. They will be
filled by this function with a channel flag stating whether the
write process is successful or not.KuraRuntimeException
- if the method is not implemented by the asset then specific
error code KuraErrorCode#OPERATION_NOT_SUPPORTED
needs to be set in the thrown KuraRuntimeException
KuraException
- if the connection to the asset was interrupted, then error
code KuraErrorCode#CONNECTION_FAILED
needs to be set
in the thrown KuraException
java.lang.NullPointerException
- if argument is null