Class UserFacade
java.lang.Object
org.eclipse.dirigible.api.v3.security.UserFacade
- All Implemented Interfaces:
IScriptingFacade
public class UserFacade extends Object implements IScriptingFacade
The Class UserFacade.
-
Constructor Summary
Constructors Constructor Description UserFacade() -
Method Summary
Modifier and Type Method Description static StringgetAuthType()Gets the auth type.static StringgetInvocationCount()Gets the invocation count.static StringgetLanguage()The accept-language attribute returns multiple values.static StringgetName()Gets the user name.static StringgetName(javax.servlet.http.HttpServletRequest request)Gets the user name by a given request as parameter.static StringgetName(javax.websocket.Session session)Gets the user name by a given request as parameter.static StringgetSecurityToken()The Authorization header returns the type + token.static IntegergetTimeout()Gets the timeout.static booleanisInRole(String role)Checks if the user is in role.static voidsetName(String userName)Sets the user name.
-
Constructor Details
-
UserFacade
public UserFacade()
-
-
Method Details
-
getName
Gets the user name.- Returns:
- the user name
-
isInRole
Checks if the user is in role.- Parameters:
role- the role- Returns:
- true, if the user is in role
-
setName
Sets the user name.- Parameters:
userName- the user name- Throws:
ContextException- in case of not initialized ThreadContext
-
getName
Gets the user name by a given request as parameter.- Parameters:
request- the request- Returns:
- the user name
-
getName
Gets the user name by a given request as parameter.- Parameters:
session- the session- Returns:
- the user name
-
getTimeout
Gets the timeout.- Returns:
- the timeout
-
getAuthType
Gets the auth type.- Returns:
- the auth type
-
getSecurityToken
The Authorization header returns the type + token. Substring from the empty space to only get the token.- Returns:
- the security token
-
getInvocationCount
Gets the invocation count.- Returns:
- the invocation count
-
getLanguage
The accept-language attribute returns multiple values. Eg. en-GB,en-US;q=0.9,en;q=0.8 Substring until the semicolon to get the IETF (BCP 47) format.- Returns:
- the language
-