public interface MySubscriptionAdminSession extends OsidSession
This session creates and removes subscriptions foe the authenticated
Agent.
The data for create and update is provided by the
consumer via the form object.
Modifier and Type | Method and Description |
---|---|
boolean |
canSubscribe()
Tests if this user can create hournal entries.
|
boolean |
canSubscribeWithRecordTypes(Type[] subscriptionRecordTypes)
Tests if this user can create a single
Subscription
using the desired record types. |
boolean |
canUnsubscribe()
Tests if this user can delete their own subscriptions.
|
boolean |
canUpdateMySubscriptions()
Tests if this user can update subscriptions.
|
Publisher |
getPublisher()
Gets the
Publisher associated with this session. |
Id |
getPublisherId()
Gets the
Publisher Id associated with
this session. |
SubscriptionForm |
getSubscriptionFormForCreate(Id dispatchId,
Type[] subscriptionRecordTypes)
Gets the subscription form for creating new entries.
|
SubscriptionForm |
getSubscriptionFormForUpdate(Id subscriptionId)
Gets the subscription form for updating an existing subscription.
|
Subscription |
subscribe(SubscriptionForm subscriptionForm)
Creates a new
Subscription. |
void |
unsubscribe(Id subscriptionId)
Deletes an
Subscription. |
void |
updateMySubscription(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 canSubscribe()
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 canSubscribeWithRecordTypes(Type[] subscriptionRecordTypes)
Subscription
using the desired record types. While
SubscriptionManager.getSubscriptionRecordTypes()
can be used
to examine which records 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, Type[] subscriptionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
dispatchId
- the Id
for the dispatchsubscriptionRecordTypes
- array of subscription record typesNotFoundException
- dispatchId
is not
foundNullArgumentException
- dispatchId
or
subscriptionRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
recod typesmandatory
- This method must be implemented. Subscription subscribe(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
- subscriptionForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- subscriptionForm
did not originate from getSubscriptionFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateMySubscriptions()
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 found for this userNullArgumentException
- subscriptionId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateMySubscription(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 canUnsubscribe()
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 unsubscribe(Id subscriptionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Subscription.
subscriptionId
- the Id
of the
Subscription
to removeNotFoundException
- subscriber
not
subscribed to subscriptionId
NullArgumentException
- subscriptionId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.