org.apache.ignite.internal.processors.rest

## Class GridRestResponse

- java.lang.Object
- - org.apache.ignite.internal.processors.rest.GridRestResponse

All Implemented Interfaces:
  Externalizable, Serializable

Direct Known Subclasses:
  GridCacheRestResponse

    public class GridRestResponse
    extends Object
    implements Externalizable

JSON response. Getters and setters must conform to JavaBean standard.

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `STATUS_AUTH_FAILED` Authentication failure.
`static int` `STATUS_FAILED` Command failed.
`static int` `STATUS_SECURITY_CHECK_FAILED` Security check failed.
`static int` `STATUS_SUCCESS` Command succeeded.

### Constructor Summary

Constructors
Constructor and Description
`GridRestResponse()`
`GridRestResponse(int status, String err)` Constructs failed rest response.
`GridRestResponse(Object obj)` Constructs successful rest response.

### Method Summary

Methods
`String` `getError()`
`Object` `getResponse()`
`String` `getSessionToken()`
`int` `getSuccessStatus()`
`void` `readExternal(ObjectInput in)`
`byte[]` `sessionTokenBytes()`
`void` `sessionTokenBytes(byte[] sesTokBytes)`
`void` `setError(String err)`
`void` `setResponse(Object obj)`
`void` `setSessionToken(String sesTokStr)`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

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

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

### Field Detail

#### STATUS_SUCCESS

    public static final int STATUS_SUCCESS

Command succeeded.

See Also:
  Constant Field Values

#### STATUS_FAILED

    public static final int STATUS_FAILED

Command failed.

See Also:
  Constant Field Values

#### STATUS_AUTH_FAILED

    public static final int STATUS_AUTH_FAILED

Authentication failure.

See Also:
  Constant Field Values

#### STATUS_SECURITY_CHECK_FAILED

    public static final int STATUS_SECURITY_CHECK_FAILED

Security check failed.

See Also:
  Constant Field Values

### Constructor Detail

#### GridRestResponse

    public GridRestResponse()

#### GridRestResponse

    public GridRestResponse(Object obj)

Constructs successful rest response.

Parameters:
  `obj` - Response object.

#### GridRestResponse

    public GridRestResponse(int status,
                    @Nullable
                    String err)

Constructs failed rest response.

Parameters:
  `status` - Response status.
  `err` - Error, `null` if success is `true`.

### Method Detail

#### getSuccessStatus

    public int getSuccessStatus()

Returns:
  Success flag.

#### getResponse

    public Object getResponse()

Returns:
  Response object.

#### setResponse

    public void setResponse(@Nullable
                   Object obj)

Parameters:
  `obj` - Response object.

#### getError

    public String getError()

Returns:
  Error.

#### setError

    public void setError(String err)

Parameters:
  `err` - Error.

#### sessionTokenBytes

    public byte[] sessionTokenBytes()

Returns:
  Session token for remote client.

#### sessionTokenBytes

    public void sessionTokenBytes(@Nullable
                         byte[] sesTokBytes)

Parameters:
  `sesTokBytes` - Session token for remote client.

#### getSessionToken

    public String getSessionToken()

Returns:
  String representation of session token.

#### setSessionToken

    public void setSessionToken(@Nullable
                       String sesTokStr)

Parameters:
  `sesTokStr` - String representation of session token.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016