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
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.jena.rdf.model.Property
protected org.apache.jena.rdf.model.Resource
protected SaiSession
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RegistrationList
(SaiSession saiSession, org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Property linkedVia) Construct aRegistrationList
(called by sub-classes) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a registration URI to the internal list of registration URIs, and add to the graph of the registryvoid
Add a list of registration URIs to the internal list, and add to the graph of the registryabstract T
Abstract find method implemented by sub-classesboolean
isEmpty()
Check if the registration list is emptyboolean
Check to see if the provided URIcheckUri
is already part of the registration listiterator()
Return an iterator for theRegistrationList
void
populate()
Populate the internal list of registration URIs based on links to registrations in the graph of the registryvoid
Remove a registration from the internal list of registration URIs, and remove from the graph of the registryMethods 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
-
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 aRegistrationList
(called by sub-classes)- Parameters:
saiSession
-SaiSession
to assignresource
- Jena resource for the associated registrylinkedVia
- Jena property that links the registry to the registry set
-
-
Method Details
-
populate
Populate the internal list of registration URIs based on links to registrations in the graph of the registry- Throws:
SaiException
-
add
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
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
Check to see if the provided URIcheckUri
is already part of the registration list- Parameters:
checkUri
- true ifcheckUri
is already part of the list- Returns:
-
isEmpty
public boolean isEmpty()Check if the registration list is empty- Returns:
- true if empty
-
find
Abstract find method implemented by sub-classes- Parameters:
targetUri
- Target URI to find with- Returns:
- found type
-
remove
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
Return an iterator for theRegistrationList
-