com.ibm.portal.resolver.uri
Class PortletURI

java.lang.Object
  extended by com.ibm.portal.resolver.uri.BaseURI
      extended by com.ibm.portal.resolver.uri.PortletURI
All Implemented Interfaces:
Identifiable, Addressable, Constants

public class PortletURI
extends BaseURI
implements Addressable, Constants, Identifiable

Handles URIs of the format

   portlet:<portletWindowID>[@<pageID>][/<pocURIScheme>/<pocURISchemeSpecificPart>]
 
in case there are '@' signs in the portletWindowID or pageID they must be escaped using URL escaping. pocURI does not need to be escaped specifically. The IDs can either be serialized objectIDs or unique names.

Since:
6.1.0.1

Field Summary
 
Fields inherited from class com.ibm.portal.resolver.uri.BaseURI
NULL_FACTORY
 
Fields inherited from interface com.ibm.portal.resolver.data.Addressable
EMPTY_PARAMETERS
 
Fields inherited from interface com.ibm.portal.resolver.Constants
ALL_BINDING_SET, ALL_BINDINGS, CREATE_DATA_SINK_FACTORY_EXTENSION_POINT, DATA_SINK_FACTORY_EXTENSION_POINT, DATA_SOURCE_FACTORY_EXTENSION_POINT, DEFAULT_BINDING_SET, DEFAULT_BINDINGS, DEFAULT_BUFFER_SIZE, DEFAULT_POST_BINDING_SET, DEFAULT_POST_BINDINGS, DELETE_DATA_SINK_FACTORY_EXTENSION_POINT, HTTP_BINDING, HTTP_DELETE_BINDING, HTTP_GET_BINDING, HTTP_MULTIPART_POST_BINDING, HTTP_POST_BINDING, KEY_ASPECT, KEY_CACHE_CONTROL, KEY_CACHE_POLICY, KEY_CACHE_SCOPE, KEY_CALENDAR, KEY_DIGEST, KEY_LOCALE, KEY_MAX_AGE, KEY_MIME_TYPE, KEY_MODE, KEY_POCURI_PARAM, KEY_PRAGMA, KEY_PROJECT_CONTEXT, KEY_REPRESENTATION_COMPACT, KEY_REPRESENTATION_EMPTY, KEY_REPRESENTATION_FULL, KEY_REPRESENTATION_MEDIUM, KEY_REPRESENTATION_MODE, KEY_STATE_URL, KEY_TIME_ZONE, KEY_UNENCODED_URI, KEY_URI, KEY_USER_CONTEXT, KEY_VARY, KEY_VERB, KEY_VIRTUAL_PORTAL_CONTEXT, PORTLET_CONTENT_LOCATION_TYPE, RESOLVER_EXTENSION_POINT, SCHEME_PORTLET, SCHEME_REDIRECT, UPDATE_DATA_SINK_FACTORY_EXTENSION_POINT, VALUE_CACHE, VALUE_DELETE, VALUE_DOWNLOAD, VALUE_DROP, VALUE_LOOKUP, VALUE_MERGE, VALUE_MUST_REVALIDATE, VALUE_NO_CACHE, VALUE_NO_STORE, VALUE_NONE, VALUE_PRIVATE, VALUE_PUBLIC, VALUE_REFRESH, VALUE_REPLACE, VALUE_REPRESENTATION_COMPACT, VALUE_REPRESENTATION_EMPTY, VALUE_REPRESENTATION_FULL, VALUE_REPRESENTATION_MEDIUM, VALUE_UNDEFINED, VALUE_UPDATE, VALUE_UPLOAD, VALUE_VIEW, WP_SELECTION_BINDING
 
Fields inherited from interface com.ibm.portal.resolver.uri.Constants
ESCAPE_CHAR, ESCAPE_STRG
 
Constructor Summary
PortletURI(java.net.URI portletURI, Identification id)
          Tokenizes the uri into the components that make up a portlet URI
PortletURI(java.net.URI portletURI, Identification id, PocURIFactory uriFct)
          Tokenizes the uri into the components that make up a portlet URI
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 ObjectID getObjectID()
          Returns the object ID of the portlet window
 ObjectID getPageID()
          Returns the objectID of the page
 java.util.Map<java.lang.String,java.lang.String[]> getParameters()
           Returns an potentially unmodifiable version of the parameters used to address the object, never null, but potentially the empty map.
 java.net.URI getPocURI()
           
 ObjectID getPortletWindowID()
          Deprecated. use getObjectID() instead, since the URI not always contains portlet window IDs
 java.net.URI getURI()
          Returns the unique identifier of the object.
 int hashCode()
           
static java.net.URI newInstance(Identifiable resourceID, Identifiable pageID, java.net.URI pocURI, Identification id, PocURIFactory uriFct)
          Constructs a new URI that matches the pattern of a portlet URI.
static java.net.URI newInstance(Identifiable resourceID, java.net.URI pocURI, Identification id, PocURIFactory aFactory)
          Constructs a new URI that matches the pattern of a portlet URI.
static java.net.URI newInstance(ObjectID resourceID, ObjectID pageID, java.net.URI pocURI, Identification id)
          Constructs a new URI that matches the pattern of a portlet URI.
static java.net.URI newInstance(ObjectID resourceID, ObjectID pageID, java.net.URI pocURI, Identification id, PocURIFactory uriFct)
          Constructs a new URI that matches the pattern of a portlet URI.
static java.net.URI newInstance(ObjectID resourceID, java.net.URI pocURI, Identification id)
          Constructs a new URI that matches the pattern of a portlet URI.
