public abstract class AbstractSubscriptionManager extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,DataItemValue> |
cache |
protected boolean |
started |
Constructor and Description |
---|
AbstractSubscriptionManager(HiveSource hiveSource,
Properties properties,
ScheduledExecutorService executor,
String logName)
Create a new subscription manager
|
Modifier and Type | Method and Description |
---|---|
protected void |
bind(Hive hive) |
protected void |
clearCache() |
Map<String,DataItemValue> |
getCacheCopy() |
DataItemValue |
getCacheValue(String itemId) |
SortedMap<String,DataItemValue> |
getSortedCacheCopy() |
protected void |
handleCreateSessionResult(Future<Session> future) |
protected void |
handleDataChanged(String itemId,
Variant value,
Map<String,Variant> attributes,
boolean cache) |
protected void |
handleSubscriptionChanged(String itemId,
SubscriptionState subscriptionState) |
protected void |
performSetHive(Hive hive) |
protected void |
putState(String itemId,
DataItemValue value) |
void |
start() |
void |
stop() |
protected void |
subscribe(String itemId)
Subscribe to an item
|
protected void |
subscribeAll(Set<String> itemIds)
Subscribe to multiple items
|
protected void |
unbind() |
protected void |
unsubscribe(String itemId) |
NotifyFuture<WriteAttributeResults> |
writeAttributes(String itemId,
Map<String,Variant> attributes,
OperationParameters operationParameters,
CallbackHandler callbackHandler) |
NotifyFuture<WriteResult> |
writeValue(String itemId,
Variant value,
OperationParameters operationParameters,
CallbackHandler callbackHandler) |
protected final Map<String,DataItemValue> cache
protected volatile boolean started
public AbstractSubscriptionManager(HiveSource hiveSource, Properties properties, ScheduledExecutorService executor, String logName)
hiveSource
- the source of the hive to attach toproperties
- the hive connection propertieslogName
- An optional name of the actor, which will be used for loggingpublic void start()
public void stop()
protected void performSetHive(Hive hive)
protected void bind(Hive hive)
protected void unbind()
protected void subscribe(String itemId)
Subscriptions may only be made after the manager was started using
start()
.
itemId
- id of the item to subscribe toprotected void subscribeAll(Set<String> itemIds)
Subscriptions may only be made after the manager was started using
start()
.
itemIds
- the ids of the items to subscribe toprotected void unsubscribe(String itemId)
protected void clearCache()
protected void putState(String itemId, DataItemValue value)
public Map<String,DataItemValue> getCacheCopy()
public SortedMap<String,DataItemValue> getSortedCacheCopy()
public DataItemValue getCacheValue(String itemId)
protected void handleDataChanged(String itemId, Variant value, Map<String,Variant> attributes, boolean cache)
protected void handleSubscriptionChanged(String itemId, SubscriptionState subscriptionState)
public NotifyFuture<WriteResult> writeValue(String itemId, Variant value, OperationParameters operationParameters, CallbackHandler callbackHandler)
public NotifyFuture<WriteAttributeResults> writeAttributes(String itemId, Map<String,Variant> attributes, OperationParameters operationParameters, CallbackHandler callbackHandler)
Copyright © 2016 Eclipse NeoSCADA Project. All rights reserved.