public interface SubscriptionAdminSession extends OsidSession
This session creates, updates, and deletes Subscriptions.
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
getSubscriptionFormForCreate()
specifying the desired
relationship peers and record Types
or none if no record
Types
are needed. The returned SubscriptionForm
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
the 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.
For updates, SubscriptionForms
are requested to the
Subscription
Id
that is to be updated using
getSubscriptionFormForUpdate().
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.
The delete operations delete Subscriptions.
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.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasSubscription(Id subscriptionId,
Id aliasId)
Adds an
Id to a Subscription for the
purpose of creating compatibility. |
boolean |
canCreateSubscriptions()
Tests if this user can create hournal entries.
|
boolean |
canCreateSubscriptionWithRecordTypes(Type[] subscriptionRecordTypes)
Tests if this user can create a single
Subscription
using the desired record interface types. |
boolean |
canDeleteSubscriptions()
Tests if this user can delete subscriptions.
|
boolean |
canManageSubscriptionAliases()
Tests if this user can manage
Id aliases for
Comnents. |
boolean |
canUpdateSubscriptions()
Tests if this user can update subscriptions.
|
Subscription |
createSubscription(SubscriptionForm subscriptionForm)
Creates a new
Subscription. |
void |
deleteSubscription(Id subscriptionId)
Deletes an
Subscription. |
Publisher |
getPublisher()
Gets the
Publisher associated with this session. |
Id |
getPublisherId()
Gets the
Publisher Id associated with
this session. |
SubscriptionForm |
getSubscriptionFormForCreate(Id dispatchId,
Id resourceId,
Type[] subscriptionRecordTypes)
Gets the subscription form for creating new entries.
|
SubscriptionForm |
getSubscriptionFormForUpdate(Id subscriptionId)
Gets the subscription form for updating an existing subscription.
|
void |
updateSubscription(SubscriptionForm subscriptionForm)
Updates an existing subscription.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getPublisherId()
Publisher
Id
associated with
this session. Publisher Id
associated with this sessionmandatory
- This method must be implemented. Publisher getPublisher() throws OperationFailedException, PermissionDeniedException
Publisher
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateSubscriptions()
Subscription
will result in
a PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer create operations to
unauthorized users. false
if Subscription
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateSubscriptionWithRecordTypes(Type[] subscriptionRecordTypes)
Subscription
using the desired record interface types. While
SubscriptionManager.getSubscriptionRecordTypes()
can be used
to examine which record interfaces are supported, this method tests
which record(s) are required for creating a specific
Subscription.
Providing an empty array tests if a
Subscription
can be created with no records.subscriptionRecordTypes
- array of subscription record types true
if Subscription
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- subscriptionRecordTypes
is null
mandatory
- This method must be implemented. SubscriptionForm getSubscriptionFormForCreate(Id dispatchId, Id resourceId, Type[] subscriptionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
dispatchId
- the Id
for the dispatchresourceId
- the Id
for the resourcesubscriptionRecordTypes
- array of subscription record typesNotFoundException
- dispatchId
or
resourceId
is not foundNullArgumentException
- dispatchId, resourceId,
or subscriptionRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get from for requested
record typesmandatory
- This method must be implemented. Subscription createSubscription(SubscriptionForm subscriptionForm) throws OperationFailedException, PermissionDeniedException
Subscription.
subscriptionForm
- the form for this Subscription
Subscription
IllegalStateException
- subscriptionForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- subscriptionForm
did not originate from getSubscriptionFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateSubscriptions()
Subscription
will result in a
PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer update operations to
unauthorized users. false
if Subscription
modification is not authorized, true
otherwisemandatory
- This method must be implemented. SubscriptionForm getSubscriptionFormForUpdate(Id subscriptionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
subscriptionId
- the Id
of the
Subscription
NotFoundException
- subscriptionId
is
not foundNullArgumentException
- subscriptionId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateSubscription(SubscriptionForm subscriptionForm) throws OperationFailedException, PermissionDeniedException
subscriptionForm
- the form containing the elements to be
updatedIllegalStateException
- subscriptionForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- subscriptionId
or subscriptionForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- subscriptionForm
did not originate from getSubscriptionFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteSubscriptions()
Subscription
will result in a
PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false
if Subscription
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteSubscription(Id subscriptionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Subscription.
subscriptionId
- the Id
of the
Subscription
to removeNotFoundException
- subscriptionId
not
foundNullArgumentException
- subscriptionId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageSubscriptionAliases()
Id
aliases for
Comnents.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if Subscription
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasSubscription(Id subscriptionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Subscription
for the
purpose of creating compatibility. The primary Id
of
the Subscription
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another subscription, it is
reassigned to the given subscription Id.
subscriptionId
- the Id
of a Subscription
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- subscriptionId
not
foundNullArgumentException
- subscriptionId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.