Class BTGenerateToken
java.lang.Object
overit.geocall.bl.BusinessTask<GenerateTokenEvent>
overit.geocall.basic.bl.token.task.BTGenerateToken
- All Implemented Interfaces:
Serializable,Tool
@Event(GenerateTokenEvent.class)
public class BTGenerateToken
extends BusinessTask<GenerateTokenEvent>
Task that handle the
Can raise a DAValidate exception in case the user cannot be identified, or a DAException if there is some connection problem with the database.
GenerateTokenEvent and generates a new access token or refresh the one that is contained
into the session.
Can raise a DAValidate exception in case the user cannot be identified, or a DAException if there is some connection problem with the database.
- Since:
- 9.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(GenerateTokenEvent event, PoolKit pk) Implements this method to write the specific task logic to handle the input parameter.protected overit.geocall.rs.auth.Authenticationprotected Identityidentificate(HttpServletRequest request) <T> TreadBody(HttpServletRequest httpRequest, Class<T> c) Use to map fields between json fields request and the specific Class c.
If the request isn't an 'application/json' type will be throw anDAValidateException.protected MicroSessionrefreshOrGenerate(HttpServletRequest request) Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTGenerateToken
public BTGenerateToken()
-
-
Method Details
-
body
Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<GenerateTokenEvent>- Parameters:
event- the object upon which the task will works onpk- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
refreshOrGenerate
protected MicroSession refreshOrGenerate(HttpServletRequest request) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
identificate
- Throws:
DAValidateExceptionDAException
-
getFirstValidAuthentication
protected overit.geocall.rs.auth.Authentication getFirstValidAuthentication(HttpServletRequest request) throws DAValidateException - Throws:
DAValidateException
-
readBody
public <T> T readBody(HttpServletRequest httpRequest, Class<T> c) throws DAValidateException, IOException Use to map fields between json fields request and the specific Class c.
If the request isn't an 'application/json' type will be throw anDAValidateException.- Type Parameters:
T- The returend type.- Parameters:
httpRequest- The request containing the json fields.c- The class in which you want to map the json fields.- Returns:
- The object in which the json fields were mapped.
- Throws:
DAValidateException- Raised if the apllication content type of the request isn't an 'application/json' typeIOException- Raised if it is not possible to parse the request object.
-