OSID Logo
OSID Specifications
subscription batch package
Version 3.1.0
Interfaceosid.subscription.batch.SubscriptionBatchAdminSession
Implementsosid.subscription.SubscriptionAdminSession
Used Byosid.subscription.batch.SubscriptionBatchManager
osid.subscription.batch.SubscriptionBatchProxyManager
Description

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.

MethodgetSubscriptionFormsForCreate
Description

Gets the subscription forms for creating a bunch of new subscriptions. A SubscriptionForm is returned for each dispatch and subscriber pair.

Parametersosid.subscription.batch.SubscriptionPeerListpeers the subscription peers
osid.type.Type[]subscriptionRecordTypes array of subscription record types to be included in each create operation or an empty list if none
Returnosid.subscription.batch.SubscriptionBatchFormList the subscription forms
ErrorsNOT_FOUND a dispatchId or subscriberId is not found
NULL_ARGUMENT peers or subscriptionRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to request forms with given record types
Compliancemandatory This method must be implemented.
MethodcreateSubscriptions
Description

Creates a new set of Subscriptions. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in the BatchCreateResponse.

Parametersosid.subscription.batch.SubscriptionBatchFormListsubscriptionForms the subscription forms
Returnosid.transaction.batch.CreateResponseList the create responses
ErrorsNULL_ARGUMENT subscriptionForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetSubscriptionFormsForUpdate
Description

Gets the subscription forms for updating an existing set of subscriptions. A new subscription form should be requested for each update transaction.

Parametersosid.id.IdListsubscriptionIds the Ids of the Subscription
Returnosid.subscription.batch.SubscriptionBatchFormList the subscription form
ErrorsNOT_FOUND a subscriptionId is not found
NULL_ARGUMENT subscriptionIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateSubscriptions
Description

Updates existing subscriptions. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in the BatchCreateResponse.

Parametersosid.subscription.batch.SubscriptionBatchFormListsubscriptionForms the form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseList the update responses
ErrorsNULL_ARGUMENT subscriptionForms is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteAllSubscriptions
Description

Deletes all Subscriptions in this Publisher.

Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteSubscriptions
Description

Deletes subscriptions for the given Ids.

Parametersosid.id.IdListsubscriptionIds the Ids of the subscriptions to delete
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT subscriptionIds is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteSubscriptionsForDispatch
Description

Deletes all subscriptions for the given dispatch.

Parametersosid.id.IddispatchId an Id of a dispatch
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT dispatchId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteSubscriptionsForSubscriber
Description

Deletes all subscriptions for the given subscriber.

Parametersosid.id.IdresourceId an Id of a resource
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT resourceId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteIneffectiveSubscriptionsByDate
Description

Deletes all subscriptions expired before the given date.

Parametersosid.calendaring.DateTimedate a date
Returnosid.transaction.batch.DeleteResponseList the delete responses
ErrorsNULL_ARGUMENT date is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodaliasSubscriptions
Description

Adds an Id to a Subscription for the purpose of creating compatibility. The primary Id of the Subscription is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another subscription, it is reassigned to the given subscription Id.

Parametersosid.transaction.batch.AliasRequestListaliasRequests the alias requests
Returnosid.transaction.batch.AliasResponseList the alias responses
ErrorsNULL_ARGUMENT aliasRequests is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.