Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Command Line Interface : Security Tasks

Security Tasks
The security tasks include the connect and disconnect tasks. The tasks are used when invoking multiple tasks in a single target. They only provide registry URLs and credentials required to connect to a UDDI server. After the connection to the server is established, all the other tasks use the same credentials till the connection is terminated.
The connect task takes the connectionid property, which is passed to all the other tasks as the connection information. While executing multiple tasks in a target, you can provide the resultKeys property to all find tasks, which will save all UDDI keys in the property. As shown in the following example, the property is passed to all get tasks to retrieve the particular entity.
<find_business
      businessName="node"
      qualifier="exactMatch"
      outputFile="OutputFilePath\OutputFileName"
      limit="5"
      overwrite="false"
      resultKeys="businessKey"
      connectionid="ConnectionID"/>
The output of the above task will be stored in the output file and the UDDI keys of all the business entities returned are stored in the property specified in the resultKeys property (in this example, businessKey is specified). You can use resultKeys as a parameter to get the business entities through the following get_businessDetail task.
<get_businessDetail
      businessKey="${businessKey}"
      outputFile="OutputFilePath\OutputFileName"
      connectionid=ConnectionID/>
The following example is used to connect to a server. It contains all the related properties. In actual use, you can set part of the properties as needed.
<connect userName=UserName password=Password
      inquiryURL="http://Host:Port/uddi/services/inquiry"
      securityURL="http://Host:Port/uddi/services/security"
      publishURL="http://Host:Port/uddi/services/publication"
      subscriptionURL="http://Host:Port/uddi/services/subscription"
      adminURL="http://Host:Port/uddi/services/admin"
      trustStoreFolder=CertificatePath
      trustStorePath=TrustStorePath
      trustStoreType=TrustStoreType
      trustStorePassword=TrustStorePassword
      proxyHost=ProxyHostAddress
      proxyPort=ProxyPort
      proxyUsername=ProxyUsername
      proxyPassword=ProxyPassword
      connectionid=ConnectionID/>
With anonymous inquiry disabled, the username, password, and securityURL properties are required; with anonymous inquiry enabled, the username and password properties can be left empty. See Table 3, Ant-based Tasks and the Corresponding Required URL for related information.
You can execute multiple tasks in a target, as shown below.
<taskdef resource="com/tibco/uddi/commandline/ant/antlib.xml" />
<target name="executeMultiple">
 
  <connect  
      userName=Username
      password=Password
      inquiryURL="http://Host:Port/uddi/services/inquiry"
      securityURL="http://Host:Port/uddi/services/security"
      publishURL="http://Host:Port/uddi/services/publication"
      subscriptionURL="http://Host:Port/uddi/services/subscription"
      connectionid=ConnectionID/>
  <find_business
      businessName="node"
      qualifier="exactMatch"
      outputFile="OutputFilePath\OutputFileName"
      limit="5"
      overwrite="false"
      resultKeys="businessKey"
      connectionid=ConnectionID/>
 
  <get_businessDetail
      businessKey="${businessKey}"
      outputFile="OutputFilePath\OutputfileName"
      connectionid=ConnectionID/>
 
  <find_tModel
      tmodelName="%"
      qualifier="approximateMatch"
      outputFile="OutputFilePath\OutputfileName"
      overwrite="false"
      failOnError="true"
      resultKeys="tmodelKey"
      limit="5"
      connectionid=ConnectionID/>
 
  <get_tModelDetail
      tmodelKey="${tmodelKey}"
      overwrite="false"
      outputFile="OutputFilePath\OutputFileName"
      connectionid=ConnectionID/>
 
  <save_business
      businessName="Name"
      description="description"
      businessKey=BusinessKey
      outputFile="OutputFilePath\OutputFileName"
      overwrite="false"
      connectionid=ConnectionID/>
 
  <delete_business
      businessKey=BusinessKey
      connectionid=ConnectionID/>
 
  <save_subscription
      dataType="find_business"
      businessName="%"
      qualifier="approximateMatch"
      subscriptionKey=SubscriptionKey
      subBindingKey=""
      brief="false"
      notificationInterval=NotificationInterval
      maxEntities="5"
      expireAfter=ExpireTime
      outputFile="OutputFilePath\OutputFileName"
      overwrite="false"
connectionid=ConnectionID/>
   <disconnect connectionid=ConnectionID/>
</target>
There are two ways to specify the API used to input subscription data for the save_subscription Ant-based task. To specify the API in data files, you need to specify the name of the API (such as find_business in the above example). To specify the API in CLI, however, you need to specify the number corresponding to the desired API, as shown in the beginning of save_subscription.
When executing multiple tasks in a target, you need to make sure the output files of different Ant-based tasks are different to prevent output data of different Ant-based tasks from being overwritten. Otherwise, even if the overwrite option is set to false, the output of a subsequent Ant-based task will overwrite that of the previous one. For example, the output file for the find_business and get_businessDetail tasks in the above sample should be different.
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved