Interface DispatchEnablerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes DispatchEnablers .
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
DispatchEnabler , a DispatchEnablerForm is requested using
getDispatchEnablerFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
DispatchEnablerForm 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 DispatchEnablerForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DispatchEnablerForm
corresponds to an attempted transaction.
For updates, DispatchEnablerForms are requested to the
DispatchEnabler Id that is to be updated using
getDispatchEnablerFormForUpdate() . Similarly, the
DispatchEnablerForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
DispatchEnablerForm can only be used once for a successful update and
cannot be reused.
The delete operations delete DispatchEnablers . To unmap a
DispatchEnabler from the current Publisher , the
DispatchEnablerPublisherAssignmentSession should be used. These delete
operations attempt to remove the DispatchEnabler 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 .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasDispatchEnabler(Id dispatchEnablerId, Id aliasId) Adds anIdto aDispatchEnablerfor the purpose of creating compatibility.booleanTests if this user can createDispatchEnablers.booleancanCreateDispatchEnablerWithRecordTypes(Type[] dispatchEnablerRecordTypes) Tests if this user can create a singleDispatchEnablerusing the desired record types.booleanTests if this user can deleteDispatchEnablers.booleanTests if this user can manageIdaliases forDispatchEnablersA return of true does not guarantee successful authorization.booleanTests if this user can updateDispatchEnablers.createDispatchEnabler(DispatchEnablerForm dispatchEnablerForm) Creates a newDispatchEnabler.voiddeleteDispatchEnabler(Id dispatchEnablerId) Deletes aDispatchEnabler.getDispatchEnablerFormForCreate(Type[] dispatchEnablerRecordTypes) Gets the dispatch enabler form for creating new dispatch enablers.getDispatchEnablerFormForUpdate(Id dispatchEnablerId) Gets the dispatch enabler form for updating an existing dispatch enabler.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.voidupdateDispatchEnabler(DispatchEnablerForm dispatchEnablerForm) Updates an existing dispatch 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.
-
canCreateDispatchEnablers
boolean canCreateDispatchEnablers()Tests if this user can createDispatchEnablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDispatchEnablerwill 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:
falseifDispatchEnablercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDispatchEnablerWithRecordTypes
Tests if this user can create a singleDispatchEnablerusing the desired record types. WhileSubscriptionRulesManager.getDispatchEnablerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDispatchEnabler. Providing an empty array tests if aDispatchEnabler can becreated with no records.- Parameters:
dispatchEnablerRecordTypes- array of dispatch enabler record types- Returns:
trueifDispatchEnablercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-dispatchEnablerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDispatchEnablerFormForCreate
DispatchEnablerForm getDispatchEnablerFormForCreate(Type[] dispatchEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dispatch enabler form for creating new dispatch enablers. A new form should be requested for each create transaction.- Parameters:
dispatchEnablerRecordTypes- array of dispatch enabler record types- Returns:
- the dispatch enabler form
- Throws:
NullArgumentException-dispatchEnablerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDispatchEnabler
DispatchEnabler createDispatchEnabler(DispatchEnablerForm dispatchEnablerForm) throws OperationFailedException, PermissionDeniedException Creates a newDispatchEnabler.- Parameters:
dispatchEnablerForm- the form for thisDispatchEnabler- Returns:
- the new
DispatchEnabler - Throws:
IllegalStateException-dispatchEnablerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-dispatchEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchEnablerFormdid not originate fromgetDispatchEnablerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDispatchEnablers
boolean canUpdateDispatchEnablers()Tests if this user can updateDispatchEnablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDispatchEnablerwill 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:
falseifDispatchEnablermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDispatchEnablerFormForUpdate
DispatchEnablerForm getDispatchEnablerFormForUpdate(Id dispatchEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dispatch enabler form for updating an existing dispatch enabler. A new dispatch enabler form should be requested for each update transaction.- Parameters:
dispatchEnablerId- theIdof theDispatchEnabler- Returns:
- the dispatch enabler form
- Throws:
NotFoundException-dispatchEnablerIdis not foundNullArgumentException-dispatchEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDispatchEnabler
void updateDispatchEnabler(DispatchEnablerForm dispatchEnablerForm) throws OperationFailedException, PermissionDeniedException Updates an existing dispatch enabler.- Parameters:
dispatchEnablerForm- the form containing the elements to be updated- Throws:
IllegalStateException-dispatchEnablerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-dispatchEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchEnablerFormdid not originate fromgetDispatchEnablerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDispatchEnablers
boolean canDeleteDispatchEnablers()Tests if this user can deleteDispatchEnablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDispatchEnablerwill 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:
falseifDispatchEnablerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDispatchEnabler
void deleteDispatchEnabler(Id dispatchEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDispatchEnabler.- Parameters:
dispatchEnablerId- theIdof theDispatchEnablerto remove- Throws:
NotFoundException-dispatchEnablerIdnot foundNullArgumentException-dispatchEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDispatchEnablerAliases
boolean canManageDispatchEnablerAliases()Tests if this user can manageIdaliases forDispatchEnablersA 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:
falseifDispatchEnableraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDispatchEnabler
void aliasDispatchEnabler(Id dispatchEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDispatchEnablerfor the purpose of creating compatibility. The primaryIdof theDispatchEnableris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another dispatch enabler, it is reassigned to the given dispatch enablerId.- Parameters:
dispatchEnablerId- theIdof aDispatchEnableraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-dispatchEnablerIdnot foundNullArgumentException-dispatchEnablerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-