Class AdsConnector<CO,CI>
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.AbstractConnector<java.lang.Object,java.lang.Object,CO,CI>
-
- de.iip_ecosphere.platform.connectors.ads.AdsConnector<CO,CI>
-
- Type Parameters:
CO- the output type to the IIP-Ecosphere platformCI- the input type from the IIP-Ecosphere platform
- All Implemented Interfaces:
de.iip_ecosphere.platform.connectors.Connector<java.lang.Object,java.lang.Object,CO,CI>,de.iip_ecosphere.platform.connectors.events.EventHandlingConnector,de.iip_ecosphere.platform.connectors.model.AbstractModelAccess.NotificationChangedListener
@MachineConnector(hasModel=true, supportsModelStructs=true, supportsEvents=false, requiresTypedAccess=true, supportsModelCalls=false) public class AdsConnector<CO,CI> extends de.iip_ecosphere.platform.connectors.AbstractConnector<java.lang.Object,java.lang.Object,CO,CI>A generic ADS TwinCat connector.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAdsConnector.AdsModelAccessImplements the model access for AAS.static classAdsConnector.DescriptorThe descriptor of this connector (see META-INF/services).static interfaceAdsConnector.InstanceCreator<T>Creates instances.private static classAdsConnector.TypeDescriptor<T>
-
Field Summary
Fields Modifier and Type Field Description private de.iip_ecosphere.platform.libs.ads.AdsCommunicationcommprivate static java.lang.ObjectDUMMYprivate static org.slf4j.LoggerLOGGERstatic java.lang.StringNAMEprivate de.iip_ecosphere.platform.connectors.ConnectorParameterparamsprivate static java.util.Map<java.lang.Class<?>,AdsConnector.TypeDescriptor<?>>TYPE_DESCRIPTORS
-
Constructor Summary
Constructors Constructor Description AdsConnector(de.iip_ecosphere.platform.connectors.AdapterSelector<java.lang.Object,java.lang.Object,CO,CI> selector, de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<java.lang.Object,java.lang.Object,CO,CI>... adapter)Creates an instance and installs the protocol adapter.AdsConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<java.lang.Object,java.lang.Object,CO,CI>... adapter)Creates an instance and installs the protocol adapter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconnectImpl(de.iip_ecosphere.platform.connectors.ConnectorParameter params)protected voiddisconnectImpl()voiddispose()java.lang.StringenabledEncryption()protected voiderror(java.lang.String message, java.lang.Throwable th)java.lang.StringgetName()protected java.lang.Objectread()static <T> voidregisterType(java.lang.Class<T> cls, de.iip_ecosphere.platform.libs.ads.MemorySizeCalculator<T> sizeCalculator, de.iip_ecosphere.platform.libs.ads.ReadVisitor.ReadVisitorSupplier<T> reader, de.iip_ecosphere.platform.libs.ads.WriteVisitor.WriteVisitorSupplier<T> writer, AdsConnector.InstanceCreator<T> creator)Registers a type.java.lang.StringsupportedEncryption()protected voidwriteImpl(java.lang.Object data)-
Methods inherited from class de.iip_ecosphere.platform.connectors.AbstractConnector
checkCache, configureModelAccess, connect, createTlsContext, disconnect, doPolling, enableNotifications, enablePolling, getCachingStrategy, getCachingStrategyCls, getConnectorInputType, getConnectorOutputType, getConnectorParameter, getInitCachingStrategyCls, getProtocolInputType, getProtocolOutputType, getSelector, initializeModelAccess, initSelector, installPollTask, isPolling, notificationsChanged, notifyReconfigured, received, received, request, request, setReceptionCallback, trigger, trigger, uninstallPollTask, useTls, write
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
DUMMY
private static final java.lang.Object DUMMY
-
TYPE_DESCRIPTORS
private static final java.util.Map<java.lang.Class<?>,AdsConnector.TypeDescriptor<?>> TYPE_DESCRIPTORS
-
params
private de.iip_ecosphere.platform.connectors.ConnectorParameter params
-
comm
private de.iip_ecosphere.platform.libs.ads.AdsCommunication comm
-
-
Constructor Detail
-
AdsConnector
@SafeVarargs public AdsConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<java.lang.Object,java.lang.Object,CO,CI>... adapter)
Creates an instance and installs the protocol adapter.- Parameters:
adapter- the protocol adapter- Throws:
java.lang.IllegalArgumentException- ifadapteris null or empty or adapters are null
-
AdsConnector
@SafeVarargs public AdsConnector(de.iip_ecosphere.platform.connectors.AdapterSelector<java.lang.Object,java.lang.Object,CO,CI> selector, de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<java.lang.Object,java.lang.Object,CO,CI>... adapter)
Creates an instance and installs the protocol adapter.- Parameters:
selector- the adapter selector (null leads to a default selector for the first adapter)adapter- the protocol adapter(s)- Throws:
java.lang.IllegalArgumentException- ifadapteris null or empty or adapters are null
-
-
Method Detail
-
registerType
public static <T> void registerType(java.lang.Class<T> cls, de.iip_ecosphere.platform.libs.ads.MemorySizeCalculator<T> sizeCalculator, de.iip_ecosphere.platform.libs.ads.ReadVisitor.ReadVisitorSupplier<T> reader, de.iip_ecosphere.platform.libs.ads.WriteVisitor.WriteVisitorSupplier<T> writer, AdsConnector.InstanceCreator<T> creator)Registers a type.- Type Parameters:
T- the java type- Parameters:
cls- the java type classsizeCalculator- the related size calculatorreader- the readerwriter- the writercreator- the instance creator
-
connectImpl
protected void connectImpl(de.iip_ecosphere.platform.connectors.ConnectorParameter params) throws java.io.IOException
-
disconnectImpl
protected void disconnectImpl() throws java.io.IOException
-
dispose
public void dispose()
-
getName
public java.lang.String getName()
-
writeImpl
protected void writeImpl(java.lang.Object data) throws java.io.IOException
-
read
protected java.lang.Object read() throws java.io.IOException
-
error
protected void error(java.lang.String message, java.lang.Throwable th)
-
supportedEncryption
public java.lang.String supportedEncryption()
-
enabledEncryption
public java.lang.String enabledEncryption()
-
-