public interface RelationshipBatchAdminSession extends RelationshipAdminSession
This session creates, updates, and deletes Relationships
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 a
Relationship, a RelationshipForm is requested using
getRelationshipFormsForCreate() specifying the desired
relationship peers and record Types or none if no record
Types are needed. Each of the returned
RelationshipForms 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 a RelationshipForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each RelationshipForm
corresponds to an attempted transaction.
The RelationshipForms returned from
getRelationshipFormsForCreate() may be linked to the originating
request through the peer Ids of the
RelationshipForm. In the case where there may be duplicates, any
RelationshipForm of the same peer Ids may be
used for a create operation.
Once a batch of RelationshipForms are submitted for
create, a CreateResponse is returned for each
RelationshipForm, although the ordering is not defined. Only
errors that pertain to the entire create operation are returned from
createRelationships(), errors specific to an individual
RelationshipForm are indicated in the corresponding
CreateResponse. CreateResponses may be linked to
the originating RelationshipForm through the
RelationshipForm Id .
For updates, RelationshipForms are requested to the
Relationship Id that is to be updated using
getRelationshipFormsForUpdate() where the reference
Id in the RelationshipForm may be used to link the
request. Similarly, the RelationshipForm has metadata about
the data that can be updated and it can perform validation before
submitting the update. The RelationshipForm can only be
used once for a successful update and cannot be reused.
Once a batch of RelationshipForms are submitted for
update, an UpdateResponse is returned for each
RelationshipForm, although the ordering is not defined. Only
errors that pertain to the entire update operation are returned from
updateRelationships(), errors specific to an individual
RelationshipForm are indicated in the corresponding
UpdateResponse. UpdateResponses may be linked to
the originating RelationshipForm through the
RelationshipForm Id.
The delete operations delete Relationships in bulk. To
unmap a Relationship from the current Family,
the RelationshipFamilyAssignmentSession should be
used. These delete operations attempt to remove the Relationship
itself thus removing it from all known Family
catalogs. Bulk delete operations return the results in
DeleteResponses.
| Modifier and Type | Method and Description |
|---|---|
AliasResponseList |
aliasRelationships(AliasRequestList aliasRequests)
Adds an
Id to a Relationship for the
purpose of creating compatibility. |
CreateResponseList |
createRelationships(RelationshipBatchFormList relationshipForms)
Creates a new set of
Relationships. |
DeleteResponseList |
deleteAllRelationships()
Deletes all
Relationships in this Family
. |
DeleteResponseList |
deleteIneffectiveRelationshipsByDate(DateTime date)
Deletes relationships ineffective before the given date.
|
DeleteResponseList |
deleteRelationships(IdList relationshipIds)
Deletes relationships for the given
Ids. |
DeleteResponseList |
deleteRelationshipsForDestinationId(Id destinationId)
Deletes relationships for the given destination node.
|
DeleteResponseList |
deleteRelationshipsForSourceId(Id sourceId)
Deletes relationships for the given source.
|
RelationshipBatchFormList |
getRelationshipFormsForCreate(RelationshipPeerList peers,
Type[] relationshipRecordTypes)
Gets the relationship forms for creating a bunch of new relationships.
|
RelationshipBatchFormList |
getRelationshipFormsForUpdate(IdList relationshipIds)
Gets the relationship forms for updating an existing set of
relationships.
|
UpdateResponseList |
updateRelationships(RelationshipBatchFormList relationshipForms)
Updates existing relationships.
|
aliasRelationship, canCreateRelationships, canCreateRelationshipWithRecordTypes, canDeleteRelationships, canManageRelationshipAliases, canUpdateRelationships, createRelationship, deleteRelationship, getFamily, getFamilyId, getRelationshipFormForCreate, getRelationshipFormForUpdate, updateRelationshipgetAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseRelationshipBatchFormList getRelationshipFormsForCreate(RelationshipPeerList peers, Type[] relationshipRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
peers - a list of relationship peersrelationshipRecordTypes - array of relationship record types to
be included in each create operation or an empty list if noneNotFoundException - a node is not foundNullArgumentException - peers or
relationshipRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to request forms with
given record typesmandatory - This method must be implemented. CreateResponseList createRelationships(RelationshipBatchFormList relationshipForms) throws OperationFailedException, PermissionDeniedException
Relationships. This method returns
an error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse .relationshipForms - the relationship formsNullArgumentException - relationshipForms
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. RelationshipBatchFormList getRelationshipFormsForUpdate(IdList relationshipIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
relationshipIds - the Ids of the
Relationship NotFoundException - a relationshipId is
not foundNullArgumentException - relationshipIds
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. UpdateResponseList updateRelationships(RelationshipBatchFormList relationshipForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse .relationshipForms - the form containing the elements to be
updatedNullArgumentException - relationshipForms
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteAllRelationships() throws OperationFailedException, PermissionDeniedException
Relationships in this Family
.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteRelationships(IdList relationshipIds) throws OperationFailedException, PermissionDeniedException
Ids. relationshipIds - the Ids of the relationships to
deleteNullArgumentException - relationshipIds
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteRelationshipsForSourceId(Id sourceId) throws OperationFailedException, PermissionDeniedException
sourceId - the Id of a peerNullArgumentException - sourceId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteRelationshipsForDestinationId(Id destinationId) throws OperationFailedException, PermissionDeniedException
destinationId - the Id of a peerNullArgumentException - destinationId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteIneffectiveRelationshipsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date - a dateNullArgumentException - date is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AliasResponseList aliasRelationships(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id to a Relationship for the
purpose of creating compatibility. The primary Id of
the Relationship is determined by the provider. The new
Id is an alias to the primary Id. If the
alias is a pointer to another relationship, it is reassigned to the
given relationship Id. aliasRequests - the alias requestsNullArgumentException - aliasRequests is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.