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 Session
from(SecurityContext security)
Create a session from a security context.IRI
getAgent()
Get an agent identifier.Instant
getCreated()
Get the date when the session was created.Optional<IRI>
getDelegatedBy()
Get the user that delegated access, if one exists.IRI
getIdentifier()
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:Session
Get a session identifier.- Specified by:
getIdentifier
in interfaceSession
- Returns:
- a session identifier
-
getDelegatedBy
public Optional<IRI> getDelegatedBy()
Description copied from interface:Session
Get the user that delegated access, if one exists.- Specified by:
getDelegatedBy
in interfaceSession
- Returns:
- the user who delegated access
-
getCreated
public Instant getCreated()
Description copied from interface:Session
Get the date when the session was created.- Specified by:
getCreated
in 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
-
-