Interface DispatchConstrainerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes DispatchConstrainers
. 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
DispatchConstrainer , a DispatchConstrainerForm is requested
using getDispatchConstrainerFormForCreate() specifying the desired
record Types or none if no record Types are needed. The
returned DispatchConstrainerForm 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 DispatchConstrainerForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
DispatchConstrainerForm corresponds to an attempted transaction.
For updates, DispatchConstrainerForms are requested to the
DispatchConstrainer Id that is to be updated using
getDispatchConstrainerFormForUpdate() . Similarly, the
DispatchConstrainerForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
DispatchConstrainerForm can only be used once for a successful update and
cannot be reused.
The delete operations delete DispatchConstrainers . To unmap a
DispatchConstrainer from the current Publisher , the
DispatchConstrainerPublisherAssignmentSession should be used.
These delete operations attempt to remove the DispatchConstrainer
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 TypeMethodDescriptionvoidaliasDispatchConstrainer(Id dispatchConstrainerId, Id aliasId) Adds anIdto aDispatchConstrainerfor the purpose of creating compatibility.booleanTests if this user can createDispatchConstrainers.booleancanCreateDispatchConstrainerWithRecordTypes(Type[] dispatchConstrainerRecordTypes) Tests if this user can create a singleDispatchConstrainerusing the desired record types.booleanTests if this user can deleteDispatchConstrainers.booleanTests if this user can manageIdaliases forDispatchConstrainersA return of true does not guarantee successful authorization.booleanTests if this user can updateDispatchConstrainers.createDispatchConstrainer(DispatchConstrainerForm dispatchConstrainerForm) Creates a newDispatchConstrainer.voiddeleteDispatchConstrainer(Id dispatchConstrainerId) Deletes aDispatchConstrainer.getDispatchConstrainerFormForCreate(Type[] dispatchConstrainerRecordTypes) Gets the dispatch constrainer form for creating new dispatch constrainers.getDispatchConstrainerFormForUpdate(Id dispatchConstrainerId) Gets the dispatch constrainer form for updating an existing dispatch constrainer.Gets thePublisherassociated with this session.Gets thePublisherIdassociated with this session.voidupdateDispatchConstrainer(DispatchConstrainerForm dispatchConstrainerForm) Updates an existing dispatch constrainer.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.
-
canCreateDispatchConstrainers
boolean canCreateDispatchConstrainers()Tests if this user can createDispatchConstrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDispatchConstrainerwill 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:
falseifDispatchConstrainercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDispatchConstrainerWithRecordTypes
Tests if this user can create a singleDispatchConstrainerusing the desired record types. WhileSubscriptionRulesManager.getDispatchConstrainerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDispatchConstrainer. Providing an empty array tests if aDispatchConstrainer can becreated with no records.- Parameters:
dispatchConstrainerRecordTypes- array of dispatch constrainer record types- Returns:
trueifDispatchConstrainercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-dispatchConstrainerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDispatchConstrainerFormForCreate
DispatchConstrainerForm getDispatchConstrainerFormForCreate(Type[] dispatchConstrainerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the dispatch constrainer form for creating new dispatch constrainers. A new form should be requested for each create transaction.- Parameters:
dispatchConstrainerRecordTypes- array of dispatch constrainer record types- Returns:
- the dispatch constrainer form
- Throws:
NullArgumentException-dispatchConstrainerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDispatchConstrainer
DispatchConstrainer createDispatchConstrainer(DispatchConstrainerForm dispatchConstrainerForm) throws OperationFailedException, PermissionDeniedException Creates a newDispatchConstrainer.- Parameters:
dispatchConstrainerForm- the form for thisDispatchConstrainer- Returns:
- the new
DispatchConstrainer - Throws:
IllegalStateException-dispatchConstrainerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-dispatchConstrainerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchConstrainerFormdid not originate fromgetDispatchConstrainerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDispatchConstrainers
boolean canUpdateDispatchConstrainers()Tests if this user can updateDispatchConstrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDispatchConstrainerwill 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:
falseifDispatchConstrainermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDispatchConstrainerFormForUpdate
DispatchConstrainerForm getDispatchConstrainerFormForUpdate(Id dispatchConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the dispatch constrainer form for updating an existing dispatch constrainer. A new dispatch constrainer form should be requested for each update transaction.- Parameters:
dispatchConstrainerId- theIdof theDispatchConstrainer- Returns:
- the dispatch form
- Throws:
NotFoundException-dispatchConstrainerIdis not foundNullArgumentException-dispatchConstrainerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDispatchConstrainer
void updateDispatchConstrainer(DispatchConstrainerForm dispatchConstrainerForm) throws OperationFailedException, PermissionDeniedException Updates an existing dispatch constrainer.- Parameters:
dispatchConstrainerForm- the form containing the elements to be updated- Throws:
IllegalStateException-dispatchConstrainerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-dispatchConstrainerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-dispatchConstrainerFormdid not originate fromgetDispatchConstrainerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDispatchConstrainers
boolean canDeleteDispatchConstrainers()Tests if this user can deleteDispatchConstrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDispatchConstrainerwill 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:
falseifDispatchConstrainerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDispatchConstrainer
void deleteDispatchConstrainer(Id dispatchConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDispatchConstrainer.- Parameters:
dispatchConstrainerId- theIdof theDispatchConstrainerto remove- Throws:
NotFoundException-dispatchConstrainerIdnot foundNullArgumentException-dispatchConstrainerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDispatchConstrainerAliases
boolean canManageDispatchConstrainerAliases()Tests if this user can manageIdaliases forDispatchConstrainersA 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:
falseifDispatchConstraineraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDispatchConstrainer
void aliasDispatchConstrainer(Id dispatchConstrainerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDispatchConstrainerfor the purpose of creating compatibility. The primaryIdof theDispatchConstraineris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another dispatch constrainer, it is reassigned to the given dispatch constrainerId.- Parameters:
dispatchConstrainerId- theIdof aDispatchConstraineraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-dispatchConstrainerIdnot foundNullArgumentException-dispatchConstrainerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-