Package org.aktin.broker.auth
Class Principal
java.lang.Object
org.aktin.broker.auth.Principal
- All Implemented Interfaces:
Principal,javax.ws.rs.core.SecurityContext
-
Field Summary
Fields inherited from interface javax.ws.rs.core.SecurityContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRetrieve the full client DN stringlongGet the timestamp for the last known contact to the principal.getName()Retrieve the user nameintGet the unique node client id.intvoidbooleanisAdmin()booleanisNode()Determine whether the principal is a client node.booleanisSecure()booleanisUserInRole(String role)This method is not used right now.toString()voidUpdate the last contact / last access timestamp for this user
-
Constructor Details
-
Principal
Constructor for node principal.- Parameters:
nodeId- unique node client idinfo- authentication information
-
-
Method Details
-
isNode
public boolean isNode()Determine whether the principal is a client node. For client nodes,getNodeId()will be defined.- Returns:
trueif the principal is a node.
-
getClientDN
Retrieve the full client DN string- Returns:
- distinguished name
-
getName
Retrieve the user name -
getNodeId
Get the unique node client id. Will throwUnsupportedOperationExceptionif the principal is not a node- Returns:
- client id
- Throws:
UnsupportedOperationException- if the principal is not a node
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfacejavax.ws.rs.core.SecurityContext
-
isUserInRole
This method is not used right now.- Specified by:
isUserInRolein interfacejavax.ws.rs.core.SecurityContext
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfacejavax.ws.rs.core.SecurityContext
-
getAuthenticationScheme
- Specified by:
getAuthenticationSchemein interfacejavax.ws.rs.core.SecurityContext
-
isAdmin
public boolean isAdmin() -
updateLastAccessed
public void updateLastAccessed()Update the last contact / last access timestamp for this user -
getLastAccessed
public long getLastAccessed()Get the timestamp for the last known contact to the principal.- Returns:
- epoch millis, e.g. similar to what is returned
System.currentTimeMillis()
-
incrementWebsocketCount
public void incrementWebsocketCount() -
decrementWebsocketCount
public void decrementWebsocketCount() -
getWebsocketCount
public int getWebsocketCount() -
toString
-