Sonic ESB API

com.sonicsw.xq
Interface XQParameters

All Superinterfaces:
java.lang.Cloneable, XQCloneable

public interface XQParameters
extends XQCloneable

XQParameters provide a generic mechanism for adding name, value like information to other XQ components such as Services, Endpoints and Connections. The XQParameter uniquely identifies an entry by its name and its type where type is either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT. The value for each parameter is defined either inline or as a reference. The content for inline parameters is specified within the parameter. The content for reference parameters is specified as a URL to a resource stored either in the XQ Directory Service or at some external location. A parameter can be retrieved in either its string form or in its Object form. For example a XML parameter can be returned as either a String or as a DOM Element. Parameters can have a reference to a parent parameter object. If a parent is defined then queries to get parameters will be propagated to the parent instance if not found in this instance.


Method Summary
 boolean containsParameter(java.lang.String name, int type)
          Check if the specified parameter exists.
 java.util.Map<java.lang.String,XQParameterInfo> getAllInfo()
          Get a Map of all parameters defined in this XQParameters object.
 java.util.Iterator<XQParameterInfo> getAllInfo(int type)
          Get a list of XQParameterInfo structures for all parameters of the specified type.
 boolean getBooleanParameter(java.lang.String name, int type)
          Get a parameter as a boolean based on its name and type.
 byte getByteParameter(java.lang.String name, int type)
          Get a parameter as a byte based on its name and type.
 double getDoubleParameter(java.lang.String name, int type)
          Get a parameter as a double based on its name and type.
 float getFloatParameter(java.lang.String name, int type)
          Get a parameter as a float based on its name and type.
 XQParameterInfo getInfo(java.lang.String name, int type)
          Get the full information structure for the specified parameter.
 int getIntParameter(java.lang.String name, int type)
          Get a parameter as an int based on its name and type.
 long getLongParameter(java.lang.String name, int type)
          Get a parameter as a long based on its name and type.
 java.util.Iterator<java.lang.String> getNames(int type)
          Get a list of the parameter names that are defined of the specified type.
 java.lang.String getParameter(java.lang.String name, int type)
          Get a parameter as a String based on its name and type.
 java.lang.String getParameter(java.lang.String name, int type, java.lang.String defVal)
          Get a parameter as a String based on its name and type.
 java.lang.Object getParameterObject(java.lang.String name, int type)
          Get a parameter as an Object based on its name and type.
 java.lang.Object getParameterObject(java.lang.String name, int type, java.lang.Object defVal)
          Get a parameter as an Object based on its name and type.
 XQParameters getParent()
          Get a reference to a parent XQParameter object.
 short getShortParameter(java.lang.String name, int type)
          Get a parameter as a short based on its name and type.
 void removeAllParameters()
          removes all parameters from the map
 void removeParameter(java.lang.String name, int type)
          removes a specified parameter from the map
 XQParameterInfo setBooleanParameter(java.lang.String name, int type, boolean value)
          Set a parameter based on its name and type to the specified boolean value.
 XQParameterInfo setByteParameter(java.lang.String name, int type, byte value)
          Set a parameter based on its name and type to the specified byte value.
 XQParameterInfo setDoubleParameter(java.lang.String name, int type, double value)
          Set a parameter based on its name and type to the specified double value.
 XQParameterInfo setFloatParameter(java.lang.String name, int type, float value)
          Set a parameter based on its name and type to the specified float value.
 XQParameterInfo setIntParameter(java.lang.String name, int type, int value)
          Set a parameter based on its name and type to the specified int value.
 XQParameterInfo setLongParameter(java.lang.String name, int type, long value)
          Set a parameter based on its name and type to the specified long value.
 XQParameterInfo setParameter(java.lang.String name, int type, java.lang.String value)
          Set a parameter based on its name and type to the specified String value.
 XQParameterInfo setParameter(java.lang.String name, int type, java.lang.String value, java.lang.String ref)
          Set a parameter based on its name and type to the specified String value and the specified reference.
 XQParameterInfo setParameterObject(java.lang.String name, int type, java.lang.Object value)
          Set a parameter based on its name and type to the specified Object value.
 XQParameterInfo setParameterObject(java.lang.String name, int type, java.lang.Object value, java.lang.String ref)
          Set a parameter based on its name and type to the specified Object value and the specified reference.
 void setParent(XQParameters parent)
          Set a reference to a parent XQParameter object.
 XQParameterInfo setShortParameter(java.lang.String name, int type, short value)
          Set a parameter based on its name and type to the specified short value.
 
