Build File for Proxy Service Management
Use the command-line interface for proxy service managment to create and remove proxy applications. This section covers some of the commonly used targets to create and manage a proxy application. For more help on targets, use the command: <target name="help"></target>. The build file for proxy service management is located under <TIBCO-HOME>/pd/1.0/scripts/psm.
project Element
The project element declares the default build target for the build.xml file. taskdef and target are subelements of the project. The optional default attribute allows you to specify a default target. You can select any target from the build file to be the default target.
<project default="target">
<taskdef ... />
<target name="target" ... />
</project>
import Element
The import element identifies the task definition file, which defines the path to the libraries required by ActiveMatrix Policy Director.
<import file="${basic.cli.file}"/>
<import file="${gov.admin.cli.file}"/>
property Element
The property element identifies the properties definition file, which defines the path to the scripts required by ActiveMatrix Policy Director. The following code snippet serves as an example:
<property file="${props.file}"/>
<property name="soap-http-resources-file"
value="${pd.scripts.directory}/psm/http_resource_template_configs.xml"/>
<property name="soap-jms-resources-file"
value="${pd.scripts.directory}/psm/jms_resource_template_configs.xml"/>
<property name="soap-http-data-file"
value="${pd.scripts.directory}/psm/cli_data_http.xml"/>
<property name="soap-http-data-file-properties"
value="${pd.samples.directory}/proxyapp/soap-over-http/data.properties"/>
<property name="soap-http-wsdl-file"
value="${pd.samples.directory}/proxyapp/soap-over-http/wsdls/BooksService.wsdl"/>
<property name="soap-jms-data-file"
value="${pd.scripts.directory}/psm/cli_data_jms.xml"/>
<property name="soap-jms-data-file-properties"
value="${pd.samples.directory}/proxyapp/soap-over-jms/data.properties"/>
<property name="soap-jms-wsdl-file"
value="${pd.samples.directory}/proxyapp/soap-over-jms/wsdls/BooksService.wsdl"/>
target Element
The target element specifies the actions performed for an execution of the command line interface via the GovernanceAdminTask subelement. In a target you can provide a depends attribute containing a list of targets. Each target will be run in order until one fails or the list completes.
<target name="target">
<AMXAdminTask ... />
</target>
create-samples Target
The sample proxy application uses one of the two communication modes: SOAP/HTTP or SOAP/JMS. The data file specified in the <antcall> parameter will change depending on the communcation mode.
<target name="create-samples"
description="Create sample proxy applications.
Two applications are created that will demonstrate SOAP/HTTP and SOAP/JMS usage. ">
<antcall target="create-sample-application">
<param name="dataFile" value="${soap-http-data-file}"/>
<param name="dataFile.properties" value="${soap-http-data-file-properties}"/>
<param name="wsdlFile" value="${soap-http-wsdl-file}"/>
</antcall>
<antcall target="create-sample-application">
<param name="dataFile" value="${soap-jms-data-file}"/>
<param name="dataFile.properties" value="${soap-jms-data-file-properties}"/>
<param name="wsdlFile" value="${soap-jms-wsdl-file}"/>
</antcall>
</target>
remove-samples Target
The remove-samples target is similar to the create-samples target.
<target name="remove-samples"
description="Remove sample proxy applications bundled with the product.
All resources created for this sample application will also be removed. ">
<antcall target="remove-sample-application">
<param name="dataFile" value="${soap-http-data-file}"/>
<param name="dataFile.properties" value="${soap-http-data-file-properties}"/>
<param name="wsdlFile" value="${soap-http-wsdl-file}"/>
</antcall>
<antcall target="remove-sample-application">
<param name="dataFile" value="${soap-jms-data-file}"/>
<param name="dataFile.properties" value="${soap-jms-data-file-properties}"/>
<param name="wsdlFile" value="${soap-jms-wsdl-file}"/>
</antcall>
</target>
soap-jms Target
Use the soap-jms target to specify the WSDL and data files.
<target name="soap-jms">
<property name="dataFile" value="${soap-jms-data-file}"/>
<property name="dataFile.properties" value="${soap-jms-data-file-properties}"/>
<property name="wsdlFile" value="${soap-jms-wsdl-file}"/>
</target>
soap-http Target
Use the soap-jms target to specify the WSDL and data files.
<target name="soap-http">
<property name="dataFile" value="${soap-http-data-file}"/>
<property name="dataFile.properties" value="${soap-http-data-file-properties}"/>
<property name="wsdlFile" value="${soap-http-wsdl-file}"/>
</target>
registerService Target
The registerService target is used to register a WSDL with the proxy application.
<target name="registerService"
description="Register a WSDL with TIBCO ActiveMatrix Policy Director
Proxy Service Management application"
depends="-validate">
<PDAdminTask failOnError="true" force="true" createIfNotExists="true"
merge="true" overwrite="true"
dataFile="${dataFile}" propsFile="${props.file}" remote="true"
objectSelector="WSDL"
action="register"/>
</target>
createProxyApplication Target
The createProxyApplication target is used to create a proxy application. The node and the resource instances specified in the data file must exist to ensure that the proxy application is created successfully.
<target name="createProxyApplication"
description="Create a proxy application with information provided in $${dataFile}.
depends="-validate">
<PDAdminTask failOnError="true" force="true" createIfNotExists="true"
merge="true" overwrite="true"
dataFile="${dataFile}" propsFile="${props.file}" remote="true"
objectSelector="ProxyApplication"
action="create"/>
</target>
getProxyApplication Target
The getProxyApplication target is used to fetch details of a proxy application.
<target name="getProxyApplication"
description="Retrieves proxy application details."
depends="-validate">
<PDAdminTask failOnError="true" force="true" createIfNotExists="true"
merge="true" overwrite="true"
dataFile="${dataFile}" propsFile="${props.file}" remote="true"
objectSelector="ProxyApplication"
action="get"/>
</target>
updateProxyApplication Target
The updateProxyApplication target is used to modify a proxy application.
<target name="updateProxyApplication"
description="Update a proxy application with information provided in $${dataFile}.
depends="-validate">
<PDAdminTask failOnError="true" force="true" createIfNotExists="true"
merge="true" overwrite="true"
dataFile="${dataFile}" propsFile="${props.file}" remote="true"
objectSelector="ProxyApplication"
action="update"/>
</target>
deleteProxyApplication Target
The deleteProxyApplication target is used to delete a proxy application. Before deleting, the application is stopped and undeployed. The resource templates/instances created for this application will not be removed.
<target name="deleteProxyApplication"
description="Deletes proxy application." depends="-validate">
<PDAdminTask failOnError="true" force="true" createIfNotExists="true"
merge="true" overwrite="true"
dataFile="${dataFile}" propsFile="${props.file}" remote="true"
objectSelector="ProxyApplication"
action="delete"/>
</target>
configure-ProxyNode Target
The following code snippet is an example on configuring a proxy node:
<target name="configure-ProxyNode">
<ant dir="${TIBCO_HOME}/pd/1.0/scripts"
antfile="governance_pd_proxynode_build.xml">
<property name="TIBCO_HOME" value="${TIBCO_HOME}"/>
<property name="pd.proxynode.config.CLI.data.file"
value="${psm.scripts.directory}/governance_pd_proxy_node_data.xml"/>
<property name="port.number.file" value="${port.number}"/>
<property name="node.name" value="${node.name}"/>
<property name="pd.proxymanagement.urlpattern" value="%Endpoint%proxy"/>
<property name="create.proxy.node" value="true"/>
</ant>
</target>
remove.ProxyNode Target
The following code snippet is an example on removing a proxy node:
<target name="remove.proxynode">
<ant dir="${TIBCO_HOME}/pd/1.0/scripts" target="remove.proxynode"
antfile="governance_pd_proxynode_build.xml">
<property name="TIBCO_HOME" value="${TIBCO_HOME}"/>
<property name="pd.proxynode.config.CLI.data.file"
value="${psm.scripts.directory}/governance_pd_proxy_node_data.xml"/>
<property name="port.number.file" value="${port.number}"/>
<property name="node.name" value="${node.name}"/>
<property name="create.proxy.node" value="true"/>
</ant>
</target>