Skip to content
Permalink
Browse files

Add files via upload

Init project
  • Loading branch information...
SysIntAu committed Jan 11, 2017
1 parent 9ed54b8 commit 501b73c1c4e3fdc82af57da495d1d0ac820c34c6
Showing with 15,534 additions and 0 deletions.
  1. +265 −0 AgileGreenBook.xml
  2. +8 −0 dist/DEV.properties
  3. +60 −0 dist/ant-usage.txt
  4. +83 −0 dist/cmd-usage.txt
  5. +80 −0 dist/console-usage.txt
  6. +2 −0 dist/dpdirect.cmd
  7. +81 −0 dist/dptask_example.xml
  8. BIN dist/lib/ant.jar
  9. BIN dist/lib/log4j.jar
  10. BIN dist/lib/xercesImpl.jar
  11. BIN dist/lib/xml-apis.jar
  12. +38 −0 dpAssembly.xml
  13. BIN dpdirect-1.0.4.jar
  14. BIN lib/ant.jar
  15. BIN lib/log4j.jar
  16. BIN lib/xercesImpl.jar
  17. BIN lib/xml-apis.jar
  18. +96 −0 pom.xml
  19. +689 −0 src/main/java/org/dpdirect/dpmgmt/Constants.java
  20. +816 −0 src/main/java/org/dpdirect/dpmgmt/DPCustomOp.java
  21. +529 −0 src/main/java/org/dpdirect/dpmgmt/DPDirect.java
  22. +2,467 −0 src/main/java/org/dpdirect/dpmgmt/DPDirectBase.java
  23. +285 −0 src/main/java/org/dpdirect/dpmgmt/DPDirectInterface.java
  24. +262 −0 src/main/java/org/dpdirect/dpmgmt/DPDirectTask.java
  25. +976 −0 src/main/java/org/dpdirect/dpmgmt/ResponseParser.java
  26. +356 −0 src/main/java/org/dpdirect/schema/DocumentHelper.java
  27. +493 −0 src/main/java/org/dpdirect/schema/SchemaHelper.java
  28. +1,001 −0 src/main/java/org/dpdirect/schema/SchemaLoader.java
  29. +65 −0 src/main/java/org/dpdirect/utils/Credentials.java
  30. +137 −0 src/main/java/org/dpdirect/utils/DPDirectProperties.java
  31. +636 −0 src/main/java/org/dpdirect/utils/FileUtils.java
  32. +141 −0 src/main/java/org/dpdirect/utils/PostXML.java
  33. +93 −0 src/main/java/org/dpdirect/utils/SSL.java
  34. +1,238 −0 src/main/resources/datapower/default/mgmt/app-mgmt-protocol-v3.xsd
  35. +696 −0 src/main/resources/datapower/default/mgmt/app-mgmt-protocol.xsd
  36. +33 −0 src/main/resources/dpdirect.properties
  37. +227 −0 src/main/resources/log4j.dtd
  38. +24 −0 src/main/resources/log4j.xml
  39. +126 −0 src/main/resources/soap/1.1/soap-envelope.xsd
  40. +60 −0 src/main/resources/usage/ant-usage.txt
  41. +97 −0 src/main/resources/usage/cmd-usage.txt
  42. +8 −0 src/main/resources/usage/cmdline/DEV.properties
  43. +2 −0 src/main/resources/usage/cmdline/dpdirect.cmd
  44. +91 −0 src/main/resources/usage/console-usage.txt
  45. +81 −0 src/main/resources/usage/dptask_example.xml
  46. +56 −0 src/test/resources/test-scripts/AntTaskUsage.TXT
  47. +52 −0 src/test/resources/test-scripts/CmdLineUsage.TXT
  48. +61 −0 src/test/resources/test-scripts/ConsoleUsage.TXT
  49. +4 −0 src/test/resources/test-scripts/DEV.properties
  50. +13 −0 src/test/resources/test-scripts/build.properties
  51. +42 −0 src/test/resources/test-scripts/build.xml
  52. +24 −0 src/test/resources/test-scripts/log4j.xml
  53. +1,238 −0 target/classes/datapower/default/mgmt/app-mgmt-protocol-v3.xsd
  54. +696 −0 target/classes/datapower/default/mgmt/app-mgmt-protocol.xsd
  55. +33 −0 target/classes/dpdirect.properties
  56. +227 −0 target/classes/log4j.dtd
  57. +24 −0 target/classes/log4j.xml
  58. BIN target/classes/org/dpdirect/dpmgmt/Constants.class
  59. BIN target/classes/org/dpdirect/dpmgmt/DPCustomOp$1.class
  60. BIN target/classes/org/dpdirect/dpmgmt/DPCustomOp.class
  61. BIN target/classes/org/dpdirect/dpmgmt/DPDirect.class
  62. BIN target/classes/org/dpdirect/dpmgmt/DPDirectBase$Operation$Option.class
  63. BIN target/classes/org/dpdirect/dpmgmt/DPDirectBase$Operation.class
  64. BIN target/classes/org/dpdirect/dpmgmt/DPDirectBase.class
  65. BIN target/classes/org/dpdirect/dpmgmt/DPDirectInterface.class
  66. BIN target/classes/org/dpdirect/dpmgmt/DPDirectTask.class
  67. BIN target/classes/org/dpdirect/dpmgmt/ResponseParser$1.class
  68. BIN target/classes/org/dpdirect/dpmgmt/ResponseParser$OutputType.class
  69. BIN target/classes/org/dpdirect/dpmgmt/ResponseParser.class
  70. BIN target/classes/org/dpdirect/schema/DocumentHelper.class
  71. BIN target/classes/org/dpdirect/schema/SchemaHelper.class
  72. BIN target/classes/org/dpdirect/schema/SchemaLoader.class
  73. BIN target/classes/org/dpdirect/utils/Credentials.class
  74. BIN target/classes/org/dpdirect/utils/DPDirectProperties.class
  75. BIN target/classes/org/dpdirect/utils/FileUtils.class
  76. BIN target/classes/org/dpdirect/utils/PostXML.class
  77. BIN target/classes/org/dpdirect/utils/SSL$1.class
  78. BIN target/classes/org/dpdirect/utils/SSL$2.class
  79. BIN target/classes/org/dpdirect/utils/SSL.class
  80. +126 −0 target/classes/soap/1.1/soap-envelope.xsd
  81. +60 −0 target/classes/usage/ant-usage.txt
  82. +97 −0 target/classes/usage/cmd-usage.txt
  83. +8 −0 target/classes/usage/cmdline/DEV.properties
  84. +2 −0 target/classes/usage/cmdline/dpdirect.cmd
  85. +91 −0 target/classes/usage/console-usage.txt
  86. +81 −0 target/classes/usage/dptask_example.xml
  87. BIN target/dpdirect-1.0.5-deploy.zip
  88. BIN target/dpdirect-1.0.5.jar
  89. +5 −0 target/maven-archiver/pom.properties
  90. +56 −0 target/test-classes/test-scripts/AntTaskUsage.TXT
  91. +52 −0 target/test-classes/test-scripts/CmdLineUsage.TXT
  92. +61 −0 target/test-classes/test-scripts/ConsoleUsage.TXT
  93. +4 −0 target/test-classes/test-scripts/DEV.properties
  94. +13 −0 target/test-classes/test-scripts/build.properties
  95. +42 −0 target/test-classes/test-scripts/build.xml
  96. +24 −0 target/test-classes/test-scripts/log4j.xml

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,8 @@
domain=DEV
hostname=ESB_DEV
firmware=default

