public class DataModelImpl extends AbstractBaseDataModel
All entries are initialized with DataItemValue.DISCONNECTED in order
to populate the caches. This will allow the background transfer to already
have data before changes came in. And also prevent the cache structures to
change, so the background transmission may hold the iterators.
executor| Constructor and Description |
|---|
DataModelImpl(HiveSource hiveSource,
Set<MappingEntry> entries,
Properties hiveProperties,
InformationBean info) |
| Modifier and Type | Method and Description |
|---|---|
BackgroundIterator |
createBackgroundIterator()
Create a new background iterator
If the implementation does not support background transmissions, null may be returned. |
void |
dispose() |
void |
disposeAndWait() |
protected com.google.common.util.concurrent.ListenableFuture<Void> |
disposeSubscription(DefaultSubscription subscription) |
void |
forAllAsdu(com.google.common.base.Function<ASDUAddress,Void> function,
Runnable ifNoneFound)
A method that will call the provided function for each known ASDU address
|
protected void |
handleStateChanged(MappingEntry entry,
DataItemValue value,
boolean notify) |
protected Object |
internalBackgroundScan(org.eclipse.scada.da.server.exporter.iec60870.DataModelImpl.BackgroundState state) |
protected void |
performForAllAsdu(com.google.common.base.Function<ASDUAddress,Void> function,
Runnable ifNoneFound) |
protected Value<?> |
performRead(ASDUAddress asduAddress,
InformationObjectAddress address) |
protected void |
performReadAll(ASDUAddress asduAddress,
DataListener listener,
Map<Integer,Value<?>> map) |
protected boolean |
performWrite(org.eclipse.scada.da.server.exporter.iec60870.DataModelImpl.WriteRequest request,
MirrorCommand mirrorCommand,
boolean execute) |
Object |
proceedBackgroundScan(org.eclipse.scada.da.server.exporter.iec60870.DataModelImpl.BackgroundState state) |
com.google.common.util.concurrent.ListenableFuture<Value<?>> |
read(ASDUAddress asduAddress,
InformationObjectAddress address)
Read a specific value
The future will be called with the result of the read operation. |
com.google.common.util.concurrent.ListenableFuture<Void> |
readAll(ASDUAddress asduAddress,
Runnable prepare,
DataListener listener)
Read all values from the internal structures
The data will not be returned by the future, but pushed to the DataListener. |
Subscription |
subscribe(DataListener listener) |
void |
writeCommand(ASDUHeader header,
InformationObjectAddress informationObjectAddress,
boolean state,
byte type,
MirrorCommand mirrorCommand,
boolean execute) |
void |
writeScaledValue(ASDUHeader header,
InformationObjectAddress informationObjectAddress,
short value,
byte type,
MirrorCommand mirrorCommand,
boolean execute) |
void |
writeValue(ASDUHeader header,
InformationObjectAddress informationObjectAddress,
float value,
byte type,
MirrorCommand mirrorCommand,
boolean execute) |
getNumberOfSubscriptions, notifyChangeBoolean, notifyChangeFloatpublic DataModelImpl(HiveSource hiveSource, Set<MappingEntry> entries, Properties hiveProperties, InformationBean info)
public Subscription subscribe(DataListener listener)
subscribe in interface DataModelsubscribe in class AbstractBaseDataModelprotected com.google.common.util.concurrent.ListenableFuture<Void> disposeSubscription(DefaultSubscription subscription)
disposeSubscription in class AbstractBaseDataModelprotected void handleStateChanged(MappingEntry entry, DataItemValue value, boolean notify)
public void dispose()
dispose in interface DataModeldispose in class AbstractBaseDataModelpublic void disposeAndWait()
throws InterruptedException
disposeAndWait in class AbstractBaseDataModelInterruptedExceptionpublic com.google.common.util.concurrent.ListenableFuture<Value<?>> read(ASDUAddress asduAddress, InformationObjectAddress address)
DataModelnull.address - the address to readnull if the data model
instantly decide that the value cannot be readprotected Value<?> performRead(ASDUAddress asduAddress, InformationObjectAddress address)
public com.google.common.util.concurrent.ListenableFuture<Void> readAll(ASDUAddress asduAddress, Runnable prepare, DataListener listener)
DataModelDataListener.asduAddress - the ASDU common addressprepare - a runnable that will be called before the actual processing,
from the same thread the listener will be called. But only
when the request actually can be processed. If the runnable
was called, the method must not return null.listener - the data receivernull if the ASDU address was unknown.protected void performReadAll(ASDUAddress asduAddress, DataListener listener, Map<Integer,Value<?>> map)
public void forAllAsdu(com.google.common.base.Function<ASDUAddress,Void> function, Runnable ifNoneFound)
DataModelNote that the ASDUs must not change until each function call has been completed.
The function call can be performed asynchronously.
function - the function to call for each known ASDU addressifNoneFound - will be called if there are no known common ASDU addresses,
may be nullprotected void performForAllAsdu(com.google.common.base.Function<ASDUAddress,Void> function, Runnable ifNoneFound)
public BackgroundIterator createBackgroundIterator()
DataModelnull may be returned. nullpublic Object proceedBackgroundScan(org.eclipse.scada.da.server.exporter.iec60870.DataModelImpl.BackgroundState state)
protected Object internalBackgroundScan(org.eclipse.scada.da.server.exporter.iec60870.DataModelImpl.BackgroundState state)
public void writeCommand(ASDUHeader header, InformationObjectAddress informationObjectAddress, boolean state, byte type, MirrorCommand mirrorCommand, boolean execute)
public void writeValue(ASDUHeader header, InformationObjectAddress informationObjectAddress, float value, byte type, MirrorCommand mirrorCommand, boolean execute)
public void writeScaledValue(ASDUHeader header, InformationObjectAddress informationObjectAddress, short value, byte type, MirrorCommand mirrorCommand, boolean execute)
protected boolean performWrite(org.eclipse.scada.da.server.exporter.iec60870.DataModelImpl.WriteRequest request,
MirrorCommand mirrorCommand,
boolean execute)
Copyright © 2014 Eclipse SCADA Project. All rights reserved.