com.tibbo.aggregate.common.protocol

## Class AbstractAggreGateDeviceController<D extends AggreGateDevice,C extends RemoteContextManager>

- java.lang.Object
- - com.tibbo.aggregate.common.communication.AbstractDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>
  - - com.tibbo.aggregate.common.protocol.AbstractAggreGateDeviceController<D,C>

- All Implemented Interfaces:
    CommandParserListener, AggreGateDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>, RemoteConnector
  Direct Known Subclasses:
    RemoteServerController

      public abstract class AbstractAggreGateDeviceController<D extends AggreGateDevice,C extends RemoteContextManager>
      extends AbstractDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>
      implements AggreGateDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CompressedCommandWriter<OutgoingAggreGateCommand>` | `commandWriter`
    `static java.lang.String` | `FLAG_NO_REPLY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractAggreGateDeviceController(D device, org.apache.log4j.Logger logger, int maxEventQueueLength)`
    `AbstractAggreGateDeviceController(D device, org.apache.log4j.Logger logger, int maxEventQueueLength, boolean json)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDisconnectListener(AbstractAggreGateDeviceControllerDisconnectListener disconnectListener)`
    `DataTable` | `callRemoteFunction(java.lang.String context, java.lang.String name, TableFormat outputFormat, DataTable parameters, java.lang.String queueName)`
    `DataTable` | `callRemoteFunction(java.lang.String context, java.lang.String name, TableFormat outputFormat, DataTable parameters, java.lang.String queueName, boolean isReplyRequired)`
    `protected void` | `confirmEvent(Context con, EventDefinition def, Event event)`
    `protected boolean` | `connectImpl()`
    `ClassicEncodingSettings` | `createClassicEncodingSettings(boolean forSending)`
    `protected DataTable` | `decodeRemoteDataTable(TableFormat format, java.lang.String encodedReply)`
    `void` | `destroy()`
    `protected void` | `disconnectImpl()`
    `CallerController` | `getCallerController()`
    `ProtocolCommandBuilder` | `getCommandBuilder()`
    `C` | `getContextManager()`
    `D` | `getDevice()`
    `protected java.util.concurrent.ExecutorService` | `getEventPreprocessor()`
    `int` | `getEventQueueLength()`
    `FormatCache` | `getFormatCache()`
    `ProtocolVersion` | `getProtocolVersion()`
    `protected java.util.List<ProxyContext>` | `getProxyContexts(java.lang.String path)`
    `int` | `getRejectedEvents()`
    `UserSettings` | `getSettings()`
    `boolean` | `isAvoidSendingFormats()`
    `boolean` | `isPropagateUnifiedSearchRequests()`
    `boolean` | `isUsesCompression()`
    `protected void` | `processAsyncCommand(IncomingAggreGateCommand cmd)`
    `IncomingAggreGateCommand` | `sendCommandAndCheckReplyCode(OutgoingAggreGateCommand cmd)`
    `protected void` | `setAvoidSendingFormats(boolean avoidSendingFormats)`
    `protected void` | `setCallerController(CallerController callerController)`
    `protected void` | `setCommandParser(CommandParser commandBuffer)`
    `void` | `setContextManager(C contextManager)`
    `void` | `setDevice(D device)`
    `void` | `setFormatCache(FormatCache cache)`
    `void` | `setUsesCompression(boolean usesCompression)`
    `abstract void` | `start()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class com.tibbo.aggregate.common.communication.AbstractDeviceController

      `checkAndConnect, connect, disconnect, getActiveCommands, getCommandParser, getCommandTimeout, getLogger, getStatistics, isActive, isConnected, isLoggedIn, login, loginImpl, newDataReceived, resetCommandTimeouts, send, sendCommand, setCommandTimeout, setConnected, setLoggedIn, setResetTimeoutsOnData, startCommandProcessor`

    - ### Methods inherited from class java.lang.Object

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

    - ### Methods inherited from interface com.tibbo.aggregate.common.protocol.AggreGateDeviceController

      `connect, disconnect, getActiveCommands, getStatistics, isActive, login, sendCommand`

