de.esprit.netsuite.client.netch

## Interface ClientConnector

- All Superinterfaces:
    ABOChangeEvent.Source, java.lang.AutoCloseable, BatchTaskEvent.Source, CloseableComponent, NetMessageEvent.Source, NetRequestEvent.Source, NetResponseEvent.Source, NetworkConnectionEvent.Source, RemoteRecordChangeEvent.Source, RemoteTaskEvent.Source, ServerStatusEvent.Source, SystemEvent.Source
  All Known Implementing Classes:
    EspritClientConnector

      public interface ClientConnector
      extends CloseableComponent, NetRequestEvent.Source, NetResponseEvent.Source, NetMessageEvent.Source, ServerStatusEvent.Source, BatchTaskEvent.Source, RemoteRecordChangeEvent.Source, RemoteTaskEvent.Source, NetworkConnectionEvent.Source, SystemEvent.Source, ABOChangeEvent.Source

  This interface defines the API of the client's connection to the network.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAgentMessageListener(AgentMessageListener l)`
    `void` | `addNetEventListener(GenericEvent.Listener l)`
    `void` | `addServerLogMessageListener(LogMessageEvent.Listener l)`
    `void` | `checkConnected()` Checks whether the client is connected and throws an Exception if not
    `void` | `connect()` Connects both the `RequestChannel` and `MessageChannel`.
    `boolean` | `disconnect()` Disconnects both the `RequestChannel` and `MessageChannel`.
    `java.lang.String` | `getClientConnectionInfo()` Returns an info string about the current client side connection.
    `java.sql.Timestamp` | `getConnectedSinceTs()` Returns the timestamp since the connection was established.
    `LoginData` | `getLastLoginData()`
    `java.lang.String` | `getServerConnectionInfo()` Returns an info string about the current server side connection.
    `ServerHost` | `getServerHost()` Returns the `ServerHost` defined for this connection.
    `ServerId` | `getServerId()` Returns the `ServerId` object which is available since the first successful server connection.
    `SessionId` | `getSessionId()` Returns the `SessionId` if a connection is established.
    `User` | `getUser()` Returns the full `User` object of the current login.
    `UserId` | `getUserId()` Returns the `UserId` object of the current login.
    `boolean` | `isConnected()` Tells whether the network connection is established
    `boolean` | `isLoggedIn()` Tells whether the user is currently logged in.
    `User` | `login(LoginData loginData)` Performs a user login with the given login parameters
    `User` | `login(java.lang.String username, java.lang.String password)` Performs a user login with the given login parameters.
    `boolean` | `logout(boolean isFinalLogout)` Performs a user logout.
    `void` | `reconnect()` Disconnects if applicable and reconnects again.
    `void` | `removeAgentMessageListener(AgentMessageListener l)`
    `void` | `removeNetEventListener(GenericEvent.Listener l)`
    `void` | `removeServerLogMessageListener(LogMessageEvent.Listener l)`
    `void` | `setServerShutDownHandler(ServerShutdownEvent.Listener handler)`

    - ### Methods inherited from interface java.lang.AutoCloseable

      `close`

    - ### Methods inherited from interface de.esprit.netsuite.client.net.event.NetRequestEvent.Source

      `addRequestListener, removeRequestListener`

    - ### Methods inherited from interface de.esprit.netsuite.client.net.event.NetResponseEvent.Source

      `addResponseListener, removeResponseListener`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.event.NetMessageEvent.Source

      `addNetMessageListener, removeNetMessageListener`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.event.ServerStatusEvent.Source

      `addServerStatusListener, removeServerStatusListener`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.event.BatchTaskEvent.Source

      `addBatchTaskListener, removeBatchTaskListener`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.event.RemoteRecordChangeEvent.Source

      `addRemoteRecordChangeListener, removeRemoteRecordChangeListener`

    - ### Methods inherited from interface de.esprit.netsuite.rtask.RemoteTaskEvent.Source

      `addRemoteTaskListener, removeRemoteTaskListener`

    - ### Methods inherited from interface de.esprit.netsuite.client.net.event.NetworkConnectionEvent.Source

      `addNetworkConnectionListener, removeNetworkConnectionListener`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.event.SystemEvent.Source

      `addSystemEventListener, removeSystemEventListener`

    - ### Methods inherited from interface de.esprit.netsuite.netdata.event.ABOChangeEvent.Source

      `addABOChangeListener, removeABOChangeListener`