# Creds should be provided by a _netrc or .netrc file in your profile path.
# However creds can be over-ridden in plaintext using the following:
Username=devUser
Password=devPassWord
@@ -0,0 +1,60 @@
DPDirect Ant Task Usage:

Declare the taskdef (eg. 'dpDeploy') inside your ant target.
Eg.
<taskdef name="dpDeploy" classname="org.dpdirect.datapower.management.DPDirect" classpath="DPDirect.jar"/>

Invoke the DPDirect task (as 'dpDeploy' in this eg), with the following attributes (global options):
hostname (required)
username, userPassword (optional - extracted from .netrc or _netrc)
port (optional - default is '5550')
failOnError (optional - default is 'true')
rollbackOnError (optional - default is 'false')
verbose (optional - default is 'false')
domain (optional global default domain)
outputType <XML|LINES|PARSED> (<XML|LINES|PARSED> - default is 'PARSED'
style of output : for the eyeball(PARSED), string manipulation(LINES) or xml parsing(XML))
firmware (major version number, default is '4'.
'5' offers enhanced SOMA, AMP v3)
schema (add schema, alternative schema location)
Eg.
<dpDeploy domain="SCRATCH" verbose="true" userName="EFGRTT" userPassword="droWssaP">

Nest operation identifiers - with mandatory valid SOMA or AMP operation name attribute
Nested operations are processed sequentially
Invoke operations with the following attributes (operation options):
name (mandatory - valid SOMA or AMP operation name)
domain (optional - defaults to global default domain)
destFile (optional - reqired only for download: get-file, do-export etc)
srcFile (optional - reqired only for upload: set-file, do-import etc)
destDir (optional - reqired only for custom operations get-dir, set-dir)
srcDir (optional - reqired only for custom operations get-dir, set-dir)
overwrite (optional - reqired only for custom operations get-dir, set-dir)
Eg.
<dpDeploy domain="SCRATCH" verbose="true" userName="EFGRTT" userPassword="droWssaP">
<operation name="SaveConfig" />
<operation name="get-dir" destDir="C:/temp/SV001" srcDir="local:/SV001"/>
</operation>

