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 Modifier and Type Field Description static intSERVICE_UNAVAILABLEHTTP REQUEST not allowedstatic intSTATUS_AUTH_FAILEDAuthentication failure.static intSTATUS_FAILEDCommand failed.static intSTATUS_ILLEGAL_ARGUMENTstatic intSTATUS_SECURITY_CHECK_FAILEDSecurity check failed.static intSTATUS_SUCCESSCommand succeeded.
-
Constructor Summary
Constructors Constructor Description GridRestResponse()GridRestResponse(int status, @Nullable String err)Constructs failed rest response.GridRestResponse(Object obj)Constructs successful rest response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetError()ObjectgetResponse()UUIDgetSecuritySubjectId()StringgetSessionToken()intgetSuccessStatus()voidreadExternal(ObjectInput in)byte[]sessionTokenBytes()voidsessionTokenBytes(@org.jetbrains.annotations.Nullable byte[] sesTokBytes)voidsetError(String err)voidsetResponse(@Nullable Object obj)voidsetSecuritySubjectId(UUID secSubjId)voidsetSessionToken(@Nullable String sesTokStr)StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
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
-
STATUS_ILLEGAL_ARGUMENT
public static final int STATUS_ILLEGAL_ARGUMENT
- See Also:
- Constant Field Values
-
SERVICE_UNAVAILABLE
public static final int SERVICE_UNAVAILABLE
HTTP REQUEST not allowed- 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 @Nullable String err)Constructs failed rest response.- Parameters:
status- Response status.err- Error,nullif success istrue.
-
-
Method Detail
-
getSuccessStatus
public int getSuccessStatus()
- Returns:
- Success flag.
-
getResponse
public Object getResponse()
- Returns:
- Response object.
-
setResponse
public void setResponse(@Nullable @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 @org.jetbrains.annotations.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 @Nullable String sesTokStr)- Parameters:
sesTokStr- String representation of session token.
-
getSecuritySubjectId
public UUID getSecuritySubjectId()
-
setSecuritySubjectId
public void setSecuritySubjectId(UUID secSubjId)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-