Package be.personify.iam.api
Class APIBase<T>
- java.lang.Object
-
- be.personify.iam.api.APIBase<T>
-
public class APIBase<T> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHORIZATIONstatic StringERROR_MESSAGE_TEMPLATEstatic com.fasterxml.jackson.databind.ObjectMapperobjectMapperstatic StringPLUS_REPLACEMENTstatic StringQUERY_PARAM_PAGEstatic StringQUERY_PARAM_SIZEstatic StringQUERY_PARAM_SORT
-
Constructor Summary
Constructors Constructor Description APIBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.web.util.UriComponentscomposeUriComponents(long page, long size, String sort, StringBuilder url)compse the componentsvoiddelete(String href)Deletes a ${entity.name} by hreforg.springframework.http.RequestEntity<Void>getRequest(String URL)A requestStringgetToken()Returns the tokenorg.springframework.http.RequestEntity<Void>postRequest(String URL)voidprocessAssociations(org.springframework.hateoas.EntityModel<?> sourceObject, org.springframework.hateoas.EntityModel<?> savedObject)org.springframework.web.client.RestTemplaterestTemplate()org.springframework.web.client.RestTemplaterestTemplate(boolean secured)A new resttemplatevoidsetTokenStore(GenericTokenStore store)
-
-
-
Field Detail
-
ERROR_MESSAGE_TEMPLATE
public static final String ERROR_MESSAGE_TEMPLATE
- See Also:
- Constant Field Values
-
AUTHORIZATION
public static final String AUTHORIZATION
- See Also:
- Constant Field Values
-
QUERY_PARAM_PAGE
public static final String QUERY_PARAM_PAGE
- See Also:
- Constant Field Values
-
QUERY_PARAM_SIZE
public static final String QUERY_PARAM_SIZE
- See Also:
- Constant Field Values
-
QUERY_PARAM_SORT
public static final String QUERY_PARAM_SORT
- See Also:
- Constant Field Values
-
PLUS_REPLACEMENT
public static final String PLUS_REPLACEMENT
- See Also:
- Constant Field Values
-
objectMapper
public static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Detail
-
restTemplate
public org.springframework.web.client.RestTemplate restTemplate()
-
setTokenStore
public void setTokenStore(GenericTokenStore store)
-
restTemplate
public org.springframework.web.client.RestTemplate restTemplate(boolean secured)
A new resttemplate- Parameters:
secured- indicating a secured template- Returns:
- the resttemplate composed
-
getToken
public String getToken()
Returns the token- Returns:
- a string containing the token
-
getRequest
public org.springframework.http.RequestEntity<Void> getRequest(String URL)
A request- Parameters:
URL- the url for which to compose a request- Returns:
- the requestentity to be returned
-
processAssociations
public void processAssociations(org.springframework.hateoas.EntityModel<?> sourceObject, org.springframework.hateoas.EntityModel<?> savedObject)
-
delete
public void delete(String href)
Deletes a ${entity.name} by href- Parameters:
href- the href given
-
composeUriComponents
public org.springframework.web.util.UriComponents composeUriComponents(long page, long size, String sort, StringBuilder url)compse the components- Parameters:
page- the pagesize- the sizesort- the sorturl- the url- Returns:
- the uricomponents
-
-