Class URI

java.lang.Object
com.webmethods.portal.system.URI
All Implemented Interfaces:
IURI, IPooledObject<IURI>, Serializable, Cloneable

public class URI extends Object implements IURI, IPooledObject<IURI>
Default implementation of the IURI interface.
See Also:
  • Field Details

  • Constructor Details

    • URI

      public URI()
    • URI

      public URI(String uri)
  • Method Details

    • getSegment

      public String getSegment(int segment)
      Get the specified segment. The segments are 0 based, so the last segment is getSize () - 1.
      Specified by:
      getSegment in interface IURI
      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
      Specified by:
      getSize in interface IURI
      Returns:
      the amount of segments, always >= 1
    • setURI

      public void setURI(String uri)
      Set the URI on this object
      Parameters:
      uri - the new URI
    • getServiceName

      public String getServiceName()
      Returns the service name to which the identified resource belongs, or null if not determined.
      Specified by:
      getServiceName in interface IURI
    • getSegments

      public String getSegments(int start)
      Get the partial URI starting with the supplied segment to the end of the URI.
      Specified by:
      getSegments in interface IURI
      Parameters:
      start - the segment to start the URI
      Returns:
      a String representing the partial URI
    • getSegments

      public String getSegments(int start, int end)
      Get the segments that fall within the given range, inclusively.
      Specified by:
      getSegments in interface IURI
      Parameters:
      start - the starting segment
      end - the last segment to retrieve
      Returns:
      a String representing this section of the URI
    • toString

      public String toString()
      Description copied from interface: IURI
      Gets the resource's string id.
      Specified by:
      toString in interface IURI
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • initialize

      public void initialize(String uri) throws PortalException
      Initialize this URI with the given String. Should only be called by the URI factory.
      Specified by:
      initialize in interface IURI
      Parameters:
      uri - the String version of the URI
      Throws:
      PortalException - if invalid uri
    • getPool

      public IObjectPool<IURI> getPool()
      Gets this object's pool. May return null.
      Specified by:
      getPool in interface IPooledObject<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 interface IPooledObject<IURI>
    • setPool

      public void setPool(IObjectPool<IURI> pool)
      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 interface IPooledObject<IURI>
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public Object clone() throws CloneNotSupportedException
      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 interface IURI
      Overrides:
      clone in class Object
      Returns:
      a non-pooled version of thie IURI
      Throws:
      CloneNotSupportedException
    • parseURI

      protected void parseURI()