- - ### Method Detail

    - #### getServerHost

          ServerHost getServerHost()

      Returns the `ServerHost` defined for this connection.

    - #### getServerId

          ServerId getServerId()

      Returns the `ServerId` object which is available since the first successful server connection. It provides further detail information about the server.

    - #### getSessionId

          SessionId getSessionId()

      Returns the `SessionId` if a connection is established. Null otherwise.

    - #### isConnected

          boolean isConnected()

      Tells whether the network connection is established
      See Also:
        `checkConnected()`

    - #### checkConnected

          void checkConnected()
                              throws ClientNotConnectedException

      Checks whether the client is connected and throws an Exception if not
      Throws:
        `ClientNotConnectedException`
      See Also:
        `isConnected()`

    - #### connect

          void connect()
                       throws java.lang.Exception

      Connects both the `RequestChannel` and `MessageChannel`.
      Throws:
        `java.lang.Exception`

    - #### disconnect

          boolean disconnect()

      Disconnects both the `RequestChannel` and `MessageChannel`. Returns false if the there was no connection, true otherwise.

    - #### reconnect

          void reconnect()
                         throws java.lang.Exception

      Disconnects if applicable and reconnects again. If the user was logged in a relogin is made with the last known `LoginData` and `LoginAgent`.
      Throws:
        `java.lang.Exception`

    - #### login

          User login(java.lang.String username,
                   java.lang.String password)
                     throws java.lang.Exception

      Performs a user login with the given login parameters. This is a shortcut method for `login(LoginData)`.
      Throws:
        `java.lang.Exception`

    - #### login

          User login(LoginData loginData)
                     throws java.lang.Exception

      Performs a user login with the given login parameters
      Throws:
        `java.lang.Exception`

    - #### logout

          boolean logout(boolean isFinalLogout)

      Performs a user logout. If isFinalLogout is true, no relogin will be made by a succeeding `reconnect()` call.

    - #### isLoggedIn

          boolean isLoggedIn()

      Tells whether the user is currently logged in.

    - #### getLastLoginData

          LoginData getLastLoginData()

    - #### getUser

          User getUser()

      Returns the full `User` object of the current login.

    - #### getUserId

          UserId getUserId()

      Returns the `UserId` object of the current login.

    - #### getClientConnectionInfo

          java.lang.String getClientConnectionInfo()

      Returns an info string about the current client side connection.

    - #### getServerConnectionInfo

          java.lang.String getServerConnectionInfo()

      Returns an info string about the current server side connection.

    - #### getConnectedSinceTs

          java.sql.Timestamp getConnectedSinceTs()

      Returns the timestamp since the connection was established.

    - #### addServerLogMessageListener

          void addServerLogMessageListener(LogMessageEvent.Listener l)

    - #### removeServerLogMessageListener

          void removeServerLogMessageListener(LogMessageEvent.Listener l)

    - #### addNetEventListener

          void addNetEventListener(GenericEvent.Listener l)

    - #### removeNetEventListener

          void removeNetEventListener(GenericEvent.Listener l)

    - #### addAgentMessageListener

          void addAgentMessageListener(AgentMessageListener l)

    - #### removeAgentMessageListener

          void removeAgentMessageListener(AgentMessageListener l)

    - #### setServerShutDownHandler

          void setServerShutDownHandler(ServerShutdownEvent.Listener handler)

Copyright © 2014 EsprIT-Systems. All Rights Reserved.