Interface OrganizationBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OrganizationAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Organizations 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
Organization , an OrganizationForm is requested using
getOrganizationFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the
returned OrganizationForms 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 OrganizationForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each OrganizationForm
corresponds to an attempted transaction.
The OrganizationForms returned from
getOrganizationFormsForCreate() may be linked to the originating request
through the peer Ids of the OrganizationForm . In the case
where there may be duplicates, any OrganizationForm of the same
peer Ids may be used for a create operation.
Once a batch of OrganizationForms are submitted for create, a
CreateResponse is returned for each OrganizationForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createOrganizations() ,
errors specific to an individual OrganizationForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating OrganizationForm through the
OrganizationForm Id .
For updates, OrganizationForms are requested to the
Organization Id that is to be updated using
getOrganizationFormsForUpdate() where the reference Id in the
OrganizationForm may be used to link the request. Similarly, the
OrganizationForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
OrganizationForm can only be used once for a successful update and cannot
be reused.
Once a batch of OrganizationForms are submitted for update, an
UpdateResponse is returned for each OrganizationForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateOrganizations() ,
errors specific to an individual OrganizationForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating OrganizationForm through the
OrganizationForm Id .
The delete operations delete Organizations in bulk. To unmap
an Organization from the current Realm , the
OrganizationRealmAssignmentSession should be used. These delete
operations attempt to remove the Organization itself thus removing
it from all known Realm catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasOrganizations(AliasRequestList aliasRequests) Adds anIdto anOrganizationfor the purpose of creating compatibility.createOrganizations(OrganizationBatchFormList organizationForms) Creates a new set ofOrganizations.Deletes allOrganizationsin thisRealm.Deletes organizations expired before the given date.deleteOrganizations(IdList organizationIds) Deletes organizations for the givenIds.deleteOrganizationsForResource(Id resourceId) Deletes all organizations for the given resource.getOrganizationFormsForCreate(long number, Type[] organizationRecordTypes) Gets the organization forms for creating a bunch of new organizations.getOrganizationFormsForUpdate(IdList organizationIds) Gets the organization forms for updating an existing set of organizations.updateOrganizations(OrganizationBatchFormList organizationForms) Updates existing organizations.Methods inherited from interface OrganizationAdminSession
aliasOrganization, canCreateOrganizations, canCreateOrganizationWithRecordTypes, canDeleteOrganizations, canManageOrganizationAliases, canUpdateOrganizations, createOrganization, deleteOrganization, getOrganizationFormForCreate, getOrganizationFormForUpdate, getRealm, getRealmId, updateOrganizationModifier and TypeMethodDescriptionvoidaliasOrganization(Id organizationId, Id aliasId) Adds anIdto anOrganizationfor the purpose of creating compatibility.booleanTests if this user can create organizations.booleancanCreateOrganizationWithRecordTypes(Type[] organizationRecordTypes) Tests if this user can create a singleOrganizationusing the desired record types.booleanTests if this user can delete organizations.booleanTests if this user can manageIdaliases forOrganizations.booleanTests if this user can update organizations.createOrganization(OrganizationForm organizationForm) Creates a newOrganization.voiddeleteOrganization(Id organizationId) Deletes anOrganization.getOrganizationFormForCreate(Type[] organizationRecordTypes) Gets the organization form for creating new organizations.getOrganizationFormForUpdate(Id organizationId) Gets the organization form for updating an existing organization.getRealm()Gets theRealmassociated with this session.Gets theRealmIdassociated with this session.voidupdateOrganization(OrganizationForm organizationForm) Updates an existing organization.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
-
getOrganizationFormsForCreate
OrganizationBatchFormList getOrganizationFormsForCreate(long number, Type[] organizationRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the organization forms for creating a bunch of new organizations.- Parameters:
number- the number of forms to retrieveorganizationRecordTypes- array of organization record types to be included in each create operation or an empty list if none- Returns:
- the organization forms
- Throws:
NullArgumentException-organizationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createOrganizations
CreateResponseList createOrganizations(OrganizationBatchFormList organizationForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofOrganizations. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
organizationForms- the organization forms- Returns:
- the create responses
- Throws:
NullArgumentException-organizationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOrganizationFormsForUpdate
OrganizationBatchFormList getOrganizationFormsForUpdate(IdList organizationIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the organization forms for updating an existing set of organizations. A new organization form should be requested for each update transaction.- Parameters:
organizationIds- theIdsof theOrganization- Returns:
- the organization form
- Throws:
NotFoundException- anorganizationIdis not foundNullArgumentException-organizationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateOrganizations
UpdateResponseList updateOrganizations(OrganizationBatchFormList organizationForms) throws OperationFailedException, PermissionDeniedException Updates existing organizations. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
organizationForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-organizationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllOrganizations
DeleteResponseList deleteAllOrganizations() throws OperationFailedException, PermissionDeniedExceptionDeletes allOrganizationsin thisRealm.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOrganizations
DeleteResponseList deleteOrganizations(IdList organizationIds) throws OperationFailedException, PermissionDeniedException Deletes organizations for the givenIds.- Parameters:
organizationIds- theIdsof the organizations to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-organizationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOrganizationsForResource
DeleteResponseList deleteOrganizationsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes all organizations for the given resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveOrganizationsByDate
DeleteResponseList deleteIneffectiveOrganizationsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes organizations expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasOrganizations
AliasResponseList aliasOrganizations(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anOrganizationfor the purpose of creating compatibility. The primaryIdof theOrganizationis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another organization, it is reassigned to the given organizationId.- 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.
-