Nest operation options (optional) - SOMA and AMP operation attributes and element values in name=* value=* format.
Operation option names may be attribute or element names, or may be written in '.' or '/' separated path values
An '@' character speficically denotes an attribute value
Eg.
<operation name="do-export" destFile="c:/temp/SCRATCH.zip">
<option name="format" value="ZIP"/>
<option name="do-export@all-files" value="true"/>
</operation>

Example usage:
<target name="testDeploy">
<taskdef name="dpDeploy" classname="org.dpdirect.datapower.management.DPDirect" classpath="DPDirect.jar"/>
<dpDeploy domain="SCRATCH">
<operation name="SaveConfig" />
<operation name="get-dir" srcDir="local:/SV001" destDir="C:/temp/SV001"/>
<operation name="do-import">
<option name="do-import" srcFile="C:/temp/SCRATCH.zip"/>
<option name="overwrite-files" value="true"/>
</operation>
<operation name="RetartDomainRequest" domain="SCRATCH"/>
</dpDeploy>
</target>
@@ -0,0 +1,83 @@
DataPower DPDirect Command Line Usage:

Help: 'DPDirect help' returns this page.
'DPDirect help console' returns console specific help.
'DPDirect help ant' returns help on using DPDirect as an ant task.
'DPDirect find <regex>' returns sample XML for any operation
matching the given regex, Eg. 'DPDirect find .*[Cc]hange.*'
or containing the given word, Eg. 'DPDirect find change' .
The sample XML will indicate the attributes and values that may be set for an operation.
Be aware that most attributes and values will be optional.

Properties file (optional)
The FIRST parameter may name a properties file containing global options
The properties must reside next to the DPDirect jar file and take the form <name>.properties
It is not necessary to include the .properties extension at the cmd-line
Eg. dpdirect DEV ...

