|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.distributed.ServiceAttributes
org.mbari.siam.distributed.InstrumentServiceAttributes
public class InstrumentServiceAttributes
InstrumentServiceAttributes and its base class ServiceAttributes provide a framework for representation of instrument service state, which is an important component of service metadata. Each member variable of InstrumentServiceAttributes whose name does not being with "_" is treated as an "attribute", and each instrument service contains an instance of InstrumentServiceAttributes (or subclass). As the service runs, it sets the attribute values to reflect the service state. When generating a metadata packet, the InstrumentService framework automatically generates a representation of service state based on the ServiceAttribute values.
Moreover some attributes are "configurable", in the sense that the attribute's initial value can be specified at service runtime, in a "service properties" file. InstrumentServiceAttributes supports runtime configuration by providing methods that convert from attribute values to Java property strings, and vice versa. Each configurable attribute will have a property, the property name being the name of the attribute's member variable. E.g. an attribute declared as
long isiID;will be represented as a property named "isiID" and a property value string that can be converted to a "long" value. An attribute is configurable only if the requiredIsConfigurable() or isConfigurable() method returns 'true'.
When a service is started, the InstrumentService framework reads the service property file and invokes ServiceAttributes.fromProperties(). During this process, ServiceAttributes will verify that the property values are consistent with the attribute types, and will detect property names that do not correspond to any attribute name. Moreover, several override-able ServiceAttributes callback methods are invoked:
Finally, instantiate your attributes subclass within your instrument service, specifying a reference to the instrument service as a constructor argument:
MyAttributes _attributes = new MyAttributes(this);This will replace the framework's InstrumentServiceAttributes object with your attributes subclass object. (Note that if you do not instantiate a new attributes object in this manner, the framework will continue to use the default InstrumentServiceAttributes object referenced by the InstrumentService._instrumentAttributes member.)
*
ServiceAttributes,
DeviceServiceIF,
Mnemonic,
Serialized Form| Field Summary | |
|---|---|
PowerPolicy |
commPowerPolicy
Instrument communication policy. |
int |
currentLimitMa
Current limit (milliamp) |
float |
dataShelfLifeHours
By default don't telemeter packets older than dataShelfLifeHours. |
int |
defaultSkipInterval
SensorDataPackets skipped by default when subsampling |
int |
diagnosticSampleInterval
Interval (in samples) at which to also sample port/node diagnostics. |
int |
errCacheLimit
Number of error messages to cache before logging to MessagePacket in telemetry stream |
int |
maxSampleTries
Maximum sampling tries |
int |
maxSummarySamples
Sets the maximum number of samples that will be stored in the SummaryBlock. |
int |
nominalCurrentMa
Nominal current draw (milliamp) |
int |
packetSetSize
Max number of packets in each retrieved packet set. |
int |
peakCurrentMa
Peak current draw (milliamp); this value is the peak current spike or individual spikes lasting longer than 50 microseconds drawn by the instrument over one sample period. |
int |
powerOnDelaySec
|
PowerPolicy |
powerPolicy
Instrument power policy. |
boolean |
rbnbAdvertiseService
Advertise RBNB service on network (e.g. |
int |
rbnbArchiveFrames
Number of frames of disk archive for RBNB DataTurbine |
int |
rbnbCacheFrames
Number of frames of memory cache for RBNB DataTurbine |
long[] |
rbnbExcludeRecordTypes
RecordTypes to exclude from the Turbinator |
java.lang.String |
rbnbServer
Make data available to subscribers as it is acquired. |
ScheduleSpecifier |
sampleSchedule
Sampling schedule. |
long |
sampleTimeoutMsec
Sample timeout (msec) |
int |
startDelayMsec
|
int |
summaryTriggerCount
Sample interval between summaries |
java.lang.String[] |
summaryVars
The names of the variables that will be summaryized. |
boolean |
timeSynch
Time-synchronization flag; if true then synchronize instrument's clock to host clock. |
| Fields inherited from class org.mbari.siam.distributed.ServiceAttributes |
|---|
_CONFIGURABLE_FILTER_OFF, _CONFIGURABLE_FILTER_ON, _log4j, advertiseService, className, extendedVersion, frameworkVersion, instrumentName, isiID, locationName, parentID, registryName, serviceName, serviceStatus, UUID |
| Constructor Summary | |
|---|---|
InstrumentServiceAttributes(DeviceServiceIF service)
Construct instrument service attributes, and associate it with specified service. |
|
| Method Summary | |
|---|---|
static InstrumentServiceAttributes |
getAttributes()
Return an InstrumentServiceAttributes object which is not associated with any particular service. |
protected void |
missingAttributeRequiredCallback(java.lang.String fieldName)
Throw MissingPropertyException if specified attribute is mandatory. |
protected void |
requiredCheckValues()
Throw InvalidPropertyException if any invalid values |
protected boolean |
requiredIsConfigurable(java.lang.String fieldName)
Return true if specified field is "configurable", i.e. |
protected void |
setAttributeRequiredCallback(java.lang.String fieldName)
Throw InvalidPropertyException if specified field has invalid value. |
| Methods inherited from class org.mbari.siam.distributed.ServiceAttributes |
|---|
checkPropertyNames, checkValues, fromProperties, getConfigurableFields, getExtendedVersion, getHelp, getMnemonicValues, getTypeName, isConfigurable, missingAttributeCallback, setAttributeCallback, toConfigurableProperties, toProperties, toProperties, toPropertyStrings, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int currentLimitMa
public int nominalCurrentMa
public int peakCurrentMa
public int maxSampleTries
public int startDelayMsec
public long sampleTimeoutMsec
public ScheduleSpecifier sampleSchedule
public PowerPolicy powerPolicy
public PowerPolicy commPowerPolicy
public boolean timeSynch
public int powerOnDelaySec
public int defaultSkipInterval
public int packetSetSize
public int maxSummarySamples
SummaryBlock. This will be the maximum number of samples used
to calculate a summary.
public int summaryTriggerCount
public java.lang.String[] summaryVars
DevicePacketParser if you want
any actual summaries to occur.
public int errCacheLimit
public int diagnosticSampleInterval
public float dataShelfLifeHours
public java.lang.String rbnbServer
public int rbnbCacheFrames
public int rbnbArchiveFrames
public boolean rbnbAdvertiseService
public long[] rbnbExcludeRecordTypes
| Constructor Detail |
|---|
public InstrumentServiceAttributes(DeviceServiceIF service)
| Method Detail |
|---|
protected final void setAttributeRequiredCallback(java.lang.String fieldName)
throws InvalidPropertyException
ServiceAttributes
setAttributeRequiredCallback in class ServiceAttributesInvalidPropertyException
protected final void missingAttributeRequiredCallback(java.lang.String fieldName)
throws MissingPropertyException
missingAttributeRequiredCallback in class ServiceAttributesMissingPropertyException
protected final void requiredCheckValues()
throws InvalidPropertyException
requiredCheckValues in class ServiceAttributesInvalidPropertyExceptionprotected final boolean requiredIsConfigurable(java.lang.String fieldName)
requiredIsConfigurable in class ServiceAttributesfieldName -
public static InstrumentServiceAttributes getAttributes()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||