Interface TypeAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session is used to create, update and delete Types in the
registry.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBaseType(Type type, Type baseType) Adds a base type to a type.voidaddTypeRelation(Type sourceType, Type destinationType, Type relationType) Adds a relation between two types.booleanTests if this user can createTypes.booleancanDeleteType(Type type) Tests if this user can delete the specified type.booleanTests if this user can deleteTypesfrom thisItemBank.booleanTests if this user can update types.createType(TypeForm typeForm) Creates a newType.voiddeleteType(Type type) Removes aType.getTypeFormForCreate(Type type) Gets the type form for creating new types.getTypeFormForUpdate(Type type) Gets the type form for creating new types.voidmakeEquivalent(Type primaryType, Type equivalentType) Makes twoTypesequivalent.voidremoveBaseType(Type type, Type baseType) Removes a base type from a type.voidremoveTypeRelation(Type sourceType, Type destinationType, Type relationType) Renoves a relation between two types.voidupdateType(TypeForm typeForm) Updates a type.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
-
canCreateTypes
boolean canCreateTypes()Tests if this user can createTypes. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aTypewill 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:
falseifTypecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getTypeFormForCreate
Gets the type form for creating new types. A new form should be requested for each create transaction.- Parameters:
type- theTypeto be created- Returns:
- the type form
- Throws:
NullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
createType
Creates a newType.- Parameters:
typeForm- the type form- Returns:
- the created
Type - Throws:
IllegalStateException-typeFormalready used in a create transactionInvalidArgumentException- one or more of the arguments is invalidNullArgumentException-typeFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-typeFormdid not originate fromgetTypeFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateTypes
boolean canUpdateTypes()Tests if this user can update types. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aTypewill 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:
falseif type modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getTypeFormForUpdate
TypeForm getTypeFormForUpdate(Type type) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the type form for creating new types. A new form should be requested for each create transaction.- Parameters:
type- theTypeto be updated- Returns:
- the type form
- Throws:
NotFoundException-typenot foundNullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateType
Updates a type.- Parameters:
typeForm- the type form- Throws:
IllegalStateException-typeFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-typeFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-typeFormdid not originate fromgetTypeFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteTypes
boolean canDeleteTypes()Tests if this user can deleteTypesfrom thisItemBank. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aTypewill 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:
falseifItemdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canDeleteType
Tests if this user can delete the specified type. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleteing theTypewill 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:
type- theTypeto be deleted- Returns:
falseif type deletion is not authorized,trueotherwise- Throws:
NullArgumentException-typeisnull- Compliance:
mandatory- This method must be implemented.
-
deleteType
void deleteType(Type type) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aType.- Parameters:
type- theTypeto remove- Throws:
NotFoundException-typeis not foundNullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
makeEquivalent
void makeEquivalent(Type primaryType, Type equivalentType) throws NotFoundException, OperationFailedException, PermissionDeniedException Makes twoTypesequivalent. Calls toTypeLookupSession.getType(equivalentType)return theprimaryType.- Parameters:
primaryType- the primaryTypeequivalentType- aTypeto be made equivalent- Throws:
NotFoundException-primaryTypeorequivalentTypeis not foundNullArgumentException-primaryTypeorequivalentTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addBaseType
void addBaseType(Type type, Type baseType) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a base type to a type. A base type is a parent of the type where the type implies support of the base type.- Parameters:
type- aTypebaseType- a base type- Throws:
NotFoundException-typeorbaseTypeis not foundNullArgumentException-typeorbaseTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeBaseType
void removeBaseType(Type type, Type baseType) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a base type from a type.- Parameters:
type- aTypebaseType- a base type- Throws:
NotFoundException-typeorbaseTypeis not found orbaseTypeis not a base oftypeNullArgumentException-typeorbaseTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addTypeRelation
void addTypeRelation(Type sourceType, Type destinationType, Type relationType) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a relation between two types. The relationship is aTypein itself.- Parameters:
sourceType- the source typedestinationType- the destination typerelationType- the relation type- Throws:
NotFoundException-sourceType, destinationType, orrelationTypeis not foundNullArgumentException-sourceType, destinationType, orrelationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeTypeRelation
void removeTypeRelation(Type sourceType, Type destinationType, Type relationType) throws NotFoundException, OperationFailedException, PermissionDeniedException Renoves a relation between two types.- Parameters:
sourceType- the source typedestinationType- the destination typerelationType- the relation type- Throws:
NotFoundException-sourceType, destinationType, orrelationTypeis not found, or the relationship does not existNullArgumentException-sourceType, destinationType, orrelationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-