Interface TypeLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session retrieves Types. A single Type can be retrieved using
getType() and all types known to this service can be accessed via
getTypes() .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performTypelookups.getBaseTypes(Type type) Gets the immediate base types of this type.getDestinationTypesByRelationType(Type relationType) Gets all destinationTypesrelated by the given type.getDestinationTypesBySource(Type sourceType) Gets all destination Types related to the given sourceType.getDestinationTypesBySourceAndRelationType(Type sourceType, Type relationType) Gets all destination Types related to the given sourceTypeand relationType.Gets all known relationTypes.getSourceTypesByDestination(Type destinationType) Gets all source Types related to the given destinationType.getSourceTypesByDestinationAndRelationType(Type destinationType, Type relationType) Gets all source Types related to the given destinationTypeand relationType.getSourceTypesByRelationType(Type relationType) Gets all sourceTypesrelated by the given type.Gets aTypeby its string representation which is a combination of the authority and identifier.getTypes()Gets all the known Types.getTypesByAuthority(String authority) Gets all the known Types by authority.getTypesByDomain(String domain) Gets all the known Types by domain.getTypesByDomainAndAuthority(String domain, String authority) Gets all the known Types by domain and authority.booleanhasBaseType(Type type) Tests if the given type is derived from a base type.booleanTests if the givenTypeis known.booleanimpliesSupport(Type type, Type baseType) Tests if the given type is implies support of a base type.booleanisEquivalent(Type type, Type equivalentType) Tests if the given types are equivalent.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
-
canLookupTypes
boolean canLookupTypes()Tests if this user can performTypelookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getType
Type getType(String namespace, String identifier, String authority) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aTypeby its string representation which is a combination of the authority and identifier. This method only returns theTypeif it is known by the given identification components.- Parameters:
namespace- the identifier namespaceidentifier- the identifierauthority- the authority- Returns:
- the
Type - Throws:
NotFoundException- the type is not foundNullArgumentException-nullargument providedOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
hasType
Tests if the givenTypeis known.- Parameters:
type- theTypeto look for- Returns:
trueif the givenTypeis known,falseotherwise- Throws:
NullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getTypesByDomain
Gets all the known Types by domain.- Parameters:
domain- the domain- Returns:
- the list of
Typeswith the given domain - Throws:
NullArgumentException-domainisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getTypesByAuthority
TypeList getTypesByAuthority(String authority) throws OperationFailedException, PermissionDeniedException Gets all the known Types by authority.- Parameters:
authority- the authority- Returns:
- the list of
Typeswith the given authority - Throws:
NullArgumentException-authorityisnullOperationFailedException- unable to complete requestPermissionDeniedException- respect my authoritay- Compliance:
mandatory- This method must be implemented.
-
getTypesByDomainAndAuthority
TypeList getTypesByDomainAndAuthority(String domain, String authority) throws OperationFailedException, PermissionDeniedException Gets all the known Types by domain and authority.- Parameters:
domain- the domainauthority- the authority- Returns:
- the list of
Typeswith the given domain and authority - Throws:
NullArgumentException-domainorauthorityisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getTypes
Gets all the known Types.- Returns:
- the list of all known
Types - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isEquivalent
boolean isEquivalent(Type type, Type equivalentType) throws OperationFailedException, PermissionDeniedException Tests if the given types are equivalent.- Parameters:
type- a typeequivalentType- another type- Returns:
trueif both types are equivalent,falseotherwise- Throws:
NullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
impliesSupport
boolean impliesSupport(Type type, Type baseType) throws OperationFailedException, PermissionDeniedException Tests if the given type is implies support of a base type.- Parameters:
type- a typebaseType- another type- Returns:
trueifbaseTypeif supported bytype,falseotherwise- Throws:
NullArgumentException-typeorbaseTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
hasBaseType
Tests if the given type is derived from a base type.- Parameters:
type- a type- Returns:
trueis the given type is derived from a base type,falseotherwise- Throws:
NullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBaseTypes
Gets the immediate base types of this type.- Parameters:
type- a type- Returns:
- the base types
- Throws:
NullArgumentException-typeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRelationTypes
Gets all known relationTypes. A relation Types relates twoTypes.- Returns:
- known relation types
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getSourceTypesByRelationType
TypeList getSourceTypesByRelationType(Type relationType) throws OperationFailedException, PermissionDeniedException Gets all sourceTypesrelated by the given type.- Parameters:
relationType- a relation type- Returns:
- the source types
- Throws:
NullArgumentException-relationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDestinationTypesBySource
TypeList getDestinationTypesBySource(Type sourceType) throws OperationFailedException, PermissionDeniedException Gets all destination Types related to the given sourceType.- Parameters:
sourceType- a source type- Returns:
- the related types
- Throws:
NullArgumentException-sourceTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDestinationTypesBySourceAndRelationType
TypeList getDestinationTypesBySourceAndRelationType(Type sourceType, Type relationType) throws OperationFailedException, PermissionDeniedException Gets all destination Types related to the given sourceTypeand relationType.- Parameters:
sourceType- a source typerelationType- a relation type- Returns:
- the related types
- Throws:
NullArgumentException-sourceTypeorrelationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDestinationTypesByRelationType
TypeList getDestinationTypesByRelationType(Type relationType) throws OperationFailedException, PermissionDeniedException Gets all destinationTypesrelated by the given type.- Parameters:
relationType- a relation type- Returns:
- the destination types
- Throws:
NullArgumentException-relationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getSourceTypesByDestination
TypeList getSourceTypesByDestination(Type destinationType) throws OperationFailedException, PermissionDeniedException Gets all source Types related to the given destinationType.- Parameters:
destinationType- a destination type- Returns:
- the source types
- Throws:
NullArgumentException-destinationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getSourceTypesByDestinationAndRelationType
TypeList getSourceTypesByDestinationAndRelationType(Type destinationType, Type relationType) throws OperationFailedException, PermissionDeniedException Gets all source Types related to the given destinationTypeand relationType.- Parameters:
destinationType- a destination typerelationType- a relation type- Returns:
- the related types
- Throws:
NullArgumentException-destinationTypeorrelationTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-