Class AbstractModelAccess
java.lang.Object
de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
- All Implemented Interfaces:
ModelAccess
- Direct Known Subclasses:
AbstractTypeMappingModelAccess
Basic implementation of the model access.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener for notification changes. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractModelAccess(AbstractModelAccess.NotificationChangedListener notificationChangedListener) Creates an abstract model access with notification changed listener. -
Method Summary
Modifier and TypeMethodDescriptionabstract ConnectorParameterReturns the actual connector parameters that apply for this model instance.Composes multiple names to a qualified instance name starting withModelAccess.topInstancesQName()usingModelAccess.getQSeparator().protected final booleanReturns whether detailed notifications for monitored items is enabled.voidMonitors the givenqNameelement in the server namespace and upon changes, triggers a reception in the connector.voidMonitors generic model changes, in particular those not covered byModelAccess.monitor(String...).Composes multiple names to a qualified name usingModelAccess.getQSeparator().private StringComposes a qualified name.final voidsetDetailNotifiedItem(boolean detail) Whether the connector shall send detailed information about monitored changes.protected final booleanReturns whether (event-based) notifications or polling shall be used.final voiduseNotifications(boolean useNotifications) Use notifications or polling.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.connectors.model.ModelAccess
call, dispose, get, get, getBoolean, getByte, getDouble, getFloat, getInputConverter, getInt, getLong, getMultiValue, getOutputConverter, getQSeparator, getShort, getString, getStruct, monitor, monitorModelChanges, registerCustomType, set, setBoolean, setByte, setDouble, setFloat, setInt, setLong, setMultiValue, setMultiValue, setShort, setString, setStruct, stepInto, stepOut, topInstancesQName
-
Field Details
-
detailNotifications
private boolean detailNotifications -
useNotifications
-
notificationChangedListener
-
-
Constructor Details
-
AbstractModelAccess
protected AbstractModelAccess(AbstractModelAccess.NotificationChangedListener notificationChangedListener) Creates an abstract model access with notification changed listener.- Parameters:
notificationChangedListener- listener to be called when the notification settings have been changed, typically during initialization of the connector/model
-
-
Method Details
-
isDetailNotifiedItemEnabled
protected final boolean isDetailNotifiedItemEnabled()Returns whether detailed notifications for monitored items is enabled.- Returns:
truefor details,falsefor null
-
setDetailNotifiedItem
public final void setDetailNotifiedItem(boolean detail) Description copied from interface:ModelAccessWhether the connector shall send detailed information about monitored changes. Intended to be used inConnectorOutputTypeTranslator.initializeModelAccess(). [monitoring]- Specified by:
setDetailNotifiedItemin interfaceModelAccess- Parameters:
detail-truefor details,falsefor null (default)
-
useNotifications
protected final boolean useNotifications()Returns whether (event-based) notifications or polling shall be used.- Returns:
truefor notifications,falsefor polling
-
useNotifications
public final void useNotifications(boolean useNotifications) Description copied from interface:ModelAccessUse notifications or polling. This is required here, as the related translator codeModelAccess.monitor(String...)depends on that. [monitoring]- Specified by:
useNotificationsin interfaceModelAccess- Parameters:
useNotifications-truefor notifications,falsefor polling
-
qName
Composes a qualified name.- Parameters:
init- the initialization for the result to be used when the first non-empty name shall be appendednames- the names to be appended- Returns:
- the qualified name, empty if there was nothing to compose irrespective of
init
-
qName
Description copied from interface:ModelAccessComposes multiple names to a qualified name usingModelAccess.getQSeparator().- Specified by:
qNamein interfaceModelAccess- Parameters:
names- the names (may be empty but shall be ignored then)- Returns:
- the composed qualified name, empty if no
nameswere given
-
iqName
Description copied from interface:ModelAccessComposes multiple names to a qualified instance name starting withModelAccess.topInstancesQName()usingModelAccess.getQSeparator().- Specified by:
iqNamein interfaceModelAccess- Parameters:
names- the names (may be empty but shall be ignored then)- Returns:
- the composed qualified name, empty if no
nameswere given
-
monitor
Description copied from interface:ModelAccessMonitors the givenqNameelement in the server namespace and upon changes, triggers a reception in the connector. Intended to be used inConnectorOutputTypeTranslator.initializeModelAccess().ConnectorParameter.getNotificationInterval()shall be used as default value if applicable. [monitoring]- Specified by:
monitorin interfaceModelAccess- Parameters:
qNames- the qualified names of the elements to monitor- Throws:
IOException- if creating the monitor fails
-
monitorModelChanges
Description copied from interface:ModelAccessMonitors generic model changes, in particular those not covered byModelAccess.monitor(String...). Triggers a reception in the connector. Intended to be used inConnectorOutputTypeTranslator.initializeModelAccess().ConnectorParameter.getNotificationInterval()shall be used as default value if applicable. [monitoring]- Specified by:
monitorModelChangesin interfaceModelAccess- Throws:
IOException- if creating the monitor fails
-
getConnectorParameter
Returns the actual connector parameters that apply for this model instance.- Returns:
- the connector parameters
-