Interface DistributorAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
DistributorBatchAdminSession
This session creates, updates, and deletes Distributors . 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
Distributor , a DistributorForm is requested using
getDistributorFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
DistributorForm 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 DistributorForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DistributorForm corresponds
to an attempted transaction.
For updates, DistributorForms are requested to the
Distributor Id that is to be updated using
getDistributorFormForUpdate() . Similarly, the DistributorForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The DistributorForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Distributors .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasDistributor(Id distributorId, Id aliasId) Adds anIdto aDistributorfor the purpose of creating compatibility.booleanTests if this user can createDistributors.booleancanCreateDistributorWithRecordTypes(Type[] distributorRecordTypes) Tests if this user can create a singleDistributorusing the desired record types.booleanTests if this user can deleteDistributors.booleanTests if this user can manageIdaliases forDistributors.booleanTests if this user can updateDistributors.createDistributor(DistributorForm distributorForm) Creates a newDistributor.voiddeleteDistributor(Id distributorId) Deletes aDistributor.getDistributorFormForCreate(Type[] distributorRecordTypes) Gets the distributor form for creating new distributors.getDistributorFormForUpdate(Id distributorId) Gets the distributor form for updating an existing distributor.voidupdateDistributor(DistributorForm distributorForm) Updates an existing distributorMethods 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
-
canCreateDistributors
boolean canCreateDistributors()Tests if this user can createDistributors. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDistributor. will 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:
falseifDistributorcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDistributorWithRecordTypes
Tests if this user can create a singleDistributorusing the desired record types. WhileProvisioningManager.getDistributorRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDistributor. Providing an empty array tests if aDistributorcan be created with no records.- Parameters:
distributorRecordTypes- array of distributor record types- Returns:
trueifDistributorcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-distributorRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDistributorFormForCreate
DistributorForm getDistributorFormForCreate(Type[] distributorRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the distributor form for creating new distributors. A new form should be requested for each create transaction.- Parameters:
distributorRecordTypes- array of distributor record types- Returns:
- the distributor form
- Throws:
NullArgumentException-distributorRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDistributor
Distributor createDistributor(DistributorForm distributorForm) throws OperationFailedException, PermissionDeniedException Creates a newDistributor.- Parameters:
distributorForm- the form for thisDistributor- Returns:
- the new
Distributor - Throws:
IllegalStateException-distributorFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-distributorFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-distributorFormdid not originate fromgetDistributorFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDistributors
boolean canUpdateDistributors()Tests if this user can updateDistributors. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDistributorwill 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:
falseifDistributormodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDistributorFormForUpdate
DistributorForm getDistributorFormForUpdate(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the distributor form for updating an existing distributor. A new distributor form should be requested for each update transaction.- Parameters:
distributorId- theIdof theDistributor- Returns:
- the distributor form
- Throws:
NotFoundException-distributorIdis not foundNullArgumentException-distributorIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDistributor
void updateDistributor(DistributorForm distributorForm) throws OperationFailedException, PermissionDeniedException Updates an existing distributor- Parameters:
distributorForm- the form containing the elements to be updated- Throws:
IllegalStateException-distributorFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-distributorFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-distributorFormdid not originate fromgetDistributorFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDistributors
boolean canDeleteDistributors()Tests if this user can deleteDistributors. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDistributorwill 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:
falseifDistributordeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDistributor
void deleteDistributor(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDistributor.- Parameters:
distributorId- theIdof theDistributorto remove- Throws:
NotFoundException-distributorIdnot foundNullArgumentException-distributorIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDistributorAliases
boolean canManageDistributorAliases()Tests if this user can manageIdaliases forDistributors. 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:
falseifDistributoraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDistributor
void aliasDistributor(Id distributorId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDistributorfor the purpose of creating compatibility. The primaryIdof theDistributoris determined by the provider. The newIdperforms as an alias to the primaryId.- Parameters:
distributorId- theIdof aDistributoraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-distributorIdnot foundNullArgumentException-distributorIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-