org.apache.axis.client

Class AdminClient

public class AdminClient extends Object

An admin client object that can be used both from the command line and programmatically.

Author: Rob Jellinghaus (robj@unrealities.com) Doug Davis (dug@us.ibm.com) Simeon Simeonov (simeons@macromedia.com)

Field Summary
protected Callcall
the object that represents our call
protected static Loglog
protected static StringROOT_UNDEPLOY
root element of the undeploy request
Constructor Summary
AdminClient()
Construct an admin client w/o a logger.
AdminClient(boolean ignored)
this is a somwhat contrived variant constructor, one that throws an exception if things go wrong.
Method Summary
CallgetCall()
External access to our Call
Stringlist(Options opts)
process the options then run a list call
Stringlist()
send a list command
static voidmain(String[] args)
Creates in instance of AdminClient and invokes process(args).
Stringprocess(String[] args)

Processes a set of administration commands.

The following commands are available:

  • -lurl sets the AxisServlet URL
  • -hhostName sets the AxisServlet host
  • -pportNumber sets the AxisServlet port
  • -sservletPath sets the path to the AxisServlet
  • -ffileName specifies that a simple file protocol should be used
  • -uusername sets the username
  • -wpassword sets the password
  • -d sets the debug flag (for instance, -ddd would set it to 3)
  • -tname sets the transport chain touse
  • list will list the currently deployed services
  • quit will quit (?
Stringprocess(InputStream input)
Stringprocess(URL xmlURL)
Stringprocess(String xmlFile)
process an XML file containing a pre-prepared admin message
Stringprocess(Options opts, String xmlFile)
Stringprocess(Options opts, InputStream input)
submit the input stream's contents to the endpoint, return the results as a string.
voidprocessOpts(Options opts)
go from the (parsed) command line to setting properties on our call object.
Stringquit(Options opts)
process the command line ops, then send a quit command
Stringquit()
make a quit command
static voidsetDefaultConfiguration(EngineConfiguration config)
If the user calls this with an EngineConfiguration object, all AdminClients on this thread will use that EngineConfiguration rather than the default one.
voidsetLogin(String user, String password)
set the username and password requires that call!
voidsetTargetEndpointAddress(URL address)
set the URL to deploy to requires that call!
voidsetTransport(String transportName)
set the transport to deploy with. requires that call!
StringundeployHandler(String handlerName)
undeploy a handler
StringundeployService(String serviceName)
undeploy a service

Field Detail

call

protected Call call
the object that represents our call

log

protected static Log log

ROOT_UNDEPLOY

protected static final String ROOT_UNDEPLOY
root element of the undeploy request

Constructor Detail

AdminClient

public AdminClient()
Construct an admin client w/o a logger. If the client cannot create a call object, then it does not throw an exception. Instead it prints a message to System.err. This is for 'historical reasons'

AdminClient

public AdminClient(boolean ignored)
this is a somwhat contrived variant constructor, one that throws an exception if things go wrong.

Parameters: ignored

Method Detail

getCall

public Call getCall()
External access to our CallReturns: the Call object this instance uses

list

public String list(Options opts)
process the options then run a list call

Parameters: opts

Returns:

Throws: Exception

list

public String list()
send a list command

Returns: the response from the call

Throws: Exception

main

public static void main(String[] args)
Creates in instance of AdminClient and invokes process(args).

Diagnostic output goes to log.info.

Parameters: args Commands to process

process

public String process(String[] args)

Processes a set of administration commands.

The following commands are available:

If -l or -h -p -s are not set, the AdminClient will invoke http://localhost:8080/axis/servlet/AxisServlet.

Parameters: args Commands to process

Returns: XML result or null in case of failure. In the case of multiple commands, the XML results will be concatenated, separated by \n

Throws: Exception Could be an IO exception, an AxisFault or something else

process

public String process(InputStream input)

process

public String process(URL xmlURL)

process

public String process(String xmlFile)
process an XML file containing a pre-prepared admin message

Parameters: xmlFile file to load

Returns:

Throws: Exception

process

public String process(Options opts, String xmlFile)

process

public String process(Options opts, InputStream input)
submit the input stream's contents to the endpoint, return the results as a string. The input stream is always closed after the call, whether the request worked or not

Parameters: opts options -can be null input -input stream for request

Returns:

Throws: Exception if the call was null AxisFault if the invocation returned an empty response

processOpts

public void processOpts(Options opts)
go from the (parsed) command line to setting properties on our call object.

Parameters: opts

Throws: Exception if call==null

quit

public String quit(Options opts)
process the command line ops, then send a quit command

Parameters: opts

Returns:

Throws: Exception

quit

public String quit()
make a quit command

Returns:

Throws: Exception

setDefaultConfiguration

public static void setDefaultConfiguration(EngineConfiguration config)
If the user calls this with an EngineConfiguration object, all AdminClients on this thread will use that EngineConfiguration rather than the default one. This is primarily to enable the deployment of custom transports and handlers.

Parameters: config the EngineConfiguration which should be used

setLogin

public void setLogin(String user, String password)
set the username and password requires that call!=null

Parameters: user username password password

setTargetEndpointAddress

public void setTargetEndpointAddress(URL address)
set the URL to deploy to requires that call!=null

Parameters: address

setTransport

public void setTransport(String transportName)
set the transport to deploy with. requires that call!=null

Parameters: transportName a null or empty value does not trigger a setting

undeployHandler

public String undeployHandler(String handlerName)
undeploy a handler

Parameters: handlerName name of the handler to undeploy

Returns:

Throws: Exception

undeployService

public String undeployService(String serviceName)
undeploy a service

Parameters: serviceName name of service

Returns:

Throws: Exception

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.