de.esprit.netsuite.client.net

## Class RequestChannel

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.netsuite.client.AbstractClientObject<ClientContext>
      - - de.esprit.netsuite.client.net.RequestChannel

- All Implemented Interfaces:
    ApplicationObject<ClientContext>, SimpleLogSupport, Dumpable, ClientObject<ClientContext>, NetRequestEvent.Source, NetResponseEvent.Source

      public final class RequestChannel
      extends AbstractClientObject<ClientContext>
      implements NetRequestEvent.Source, NetResponseEvent.Source

  This class encapsulates the functionality provided by the Request network channel.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestChannel(ClientContext clientCtx, ClientNetworkAdapter networkAdapter)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRequestListener(NetRequestEvent.Listener l)`
    `void` | `addResponseListener(NetResponseEvent.Listener l)`
    `void` | `connect()`
    `boolean` | `disconnect()`
    `java.lang.String` | `getConnectionInfoLocal()`
    `java.lang.String` | `getConnectionInfoRemote()`
    `ClientNetworkAdapter` | `getNetworkAdapter()` Returns the `ClientConnector` instance which maintains the connection to the server
    `SessionId` | `getSessionId()`
    `boolean` | `isLoggedIn()`
    `void` | `removeRequestListener(NetRequestEvent.Listener l)`
    `void` | `removeResponseListener(NetResponseEvent.Listener l)`
    `<A extends Agent> A` | `sendExecuteAgent(A agentIn)` Sends the given agent to the server and returns a copy of the server-processed agent.
    `NetResponse` | `sendRequest(NetRequest request)` Sends a `NetRequest` object to the server and returns the `NetResponse` object to the client.

    - ### Methods inherited from class de.esprit.netsuite.client.AbstractClientObject

      `getClientConfig, getClientContext`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

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

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

- - ### Constructor Detail

    - #### RequestChannel

          public RequestChannel(ClientContext clientCtx,
                        ClientNetworkAdapter networkAdapter)

  - ### Method Detail

    - #### getNetworkAdapter

          public final ClientNetworkAdapter getNetworkAdapter()

      Returns the `ClientConnector` instance which maintains the connection to the server

    - #### getSessionId

          public SessionId getSessionId()

    - #### getConnectionInfoLocal

          public java.lang.String getConnectionInfoLocal()

    - #### getConnectionInfoRemote

          public java.lang.String getConnectionInfoRemote()

    - #### isLoggedIn

          public boolean isLoggedIn()

    - #### connect

          public void connect()
                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### disconnect

          public boolean disconnect()

    - #### sendRequest

          public NetResponse sendRequest(NetRequest request)

      Sends a `NetRequest` object to the server and returns the `NetResponse` object to the client. Note that the response object is guaranteed not to be null but it must be checked for errors with the hasError() method.

    - #### sendExecuteAgent

          public <A extends Agent> A sendExecuteAgent(A agentIn)

      Sends the given agent to the server and returns a copy of the server-processed agent. When agent execution failed on the server, then the returned agent contains an exception. If the agent could not be sent at all, then the original agent is returned with an exception.

    - #### addResponseListener

          public void addResponseListener(NetResponseEvent.Listener l)

      Specified by:
        `addResponseListener` in interface `NetResponseEvent.Source`

    - #### removeResponseListener

          public void removeResponseListener(NetResponseEvent.Listener l)

      Specified by:
        `removeResponseListener` in interface `NetResponseEvent.Source`

    - #### addRequestListener

          public void addRequestListener(NetRequestEvent.Listener l)

      Specified by:
        `addRequestListener` in interface `NetRequestEvent.Source`

    - #### removeRequestListener

          public void removeRequestListener(NetRequestEvent.Listener l)

      Specified by:
        `removeRequestListener` in interface `NetRequestEvent.Source`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.