- - ### Field Detail

    - #### FLAG_NO_REPLY

          public static final java.lang.String FLAG_NO_REPLY

      See Also:
        Constant Field Values

    - #### commandWriter

          protected final CompressedCommandWriter<OutgoingAggreGateCommand> commandWriter

  - ### Constructor Detail

    - #### AbstractAggreGateDeviceController

          public AbstractAggreGateDeviceController(D device,
                                                   org.apache.log4j.Logger logger,
                                                   int maxEventQueueLength)

    - #### AbstractAggreGateDeviceController

          public AbstractAggreGateDeviceController(D device,
                                                   org.apache.log4j.Logger logger,
                                                   int maxEventQueueLength,
                                                   boolean json)

  - ### Method Detail

    - #### getContextManager

          public C getContextManager()

      Specified by:
        `getContextManager` in interface `RemoteConnector`

    - #### setContextManager

          public void setContextManager(C contextManager)

    - #### setDevice

          public void setDevice(D device)

    - #### getDevice

          public D getDevice()

      Specified by:
        `getDevice` in interface `AggreGateDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>`

    - #### getCallerController

          public CallerController getCallerController()

      Specified by:
        `getCallerController` in interface `RemoteConnector`

    - #### setCallerController

          protected void setCallerController(CallerController callerController)

    - #### getFormatCache

          public FormatCache getFormatCache()

    - #### setFormatCache

          public void setFormatCache(FormatCache cache)

    - #### getSettings

          public UserSettings getSettings()

      Specified by:
        `getSettings` in interface `RemoteConnector`

    - #### createClassicEncodingSettings

          public ClassicEncodingSettings createClassicEncodingSettings(boolean forSending)

    - #### setAvoidSendingFormats

          protected void setAvoidSendingFormats(boolean avoidSendingFormats)

    - #### isAvoidSendingFormats

          public boolean isAvoidSendingFormats()

    - #### connectImpl

          protected boolean connectImpl()
                                 throws DisconnectionException,
                                        java.io.IOException,
                                        java.lang.InterruptedException,
                                        RemoteDeviceErrorException,
                                        ContextException

      Specified by:
        `connectImpl` in class `AbstractDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>`
      Throws:
        `DisconnectionException`
        `java.io.IOException`
        `java.lang.InterruptedException`
        `RemoteDeviceErrorException`
        `ContextException`

    - #### start

          public abstract void start()
                              throws java.io.IOException,
                                     java.lang.InterruptedException,
                                     ContextException,
                                     RemoteDeviceErrorException

      Specified by:
        `start` in interface `AggreGateDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>`
      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`
        `ContextException`
        `RemoteDeviceErrorException`

    - #### destroy

          public void destroy()

    - #### addDisconnectListener

          public void addDisconnectListener(AbstractAggreGateDeviceControllerDisconnectListener disconnectListener)

    - #### disconnectImpl

          protected void disconnectImpl()

      Specified by:
        `disconnectImpl` in class `AbstractDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>`

    - #### getProxyContexts

          protected java.util.List<ProxyContext> getProxyContexts(java.lang.String path)

    - #### getEventPreprocessor

          protected java.util.concurrent.ExecutorService getEventPreprocessor()

    - #### sendCommandAndCheckReplyCode

          public IncomingAggreGateCommand sendCommandAndCheckReplyCode(OutgoingAggreGateCommand cmd)
                                                                throws DisconnectionException,
                                                                       ContextException,
                                                                       java.io.IOException,
                                                                       java.lang.InterruptedException,
                                                                       RemoteDeviceErrorException

      Throws:
        `DisconnectionException`
        `ContextException`
        `java.io.IOException`
        `java.lang.InterruptedException`
        `RemoteDeviceErrorException`

    - #### processAsyncCommand

          protected void processAsyncCommand(IncomingAggreGateCommand cmd)

      Overrides:
        `processAsyncCommand` in class `AbstractDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>`

    - #### confirmEvent

          protected void confirmEvent(Context con,
                                      EventDefinition def,
                                      Event event)
                               throws ContextException

      Throws:
        `ContextException`

    - #### setCommandParser

          protected void setCommandParser(CommandParser commandBuffer)

      Overrides:
        `setCommandParser` in class `AbstractDeviceController<IncomingAggreGateCommand,OutgoingAggreGateCommand>`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### callRemoteFunction

          public DataTable callRemoteFunction(java.lang.String context,
                                              java.lang.String name,
                                              TableFormat outputFormat,
                                              DataTable parameters,
                                              java.lang.String queueName)
                                       throws ContextException

      Throws:
        `ContextException`

    - #### callRemoteFunction

          public DataTable callRemoteFunction(java.lang.String context,
                                              java.lang.String name,
                                              TableFormat outputFormat,
                                              DataTable parameters,
                                              java.lang.String queueName,
                                              boolean isReplyRequired)
                                       throws ContextException

      Throws:
        `ContextException`

    - #### decodeRemoteDataTable

          protected DataTable decodeRemoteDataTable(TableFormat format,
                                                    java.lang.String encodedReply)
                                             throws DataTableException

      Throws:
        `DataTableException`

    - #### isUsesCompression

          public boolean isUsesCompression()

    - #### setUsesCompression

          public void setUsesCompression(boolean usesCompression)

    - #### getProtocolVersion

          public ProtocolVersion getProtocolVersion()

    - #### getEventQueueLength

          public int getEventQueueLength()

    - #### getRejectedEvents

          public int getRejectedEvents()

    - #### getCommandBuilder

          public ProtocolCommandBuilder getCommandBuilder()

    - #### isPropagateUnifiedSearchRequests

          public boolean isPropagateUnifiedSearchRequests()