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 classClass for access and iteration ofApplicationRegistrations.static classBuilder forAgentRegistryinstances.static classClass for access and iteration ofSocialAgentRegistrations. -
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 anAgentRegistryinstance from the providedAgentRegistry.Builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AgentRegistration registration) static AgentRegistryget(URI uri, SaiSession saiSession) Callget(URI, SaiSession, ContentType)without specifying a desired content type for retrievalstatic AgentRegistryget(URI uri, SaiSession saiSession, com.janeirodigital.sai.httputils.ContentType contentType) Get anAgentRegistryat the provideduribooleanisEmpty()Indicate whether theAgentRegistryhas any registrationsreload()Reload a new instance ofAgentRegistryusing the attributes of the current instancevoidremove(AgentRegistration registration) Remove anAgentRegistrationfrom theAgentRegistryMethods inherited from class com.janeirodigital.sai.core.resources.CRUDResource
delete, updateMethods inherited from class com.janeirodigital.sai.core.resources.ReadableResource
checkReadableResponse, read
-
Constructor Details
-
AgentRegistry
Construct anAgentRegistryinstance from the providedAgentRegistry.Builder.- Parameters:
builder-AgentRegistry.Builderto 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 anAgentRegistryat the provideduri- Parameters:
uri- URI of theAgentRegistryto getsaiSession-SaiSessionto assigncontentType-ContentTypeto use- Returns:
- Retrieved
AgentRegistry - Throws:
SaiExceptioncom.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 theAgentRegistrysaiSession-SaiSessionto assign- Returns:
- Throws:
com.janeirodigital.sai.httputils.SaiHttpNotFoundExceptionSaiException
-
reload
public AgentRegistry reload() throws com.janeirodigital.sai.httputils.SaiHttpNotFoundException, SaiExceptionReload a new instance ofAgentRegistryusing the attributes of the current instance- Returns:
- Reloaded
AgentRegistry - Throws:
com.janeirodigital.sai.httputils.SaiHttpNotFoundExceptionSaiException
-
isEmpty
public boolean isEmpty()Indicate whether theAgentRegistryhas any registrations- Returns:
- true if there are not registrations
-
add
- Parameters:
registration-AgentRegistrationto add- Throws:
SaiAlreadyExistsException
-
remove
Remove anAgentRegistrationfrom theAgentRegistry- Parameters:
registration-AgentRegistrationto remove
-