Interface IURI
- All Superinterfaces:
Cloneable
,Serializable
- All Known Subinterfaces:
IContentURI
,IContext
,IThingID
,IVersionURI
- All Known Implementing Classes:
URI
IURI is the interface used to represent an object that references a particular portal resource. All objects in the system can be looked up via an IURI.
All URIs point to one distinct object in the system. The URIs are looked up via the PortalSystem.lookup(com.webmethods.portal.system.IURI)
method, where the corresponding service resolves the URI into portal object. URIs are obtained via the PortalSystem.acquireURI(java.lang.String)
method, where the corresponding service constructs the unique URI for the object, and are in the form
/[service name]/[service dependent string]
.
Also URIs are pooled by default, meaning a reference should not be cached for a URI beyond the scope of a
request. If a URI is required to held for longer, use the clone()
method should be used to obtain
a non-pooled copy of the URI object.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
This creates a non-pooled clone of the object.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 URIvoid
initialize
(String uri) Initialize this URI with the given String.toString()
Gets the resource's string id.
-
Method Details
-
initialize
Initialize this URI with the given String. Should only be called by the URI factory.- Parameters:
uri
- the String version of the URI- Throws:
PortalException
- if invalid uri
-
getServiceName
String getServiceName()Returns the service name to which the identified resource belongs, or null if not determined. -
getSize
int getSize()Get the number of segments in this URI- Returns:
- the amount of segments, always >= 1
-
getSegment
Get the specified segment. The segments are 0 based, so the last segment is getSize () - 1.- Parameters:
segment
- the index of the segment to retrieve (0 based)- Returns:
- the specified segment, or null if no such segment exists
-
getSegments
Get the segments that fall within the given range, inclusively.- Parameters:
start
- the starting segmentend
- the last segment to retrieve- Returns:
- a String representing this section of the URI
-
getSegments
Get the partial URI starting with the supplied segment to the end of the URI.- Parameters:
start
- the segment to start the URI- Returns:
- a String representing the partial URI
-
toString
String toString()Gets the resource's string id. -
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.- Returns:
- a non-pooled version of thie IURI
- Throws:
CloneNotSupportedException
-