public abstract class RestHandler extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
RestHandler.AuthData
Handles encoding/decoding of agent and timestamp data
|
| Modifier and Type | Field and Description |
|---|---|
static String |
COOKIENAME |
static String |
PASSWORD |
static String |
USERNAME |
| Constructor and Description |
|---|
RestHandler() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.NewCookie |
checkAndCreateNewCookie(javax.ws.rs.core.Cookie authCookie)
This method will check if authentication is 30seconds old, if true then it will return NewCookie.
|
javax.ws.rs.core.NewCookie |
checkAndCreateNewCookie(RestHandler.AuthData authData)
This method will check if authentication is 30seconds old, if true then it will return NewCookie.
|
RestHandler.AuthData |
checkAuthCookie(javax.ws.rs.core.Cookie authCookie)
Authorisation data is decrypted from the cookie
|
javax.ws.rs.core.NewCookie |
createNewCookie(AgentPath agentPath) |
javax.ws.rs.core.NewCookie |
createNewCookie(RestHandler.AuthData authData) |
protected RestHandler.AuthData |
decryptAuthData(String authData) |
protected String |
encryptAuthData(RestHandler.AuthData auth) |
AgentProxy |
getAgent(String agentName,
javax.ws.rs.core.Cookie authCookie)
AgentProxy is resolved either from cookie or from the name.
|
AgentProxy |
getAgent(String agentName,
String authData)
AgentProxy is resolved either from authorisation data or from the name.
|
AgentPath |
getAgentPath(javax.ws.rs.core.Cookie authCookie)
AgentPath is decrypted from the cookie
|
Map<String,Object> |
getPagedResult(javax.ws.rs.core.UriInfo uri,
int start,
int batchSize,
int totalRows,
List<?> rows)
Constructs the Map containing all data describing a PagedResult.
|
List<Property> |
getPropertiesFromQParams(String search)
Converts QueryParams to Item Properties
|
protected Map<String,Object> |
makeItemDomainPathsData(ItemPath ip) |
javax.ws.rs.core.Response.ResponseBuilder |
toJSON(Object data,
javax.ws.rs.core.NewCookie cookie) |
public static final String COOKIENAME
public static final String USERNAME
public static final String PASSWORD
protected RestHandler.AuthData decryptAuthData(String authData) throws InvalidAgentPathException, IllegalBlockSizeException, BadPaddingException, InvalidDataException
authData - InvalidAgentPathExceptionIllegalBlockSizeExceptionBadPaddingExceptionInvalidDataExceptionprotected String encryptAuthData(RestHandler.AuthData auth) throws IllegalBlockSizeException, BadPaddingException
auth - IllegalBlockSizeExceptionBadPaddingExceptionpublic javax.ws.rs.core.Response.ResponseBuilder toJSON(Object data, javax.ws.rs.core.NewCookie cookie)
public javax.ws.rs.core.NewCookie checkAndCreateNewCookie(RestHandler.AuthData authData)
authData - public javax.ws.rs.core.NewCookie checkAndCreateNewCookie(javax.ws.rs.core.Cookie authCookie)
authCookie - public javax.ws.rs.core.NewCookie createNewCookie(AgentPath agentPath)
public javax.ws.rs.core.NewCookie createNewCookie(RestHandler.AuthData authData)
public AgentPath getAgentPath(javax.ws.rs.core.Cookie authCookie)
authCookie - the cookie sent by the clientpublic RestHandler.AuthData checkAuthCookie(javax.ws.rs.core.Cookie authCookie)
authCookie - the cookie sent by the clientpublic AgentProxy getAgent(String agentName, javax.ws.rs.core.Cookie authCookie) throws ObjectNotFoundException
agentName - the name of the AgentauthCookie - the cookie sent by the clientObjectNotFoundExceptionpublic AgentProxy getAgent(String agentName, String authData) throws ObjectNotFoundException
agentName - the name of the AgentauthData - authorisation data (from cookie or token)ObjectNotFoundExceptionpublic Map<String,Object> getPagedResult(javax.ws.rs.core.UriInfo uri, int start, int batchSize, int totalRows, List<?> rows)
uri - The resource URI which is used to create pervPage and nextPage URLstart - the start index of the result set to be retrievedbatchSize - the size of the result set to be retrievedtotalRows - the total number of rows in the result setrows - the actual rowspublic List<Property> getPropertiesFromQParams(String search)
search - the string to decompose in the format: name,prop:val,prop:valCopyright © 1997–2019 CRISTAL-iSE. All rights reserved.