org.purl.sword.client
Class CmdClient

java.lang.Object
  extended by org.purl.sword.client.CmdClient
All Implemented Interfaces:
ClientType

public class CmdClient
extends Object
implements ClientType

Example implementation of a command line client. This can send out service document requests and print out the results and process posting a file to either a single or multiple destinations. The command line options are initialised prior to calling the class. The options are passed into the run(ClientOptions) method.

Author:
Neil Taylor

Constructor Summary
CmdClient()
          Create a new instance of the class and create an instance of the client.
 
Method Summary
 void process()
          Process the options that have been initialised from the command line.
protected  void processPost(PostMessage message)
          Process the post response.
 void run(ClientOptions options)
          Run the client and process the specified options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdClient

public CmdClient()
Create a new instance of the class and create an instance of the client.

Method Detail

process

public void process()
Process the options that have been initialised from the command line. This will call one of service(), post() or multiPost().


processPost

protected void processPost(PostMessage message)
                    throws SWORDClientException
Process the post response. The message contains the list of arguments for the post. The method will then print out the details of the response.

Throws:
SWORDClientException - if there is an error accessing the post response.

run

public void run(ClientOptions options)
Run the client and process the specified options.

Specified by:
run in interface ClientType
Parameters:
options - The command line options.


Copyright © 2011 DuraSpace. All Rights Reserved.