public final class AddChannelCommand extends ArchiveConfigurationCommand
AddOrUpdateChannelCommand
. This command object contains all
data that is needed for the add operation. Typically, it is passed to the
ArchiveConfigurationService
, but it might also be sent over the
network before actually being processed.ArchiveConfigurationCommand.Type
Constructor and Description |
---|
AddChannelCommand(String channelName,
String controlSystemType,
Set<Integer> decimationLevels,
Map<Integer,Integer> decimationLevelToRetentionPeriod,
boolean enabled,
Map<String,String> options,
UUID serverId)
Creates an "add channel" command.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getChannelName()
Returns the name of the channel that shall be added.
|
ArchiveConfigurationCommand.Type |
getCommandType()
Returns the type of the actual command type.
|
String |
getControlSystemType()
Returns a string identifying the control-system support for the channel
to be added.
|
Set<Integer> |
getDecimationLevels()
Returns the set containing the decimation levels that shall be created
for the channel.
|
Map<Integer,Integer> |
getDecimationLevelToRetentionPeriod()
Returns the map storing the mapping of decimation levels to their
respective retention period.
|
Map<String,String> |
getOptions()
Returns control-system-specific configuration-options for the channel.
|
UUID |
getServerId()
Returns the ID of the server to which the channel shall be added.
|
int |
hashCode() |
boolean |
isEnabled()
Tells whether archiving shall be enabled for the channel to be added.
|
String |
toString() |
public AddChannelCommand(String channelName, String controlSystemType, Set<Integer> decimationLevels, Map<Integer,Integer> decimationLevelToRetentionPeriod, boolean enabled, Map<String,String> options, UUID serverId)
channelName
- name of the channel to be added.controlSystemType
- string identifying the control-system support that is used for
the channel.decimationLevels
- set of decimation levels that shall be created for the
channel. The number identifying a decimation level represents
the period between two samples (in seconds). The decimation
level zero (for raw samples) is always created, even if it is
not contained in the specified set. If null
, only
the decimation level zero is created.decimationLevelToRetentionPeriod
- map containing the mapping of decimation levels to the
corresponding retention period (both in seconds). If an entry
for a decimation level is missing, a retention period of zero
(keep samples indefinitely) is assumed. Negative retention
periods are silently converted to zero. A null
reference has the same effect as an empty map (use a retention
period of zero for all decimation levels). This map must not
contain negative keys. It must also not contain a mapping that
violates the constraint that each decimation period must have
a retention period equal to or greater than the one of the
preceding (next smaller decimation period) decimation level.enabled
- true
if archiving for the channel shall be
enabled, false
if archiving shall be disabled.options
- map storing the control-system specific options for the
channel. A null
reference has the same effect as
an empty map.serverId
- ID of the server to which the channel shall be added.IllegalArgumentException
- if channelName
is empty,
decimationLevels
contains negative elements,
decimationLevelToRetentionPeriod
contains
negative keys, or
decimationLevelToRetentionPeriod
contains a
mapping that violates the constraint that each decimation
period must have a retention period equal to or greater than
the one of the preceding (next smaller decimation period)
decimation level.NullPointerException
- if channelName
, controlSystemType
,
or serverId
is null
or
decimationLevels
,
decimationLevelToRetentionPeriod
, or
options
contains null
keys or
values.public ArchiveConfigurationCommand.Type getCommandType()
ArchiveConfigurationCommand
ArchiveConfigurationCommand
class or the ArchiveConfigurationCommand.Type
enum
for a list of types. The return value is never null
.getCommandType
in class ArchiveConfigurationCommand
public String getChannelName()
null
or the empty string.public String getControlSystemType()
null
.public Set<Integer> getDecimationLevels()
null
, never empty, and does not contain null
elements. It always contains the element zero.public Map<Integer,Integer> getDecimationLevelToRetentionPeriod()
Returns the map storing the mapping of decimation levels to their respective retention period. The retention period of a decimation level specifies how long (in seconds) samples in this decimation level are supposed to be kept. A retention period of zero specifies that samples are supposed to be stored indefinitely.
The map returned is never null
, does not contain
null
keys or values and contains a mapping for each
decimation level (as returned by getDecimationLevels()
). It is
also guaranteed that the retention period of each decimation level is
greater than or equal to the retention period of the preceding decimation
level (that is the decimation level with the next smaller decimation
period).
public boolean isEnabled()
true
if archiving shall be enabled,
false
if it shall be disabled.public Map<String,String> getOptions()
null
and
does not contain null
keys or values.public UUID getServerId()
null
.Copyright © 2011–2017 aquenos GmbH. All rights reserved.