Class Hierarchy All Classes All Fields and Methods

Class com.ibm.broker.config.proxy.DeploymentDescriptor

java.lang.Object
        com.ibm.broker.config.proxy.DeploymentDescriptor

public class DeploymentDescriptor
extends Object

Represents a deployment descriptor. While a deployment descriptor is not deployable in itself, it is used to override properties of message flows inside a broker archive file.

To manipulate deployment descriptors programatically, you must first either create one from scratch or load the existing file from the broker archive:

     BarFile b = BarFile.loadBarFile("C:\\MyBars\\test.bar");
     DeploymentDescriptor d = new DeploymentDescriptor();
         // [modify d here]
     b.setDeploymentDescriptor(d);
     b.save();
or
     BarFile b = BarFile.loadBarFile("C:\\MyBars\\test.bar");
     DeploymentDescriptor d = b.getDeploymentDescriptor();
         // [modify d here]
     b.save();
 

A number of methods in this class require a property identifier to be supplied. Property identifiers are a way of addressing a specific property that exists within a specific flow inside the Bar file. The format of the property identifier is FLOWNAME#NODENAME.PROPERTYNAME (FLOWNAME#PROPERTYNAME for message flow properties), where the '#' is the value of FLOW_NODE_DELIMITER, and the '.' is the value of NODE_PROPERTY_DELIMITER. However, unless you are creating a deployment descriptor from scratch it is normally possible to discover the available property identifiers using the getPropertyNames() and getOverriddenPropertyNames() methods.

The active deployment descriptor for a BarFile is always found in the Bar file's META-INF directory as the file 'broker.xml'. Manipulating the deployment descriptor implies manipulating this file. Changes are only persisted to the local filesystem if the BarFile.save() or BarFile.saveAs() is called.

com.ibm.broker.config.proxy.DeploymentDescriptor

Responsibilities A representation of a deployment descriptor. Provides the ability to change values in the deployment descriptor
Internal Collaborators None


 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 45166    2007-06-05  HDMPL           v6.1 Release
 
 

Field Index
Field Description
copyright IBM Copyright
FLOW_NODE_DELIMITER The String that separates the flow name from the node name inside property identifiers.
NODE_PROPERTY_DELIMITER The String that separates the node name from the property name inside property identifiers.
sccsid Version information
Constructor Index
Constructor Description
DeploymentDescriptor() Instantiates a blank DeploymentDescriptor object with no overridden properties.
DeploymentDescriptor(InputStream) Instantiates a new DeploymentDescriptor object that describes the deployment descriptor file with the supplied contents.
Method Index
Method Description
InputStream getContents() Returns the deployment descriptor physical format as an InputStream
Document getDeploymentDescriptorXML() Returns the raw XML document that describes the contents of the deployment descriptor.
String getFilename() Returns the static name of the deployment descriptor file, as it appears in the BAR file.
Enumeration getOverriddenPropertyIdentifiers() Returns an Enumeration of all the fully-qualified property identifiers that have been overridden in this deployment descriptor.
String getOverride(String) Returns the current value of an override given a fully-qualified property identifier.
Enumeration getPropertyIdentifiers() Returns an Enumeration of all the fully-qualified property identifiers that are described in this deployment descriptor, regardless of whether they have been overridden.
int replacePropertyValue(String, String) Sets or removes an override property in the deployment descriptor.
void setOverride(String, String) Sets or removes an override property in the deployment descriptor.

Fields

copyright

protected static final java.lang.String copyright

IBM Copyright

FLOW_NODE_DELIMITER

public static final java.lang.String FLOW_NODE_DELIMITER

The String that separates the flow name from the node name inside property identifiers.

NODE_PROPERTY_DELIMITER

public static final java.lang.String NODE_PROPERTY_DELIMITER

The String that separates the node name from the property name inside property identifiers.

sccsid

protected static final java.lang.String sccsid

Version information

Constructors

DeploymentDescriptor

public DeploymentDescriptor() 

Instantiates a blank DeploymentDescriptor object with no overridden properties.

DeploymentDescriptor

public DeploymentDescriptor(InputStream inputStream) throws SAXException, ParserConfigurationException, IOException

Instantiates a new DeploymentDescriptor object that describes the deployment descriptor file with the supplied contents.

Methods

getContents

public InputStream getContents() 

Returns the deployment descriptor physical format as an InputStream

getDeploymentDescriptorXML

public Document getDeploymentDescriptorXML() 

Returns the raw XML document that describes the contents of the deployment descriptor. It is not usually necessary to call this method; use the other public methods in this class to manipulate the deployment descriptor more easily.

getFilename

public String getFilename() 

Returns the static name of the deployment descriptor file, as it appears in the BAR file.

getOverriddenPropertyIdentifiers

public Enumeration getOverriddenPropertyIdentifiers() 

Returns an Enumeration of all the fully-qualified property identifiers that have been overridden in this deployment descriptor.

getOverride

public String getOverride(String propertyIdentifier) 

Returns the current value of an override given a fully-qualified property identifier. If the property whose name has been supplied has not been overridden in the deployment descriptor, null is returned. (This just means that the property has not been overridden; the property may still have been defined in the message flow.)

getPropertyIdentifiers

public Enumeration getPropertyIdentifiers() 

Returns an Enumeration of all the fully-qualified property identifiers that are described in this deployment descriptor, regardless of whether they have been overridden.

The number of property identifiers returned by this method depends on the way the the deployment descriptor was generated. Deployment descriptors generated by the Message Brokers Toolkit will contain a complete set of overridable properties for each flow in the Bar file. Deployment descriptors created programatically using the empty constructor will not list any overridable properties unless they have been set manually.

replacePropertyValue

public int replacePropertyValue(String oldPropertyValue,
                                String newPropertyValue) 

Sets or removes an override property in the deployment descriptor.

This method will attempt to find any values of the supplied oldPropertyValue parameter as a property value in the deployment descriptor (e.g. "OLD_QUEUE_NAME").

All occurrences of the old property value will be replaced with the newPropertyValue unless newPropertyValue is null, in which case this method removes any overrides that are found.

Changes to the deployment descriptor are not saved to the local filesystem unless BarFile.save() or BarFile.saveAs() is called.

setOverride

public void setOverride(String propertyIdentifier,
                        String newPropertyValue) throws IllegalArgumentException

Sets or removes an override property in the deployment descriptor.

This method will attempt to override a property whose fully-qualified name is the value of propertyIdentifier (e.g. "sampleFlow#MQOutput.queueManagerName"). If the property had not previously been overridden, then a new override is added to the deployment descriptor.

If the value of newPropertyValue is null, this method removes the first override that is found after following the above algorithm. This means that the property value specified in the message flow definition will be used.

Changes to the deployment descriptor are not saved to the local filesystem unless BarFile.save() or BarFile.saveAs() is called.

Class Hierarchy All Classes All Fields and Methods