Package org.trellisldp.common
Class HttpSession
- java.lang.Object
-
- org.trellisldp.common.HttpSession
-
-
Constructor Summary
Constructors Constructor Description HttpSession()Create an HTTP-based session.HttpSession(IRI agent)Create an HTTP-based session.HttpSession(IRI agent, IRI delegatedBy)Create an HTTP-based session.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Sessionfrom(SecurityContext security)Create a session from a security context.IRIgetAgent()Get an agent identifier.InstantgetCreated()Get the date when the session was created.Optional<IRI>getDelegatedBy()Get the user that delegated access, if one exists.IRIgetIdentifier()Get a session identifier.
-
-
-
Constructor Detail
-
HttpSession
public HttpSession(IRI agent, IRI delegatedBy)
Create an HTTP-based session.- Parameters:
agent- the agentdelegatedBy- the delegatedBy value
-
HttpSession
public HttpSession(IRI agent)
Create an HTTP-based session.- Parameters:
agent- the agent
-
HttpSession
public HttpSession()
Create an HTTP-based session.
-
-
Method Detail
-
getIdentifier
public IRI getIdentifier()
Description copied from interface:SessionGet a session identifier.- Specified by:
getIdentifierin interfaceSession- Returns:
- a session identifier
-
getDelegatedBy
public Optional<IRI> getDelegatedBy()
Description copied from interface:SessionGet the user that delegated access, if one exists.- Specified by:
getDelegatedByin interfaceSession- Returns:
- the user who delegated access
-
getCreated
public Instant getCreated()
Description copied from interface:SessionGet the date when the session was created.- Specified by:
getCreatedin interfaceSession- Returns:
- the creation date
-
from
public static Session from(SecurityContext security)
Create a session from a security context.- Parameters:
security- the security context- Returns:
- the session
-
-