org.overlord.sramp.governance.shell.commands
Class Dir2BrmsCommand

java.lang.Object
  extended by org.overlord.sramp.shell.api.AbstractShellCommand
      extended by org.overlord.sramp.governance.shell.commands.Dir2BrmsCommand
All Implemented Interfaces:
ShellCommand

public class Dir2BrmsCommand
extends AbstractShellCommand

Some good resources: https://community.jboss.org/wiki/AtomPubInterfaceForGuvnor http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/ch09.html https://github.com/droolsjbpm/guvnor/blob/master/guvnor-webapp-drools/src/test/java/org/drools/guvnor/server/jaxrs/BasicPackageResourceIntegrationTest.java

Author:
kstam

Constructor Summary
Dir2BrmsCommand()
          Constructor.
 
Method Summary
 void addAssetsToPackageToBRMS(String brmsBaseUrl, String pkgName, String userId, String password, String packagePath)
          Uploads assets to the correct package in BRMS.
protected  void applyAuth(HttpURLConnection connection, String user, String password)
          Applies authentication to the given HTTP URL connection.
 void createNewPackage(String brmsBaseUrl, String pkgName, String userId, String password)
          A HTTP POST request to URL http://host:portnumber/repository/packages with the data: testPackage1 desc1
 void execute()
           
static void main(String[] args)
          Main entry point - for use outside the interactive shell.
 void printHelp()
           
 void printUsage()
           
 boolean urlExists(String checkUrl, String user, String password)
          Returns true if the given URL is accessible.
 
Methods inherited from class org.overlord.sramp.shell.api.AbstractShellCommand
getArguments, getContext, optionalArgument, optionalArgument, print, requiredArgument, setArguments, setContext, setOutput, tabCompletion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dir2BrmsCommand

public Dir2BrmsCommand()
Constructor.

Method Detail

main

public static void main(String[] args)
                 throws Exception
Main entry point - for use outside the interactive shell.

Parameters:
args -
Throws:
Exception

printUsage

public void printUsage()
See Also:
shell.ShellCommand

printHelp

public void printHelp()
See Also:
shell.ShellCommand

execute

public void execute()
             throws Exception
Throws:
Exception
See Also:
shell.ShellCommand

urlExists

public boolean urlExists(String checkUrl,
                         String user,
                         String password)
Returns true if the given URL is accessible.

Parameters:
checkUrl -
user -
password -

applyAuth

protected void applyAuth(HttpURLConnection connection,
                         String user,
                         String password)
Applies authentication to the given HTTP URL connection.

Parameters:
connection -
user -
password -

createNewPackage

public void createNewPackage(String brmsBaseUrl,
                             String pkgName,
                             String userId,
                             String password)
                      throws Exception
A HTTP POST request to URL http://host:portnumber/repository/packages with the data: testPackage1 desc1

Parameters:
brmsBaseUrl -
pkgName -
userId -
password -
Throws:
Exception

addAssetsToPackageToBRMS

public void addAssetsToPackageToBRMS(String brmsBaseUrl,
                                     String pkgName,
                                     String userId,
                                     String password,
                                     String packagePath)
                              throws Exception
Uploads assets to the correct package in BRMS.

Parameters:
brmsBaseUrl -
pkgName -
userId -
password -
packagePath -
Throws:
Exception


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.