omq.common.message

## Class Request

- java.lang.Object
- - omq.common.message.Request

- All Implemented Interfaces:
    java.io.Serializable

      public class Request
      extends java.lang.Object
      implements java.io.Serializable

  Serializable request information. This class is used to send the information to the server. It has information about which method is wanted to invoke, its parameters, its correlation id and if a response is needed -asynchronous method-.
  Author:
    Sergi Toda
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Request()`
    `Request(java.lang.String id, java.lang.String method, boolean async, java.lang.Object[] params)`
    `Request(java.lang.String id, java.lang.String method, boolean async, java.lang.Object[] params, boolean multi)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getId()`
    `java.lang.String` | `getMethod()`
    `java.lang.Object[]` | `getParams()`
    `int` | `getRetries()`
    `long` | `getTimeout()`
    `int` | `getWait()`
    `boolean` | `isAsync()`
    `boolean` | `isMulti()`
    `static Request` | `newAsyncRequest(java.lang.String id, java.lang.String method, java.lang.Object[] params, boolean multi)` This method creates a new asynchronous request
    `static Request` | `newSyncRequest(java.lang.String id, java.lang.String method, java.lang.Object[] params)` This method creates a new synchronous request
    `static Request` | `newSyncRequest(java.lang.String id, java.lang.String method, java.lang.Object[] params, int retries, long timeout, boolean multi, int wait)` This method creates a new synchronous request
    `void` | `setAsync(boolean async)`
    `void` | `setId(java.lang.String id)`
    `void` | `setMethod(java.lang.String method)`
    `void` | `setMulti(boolean multi)`
    `void` | `setParams(java.lang.Object[] params)`
    `void` | `setRetries(int retries)`
    `void` | `setTimeout(long timeout)`
    `void` | `setWait(int wait)`

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

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

- - ### Constructor Detail

    - #### Request

          public Request()

    - #### Request

          public Request(java.lang.String id,
                 java.lang.String method,
                 boolean async,
                 java.lang.Object[] params)

    - #### Request

          public Request(java.lang.String id,
                 java.lang.String method,
                 boolean async,
                 java.lang.Object[] params,
                 boolean multi)

  - ### Method Detail

    - #### newSyncRequest

          public static Request newSyncRequest(java.lang.String id,
                               java.lang.String method,
                               java.lang.Object[] params)

      This method creates a new synchronous request
      Parameters:
        `id` - - correlation id of this invocation
        `method` - - method name wanted to call
        `params` - - parameters of this method
      Returns:
        - new SyncRequest

    - #### newSyncRequest

          public static Request newSyncRequest(java.lang.String id,
                               java.lang.String method,
                               java.lang.Object[] params,
                               int retries,
                               long timeout,
                               boolean multi,
                               int wait)

      This method creates a new synchronous request
      Parameters:
        `id` - - correlation id of this invocation
        `method` - - method name wanted to call
        `params` - - parameters of this method
        `retries` - - How many retries will be done
        `timeout` - - Timeout for every retry
        `multi` - - If the method is multi
        `wait` - - If the method is multi how many responses will be listened
      Returns:
        - new SyncRequest

    - #### newAsyncRequest

          public static Request newAsyncRequest(java.lang.String id,
                                java.lang.String method,
                                java.lang.Object[] params,
                                boolean multi)

      This method creates a new asynchronous request
      Parameters:
        `id` - - correlation id of this invocation
        `method` - - method name wanted to call
        `params` - - parameters of this method
        `multi` - - If the method is multi
      Returns:
        new AsyncRequest

    - #### getId

          public java.lang.String getId()

    - #### setId

          public void setId(java.lang.String id)

    - #### getMethod

          public java.lang.String getMethod()

    - #### setMethod

          public void setMethod(java.lang.String method)

    - #### getParams

          public java.lang.Object[] getParams()

    - #### setParams

          public void setParams(java.lang.Object[] params)

    - #### isAsync

          public boolean isAsync()

    - #### setAsync

          public void setAsync(boolean async)

    - #### getTimeout

          public long getTimeout()

    - #### setTimeout

          public void setTimeout(long timeout)

    - #### getRetries

          public int getRetries()

    - #### setRetries

          public void setRetries(int retries)

    - #### isMulti

          public boolean isMulti()

    - #### setMulti

          public void setMulti(boolean multi)

    - #### getWait

          public int getWait()

    - #### setWait

          public void setWait(int wait)