Methods inherited from interface com.sonicsw.xq.XQCloneable
clone
 

Method Detail

getParameter

java.lang.String getParameter(java.lang.String name,
                              int type)
Get a parameter as a String based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Returns null if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the String value for this parameter or null if the parameter is not defined.

getIntParameter

int getIntParameter(java.lang.String name,
                    int type)
                    throws XQServiceException
Get a parameter as an int based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Throws an XQServiceException if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the int value for this parameter
Throws:
XQServiceException - thrown if the parameter value is not defined or cannot be converted to an int

getShortParameter

short getShortParameter(java.lang.String name,
                        int type)
                        throws XQServiceException
Get a parameter as a short based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Throws an XQServiceException if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the short value for this parameter.
Throws:
XQServiceException - thrown if the parameter value is not defined or cannot be converted to a short

getLongParameter

long getLongParameter(java.lang.String name,
                      int type)
                      throws XQServiceException
Get a parameter as a long based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Throws an XQServiceException if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the long value for this parameter.
Throws:
XQServiceException - thrown if the parameter value is not defined or cannot be converted to a long

getDoubleParameter

double getDoubleParameter(java.lang.String name,
                          int type)
                          throws XQServiceException
Get a parameter as a double based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Throws an XQServiceException if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the double value for this parameter.
Throws:
XQServiceException - thrown if the parameter value is not defined or cannot be converted to a double

getFloatParameter

float getFloatParameter(java.lang.String name,
                        int type)
                        throws XQServiceException
Get a parameter as a float based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Throws an XQServiceException if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the float value for this parameter.
Throws:
XQServiceException - thrown if the parameter value is not defined or cannot be converted to a float

getByteParameter

byte getByteParameter(java.lang.String name,
                      int type)
                      throws XQServiceException
Get a parameter as a byte based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Throws an XQServiceException if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the byte value for this parameter.
Throws:
XQServiceException - thrown if the parameter value is not defined or cannot be converted to a byte

getBooleanParameter

boolean getBooleanParameter(java.lang.String name,
                            int type)
                            throws XQServiceException
Get a parameter as a boolean based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Returns false if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the boolean value for this parameter or false if the parameter is not defined.
Throws:
XQServiceException - thrown if this parameter value cannot be converted to a boolean

getParameter

java.lang.String getParameter(java.lang.String name,
                              int type,
                              java.lang.String defVal)
Get a parameter as a String based on its name and type. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. If the parameter is not found then the specified default value will be returned.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
defVal - a default value to return if not found
Returns:
the String value for this parameter or the specified default value.

getParameterObject

java.lang.Object getParameterObject(java.lang.String name,
                                    int type)
Get a parameter as an Object based on its name and type. The type of the returned Object will depend on the type of the parameter e.g. for XML parameters the Object will be a DOM Element. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. Returns null if parameter is not defined.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the Object value for this parameter or null if the parameter is not defined.

getParameterObject

java.lang.Object getParameterObject(java.lang.String name,
                                    int type,
                                    java.lang.Object defVal)
Get a parameter as an Object based on its name and type. The type of the returned Object will depend on the type of the parameter e.g. for XML parameters the Object will be a DOM Element. The parameter will be returned from this object if it is present, otherwise, if a parent XQParameter is configured then the parent will be checked. If the parameter is not found then the speciedied default value will be returned.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
defVal - a default value to return if not found
Returns:
the Object value for this parameter or the specified default value.

setParameter

