public interface FamilyAdminSession extends OsidSession
This session creates, updates, and deletes Families. 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
Family, a FamilyForm is requested using
getFamilyFormForCreate() specifying the desired record
Types or none if no record Types are needed. The
returned FamilyForm 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 FamilyForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each FamilyForm
corresponds to an attempted transaction.
For updates, FamilyForms are requested to the
Family Id that is to be updated using
getFamilyFormForUpdate(). Similarly, the FamilyForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The FamilyForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Families.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasFamily(Id familyId,
Id aliasId)
Adds an
Id to a Family for the purpose
of creating compatibility. |
boolean |
canCreateFamilies()
Tests if this user can create families.
|
boolean |
canCreateFamilyWithRecordTypes(Type[] familyRecordTypes)
Tests if this user can create a single
Family using the
desired record types. |
boolean |
canDeleteFamilies()
Tests if this user can delete families.
|
boolean |
canManageFamilyAliases()
Tests if this user can manage
Id aliases for families. |
boolean |
canUpdateFamilies()
Tests if this user can update families.
|
Family |
createFamily(FamilyForm familyForm)
Creates a new
Family. |
void |
deleteFamily(Id familyId)
Deletes a
Family. |
FamilyForm |
getFamilyFormForCreate(Type[] familyRecordTypes)
Gets the family form for creating new families.
|
FamilyForm |
getFamilyFormForUpdate(Id familyId)
Gets the family form for updating an existing family.
|
void |
updateFamily(FamilyForm familyForm)
Updates an existing family.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateFamilies()
Family will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer create operations to
unauthorized users. false if Family creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateFamilyWithRecordTypes(Type[] familyRecordTypes)
Family using the
desired record types. While
RelationshipManager.getFamilyRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Family. Providing
an empty array tests if a Family can be created with no
records.familyRecordTypes - array of family record types true if Family creation using
the specified record Types is supported,
false otherwiseNullArgumentException - familyRecordTypes is
null mandatory - This method must be implemented. FamilyForm getFamilyFormForCreate(Type[] familyRecordTypes) throws OperationFailedException, PermissionDeniedException
familyRecordTypes - array of family record typesNullArgumentException - familyRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Family createFamily(FamilyForm familyForm) throws OperationFailedException, PermissionDeniedException
Family. familyForm - the form for this Family. Family IllegalStateException - familyForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - familyForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - familyForm did
not originate from getFamilyFormForCreate() mandatory - This method must be implemented. boolean canUpdateFamilies()
Family will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer update operations to
unauthorized users. false if Family modification is
not authorized, true otherwisemandatory - This method must be implemented. FamilyForm getFamilyFormForUpdate(Id familyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
familyId - the Id of the Family NotFoundException - familyId is not
foundNullArgumentException - familyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateFamily(FamilyForm familyForm) throws OperationFailedException, PermissionDeniedException
familyForm - the form containing the elements to be updatedIllegalStateException - familyForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - familyId or
familyForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - familyForm did
not originate from getFamilyFormForUpdate() mandatory - This method must be implemented. boolean canDeleteFamilies()
Family will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false if Family deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteFamily(Id familyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Family. familyId - the Id of the Family to
removeNotFoundException - familyId not foundNullArgumentException - familyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageFamilyAliases()
Id aliases for families.
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 Family aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasFamily(Id familyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Family for the purpose
of creating compatibility. The primary Id of the
Family is determined by the provider. The new Id
performs as an alias to the primary Id. If the
alias is a pointer to another family, it is reassigned to the given
family Id. familyId - the Id of a Family aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - familyId not foundNullArgumentException - familyId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.