Package com.webmethods.portal.system
Class URI
java.lang.Object
com.webmethods.portal.system.URI
- All Implemented Interfaces:
IURI
,IPooledObject<IURI>
,Serializable
,Cloneable
Default implementation of the
IURI
interface.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
This creates a non-pooled clone of the object.boolean
getPool()
Gets this object's pool.getSegment
(int segment) Get the specified segment.getSegments
(int start) Get the partial URI starting with the supplied segment to the end of the URI.getSegments
(int start, int end) Get the segments that fall within the given range, inclusively.Returns the service name to which the identified resource belongs, or null if not determined.int
getSize()
Get the number of segments in this URIint
hashCode()
Returns a hash code value for the object.void
initialize
(String uri) Initialize this URI with the given String.protected void
parseURI()
void
release()
Cleans up this object's member resources, preparing it to be added back into the pool.void
setPool
(IObjectPool<IURI> pool) Sets this object's pool.void
Set the URI on this objecttoString()
Gets the resource's string id.
-
Field Details
-
m_uri
-
m_segments
-
m_pool
-
-
Constructor Details
-
URI
public URI() -
URI
-
-
Method Details
-
getSegment
Get the specified segment. The segments are 0 based, so the last segment is getSize () - 1.- Specified by:
getSegment
in interfaceIURI
- Parameters:
segment
- the index of the segment to retrieve (0 based)- Returns:
- the specified segment, or null if no such segment exists
-
getSize
public int getSize()Get the number of segments in this URI -
setURI
Set the URI on this object- Parameters:
uri
- the new URI
-
getServiceName
Returns the service name to which the identified resource belongs, or null if not determined.- Specified by:
getServiceName
in interfaceIURI
-
getSegments
Get the partial URI starting with the supplied segment to the end of the URI.- Specified by:
getSegments
in interfaceIURI
- Parameters:
start
- the segment to start the URI- Returns:
- a String representing the partial URI
-
getSegments
Get the segments that fall within the given range, inclusively.- Specified by:
getSegments
in interfaceIURI
- Parameters:
start
- the starting segmentend
- the last segment to retrieve- Returns:
- a String representing this section of the URI
-
toString
Description copied from interface:IURI
Gets the resource's string id. -
initialize
Initialize this URI with the given String. Should only be called by the URI factory.- Specified by:
initialize
in interfaceIURI
- Parameters:
uri
- the String version of the URI- Throws:
PortalException
- if invalid uri
-
getPool
Gets this object's pool. May return null.- Specified by:
getPool
in interfaceIPooledObject<IURI>
-
release
public void release()Cleans up this object's member resources, preparing it to be added back into the pool. This method should be called prior to checking this object back into the pool.- Specified by:
release
in interfaceIPooledObject<IURI>
-
setPool
Sets this object's pool. Implementing classes may choose not to allow this object's pool to be set. In that case,setPool(com.webmethods.portal.system.pool.IObjectPool<com.webmethods.portal.system.IURI>)
does nothing.- Specified by:
setPool
in interfaceIPooledObject<IURI>
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
-
clone
This creates a non-pooled clone of the object. Therefore, if you're original IURI was from an object pool, the cloned version will not be.- Specified by:
clone
in interfaceIURI
- Overrides:
clone
in classObject
- Returns:
- a non-pooled version of thie IURI
- Throws:
CloneNotSupportedException
-
parseURI
protected void parseURI()
-