Interface DemographicEnablerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates and removes demographic enablers. The data for
create and update is provided via the DemographicEnablerForm .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasDemographicEnabler(Id demographicEnablerId, Id aliasId) Adds anIdto aDemographicEnablerfor the purpose of creating compatibility.booleanTests if this user can create demographic enablers.booleancanCreateDemographicEnablerWithRecordTypes(Type[] demographicEnablerRecordTypes) Tests if this user can create a singleDemographicEnablerusing the desired record types.booleancanDeleteDemographicEnabler(Id demographicEnablerId) Tests if this user can delete a specifiedDemographicEnabler.booleanTests if this user can delete demographic enablers.booleanTests if this user can manageIdaliases for demographic enablers.booleancanUpdateDemographicEnabler(Id demographicEnablerId) Tests if this user can update a demographic enabler.booleanTests if this user can update demographic enablers.createDemographicEnabler(DemographicEnablerForm demographicEnablerForm) Creates a newDemographicEnabler.voiddeleteDemographicEnabler(Id demographicEnablerId) Deletes aDemographicEnabler.getBin()Gets theBinassociated with this session.getBinId()Gets theBinIdassociated with this session.getDemographicEnablerFormForCreate(Type[] demographicEnablerRecordTypes) Gets the demographic enabler form for creating new demographic enablers.getDemographicEnablerFormForUpdate(Id demographicEnablerId) Gets the demographic enabler form for updating an existing demographic enabler.voidupdateDemographicEnabler(DemographicEnablerForm demographicEnablerForm) Updates an existing demographic 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
-
getBinId
Id getBinId()Gets theBinIdassociated with this session.- Returns:
- the
Bin Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBin
Gets theBinassociated with this session.- Returns:
- the bin
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateDemographicEnabler
boolean canCreateDemographicEnabler()Tests if this user can create demographic enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDemographicEnablerwill 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:
falseifDemographicEnablercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDemographicEnablerWithRecordTypes
Tests if this user can create a singleDemographicEnablerusing the desired record types. WhileResourceDemographicManager.getDemographicEnablerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDemographicEnabler. Providing an empty array tests if aDemographicEnablercan be created with no records.- Parameters:
demographicEnablerRecordTypes- array of demographic enabler record types- Returns:
trueifDemographicEnablercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-demographicEnablerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDemographicEnablerFormForCreate
DemographicEnablerForm getDemographicEnablerFormForCreate(Type[] demographicEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the demographic enabler form for creating new demographic enablers. A new form should be requested for each create transaction.- Parameters:
demographicEnablerRecordTypes- array of demographic enabler record types- Returns:
- the demographic enabler form
- Throws:
NullArgumentException-demographicEnablerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDemographicEnabler
DemographicEnabler createDemographicEnabler(DemographicEnablerForm demographicEnablerForm) throws AlreadyExistsException, OperationFailedException, PermissionDeniedException Creates a newDemographicEnabler.- Parameters:
demographicEnablerForm- the form for thisDemographicEnabler- Returns:
- the new
DemographicEnabler - Throws:
AlreadyExistsException- attempt at duplicating a property the underlying system is enforcing to be uniqueInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-demographicEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-demographicEnablerFormis not of this service- Compliance:
mandatory- This method must be implemented.
-
canUpdateDemographicEnablers
boolean canUpdateDemographicEnablers()Tests if this user can update demographic enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDemographicEnablerwill 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:
falseifDemographicEnablermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canUpdateDemographicEnabler
Tests if this user can update a demographic enabler. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDemographicEnablerwill 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.- Parameters:
demographicEnablerId- theIdof theDemographicEnabler- Returns:
falseif demographic enabler modification is not authorized,trueotherwise- Throws:
NullArgumentException-demographicEnablerIdisnull- Compliance:
mandatory- This method must be implemented.- Notes:
If- the {@code demographicEnablerId} is not found, then it is acceptable to return false to indicate the lack of an update available.
-
getDemographicEnablerFormForUpdate
DemographicEnablerForm getDemographicEnablerFormForUpdate(Id demographicEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the demographic enabler form for updating an existing demographic enabler. A new demographic enabler form should be requested for each update transaction.- Parameters:
demographicEnablerId- theIdof theDemographicEnabler- Returns:
- the demographic enabler form
- Throws:
NotFoundException-demographicEnablerIdis not foundNullArgumentException-demographicEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDemographicEnabler
void updateDemographicEnabler(DemographicEnablerForm demographicEnablerForm) throws OperationFailedException, PermissionDeniedException Updates an existing demographic enabler.- Parameters:
demographicEnablerForm- the form containing the elements to be updated- Throws:
IllegalStateException-demographicEnablerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-demographicEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-demographicEnablerFormdid not originate fromgetDemographicEnablerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDemographicEnablers
boolean canDeleteDemographicEnablers()Tests if this user can delete demographic enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDemographicEnablerwill 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:
falseifDemographicEnablerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canDeleteDemographicEnabler
Tests if this user can delete a specifiedDemographicEnabler. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting theDemographicEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer a delete operation to an unauthorized user.- Parameters:
demographicEnablerId- theIdof theDemographicEnabler- Returns:
falseif deletion of thisDemographicEnableris not authorized,trueotherwise- Throws:
NullArgumentException-demographicEnablerIdisnull- Compliance:
mandatory- This method must be implemented.- Notes:
If- the {@code demographicEnablerId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
-
deleteDemographicEnabler
void deleteDemographicEnabler(Id demographicEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDemographicEnabler.- Parameters:
demographicEnablerId- theIdof theDemographicEnablerto remove- Throws:
NotFoundException-demographicEnablerIdnot foundNullArgumentException-demographicEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDemographicEnablerAliases
boolean canManageDemographicEnablerAliases()Tests if this user can manageIdaliases for demographic enablers. 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:
falseifDemographicEnableraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDemographicEnabler
void aliasDemographicEnabler(Id demographicEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDemographicEnablerfor the purpose of creating compatibility. The primaryIdof theDemographicEnableris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another demographic enabler. it is reassigned to the given demographic enablerId.- Parameters:
demographicEnablerId- theIdof aDemographicEnableraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-demographicEnablerIdnot foundNullArgumentException-demographicEnablerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-