public interface DemographicAdminSession extends OsidSession
This session creates and removes demographics. The data for create and
update is provided via the DemographicForm.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasDemographic(Id demographicId,
Id aliasId)
Adds an
Id to a Demographic for the
purpose of creating compatibility. |
boolean |
canCreateDemographic()
Tests if this user can create demographics.
|
boolean |
canCreateDemographicWithRecordTypes(Type[] demographicRecordTypes)
Tests if this user can create a single
Demographic
using the desired record types. |
boolean |
canDeleteDemographics()
Tests if this user can delete demographics.
|
boolean |
canManageDemographicAliases()
Tests if this user can manage
Id aliases for
demographics. |
boolean |
canUpdateDemographics()
Tests if this user can update demographics.
|
Demographic |
createDemographic(DemographicForm demographicForm)
Creates a new
Demographic. |
void |
deleteDemographic(Id demographicId)
Deletes a
Demographic. |
Bin |
getBin()
Gets the
Bin associated with this session. |
Id |
getBinId()
Gets the
Bin Id associated with this
session. |
DemographicForm |
getDemographicFormForCreate(Type[] demographicRecordTypes)
Gets the demographic form for creating new demographics.
|
DemographicForm |
getDemographicFormForUpdate(Id demographicId)
Gets the demographic form for updating an existing demographic.
|
void |
updateDemographic(DemographicForm demographicForm)
Updates an existing demographic.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getBinId()
Bin Id associated with this
session. Bin Id associated with this sessionmandatory - This method must be implemented. Bin getBin() throws OperationFailedException, PermissionDeniedException
Bin associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateDemographic()
Demographic will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer create operations to an
unauthorized user. false if Demographic creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateDemographicWithRecordTypes(Type[] demographicRecordTypes)
Demographic
using the desired record types. While
ResourceDemographicManager.getDemographicRecordTypes() can be
used to examine which records are supported, this method tests which
record(s) are required for creating a specific Demographic.
Providing an empty array tests if a Demographic
can be created with no records.demographicRecordTypes - array of demographic record types true if Demographic creation
using the specified record Types is supported,
false otherwiseNullArgumentException - demographicRecordTypes
is null mandatory - This method must be implemented. DemographicForm getDemographicFormForCreate(Type[] demographicRecordTypes) throws OperationFailedException, PermissionDeniedException
demographicRecordTypes - array of demographic record typesNullArgumentException - demographicRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Demographic createDemographic(DemographicForm demographicForm) throws OperationFailedException, PermissionDeniedException
Demographic. demographicForm - the form for this Demographic Demographic IllegalStateException - demographicForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - demographicForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - demographicForm
did not originate from getDemographicFormForCreate()
mandatory - This method must be implemented. boolean canUpdateDemographics()
Demographic will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer update operations to an
unauthorized user. false if Demographic
modification is not authorized, true otherwisemandatory - This method must be implemented. DemographicForm getDemographicFormForUpdate(Id demographicId) throws NotFoundException, OperationFailedException, PermissionDeniedException
demographicId - the Id of the Demographic
NotFoundException - demographicId is not
foundNullArgumentException - demographicId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateDemographic(DemographicForm demographicForm) throws OperationFailedException, PermissionDeniedException
demographicForm - the form containing the elements to be updatedIllegalStateException - demographicForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - demographicId or
demographicForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - demographicForm
did not originate from getDemographicFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteDemographics()
Demographic will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer delete operations to an
unauthorized user. false if Demographic deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteDemographic(Id demographicId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Demographic. demographicId - the Id of the Demographic
to removeNotFoundException - demographicId not
foundNullArgumentException - demographicId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageDemographicAliases()
Id aliases for
demographics. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Demographic aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasDemographic(Id demographicId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Demographic for the
purpose of creating compatibility. The primary Id of
the Demographic is determined by the provider. The new
Id performs as an alias to the primary Id
. If the alias is a pointer to another demographic. it is
reassigned to the given demographic Id. demographicId - the Id of a Demographic
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - demographicId not
foundNullArgumentException - demographicId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.