Interface DispatchProcessorAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes DispatchProcessors .
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
DispatchProcessor , a DispatchProcessorForm is requested using
getDispatchProcessorFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
DispatchProcessorForm 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 DispatchProcessorForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each DispatchProcessorForm
corresponds to an attempted transaction.
For updates, DispatchProcessorForms are requested to the
DispatchProcessor Id that is to be updated using
getDispatchProcessorFormForUpdate() . Similarly, the
DispatchProcessorForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
DispatchProcessorForm can only be used once for a successful update and
cannot be reused.
The delete operations delete DispatchProcessors . To unmap a
DispatchProcessor from the current Publisher , the
DispatchProcessorPublisherAssignmentSession should be used. These delete
operations attempt to remove the DispatchProcessor 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 TypeMethodDescriptionvoidaliasDispatchProcessor(Id dispatchProcessorId, Id aliasId) Adds anIdto aDispatchProcessorfor the purpose of creating compatibility.booleanTests if this user can createDispatchProcessors.booleancanCreateDispatchProcessorWithRecordTypes(Type[] dispatchProcessorRecordTypes) Tests if this user can create a singleDispatchProcessorusing the desired record types.booleanTests if this user can deleteDispatchProcessors.booleanTests if this user can manageIdaliases forDispatchProcessorsA return of true does not guarantee successful authorization.booleanTests if this user can updateDispatchProcessors.createDispatchProcessor(DispatchProcessorForm dispatchProcessorForm) Creates a newDispatchProcessor.voiddeleteDispatchProcessor(Id dispatchProcessorId) Deletes aDispatchProcessor.getDispatchProcessorFormForCreate(Type[] dispatchProcessorRecordTypes) Gets the dispatch processor form for creating new dispatch processors.getDispatchProcessorFormForUpdate(Id dispatchProcessorId) Gets the dispatch processor form for updating an existing dispatch processor.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.voidupdateDispatchProcessor(DispatchProcessorForm dispatchProcessorForm) Updates an existing dispatch processor.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.
-
canCreateDispatchProcessors
boolean canCreateDispatchProcessors()Tests if this user can createDispatchProcessors. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDispatchProcessorwill 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:
falseifDispatchProcessorcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDispatchProcessorWithRecordTypes
Tests if this user can create a singleDispatchProcessorusing the desired record types. WhileSubscriptionRulesManager.getDispatchProcessorRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDispatchProcessor. Providing an empty array tests if aDispatchProcessor can becreated with no records.- Parameters:
dispatchProcessorRecordTypes- array of dispatch processor record types- Returns:
trueifDispatchProcessorcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-dispatchProcessorRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDispatchProcessorFormForCreate
DispatchProcessorForm getDispatchProcessorFormForCreate(Type[] dispatchProcessorRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dispatch processor form for creating new dispatch processors. A new form should be requested for each create transaction.- Parameters:
dispatchProcessorRecordTypes- array of dispatch processor record types- Returns:
- the dispatch processor form
- Throws:
NullArgumentException-dispatchProcessorRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDispatchProcessor
DispatchProcessor createDispatchProcessor(DispatchProcessorForm dispatchProcessorForm) throws OperationFailedException, PermissionDeniedException Creates a newDispatchProcessor.- Parameters:
dispatchProcessorForm- the form for thisDispatchProcessor- Returns:
- the new
DispatchProcessor - Throws:
IllegalStateException-dispatchProcessorFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-dispatchProcessorFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchProcessorFormdid not originate fromgetDispatchProcessorFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDispatchProcessors
boolean canUpdateDispatchProcessors()Tests if this user can updateDispatchProcessors. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDispatchProcessorwill 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:
falseifDispatchProcessormodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDispatchProcessorFormForUpdate
DispatchProcessorForm getDispatchProcessorFormForUpdate(Id dispatchProcessorId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dispatch processor form for updating an existing dispatch processor. A new dispatch processor form should be requested for each update transaction.- Parameters:
dispatchProcessorId- theIdof theDispatchProcessor- Returns:
- the dispatch processor form
- Throws:
NotFoundException-dispatchProcessorIdis not foundNullArgumentException-dispatchProcessorIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDispatchProcessor
void updateDispatchProcessor(DispatchProcessorForm dispatchProcessorForm) throws OperationFailedException, PermissionDeniedException Updates an existing dispatch processor.- Parameters:
dispatchProcessorForm- the form containing the elements to be updated- Throws:
IllegalStateException-dispatchProcessorFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-dispatchProcessorFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchProcessorFormdid not originate fromgetDispatchProcessorFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDispatchProcessors
boolean canDeleteDispatchProcessors()Tests if this user can deleteDispatchProcessors. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDispatchProcessorwill 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:
falseifDispatchProcessordeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDispatchProcessor
void deleteDispatchProcessor(Id dispatchProcessorId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDispatchProcessor.- Parameters:
dispatchProcessorId- theIdof theDispatchProcessorto remove- Throws:
NotFoundException-dispatchProcessorIdnot foundNullArgumentException-dispatchProcessorIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDispatchProcessorAliases
boolean canManageDispatchProcessorAliases()Tests if this user can manageIdaliases forDispatchProcessorsA 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:
falseifDispatchProcessoraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDispatchProcessor
void aliasDispatchProcessor(Id dispatchProcessorId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDispatchProcessorfor the purpose of creating compatibility. The primaryIdof theDispatchProcessoris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another dispatch processor, it is reassigned to the given dispatch processorId.- Parameters:
dispatchProcessorId- theIdof aDispatchProcessoraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-dispatchProcessorIdnot foundNullArgumentException-dispatchProcessorIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-