Skip navigation links


com.fatwire.cs.core.uri
Class Simple

java.lang.Object
  extended by com.fatwire.cs.core.uri.Simple

All Implemented Interfaces:
Definition
Direct Known Subclasses:
SatelliteTokenAssembler.STADefinition

public class Simple
extends java.lang.Object
implements Definition

Simple implementation of the Definition interface. No bells or whistles, it's simply a value class.

Since:
19-Oct-2004 1:59:21 PM

Nested Class Summary

 

Nested classes/interfaces inherited from interface com.fatwire.cs.core.uri.Definition
Definition.AppType, Definition.ContainerType, Definition.SatelliteContext

 

Field Summary

 

Fields inherited from interface com.fatwire.cs.core.uri.Definition
LOG_NAME

 

Constructor Summary
Simple(boolean enc, Definition.SatelliteContext context, Definition.ContainerType ct, java.lang.String scheme, java.lang.String authority, Definition.AppType at, java.lang.String frag)
          Simple Definition

 

Method Summary
 Definition.AppType getAppType()
          Returns the app type for which this URI is to be generated.
 java.util.Collection getAttrbuteNames()
          Returns the keys of all the attributes.
 java.lang.Object getAttribute(java.lang.String key)
          Return an attribute with the given key.
 java.lang.String getAuthority()
          Returns the authority for this URI.
 Definition.ContainerType getContainerType()
          Returns the container type for which this URI is to be generated.
 java.lang.String getFragment()
          Returns a fragment identifier for this URI.
 java.lang.String getParameter(java.lang.String sName)
          Return a single parameter with the given name.
 java.util.Collection getParameterNames()
          Returns the names of all the parameters.
 java.lang.String[] getParameters(java.lang.String sName)
          Returns an array of parameters with the given name.
 Definition.SatelliteContext getSatelliteContext()
          Returns an object describing whether the URI should be forcibly set to render a Satellite Server URL or a Content Server URL.
 java.lang.String getScheme()
          Returns the scheme for this URI.
 boolean sessionEncode()
          Returns true if this URI should be session-encoded by the container.
 void setAttribute(java.lang.String key, java.lang.Object value)
           
 java.lang.String[] setQueryStringParameter(java.lang.String name, java.lang.String value)
          Adds a value to the list of parameters for this Definition.
 java.lang.String[] setQueryStringParameter(java.lang.String name, java.lang.String[] value)
          Sets the query string parameter for the name specified.
 java.util.Map setQueryStringParameters(java.util.Map args)
          Sets all of the query string parameters for this Definition.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Simple

public Simple(boolean enc,
              Definition.SatelliteContext context,
              Definition.ContainerType ct,
              java.lang.String scheme,
              java.lang.String authority,
              Definition.AppType at,
              java.lang.String frag)
Simple Definition
Parameters:
enc - True to session-encode the URI, false to not session-encode the URI
context - SATELLITE_SERVER to force a SS URL, CONTENT_SERVER to force a CS URL, or null to choose dynamically.
ct - the container type generating the URI.
scheme - the scheme for this uri, like http or https. Null is ok.
authority - the authority (host:port or host) for this URI. Null is ok.
at - app type for the URI
frag - fragment for the URI

Method Detail

setQueryStringParameter

public java.lang.String[] setQueryStringParameter(java.lang.String name,
                                                  java.lang.String value)
Adds a value to the list of parameters for this Definition.
Parameters:
name - name of the parameter
value - value of the parameter. If the value is already set, an additional value is specified.
Returns:
string array of all of the original values for this parameter, or null if this is the first parameter to be added
See Also:
Simple.setQueryStringParameter(String, String[])

setQueryStringParameter

public java.lang.String[] setQueryStringParameter(java.lang.String name,
                                                  java.lang.String[] value)
Sets the query string parameter for the name specified. If previous values exited for this parameter, they are replaced with the new values.
Parameters:
name - name of the parameter
value - value of the parameter. If the value is already set, this replaces all other values for this parameter name.
Returns:
string array of all of the original values for this parameter, or null if the parameter did not already exist.
See Also:
Simple.setQueryStringParameter(String, String)

