Class AgentRegistry
java.lang.Object
com.janeirodigital.sai.core.resources.ReadableResource
com.janeirodigital.sai.core.resources.CRUDResource
com.janeirodigital.sai.core.agents.AgentRegistry
Modifiable instantiation of an
Agent Registry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class for access and iteration ofApplicationRegistration
s.static class
Builder forAgentRegistry
instances.static class
Class for access and iteration ofSocialAgentRegistration
s. -
Field Summary
Fields inherited from class com.janeirodigital.sai.core.resources.ReadableResource
contentType, dataset, exists, httpClient, jsonLdContext, resource, saiSession, unprotected, uri
-
Constructor Summary
ConstructorsConstructorDescriptionAgentRegistry
(AgentRegistry.Builder builder) Construct anAgentRegistry
instance from the providedAgentRegistry.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(AgentRegistration registration) static AgentRegistry
get
(URI uri, SaiSession saiSession) Callget(URI, SaiSession, ContentType)
without specifying a desired content type for retrievalstatic AgentRegistry
get
(URI uri, SaiSession saiSession, com.janeirodigital.sai.httputils.ContentType contentType) Get anAgentRegistry
at the provideduri
boolean
isEmpty()
Indicate whether theAgentRegistry
has any registrationsreload()
Reload a new instance ofAgentRegistry
using the attributes of the current instancevoid
remove
(AgentRegistration registration) Remove anAgentRegistration
from theAgentRegistry
Methods inherited from class com.janeirodigital.sai.core.resources.CRUDResource
delete, update
Methods inherited from class com.janeirodigital.sai.core.resources.ReadableResource
checkReadableResponse, read
-
Constructor Details
-
AgentRegistry
Construct anAgentRegistry
instance from the providedAgentRegistry.Builder
.- Parameters:
builder
-AgentRegistry.Builder
to construct with- Throws:
SaiException
-
-
Method Details
-
get
public static AgentRegistry get(URI uri, SaiSession saiSession, com.janeirodigital.sai.httputils.ContentType contentType) throws SaiException, com.janeirodigital.sai.httputils.SaiHttpNotFoundException Get anAgentRegistry
at the provideduri
- Parameters:
uri
- URI of theAgentRegistry
to getsaiSession
-SaiSession
to assigncontentType
-ContentType
to use- Returns:
- Retrieved
AgentRegistry
- Throws:
SaiException
com.janeirodigital.sai.httputils.SaiHttpNotFoundException
-
get
public static AgentRegistry get(URI uri, SaiSession saiSession) throws com.janeirodigital.sai.httputils.SaiHttpNotFoundException, SaiException Callget(URI, SaiSession, ContentType)
without specifying a desired content type for retrieval- Parameters:
uri
- URI of theAgentRegistry
saiSession
-SaiSession
to assign- Returns:
- Throws:
com.janeirodigital.sai.httputils.SaiHttpNotFoundException
SaiException
-
reload
public AgentRegistry reload() throws com.janeirodigital.sai.httputils.SaiHttpNotFoundException, SaiExceptionReload a new instance ofAgentRegistry
using the attributes of the current instance- Returns:
- Reloaded
AgentRegistry
- Throws:
com.janeirodigital.sai.httputils.SaiHttpNotFoundException
SaiException
-
isEmpty
public boolean isEmpty()Indicate whether theAgentRegistry
has any registrations- Returns:
- true if there are not registrations
-
add
- Parameters:
registration
-AgentRegistration
to add- Throws:
SaiAlreadyExistsException
-
remove
Remove anAgentRegistration
from theAgentRegistry
- Parameters:
registration
-AgentRegistration
to remove
-