XQParameterInfo setParameter(java.lang.String name,
                             int type,
                             java.lang.String value)
Set a parameter based on its name and type to the specified String value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setIntParameter

XQParameterInfo setIntParameter(java.lang.String name,
                                int type,
                                int value)
Set a parameter based on its name and type to the specified int value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setShortParameter

XQParameterInfo setShortParameter(java.lang.String name,
                                  int type,
                                  short value)
Set a parameter based on its name and type to the specified short value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setLongParameter

XQParameterInfo setLongParameter(java.lang.String name,
                                 int type,
                                 long value)
Set a parameter based on its name and type to the specified long value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setDoubleParameter

XQParameterInfo setDoubleParameter(java.lang.String name,
                                   int type,
                                   double value)
Set a parameter based on its name and type to the specified double value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setFloatParameter

XQParameterInfo setFloatParameter(java.lang.String name,
                                  int type,
                                  float value)
Set a parameter based on its name and type to the specified float value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setByteParameter

XQParameterInfo setByteParameter(java.lang.String name,
                                 int type,
                                 byte value)
Set a parameter based on its name and type to the specified byte value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setBooleanParameter

XQParameterInfo setBooleanParameter(java.lang.String name,
                                    int type,
                                    boolean value)
Set a parameter based on its name and type to the specified boolean value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setParameter

XQParameterInfo setParameter(java.lang.String name,
                             int type,
                             java.lang.String value,
                             java.lang.String ref)
Set a parameter based on its name and type to the specified String value and the specified reference.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the String value for this parameter or null
ref - the reference to a resource containing data for this parameter or null.
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setParameterObject

XQParameterInfo setParameterObject(java.lang.String name,
                                   int type,
                                   java.lang.Object value)
Set a parameter based on its name and type to the specified Object value.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the Object value for this parameter
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

setParameterObject

XQParameterInfo setParameterObject(java.lang.String name,
                                   int type,
                                   java.lang.Object value,
                                   java.lang.String ref)
Set a parameter based on its name and type to the specified Object value and the specified reference.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
value - the Object value for this parameter
ref - the reference to a resource containing data for this parameter or null.
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

getNames

java.util.Iterator<java.lang.String> getNames(int type)
Get a list of the parameter names that are defined of the specified type.

Parameters:
type - The type of parameters to return. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
a list of parameter names of the specified type

getInfo

XQParameterInfo getInfo(java.lang.String name,
                        int type)
Get the full information structure for the specified parameter.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
the XQParameterInfo structure containing all information for this parameter entry.

getAllInfo

java.util.Iterator<XQParameterInfo> getAllInfo(int type)
Get a list of XQParameterInfo structures for all parameters of the specified type.

Parameters:
type - The type of parameters to return. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
a list of XQParameterInfo structures of the specified type

getAllInfo

java.util.Map<java.lang.String,XQParameterInfo> getAllInfo()
Get a Map of all parameters defined in this XQParameters object. The value of each map entry will be a XQParameterInfo structure.

Returns:
a list of XQParameterInfo structures.

containsParameter

boolean containsParameter(java.lang.String name,
                          int type)
Check if the specified parameter exists.

Parameters:
name - the name of the parameter
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT
Returns:
true if the parameter exists, otherwise false.

setParent

void setParent(XQParameters parent)
Set a reference to a parent XQParameter object. On get operations the parent will be checked if a parameter is not found in the current parameter instance.

Parameters:
parent - a reference to another XQParameter object

getParent

XQParameters getParent()
Get a reference to a parent XQParameter object. On get operations the parent will be checked if a parameter is not found in the current parameter instance.

Parameters:
parent - a reference to another XQParameter object

removeParameter

void removeParameter(java.lang.String name,
                     int type)
removes a specified parameter from the map

Parameters:
name - the name of the parameter to remove
type - the type of the parameter. The type can be either XQConstants.PARAM_STRING, XQConstants.PARAM_XML or XQConstants.PARAM_OBJECT

removeAllParameters

void removeAllParameters()
removes all parameters from the map


Sonic ESB API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.