static java.net.URI newInstance(ObjectID resourceID, java.net.URI pocURI, Identification id, PocURIFactory uriFct)
          Constructs a new URI that matches the pattern of a portlet URI.
 java.net.URI newInstance(java.net.URI aPocURI)
          Construct a portlet URI with the same portlet ID but a new POC URI
 java.lang.String toString()
           
 java.net.URI toURI()
          Returns the URI version of this portlet URI
 
Methods inherited from class com.ibm.portal.resolver.uri.BaseURI
createURI, createURI, createURI, createURI, decode, decode, decode, decode, encode, encode, normalizeRawSchemeSpecificPart, normalizeRawSchemeSpecificPart
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortletURI

public PortletURI(java.net.URI portletURI,
                  Identification id)
           throws SerializationException,
                  java.net.URISyntaxException,
                  java.io.IOException
Tokenizes the uri into the components that make up a portlet URI

Parameters:
portletURI - uri to decode
id - identification service used for string deserialization
Throws:
SerializationException - for errors during the serialization or deserialization of object IDs.
java.net.URISyntaxException - if a POCURI is available and if this URI is not a valid URI
java.io.IOException - for errors during the decoding process

PortletURI

public PortletURI(java.net.URI portletURI,
                  Identification id,
                  PocURIFactory uriFct)
           throws SerializationException,
                  java.net.URISyntaxException,
                  java.io.IOException
Tokenizes the uri into the components that make up a portlet URI

Parameters:
portletURI - uri to decode
id - identification service used for string deserialization
Throws:
SerializationException - for errors during the serialization or deserialization of object IDs.
java.net.URISyntaxException - if a POCURI is available and if this URI is not a valid URI
java.io.IOException - for errors during the decoding process
Method Detail

newInstance

public static final java.net.URI newInstance(Identifiable resourceID,
                                             Identifiable pageID,
                                             java.net.URI pocURI,
                                             Identification id,
                                             PocURIFactory uriFct)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
resourceID - objectID to the portlet window, must not be null
pageID - objectID of the page that contains the portlet window, may be null
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
SerializationException
java.net.URISyntaxException
java.net.URISyntaxException
java.io.IOException
java.io.IOException

newInstance

public static final java.net.URI newInstance(Identifiable resourceID,
                                             java.net.URI pocURI,
                                             Identification id,
                                             PocURIFactory aFactory)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
resourceID - objectID to the portlet window, must not be null
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
java.net.URISyntaxException
java.io.IOException
Since:
8.5

newInstance

public static final java.net.URI newInstance(ObjectID resourceID,
                                             ObjectID pageID,
                                             java.net.URI pocURI,
                                             Identification id)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
resourceID - objectID to the portlet window, must not be null
pageID - objectID of the page that contains the portlet window, may be null
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
SerializationException
java.net.URISyntaxException
java.net.URISyntaxException
java.io.IOException
java.io.IOException

newInstance

public static final java.net.URI newInstance(ObjectID resourceID,
                                             ObjectID pageID,
                                             java.net.URI pocURI,
                                             Identification id,
                                             PocURIFactory uriFct)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
resourceID - objectID to the portlet window, must not be null
pageID - objectID of the page that contains the portlet window, may be null
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
SerializationException
java.net.URISyntaxException
java.net.URISyntaxException
java.io.IOException
java.io.IOException

newInstance

public static final java.net.URI newInstance(ObjectID resourceID,
                                             java.net.URI pocURI,
                                             Identification id)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
resourceID - objectID to the portlet window, must not be null
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
java.net.URISyntaxException
java.io.IOException
Since:
6.1.0.1

newInstance

public static final java.net.URI newInstance(ObjectID resourceID,
                                             java.net.URI pocURI,
                                             Identification id,
                                             PocURIFactory uriFct)
                                      throws SerializationException,
                                             java.net.URISyntaxException,
                                             java.io.IOException
Constructs a new URI that matches the pattern of a portlet URI.

Parameters:
resourceID - objectID to the portlet window, must not be null
pocURI - pocURI, potentially null
id - identification service used for the serialization of the objectIDs
Returns:
URI to the portlet
Throws:
SerializationException
java.net.URISyntaxException
java.io.IOException
Since:
8.5

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getObjectID

public ObjectID getObjectID()
Returns the object ID of the portlet window

Specified by:
getObjectID in interface Identifiable
Returns:
the ObjectID of this resource, this can never be null
See Also:
Identifiable.getObjectID()

getPageID

public ObjectID getPageID()
Returns the objectID of the page

Returns:
the page ID, may be null

getParameters

public java.util.Map<java.lang.String,java.lang.String[]> getParameters()
Description copied from interface: Addressable

Returns an potentially unmodifiable version of the parameters used to address the object, never null, but potentially the empty map.

The key is of type String, the values of type String[]

Specified by:
getParameters in interface Addressable
Returns:
parameter map

getPocURI

public java.net.URI getPocURI()
Returns:
the POC URI, may be null

getPortletWindowID

@Deprecated
public ObjectID getPortletWindowID()
Deprecated. use getObjectID() instead, since the URI not always contains portlet window IDs

Returns the objectID of the portlet window.

Returns:
the window ID, never null

getURI

public java.net.URI getURI()
Description copied from interface: Addressable
Returns the unique identifier of the object. The URI must contain valid scheme information and cannot be just a relative URL.

Specified by:
getURI in interface Addressable
Returns:
URI of the object, never null.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

newInstance

public java.net.URI newInstance(java.net.URI aPocURI)
                         throws SerializationException,
                                java.net.URISyntaxException,
                                java.io.IOException
Construct a portlet URI with the same portlet ID but a new POC URI

Parameters:
aPocURI - the new poc URI
Returns:
the new URI
Throws:
java.net.URISyntaxException
SerializationException
java.io.IOException
Since:
6.1.0.3

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toURI

public java.net.URI toURI()
Returns the URI version of this portlet URI

Returns:
the URI
Since:
6.1.0.3