setQueryStringParameters

public java.util.Map setQueryStringParameters(java.util.Map args)
Sets all of the query string parameters for this Definition. If any previous parameters have been set, they are returned in a map.
Parameters:
args - Map of String/String[] pairs that contains all of the parameters for this map.
Returns:
map of all the previous parameters (in String/String[] pairs) that have been set. If no previous parameters have been set, the returned map is empty.
Throws:
java.lang.IllegalArgumentException - if the map is not of the correct form.

getAppType

public Definition.AppType getAppType()
Description copied from interface: Definition
Returns the app type for which this URI is to be generated. This flag indicates to the assembler that a uri should be for Content Server, Blob Server or any other related app type.
Specified by:
getAppType in interface Definition
Returns:
app type.
See Also:
@link{AppType}

getFragment

public java.lang.String getFragment()
Description copied from interface: Definition
Returns a fragment identifier for this URI.
Specified by:
getFragment in interface Definition
Returns:
fragment identifier for this URI.

getScheme

public java.lang.String getScheme()
Description copied from interface: Definition
Returns the scheme for this URI. Typical values include http and https.
Specified by:
getScheme in interface Definition
Returns:
URI scheme or null if not specified
See Also:
URI.getScheme()

getAuthority

public java.lang.String getAuthority()
Description copied from interface: Definition
Returns the authority for this URI. This is typically a host and port, separated by a colon. For example, localhost:7001. Note that port is optional. As a result, another legal value would include localhost.
Specified by:
getAuthority in interface Definition
Returns:
URI authority or null if not specified.
See Also:
URI.getAuthority()

getContainerType

public Definition.ContainerType getContainerType()
Description copied from interface: Definition
Returns the container type for which this URI is to be generated. Most uses will likely return Definition.ContainerType.DEFAULT which allows the current container to be used, however when switching container types is important, this method should return a different value. An example might be a popup window in a portlet.
Specified by:
getContainerType in interface Definition
Returns:
container type.
See Also:
ContainerType}

getParameter

public java.lang.String getParameter(java.lang.String sName)
Description copied from interface: Definition
Return a single parameter with the given name. If there are multiple parameters, only the first one is returned.
Specified by:
getParameter in interface Definition
Parameters:
sName - parameter name
Returns:
parameter value or null if not found

getParameters

public java.lang.String[] getParameters(java.lang.String sName)
Description copied from interface: Definition
Returns an array of parameters with the given name. If there is only one parameter by the given name, an array of length one will be returned.
Specified by:
getParameters in interface Definition
Parameters:
sName - parameter name
Returns:
parameter values or null if no values exist.

getParameterNames

public java.util.Collection getParameterNames()
Description copied from interface: Definition
Returns the names of all the parameters.
Specified by:
getParameterNames in interface Definition
Returns:
collection of parameter names

sessionEncode

public boolean sessionEncode()
Description copied from interface: Definition
Returns true if this URI should be session-encoded by the container.
Specified by:
sessionEncode in interface Definition
Returns:
true to session-encode, false to not session-encode.

getSatelliteContext

public Definition.SatelliteContext getSatelliteContext()
Returns an object describing whether the URI should be forcibly set to render a Satellite Server URL or a Content Server URL. If no SatelliteContext is defined, then its apparent value will be determined at runtime. This means that if Satellite Server is serving the page displaying this URI, the URI will be for Satellite Server. Likewise, if Content Server is serving the page, the context will not be switched to Satellite Server.
Specified by:
getSatelliteContext in interface Definition
Returns:
Satellite Server, Content Server, or null.
See Also:
SatelliteContext}

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Description copied from interface: Definition
Return an attribute with the given key.
Specified by:
getAttribute in interface Definition
Parameters:
key - attribute key
Returns:
attribute value or null if not found

getAttrbuteNames

public java.util.Collection getAttrbuteNames()
Description copied from interface: Definition
Returns the keys of all the attributes.
Specified by:
getAttrbuteNames in interface Definition
Returns:
collection of attribute names

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.