Interface DispatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
DispatchBatchAdminSession
This session creates, updates, and deletes Dispatches . The
data for create and update is provided by the consumer via the form.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create a
Dispatch , a DispatchForm is requested using
getDispatchFormForCreate() specifying the desired relationship peers and
record Types or none if no record Types are needed. The
returned DispatchForm 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 DispatchForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DispatchForm corresponds to
an attempted transaction.
For updates, DispatchForms are requested to the
Dispatch Id that is to be updated using
getDispatchFormForUpdate() . Similarly, the DispatchForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The DispatchForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Dispatches . To unmap a
Dispatch from the current Publisher , the
DispatchPublisherAssignmentSession should be used. These delete
operations attempt to remove the Dispatch 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 TypeMethodDescriptionvoidaliasDispatch(Id dispatchId, Id aliasId) Adds anIdto aDispatchfor the purpose of creating compatibility.booleanTests if this user can createDispatches.booleancanCreateDispatchWithRecordTypes(Type[] dispatchRecordTypes) Tests if this user can create a singleDispatchusing the desired record interface types.booleanTests if this user can deleteDispatchesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forDispatches.booleanTests if this user can updateDispatches.createDispatch(DispatchForm dispatchForm) Creates a newDispatch.voiddeleteDispatch(Id dispatchId) Deletes aDispatch.getDispatchFormForCreate(Type[] dispatchRecordTypes) Gets the dispatch form for creating new dispatches.getDispatchFormForUpdate(Id dispatchId) Gets the dispatch form for updating an existing dispatch.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.voidupdateDispatch(DispatchForm dispatchForm) Updates an existing dispatch.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.
-
canCreateDispatches
boolean canCreateDispatches()Tests if this user can createDispatches. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDispatchwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifDispatchcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDispatchWithRecordTypes
Tests if this user can create a singleDispatchusing the desired record interface types. WhileSubscriptionManager.getDispatchRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificDispatch. Providing an empty array tests if aDispatchcan be created with no records.- Parameters:
dispatchRecordTypes- array of dispatch record types- Returns:
trueifDispatchcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-dispatchRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDispatchFormForCreate
DispatchForm getDispatchFormForCreate(Type[] dispatchRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dispatch form for creating new dispatches. A new form should be requested for each create transaction.- Parameters:
dispatchRecordTypes- array of dispatch record types- Returns:
- the dispatch form
- Throws:
NullArgumentException-dispatchRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get from for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDispatch
Dispatch createDispatch(DispatchForm dispatchForm) throws OperationFailedException, PermissionDeniedException Creates a newDispatch.- Parameters:
dispatchForm- the form for thisDispatch- Returns:
- the new
Dispatch - Throws:
IllegalStateException-dispatchFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-dispatchFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchFormdid not originate fromgetDispatchFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDispatches
boolean canUpdateDispatches()Tests if this user can updateDispatches. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDispatchwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifDispatchmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDispatchFormForUpdate
DispatchForm getDispatchFormForUpdate(Id dispatchId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dispatch form for updating an existing dispatch. A new dispatch form should be requested for each update transaction.- Parameters:
dispatchId- theIdof theDispatch- Returns:
- the dispatch form
- Throws:
NotFoundException-dispatchIdis not foundNullArgumentException-dispatchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDispatch
void updateDispatch(DispatchForm dispatchForm) throws OperationFailedException, PermissionDeniedException Updates an existing dispatch.- Parameters:
dispatchForm- the form containing the elements to be updated- Throws:
IllegalStateException-dispatchFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-dispatchIdordispatchFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchFormdid not originate fromgetDispatchFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDispatches
boolean canDeleteDispatches()Tests if this user can deleteDispatchesA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDispatchwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifDispatchdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDispatch
void deleteDispatch(Id dispatchId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDispatch.- Parameters:
dispatchId- theIdof theDispatchto remove- Throws:
NotFoundException-dispatchIdnot foundNullArgumentException-dispatchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDispatchAliases
boolean canManageDispatchAliases()Tests if this user can manageIdaliases forDispatches. 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:
falseifDispatchaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDispatch
void aliasDispatch(Id dispatchId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDispatchfor the purpose of creating compatibility. The primaryIdof theDispatchis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another dispatch, it is reassigned to the given dispatchId.- Parameters:
dispatchId- theIdof aDispatchaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-dispatchIdnot foundNullArgumentException-dispatchIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-