Interface SubscriptionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, SubscriptionAdminSession
This session creates, updates, and deletes Subscriptions 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
Subscription , a SubscriptionForm is requested using
getSubscriptionFormsForCreate() specifying the desired dispatch,
subscriber, and record Types or none if no record Types
are needed. Each of the returned SubscriptionForms 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
SubscriptionForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each SubscriptionForm corresponds to an attempted transaction.
The SubscriptionForms returned from
getSubscriptionFormsForCreate() may be linked to the originating request
through the peer Ids of the SubscriptionForm . In the case
where there may be duplicates, any SubscriptionForm of the same
peer Ids may be used for a create operation.
Once a batch of SubscriptionForms are submitted for create, a
CreateResponse is returned for each SubscriptionForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createSubscriptions() ,
errors specific to an individual SubscriptionForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating SubscriptionForm through the
SubscriptionForm Id .
For updates, SubscriptionForms are requested to the
Subscription Id that is to be updated using
getSubscriptionFormsForUpdate() where the reference Id in the
SubscriptionForm may be used to link the request. Similarly, the
SubscriptionForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
SubscriptionForm can only be used once for a successful update and cannot
be reused.
Once a batch of SubscriptionForms are submitted for update, an
UpdateResponse is returned for each SubscriptionForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateSubscriptions() ,
errors specific to an individual SubscriptionForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating SubscriptionForm through the
SubscriptionForm Id .
The delete operations delete Subscriptions in bulk. To unmap a
Subscription from the current Publisher , the
SubscriptionPublisherAssignmentSession should be used. These delete
operations attempt to remove the Subscription itself thus removing
it from all known Publisher catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasSubscriptions(AliasRequestList aliasRequests) Adds anIdto aSubscriptionfor the purpose of creating compatibility.createSubscriptions(SubscriptionBatchFormList subscriptionForms) Creates a new set ofSubscriptions.Deletes allSubscriptionsin thisPublisher.Deletes all subscriptions expired before the given date.deleteSubscriptions(IdList subscriptionIds) Deletes subscriptions for the givenIds.deleteSubscriptionsForDispatch(Id dispatchId) Deletes all subscriptions for the given dispatch.deleteSubscriptionsForSubscriber(Id resourceId) Deletes all subscriptions for the given subscriber.getSubscriptionFormsForCreate(SubscriptionPeerList peers, Type[] subscriptionRecordTypes) Gets the subscription forms for creating a bunch of new subscriptions.getSubscriptionFormsForUpdate(IdList subscriptionIds) Gets the subscription forms for updating an existing set of subscriptions.updateSubscriptions(SubscriptionBatchFormList subscriptionForms) Updates existing subscriptions.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.Methods inherited from interface SubscriptionAdminSession
aliasSubscription, canCreateSubscriptions, canCreateSubscriptionWithRecordTypes, canDeleteSubscriptions, canManageSubscriptionAliases, canUpdateSubscriptions, createSubscription, deleteSubscription, getPublisher, getPublisherId, getSubscriptionFormForCreate, getSubscriptionFormForUpdate, updateSubscriptionModifier and TypeMethodDescriptionvoidaliasSubscription(Id subscriptionId, Id aliasId) Adds anIdto aSubscriptionfor the purpose of creating compatibility.booleanTests if this user can create hournal entries.booleancanCreateSubscriptionWithRecordTypes(Type[] subscriptionRecordTypes) Tests if this user can create a singleSubscriptionusing the desired record interface types.booleanTests if this user can delete subscriptions.booleanTests if this user can manageIdaliases forComnents.booleanTests if this user can update subscriptions.createSubscription(SubscriptionForm subscriptionForm) Creates a newSubscription.voiddeleteSubscription(Id subscriptionId) Deletes anSubscription.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.getSubscriptionFormForCreate(Id dispatchId, Id resourceId, Type[] subscriptionRecordTypes) Gets the subscription form for creating new entries.getSubscriptionFormForUpdate(Id subscriptionId) Gets the subscription form for updating an existing subscription.voidupdateSubscription(SubscriptionForm subscriptionForm) Updates an existing subscription.
-
Method Details
-
getSubscriptionFormsForCreate
SubscriptionBatchFormList getSubscriptionFormsForCreate(SubscriptionPeerList peers, Type[] subscriptionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the subscription forms for creating a bunch of new subscriptions. ASubscriptionFormis returned for each dispatch and subscriber pair.- Parameters:
peers- the subscription peerssubscriptionRecordTypes- array of subscription record types to be included in each create operation or an empty list if none- Returns:
- the subscription forms
- Throws:
NotFoundException-a dispatchIdorsubscriberIdis not foundNullArgumentException-peersorsubscriptionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createSubscriptions
CreateResponseList createSubscriptions(SubscriptionBatchFormList subscriptionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofSubscriptions. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
subscriptionForms- the subscription forms- Returns:
- the create responses
- Throws:
NullArgumentException-subscriptionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getSubscriptionFormsForUpdate
SubscriptionBatchFormList getSubscriptionFormsForUpdate(IdList subscriptionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the subscription forms for updating an existing set of subscriptions. A new subscription form should be requested for each update transaction.- Parameters:
subscriptionIds- theIdsof theSubscription- Returns:
- the subscription form
- Throws:
NotFoundException- asubscriptionIdis not foundNullArgumentException-subscriptionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSubscriptions
UpdateResponseList updateSubscriptions(SubscriptionBatchFormList subscriptionForms) throws OperationFailedException, PermissionDeniedException Updates existing subscriptions. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
subscriptionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-subscriptionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllSubscriptions
DeleteResponseList deleteAllSubscriptions() throws OperationFailedException, PermissionDeniedExceptionDeletes allSubscriptionsin thisPublisher.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSubscriptions
DeleteResponseList deleteSubscriptions(IdList subscriptionIds) throws OperationFailedException, PermissionDeniedException Deletes subscriptions for the givenIds.- Parameters:
subscriptionIds- theIdsof the subscriptions to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-subscriptionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSubscriptionsForDispatch
DeleteResponseList deleteSubscriptionsForDispatch(Id dispatchId) throws OperationFailedException, PermissionDeniedException Deletes all subscriptions for the given dispatch.- Parameters:
dispatchId- anIdof a dispatch- Returns:
- the delete responses
- Throws:
NullArgumentException-dispatchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteSubscriptionsForSubscriber
DeleteResponseList deleteSubscriptionsForSubscriber(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes all subscriptions for the given subscriber.- 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.
-
deleteIneffectiveSubscriptionsByDate
DeleteResponseList deleteIneffectiveSubscriptionsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes all subscriptions 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.
-
aliasSubscriptions
AliasResponseList aliasSubscriptions(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aSubscriptionfor the purpose of creating compatibility. The primaryIdof theSubscriptionis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another subscription, it is reassigned to the given subscriptionId.- 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.
-