Class DefaultObjectResolver
java.lang.Object
com.polarion.subterra.base.data.identification.DefaultObjectResolver
- All Implemented Interfaces:
IObjectResolver
Implementation of
IObjectResolver
.
This is a "self-hosted" implementation. No other part of system is consulted including prototype provider which means that prototype existence is not checked and implementation must be changed if prototype provider changes its behavior.
Base SubterraURI for object id to SubterraURI conversion is not checked when SubterraURI is converted back to object id.
- Author:
- Stepan Roh, Polarion Software
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultObjectResolver
(SubterraURI objectIdBaseURI, SubterraURI prototypeBaseURI) Constructor with default prefix values.DefaultObjectResolver
(SubterraURI objectIdBaseURI, String objectIdSpecificPrefix, SubterraURI prototypeBaseURI, String prototypeSpecificPrefix) Constructor.DefaultObjectResolver
(String objectIdBaseURI, String prototypeBaseURI) Constructor with default prefix values and String ServiceLocators to construct SubterraURI. -
Method Summary
Modifier and TypeMethodDescriptionReturn prototype name for given prototype URI.Return object id for given SubterraURI.Return SubterraURI for given prototype name.getSubterraURIForObjectId
(IContextId contextId, ILocalId localId) getSubterraURIForObjectId
(IObjectId objectId) Return SubterraURI for given object id.getSubterraURIForObjectId
(IObjectId objectId, IContextId contextId) toString()
-
Field Details
-
DEFAULT_OBJECTID_SPECIFIC_PREFIX
Prefix for service specific part of data object's SubterraURI.- See Also:
-
DEFAULT_PROTOTYPE_SPECIFIC_PREFIX
Prefix for service specific part of prototype's SubterraURI.- See Also:
-
-
Constructor Details
-
DefaultObjectResolver
public DefaultObjectResolver(SubterraURI objectIdBaseURI, String objectIdSpecificPrefix, SubterraURI prototypeBaseURI, String prototypeSpecificPrefix) Constructor.- Parameters:
objectIdBaseURI
- base SubterraURI for object id to SubterraURI conversionobjectIdSpecificPrefix
- service specific part prefix for object id to SubterraURI conversionprototypeBaseURI
- base SubterraURI for prototype name to SubterraURI conversionprototypeSpecificPrefix
- service specific part prefix for prototype name to SubterraURI conversion- Throws:
IllegalArgumentException
- if objectIdBaseURI isnull
IllegalArgumentException
- if objectIdSpecificPrefix isnull
IllegalArgumentException
- if prototypeBaseURI isnull
IllegalArgumentException
- if prototypeSpecificPrefix isnull
-
DefaultObjectResolver
Constructor with default prefix values and String ServiceLocators to construct SubterraURI.- Parameters:
objectIdBaseURI
- base ServiceLocator for object id to SubterraURI conversionprototypeBaseURI
- base ServiceLocator for prototype name to SubterraURI conversion- Throws:
IllegalArgumentException
- if objectIdBaseURI isnull
IllegalArgumentException
- if prototypeBaseURI isnull
- See Also:
-
DefaultObjectResolver
Constructor with default prefix values.- Parameters:
objectIdBaseURI
- base SubterraURI for object id to SubterraURI conversionprototypeBaseURI
- base SubterraURI for prototype name to SubterraURI conversion- Throws:
IllegalArgumentException
- if objectIdBaseURI isnull
IllegalArgumentException
- if prototypeBaseURI isnull
- See Also:
-
-
Method Details
-
getObjectIdForSubterraURI
Description copied from interface:IObjectResolver
Return object id for given SubterraURI.- Specified by:
getObjectIdForSubterraURI
in interfaceIObjectResolver
- Parameters:
id
- SubterraURI- Returns:
- object id
-
getSubterraURIForObjectId
- Specified by:
getSubterraURIForObjectId
in interfaceIObjectResolver
-
getSubterraURIForObjectId
Description copied from interface:IObjectResolver
Return SubterraURI for given object id.- Specified by:
getSubterraURIForObjectId
in interfaceIObjectResolver
- Parameters:
objectId
- object id- Returns:
- SubterraURI
-
getSubterraURIForObjectId
- Specified by:
getSubterraURIForObjectId
in interfaceIObjectResolver
-
getSubterraURIForDataPrototypeName
Description copied from interface:IObjectResolver
Return SubterraURI for given prototype name.Existence of given prototype may or may not be checked.
- Specified by:
getSubterraURIForDataPrototypeName
in interfaceIObjectResolver
- Parameters:
name
- prototype name- Returns:
- SubterraURI
-
toString
-
getDataPrototypeNameForSubterraURI
Description copied from interface:IObjectResolver
Return prototype name for given prototype URI.- Specified by:
getDataPrototypeNameForSubterraURI
in interfaceIObjectResolver
- Parameters:
protoId
- SubterraURI- Returns:
- prototype name
-