Interface OntologyBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OntologyAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Ontologies in bulk.
The data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create an
Ontology , an OntologyForm is requested using
getOntologyFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
OntologyForms will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once an OntologyForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each OntologyForm corresponds to an attempted
transaction.
The OntologyForms returned from
getOntologyFormsForCreate() may be linked to the originating request
through the peer Ids of the OntologyForm . In the case
where there may be duplicates, any OntologyForm of the same peer
Ids may be used for a create operation.
Once a batch of OntologyForms are submitted for create, a
CreateResponse is returned for each OntologyForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createOntologies() ,
errors specific to an individual OntologyForm are indicated in the
corresponding CreateResponse . CreateResponses may be
linked to the originating OntologyForm through the
OntologyForm Id .
For updates, OntologyForms are requested to the
Ontology Id that is to be updated using
getOntologyFormsForUpdate() where the reference Id in the
OntologyForm may be used to link the request. Similarly, the
OntologyForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The OntologyForm
can only be used once for a successful update and cannot be reused.
Once a batch of OntologyForms are submitted for update, an
UpdateResponse is returned for each OntologyForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateOntologies() ,
errors specific to an individual OntologyForm are indicated in the
corresponding UpdateResponse . UpdateResponses may be
linked to the originating OntologyForm through the
OntologyForm Id .
The delete operations delete Ontologies in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasOntologies(AliasRequestList aliasRequests) Adds anIdto aOntologyfor the purpose of creating compatibility.createOntologies(OntologyBatchFormList ontologyForms) Creates a new set ofOntologies.Deletes allOntologies.deleteOntologies(IdList ontologyIds) Deletes ontologies for the givenIds.getOntologyFormsForCreate(long number, Type[] ontologyRecordTypes) Gets the ontology forms for creating a bunch of new ontologies.getOntologyFormsForUpdate(IdList ontologyIds) Gets the ontology forms for updating an existing set of ontologies.updateOntologies(OntologyBatchFormList ontologyForms) Updates existing ontologies.Methods inherited from interface OntologyAdminSession
aliasOntology, canCreateOntologies, canCreateOntologyWithRecordTypes, canDeleteOntologies, canManageOntologyAliases, canUpdateOntologies, createOntology, deleteOntology, getOntologyFormForCreate, getOntologyFormForUpdate, updateOntologyModifier and TypeMethodDescriptionvoidaliasOntology(Id ontologyId, Id aliasId) Adds anIdto anOntologyfor the purpose of creating compatibility.booleanTests if this user can createOntologies.booleancanCreateOntologyWithRecordTypes(Type[] ontologyRecordTypes) Tests if this user can create a singleOntologyusing the desired record types.booleanTests if this user can delete ontologies.booleanTests if this user can manageIdaliases for ontologies.booleanTests if this user can updateOntologies.createOntology(OntologyForm ontologyForm) Creates a newOntology.voiddeleteOntology(Id ontologyId) Deletes anOntology.getOntologyFormForCreate(Type[] ontologyRecordTypes) Gets the ontology form for creating new ontologies.getOntologyFormForUpdate(Id ontologyId) Gets the ontology form for updating an existing ontology.voidupdateOntology(OntologyForm ontologyForm) Updates an existing ontology.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getOntologyFormsForCreate
OntologyBatchFormList getOntologyFormsForCreate(long number, Type[] ontologyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the ontology forms for creating a bunch of new ontologies.- Parameters:
number- the number of forms to retrieveontologyRecordTypes- array of ontology record types to be included in each create operation or an empty list if none- Returns:
- the ontology forms
- Throws:
NullArgumentException-ontologyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createOntologies
CreateResponseList createOntologies(OntologyBatchFormList ontologyForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofOntologies. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
ontologyForms- the ontology forms- Returns:
- the create responses
- Throws:
NullArgumentException-ontologyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOntologyFormsForUpdate
OntologyBatchFormList getOntologyFormsForUpdate(IdList ontologyIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the ontology forms for updating an existing set of ontologies. A new ontology form should be requested for each update transaction.- Parameters:
ontologyIds- theIdsof theOntology- Returns:
- the ontology form
- Throws:
NotFoundException- anontologyIdis not foundNullArgumentException-ontologyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateOntologies
UpdateResponseList updateOntologies(OntologyBatchFormList ontologyForms) throws OperationFailedException, PermissionDeniedException Updates existing ontologies. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
ontologyForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-ontologyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllOntologies
Deletes allOntologies.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOntologies
DeleteResponseList deleteOntologies(IdList ontologyIds) throws OperationFailedException, PermissionDeniedException Deletes ontologies for the givenIds.- Parameters:
ontologyIds- theIdsof the ontologies to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-ontologyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasOntologies
AliasResponseList aliasOntologies(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aOntologyfor the purpose of creating compatibility. The primaryIdof theOntologyis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another ontology, it is reassigned to the given ontologyId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-