Class RegistrationList<T>

java.lang.Object
com.janeirodigital.sai.core.utils.RegistrationList<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>
Direct Known Subclasses:
AgentRegistry.ApplicationRegistrationList, AgentRegistry.SocialAgentRegistrationList, AuthorizationRegistry.AccessAuthorizationList, DataRegistry.DataRegistrationList

public abstract class RegistrationList<T> extends Object implements Iterable<T>
Used by Registries as a base class to model their associated registrations. For example, AgentRegistry extends RegistrationList application and social agent registrations.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Custom iterator for the RegistrationList.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.jena.rdf.model.Property
     
    protected List<URI>
     
    protected org.apache.jena.rdf.model.Resource
     
    protected SaiSession
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    RegistrationList(SaiSession saiSession, org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property linkedVia)
    Construct a RegistrationList (called by sub-classes)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(URI registrationUri)
    Add a registration URI to the internal list of registration URIs, and add to the graph of the registry
    void
    addAll(List<URI> registrationUris)
    Add a list of registration URIs to the internal list, and add to the graph of the registry
    abstract T
    find(URI targetUri)
    Abstract find method implemented by sub-classes
    boolean
    Check if the registration list is empty
    boolean
    isPresent(URI checkUri)
    Check to see if the provided URI checkUri is already part of the registration list
    Return an iterator for the RegistrationList
    void
    Populate the internal list of registration URIs based on links to registrations in the graph of the registry
    void
    remove(URI registrationUri)
    Remove a registration from the internal list of registration URIs, and remove from the graph of the registry

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • registrationUris

      protected List<URI> registrationUris
    • saiSession

      protected SaiSession saiSession
    • resource

      protected org.apache.jena.rdf.model.Resource resource
    • linkedVia

      protected org.apache.jena.rdf.model.Property linkedVia
  • Constructor Details

    • RegistrationList

      protected RegistrationList(SaiSession saiSession, org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property linkedVia)
      Construct a RegistrationList (called by sub-classes)
      Parameters:
      saiSession - SaiSession to assign
      resource - Jena resource for the associated registry
      linkedVia - Jena property that links the registry to the registry set
  • Method Details

    • populate

      public void populate() throws SaiException
      Populate the internal list of registration URIs based on links to registrations in the graph of the registry
      Throws:
      SaiException
    • add

      public void add(URI registrationUri) throws SaiAlreadyExistsException
      Add a registration URI to the internal list of registration URIs, and add to the graph of the registry
      Parameters:
      registrationUri - URI of the registration to add
      Throws:
      SaiAlreadyExistsException - if the registration already exists
    • addAll

      public void addAll(List<URI> registrationUris) throws SaiAlreadyExistsException
      Add a list of registration URIs to the internal list, and add to the graph of the registry
      Parameters:
      registrationUris - List of registration URIs to add
      Throws:
      SaiAlreadyExistsException - if any of the registration URIs already exist
    • isPresent

      public boolean isPresent(URI checkUri)
      Check to see if the provided URI checkUri is already part of the registration list
      Parameters:
      checkUri - true if checkUri is already part of the list
      Returns:
    • isEmpty

      public boolean isEmpty()
      Check if the registration list is empty
      Returns:
      true if empty
    • find

      public abstract T find(URI targetUri)
      Abstract find method implemented by sub-classes
      Parameters:
      targetUri - Target URI to find with
      Returns:
      found type
    • remove

      public void remove(URI registrationUri)
      Remove a registration from the internal list of registration URIs, and remove from the graph of the registry
      Parameters:
      registrationUri - URI of the registration to remove
    • iterator

      public Iterator<T> iterator()
      Return an iterator for the RegistrationList
      Specified by:
      iterator in interface Iterable<T>
      Returns: