Interface SubscriptionEnablerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates and removes subscription enablers. The data for
create and update is provided via the SubscriptionEnablerForm .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasSubscriptionEnabler(Id subscriptionEnablerId, Id aliasId) Adds anIdto aSubscriptionEnablerfor the purpose of creating compatibility.booleanTests if this user can create subscription enablers.booleancanCreateSubscriptionEnablerWithRecordTypes(Type[] subscriptionEnablerRecordTypes) Tests if this user can create a singleSubscriptionEnablerusing the desired record types.booleanTests if this user can delete subscription enablers.booleanTests if this user can manageIdaliases for subscription enablers.booleanTests if this user can update subscription enablers.createSubscriptionEnabler(SubscriptionEnablerForm subscriptionEnablerForm) Creates a newSubscriptionEnabler.voiddeleteSubscriptionEnabler(Id subscriptionEnablerId) Deletes aSubscriptionEnabler.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.getSubscriptionEnablerFormForCreate(Type[] subscriptionEnablerRecordTypes) Gets the subscription enabler form for creating new subscription enablers.getSubscriptionEnablerFormForUpdate(Id subscriptionEnablerId) Gets the subscription enabler form for updating an existing subscription enabler.voidupdateSubscriptionEnabler(SubscriptionEnablerForm subscriptionEnablerForm) Updates an existing subscription enabler.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.
-
Method Details
-
getPublisherId
Id getPublisherId()Gets thePublisherIdassociated with this session.- Returns:
- the
Publisher Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPublisher
Gets thePublisherassociated with this session.- Returns:
- the publisher
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateSubscriptionEnabler
boolean canCreateSubscriptionEnabler()Tests if this user can create subscription enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aSubscriptionEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifSubscriptionEnablercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateSubscriptionEnablerWithRecordTypes
Tests if this user can create a singleSubscriptionEnablerusing the desired record types. WhileSubscriptionRulesManager.getSubscriptionEnablerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificSubscriptionEnabler. Providing an empty array tests if aSubscriptionEnablercan be created with no records.- Parameters:
subscriptionEnablerRecordTypes- array of subscription enabler record types- Returns:
trueifSubscriptionEnablercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-subscriptionEnablerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getSubscriptionEnablerFormForCreate
SubscriptionEnablerForm getSubscriptionEnablerFormForCreate(Type[] subscriptionEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the subscription enabler form for creating new subscription enablers. A new form should be requested for each create transaction.- Parameters:
subscriptionEnablerRecordTypes- array of subscription enabler record types- Returns:
- the subscription enabler form
- Throws:
NullArgumentException-subscriptionEnablerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createSubscriptionEnabler
SubscriptionEnabler createSubscriptionEnabler(SubscriptionEnablerForm subscriptionEnablerForm) throws OperationFailedException, PermissionDeniedException Creates a newSubscriptionEnabler.- Parameters:
subscriptionEnablerForm- the form for thisSubscriptionEnabler- Returns:
- the new
SubscriptionEnabler - Throws:
IllegalStateException-subscriptionEnablerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-subscriptionEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-subscriptionEnablerFormdid not originate fromgetSubscriptionEnablerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateSubscriptionEnablers
boolean canUpdateSubscriptionEnablers()Tests if this user can update subscription enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aSubscriptionEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifSubscriptionEnablermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getSubscriptionEnablerFormForUpdate
SubscriptionEnablerForm getSubscriptionEnablerFormForUpdate(Id subscriptionEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the subscription enabler form for updating an existing subscription enabler. A new subscription enabler form should be requested for each update transaction.- Parameters:
subscriptionEnablerId- theIdof theSubscriptionEnabler- Returns:
- the subscription enabler form
- Throws:
NotFoundException-subscriptionEnablerIdis not foundNullArgumentException-subscriptionEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSubscriptionEnabler
void updateSubscriptionEnabler(SubscriptionEnablerForm subscriptionEnablerForm) throws OperationFailedException, PermissionDeniedException Updates an existing subscription enabler.- Parameters:
subscriptionEnablerForm- the form containing the elements to be updated- Throws:
IllegalStateException-subscriptionEnablerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-subscriptionEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-subscriptionEnablerFormdid not originate fromgetSubscriptionEnablerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteSubscriptionEnablers
boolean canDeleteSubscriptionEnablers()Tests if this user can delete subscription enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aSubscriptionEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifSubscriptionEnablerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteSubscriptionEnabler
void deleteSubscriptionEnabler(Id subscriptionEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aSubscriptionEnabler.- Parameters:
subscriptionEnablerId- theIdof theSubscriptionEnablerto remove- Throws:
NotFoundException-subscriptionEnablerIdnot foundNullArgumentException-subscriptionEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageSubscriptionEnablerAliases
boolean canManageSubscriptionEnablerAliases()Tests if this user can manageIdaliases for subscription enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifSubscriptionEnableraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasSubscriptionEnabler
void aliasSubscriptionEnabler(Id subscriptionEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aSubscriptionEnablerfor the purpose of creating compatibility. The primaryIdof theSubscriptionEnableris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another subscription enabler. it is reassigned to the given subscription enablerId.- Parameters:
subscriptionEnablerId- theIdof aSubscriptionEnableraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-subscriptionEnablerIdnot foundNullArgumentException-subscriptionEnablerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-