Global/Deployment options (optional)
Global Options (must precede any SOMA or AMP operations).
name=value pairs may include:
hostname=<aHostname> (reqired, cmdLine or properties file)
username=<DPusername> (optional, .netrc file, cmdLine, prop file or prompt)
userPassword=<DPpassword> (optional, .netrc file, cmdLine, prop file or prompt)
port=<aPort> (default is '5550')
domain=<aDomainName> (default for following operations
failOnError=<trueOrFalse> (default is 'true')
rollbackOnError=<trueOrFalse> (default is 'false')
outputType=<XML|LINES|PARSED> (default is 'PARSED'
Style of output : for the eyeball(PARSED), string manipulation(LINES) or xml parsing(XML))
verbose=<trueOrFalse> (default is 'false')
firmware=<2004 | 3 | 4 | 5> (major version number, default is '4'.
'5' offers enhanced SOMA, AMP v3)
schema=<alt XMLMgmt schema path> (add schema, alternative schema location)
Eg. dpdirect DEV ...

CHOICE: you may hit enter for console mode. Console mode allows one operation at a time.

1. Hitting enter at this point will enter the DPDirect console mode.
Console mode allows one operation at a time and retains global settings such as username/userPassword.
Enter an operation name, eg. 'get-file', with options, eg. 'name=local:///myfile.xml'.
Use 'find' to discover valid attribute and element values. eg. 'find get-status'.

OR 2. Follow the global options with one or more operations identifiers - 'operation=<op-name>'.
Stack operations as per follows (this allows reuse of a single session - a faster scription option):

Operations identifier (at least one) - a valid SOMA or AMP operation name
Followed by...
Operation options (optional) - options pertaining to the immediately preceeding operation name
Operations and options may be stacked. Eg.
operation=set-file
domain=SCRATCH
set-file@name=<domainName>
set-file=c:/temp/myfile
operation=get-status
class=ActiveUsers
etc....

CONSOLE example: dpdirect hostname=soaserv01 userName=EFGRTT userPassword=droWssaP
CMDLINE example: dpdirect hostname=dp10101 domain=SYSTEST operation=get-status class=ActiveUsers operation=RestartDomainRequest operation=SaveConfig

Note: an 'Operation' must correspond to a valid SOMA or AMP request element,
OR a custom dpdirect operation as follows.

Custom Operations: 'tail-log', 'set-dir' and 'get-dir' are custom operations not catered for in the base schema.
tail-log takes an optional 'name' parameter (name of the log file - default is 'default-log')
optional 'filter' and 'filterOut' parameters to filter lines based on whether the given string is contained,
and an optional 'lines' parameter (starting lines - default is 12).
Eg. tail-log filter=mq lines=30
get-status - when issued WITHOUT a 'class=...' identifier, the get-status command will return all
'ObjectStatus' statii that do NOT return an EventCode of '0x00000000', or optionally
specify 'filter' and/or 'filterOut' parameters to filter lines based on whether the given string is contained.
Eg. get-status filter=MultiProtocolGateway filterOut=0x00000000|disabled
get-dir and set-dir take 'srcDir' and 'destDir' params in their native dest and src dir formats.

Custom Options:
srcFile - The value of an option is set to the base64 encoded content of the named file.
It is the source of any base64 payload uploaded to the device, such as set-file and do-import.
destFile - The datapower response will be base64 decoded and saved to the named path.
It is the destination of any base64 payload downloaded from the device, such as get-file and do-export.
filter and filterOut - will filter tail-log, get-status and get-log output.
endPoint - Rarely but occasionally a SOMA operation requires posting to the 2004 endpoint.
'endPoint=2004' will alter the XMLManagement end-point. Other options are 'AMP', 'SOMA',
or a manually constructed relative path, eg '/service/mgmt/amp/1.0'.
@@ -0,0 +1,80 @@
DataPower DPDirect Console Usage:

Enter a SOMA or AMP operation name, followed by 'name=value' options for the operation.
Eg. set-file name=local:/myConfig.xml srcFile=c:/Temp/myConfig.xml
Console mode allows one operation at a time and retains global settings such as username/userPassword.
Global/Deployment options may be altered within the console in a 'name=value' format.
Eg. domain=MYDOMAIN

Operations Help: 'find <regex>' returns sample XML for any operation
matching the given regex, Eg. 'DPDirect find .*[Cc]hange.*'
or containing the given word, Eg. 'DPDirect find change' .

The sample XML will indicate the attributes and values that may be set as options for an operation.
Be aware that some attributes are mandatory, and some (often most) are optional.

Typing 'find get-status' will return sample XML for the get-status operation,
and a list of valid values for the class attribute. Eg.
------------------------------------------------------
DPDirect> find get-status
# Sample XML:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<man:request domain="?" xmlns:man="http://www.datapower.com/schemas/management">
<man:get-status class="?"/>
</man:request>
</env:Body>
</env:Envelope>

# Valid 'class' attribute values:
ActiveUsers, ARPStatus, AS1PollerSourceProtocolHandlerSummary, AS2SourceProtocolHandlerSummary... (etc)
------------------------------------------------------
The sample indicates that when issuing a get-status request, the class option must be set to a valid value,
Eg. get-status class=ActiveUsers

Custom Operations: 'tail-log', 'set-dir' and 'get-dir' are custom ops not catered for in the base schema.
tail-log takes an optional 'name' parameter (name of the log file - default is 'default-log')
optional 'filter' and 'filterOut' parameters to filter lines based on whether the given string is contained,
and an optional 'lines' parameter (starting lines - default is 12).
Eg. tail-log filter=mq lines=30
tail-count (experimental) takes mandatory 'name' and 'class' parameters, e.g. 'name=Ext_Gateway class=MultiProtocolGateway'
Provides a polling count monitor on the named object.
get-status - when issued WITHOUT a 'class=...' identifier, the get-status command will return all
'ObjectStatus' statii that do NOT return an EventCode of '0x00000000', or optionally
specify 'filter' and/or 'filterOut' parameters to filter lines based on whether the given string is contained.
Eg. get-status filter=MultiProtocolGateway filterOut=0x00000000|disabled
get-dir and set-dir take 'srcDir' and 'destDir' params
in their native dest and src dir formats.

Custom Options:
srcFile - The value of an option is set to the base64 encoded content of the named file.
It is the source of any base64 payload uploaded to the device, such as set-file and do-import.
destFile - The datapower response will be base64 decoded and saved to the named path.
It is the destination of any base64 payload downloaded from the device,
such as get-file and do-export.
filter and filterOut - will filter tail-log, get-status and get-log output.
endPoint - Rarely but occasionally a SOMA operation requires posting to the 2004 endpoint.
'endPoint=2004' will alter the XMLManagement end-point. Other options are 'AMP', 'SOMA',
or a manually constructed relative path, eg '/service/mgmt/amp/1.0'.

Starting the console:
The FIRST parameter may name a properties file containing global options.
Eg. dpdirect DEV
Global options follow. Name=value pairs may include:
hostname=<aHostname> (required, cmdLine or properties file)
username=<DPusername> (required, _netrc file, cmdLine, prop file or prompt)
userPassword=<DPpassword> (required, _netrc file, cmdLine, prop file or prompt)
port=<aPort> (default is '5550')
domain=<aDomainName> (default for following operations
failOnError=<trueOrFalse> (default is 'true')
rollbackOnError=<trueOrFalse> (default is 'false')
verbose=<trueOrFalse> (default is 'false')
firmware=<2004 | 3 | 4 | 5> (major version number, default is '4',
'5' offers enhanced SOMA, AMP v3)
schema=<alt XMLMgmt schema path> (add schema, alternative schema location)
Eg. dpdirect DEV domain=SCRATCH ...

Global options may be altered from within the console, Eg. domain=NEWSCRATCH


@@ -0,0 +1,2 @@
@echo off
java -cp .\dpdirect-1.0.5.jar;.\lib\log4j.jar;.\lib\xercesImpl.jar;.\lib\xml-apis.jar org.dpdirect.dpmgmt.DPDirect %*
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- *******************************************************************
**
** NAME
** ant.simple.example.xml
**
** PURPOSE
** This file is an example ANT build script for deployment to
** DataPower XML acceleration devices.
**
** PARMS
** To use the deploy targets locally, the following parameters should be supplied as a minimum:
** hostname == Device to deploy to.
** userName, userPassword == User credentials
** service.name == name of services to deploy - correlates to a deployable <serviceName>.zip (or xml) file in teh staging.dir.
** domain == Working domain (default is '<service.name>' domain)
** staging.dir == Staging dir contains the built deployment artifacts, this will be a temporary buildforge working directory
**
** OPTIONAL PARMS - Deployment
** source.type == ZIP or XML (default is 'ZIP')
**
******************************************************************** -->
<project name="dp-deploy" default="deploy">

<!-- *****************************************************************
** Parameters : may be overridden from a properties file or via cmdLine
****************************************************************** -->
<!-- Default Environment -->
<property name="environment" value="DEV"/>

<!-- Location of optional properties file -->
<property file="deployment.properties"/>
<property file="${environment}.properties"/>

<!-- Device parameters -->
<property name="dp.soma.port" value="5550"/>
<property name="domain" value="${service.name}"/>

<!-- Deployment parameters -->
<property name="source.type" value="ZIP"/>
<property name="verbose" value="false"/>

<!-- Default locations -->
<property name="lib.dir" value="${basedir}/lib"/>

<!-- *****************************************************************
** Set up the "DPDirect" task library
****************************************************************** -->
<path id="dpdirect.class.path">
<!-- classpath for the dpdirect task -->
<pathelement location="dpdirect-1.1.0.jar"/>
<pathelement location="${lib.dir}/xercesImpl.jar"/>
<pathelement location="${lib.dir}/log4j.jar"/>
</path>
<taskdef name="dpDeploy" classname="org.dpdirect.dpmgmt.DPDirectTask" classpathref="dpdirect.class.path"/>


<!-- **********************************************************
** target: deploy.all
**
** PURPOSE
** Deploy all objects in the ${service.name}.ZIP file to each dp device, and also
** deploy all service files in the 'src' dir to the local:///${service.name} path
****************************************************************** -->
<target name="deploy">
<dpDeploy domain="${domain}"
hostname="${hostname}" firmware="5" verbose="${verbose}">
<operation name="GetDomainStatusRequest" domain="EXISTK-TEST">
<option name="Domain" value="EXISTK-TEST"/>
</operation>
<operation name="get-status">
<option name="domain" value="EXISTK-TEST"/>
<option name="class" value="ActiveUsers"/>
</operation>
<operation name="SaveConfig">
<option name="domain" value="EXISTK-TEST"/>
</operation>
</dpDeploy>
</target>

</project>
BIN +1.84 MB dist/lib/ant.jar
Binary file not shown.
BIN +344 KB dist/lib/log4j.jar
Binary file not shown.
Binary file not shown.
BIN +190 KB dist/lib/xml-apis.jar
Binary file not shown.
@@ -0,0 +1,38 @@
<?xml version='1.0' encoding='UTF-8'?>
<assembly>
<id>deploy</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src\main\resources\usage</directory>
<outputDirectory>dpdirect</outputDirectory>
<includes>
<include>*.*</include>
</includes>
</fileSet>
<fileSet>
<directory>src\main\resources\usage\cmdline</directory>
<outputDirectory>dpdirect</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
<fileSet>
<directory>lib</directory>
<outputDirectory>dpdirect\lib</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory>dpdirect</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
BIN +369 KB dpdirect-1.0.4.jar
Binary file not shown.
BIN +1.84 MB lib/ant.jar
Binary file not shown.
BIN +344 KB lib/log4j.jar
Binary file not shown.
BIN +1.17 MB lib/xercesImpl.jar
Binary file not shown.
BIN +190 KB lib/xml-apis.jar
Binary file not shown.
Oops, something went wrong.

0 comments on commit 501b73c

Please sign in to comment.
You can’t perform that action at this time.