de.esprit.netsuite.netdata

## Class NetRequest

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.TransferableObject
    - - de.esprit.netsuite.netdata.NetRequest

- All Implemented Interfaces:
    DeepCloneable, Dumpable, java.io.Serializable, java.lang.Cloneable

      public class NetRequest
      extends TransferableObject

  This object is sent by the client to the server for issuing a request. A request can carry any serializable object as an argument.
  Author:
    Rainer Buesch
  See Also:
    `NetResponse`, `NetCommand`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_REQUEST_TIMEOUT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetRequest(NetCommand cmd)`
    `NetRequest(NetCommand cmd, java.lang.Object arg)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `NetResponse` | `createErrorResponse(java.lang.Exception exc)`
    `NetResponse` | `createResponse()` Creates a NetResponse object according to this NetRequest.
    `java.lang.Object` | `getArgument()` Returns the request's argument object.
    `NetCommand` | `getCommand()` Returns the request's command value.
    `java.lang.String` | `getIdentifierString()` Short identifier string used in error messages concerning this request
    `int` | `getPriority()` Returns the thread priority which is used to executed this agent
    `static long` | `getRequestCount()` Tells how many requests the client has sent already.
    `long` | `getRequestId()` Returns a client side unique request number of this request (the n-th request of this user).
    `SessionId` | `getSessionId()`
    `java.lang.String` | `getTargetServer()`
    `int` | `getTimeout()` Returns the timeout value (in seconds) of this request.
    `boolean` | `isDisconnect()`
    `boolean` | `isLogin()`
    `boolean` | `isLogout()`
    `boolean` | `isPing()`
    `boolean` | `isSystemRequest()` Note that system requests are NOT delivered to the RequestThreadPool but rather are executed directly by the calling thread without being queued.
    `void` | `setPriority(int priority)` Sets the thread priority which is used to executed this agent
    `void` | `setSessionId(SessionId ctx)`
    `void` | `setTargetServer(java.lang.String targetServer)`
    `void` | `setTimeout(int seconds)` Sets an individual timeout for this request (in seconds).
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.

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

      `clone, deepClone`

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

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

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

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

- - ### Field Detail

    - #### DEFAULT_REQUEST_TIMEOUT

          public static final int DEFAULT_REQUEST_TIMEOUT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NetRequest

          public NetRequest(NetCommand cmd)

    - #### NetRequest

          public NetRequest(NetCommand cmd,
                    java.lang.Object arg)

  - ### Method Detail

    - #### getTargetServer

          public java.lang.String getTargetServer()

    - #### setTargetServer

          public void setTargetServer(java.lang.String targetServer)

    - #### setSessionId

          public void setSessionId(SessionId ctx)

    - #### getSessionId

          public SessionId getSessionId()

    - #### getArgument

          public java.lang.Object getArgument()

      Returns the request's argument object.

    - #### getCommand

          public NetCommand getCommand()

      Returns the request's command value.

    - #### isDisconnect

          public boolean isDisconnect()

    - #### isLogout

          public boolean isLogout()

    - #### isLogin

          public boolean isLogin()

    - #### isPing

          public boolean isPing()

    - #### isSystemRequest

          public boolean isSystemRequest()

      Note that system requests are NOT delivered to the RequestThreadPool but rather are executed directly by the calling thread without being queued.

    - #### getPriority

          public int getPriority()

      Returns the thread priority which is used to executed this agent

    - #### setPriority

          public void setPriority(int priority)

      Sets the thread priority which is used to executed this agent

    - #### getRequestId

          public long getRequestId()

      Returns a client side unique request number of this request (the n-th request of this user).

    - #### getRequestCount

          public static long getRequestCount()

      Tells how many requests the client has sent already. The request counter is incremented on each creation of a NetRequest object.

    - #### setTimeout

          public void setTimeout(int seconds)

      Sets an individual timeout for this request (in seconds). A timeout value of zero causes DEFAULT_REQUEST_TIMEOUT to be set. A negative value indicates that there is no timeout constraint.

    - #### getTimeout

          public int getTimeout()

      Returns the timeout value (in seconds) of this request. Note that a value of 0 is converted to DEFAULT_REQUEST_TIMEOUT

    - #### createResponse

          public NetResponse createResponse()

      Creates a NetResponse object according to this NetRequest.

    - #### createErrorResponse

          public NetResponse createErrorResponse(java.lang.Exception exc)

    - #### getIdentifierString

          public java.lang.String getIdentifierString()

      Short identifier string used in error messages concerning this request

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.