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.
  • Field Details

  • Constructor Details

    • AccessCredential

      protected AccessCredential(URI identifier, String credential, AccessCredential.CredentialData data, AccessCredential.CredentialMetadata metadata)
      Create a base class for credential types.
      Parameters:
      identifier - the credential identifier
      credential - the full credential
      data - items pertaining to user-defined credential data
      metadata - items pertaining to server-managed credential data
  • Method Details

    • 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