Package com.inrupt.client.accessgrant
Class AccessCredential
- java.lang.Object
-
- com.inrupt.client.accessgrant.AccessCredential
-
- Direct Known Subclasses:
AccessDenial
,AccessGrant
,AccessRequest
public class AccessCredential extends Object
A base class for access credentials.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessCredential.CredentialData
User-managed credential data.static class
AccessCredential.CredentialMetadata
Server-managed credential data.
-
Field Summary
Fields Modifier and Type Field Description protected static String
REVOCATION_LIST_2020_STATUS
protected static String
TYPE
-
Constructor Summary
Constructors Modifier Constructor Description protected
AccessCredential(URI identifier, String credential, AccessCredential.CredentialData data, AccessCredential.CredentialMetadata metadata)
Create a base class for credential types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
getCreator()
Get the creator of this access credential.Instant
getExpiration()
Get the expiration time of the access credential.URI
getIdentifier()
Get the identifier of the access credential.Instant
getIssuedAt()
Get the issuance date for the credential.URI
getIssuer()
Get the issuer of the access credential.Set<String>
getModes()
Get the access modes of the access credential.Set<URI>
getPurposes()
Get the collection of purposes associated with the access credential.Optional<URI>
getRecipient()
Get the recipient of this access credential.Set<URI>
getResources()
Get the resources associated with the access credential.Optional<Status>
getStatus()
Get the revocation status of the access credential.Set<String>
getTypes()
Get the types of the access credential.String
serialize()
Serialize this access credential as a String.
-
-
-
Field Detail
-
TYPE
protected static final String TYPE
- See Also:
- Constant Field Values
-
REVOCATION_LIST_2020_STATUS
protected static final String REVOCATION_LIST_2020_STATUS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccessCredential
protected AccessCredential(URI identifier, String credential, AccessCredential.CredentialData data, AccessCredential.CredentialMetadata metadata)
Create a base class for credential types.- Parameters:
identifier
- the credential identifiercredential
- the full credentialdata
- items pertaining to user-defined credential datametadata
- items pertaining to server-managed credential data
-
-
Method Detail
-
getTypes
public Set<String> getTypes()
Get the types of the access credential.- Returns:
- the access credential types
-
getModes
public Set<String> getModes()
Get the access modes of the access credential.- Returns:
- the access credential types
-
getStatus
public Optional<Status> getStatus()
Get the revocation status of the access credential.- Returns:
- the revocation status, if present
-
getExpiration
public Instant getExpiration()
Get the expiration time of the access credential.- Returns:
- the expiration time
-
getIssuedAt
public Instant getIssuedAt()
Get the issuance date for the credential.- Returns:
- the issuance date
-
getIssuer
public URI getIssuer()
Get the issuer of the access credential.- Returns:
- the issuer
-
getIdentifier
public URI getIdentifier()
Get the identifier of the access credential.- Returns:
- the identifier
-
getPurposes
public Set<URI> getPurposes()
Get the collection of purposes associated with the access credential.- Returns:
- the purposes
- Implementation Note:
- as of Beta3, this method returns a set of URIs. Any non-URI purpose values encountered during access credential parsing will be discarded.
-
getResources
public Set<URI> getResources()
Get the resources associated with the access credential.- Returns:
- the associated resource identifiers
-
getCreator
public URI getCreator()
Get the creator of this access credential.- Returns:
- the creator
-
getRecipient
public Optional<URI> getRecipient()
Get the recipient of this access credential.- Returns:
- the recipient, if present
-
serialize
public String serialize()
Serialize this access credential as a String.- Returns:
- a serialized form of the credential
-
-