Class MyModelConnector<CO,CI>

java.lang.Object
de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
test.de.iip_ecosphere.platform.connectors.MyModelConnector<CO,CI>
Type Parameters:
CO - the connector output type
CI - the connector input type
All Implemented Interfaces:
de.iip_ecosphere.platform.connectors.Connector<Object,Object,CO,CI>, de.iip_ecosphere.platform.connectors.events.EventHandlingConnector, de.iip_ecosphere.platform.connectors.model.AbstractModelAccess.NotificationChangedListener

@MachineConnector(hasModel=true, supportsEvents=false, supportsHierarchicalQNames=true, supportsModelCalls=false, supportsModelProperties=false, supportsModelStructs=false, specificSettings={}) public class MyModelConnector<CO,CI> extends de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
Implements a testing model connector.
Author:
Holger Eichelberger, SSE
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The descriptor of this connector (see META-INF/services).
    private class 
    Mimics a simple model access instance.

    Nested classes/interfaces inherited from class de.iip_ecosphere.platform.connectors.AbstractConnector

    de.iip_ecosphere.platform.connectors.AbstractConnector.BasicAdapterProvider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    private Deque<Object>
     
    private de.iip_ecosphere.platform.connectors.ConnectorParameter
     
    private Deque<Object>
     

    Fields inherited from class de.iip_ecosphere.platform.connectors.AbstractConnector

    DEFAULT_CHANNEL
  • Constructor Summary

    Constructors
    Constructor
    Description
    MyModelConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<Object,Object,CO,CI>... adapter)
    Creates a model connector instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    connectImpl(de.iip_ecosphere.platform.connectors.ConnectorParameter params)
     
    void
     
    void
     
     
    protected void
    error(String message, Throwable th)
     
     
    Polls a received data element.
    protected Object
     
     
    void
    Put something into the queue to trigger a "model modification".
    protected void
     

    Methods inherited from class de.iip_ecosphere.platform.connectors.AbstractConnector

    checkCache, configureAdapter, configureModelAccess, connect, createTlsContext, disconnect, doPolling, enableNotifications, enablePolling, getCachingStrategy, getCachingStrategyCls, getConnectorInputType, getConnectorOutputType, getConnectorParameter, getInitCachingStrategyCls, getInstanceIdentification, getProtocolInputType, getProtocolOutputType, getSelector, getStorageValue, initializeModelAccess, initSelector, installPollTask, isPolling, notificationsChanged, notifyDataTimeDifference, notifyReconfigured, received, received, request, request, setDataTimeDifference, setDataTimeDifferenceProvider, setInstanceIdentification, setReceptionCallback, setStorageValue, trigger, trigger, uninstallPollTask, useTls, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.iip_ecosphere.platform.connectors.Connector

    createSharedSpace, disconnectSafe, enableSharedSpace, setReceptionCallbackSafe
  • Field Details

  • Constructor Details

    • MyModelConnector

      @SafeVarargs public MyModelConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<Object,Object,CO,CI>... adapter)
      Creates a model connector instance.
      Parameters:
      adapter - the protocol adapter(s)
  • Method Details

    • connectImpl

      protected void connectImpl(de.iip_ecosphere.platform.connectors.ConnectorParameter params) throws IOException
      Specified by:
      connectImpl in class de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
      Throws:
      IOException
    • disconnectImpl

      public void disconnectImpl() throws IOException
      Specified by:
      disconnectImpl in class de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
      Throws:
      IOException
    • dispose

      public void dispose()
      Specified by:
      dispose in interface de.iip_ecosphere.platform.connectors.Connector<Object,Object,CO,CI>
      Overrides:
      dispose in class de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
    • getName

      public String getName()
    • writeImpl

      protected void writeImpl(Object data) throws IOException
      Specified by:
      writeImpl in class de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
      Throws:
      IOException
    • read

      protected Object read() throws IOException
      Specified by:
      read in class de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
      Throws:
      IOException
    • error

      protected void error(String message, Throwable th)
      Specified by:
      error in class de.iip_ecosphere.platform.connectors.AbstractConnector<Object,Object,CO,CI>
    • testTrigger

      public void testTrigger() throws IOException
      Put something into the queue to trigger a "model modification".
      Throws:
      IOException - if offering fails for some reason
    • pollReceived

      public Object pollReceived()
      Polls a received data element.
      Returns:
      the received element, null for nothing received
    • supportedEncryption

      public String supportedEncryption()
    • enabledEncryption

      public String enabledEncryption()