org.apache.uima.ducc.cli
Class DuccServiceApi

java.lang.Object
  extended by org.apache.uima.ducc.cli.CliBase
      extended by org.apache.uima.ducc.cli.DuccServiceApi
All Implemented Interfaces:
org.apache.uima.ducc.cli.IUiOptions

public class DuccServiceApi
extends CliBase

Handle registered services. This class is also the implementation of the DUCC service CLI which internally uses its API to implement itself. Details on the DUCC service CLI are found in theDUCC CLI reference.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.uima.ducc.cli.IUiOptions
org.apache.uima.ducc.cli.IUiOptions.ClasspathOrderParms, org.apache.uima.ducc.cli.IUiOptions.UiOption
 
Field Summary
 
Fields inherited from interface org.apache.uima.ducc.cli.IUiOptions
help_width
 
Constructor Summary
DuccServiceApi(IDuccCallback cb)
           
 
Method Summary
 boolean execute()
          All extenders must implement execute - this method does whatever processing on the input is needed and passes the CLI request to the internal DUCC processes.
static void main(String[] args)
          This is the main entrypoint, used by the executable jars and callable directly from the command line.
 IServiceReply modify(String[] args)
          The service 'modify' command is used to change various aspects of a registered service without the need to reregister it.
 IServiceReply query(String[] args)
          The query API is used to query the status of services known to the service manager.
 IServiceReply register(String[] args)
          The register API is used to register a service with the service manager.
 IServiceReply start(String[] args)
          The start API is used to start one or more instances of a registered service.
 IServiceReply stop(String[] args)
          The stop API is used to stop one or more service instances.
 IServiceReply unregister(String[] args)
          The unregister API is used to unregister a service.
 
Methods inherited from class org.apache.uima.ducc.cli.CliBase
getDuccId, getReturnCode, isConsoleAttached, makeOptions, setProperty, waitForCompletion
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuccServiceApi

public DuccServiceApi(IDuccCallback cb)
Method Detail

register

public IServiceReply register(String[] args)
                       throws Exception
The register API is used to register a service with the service manager.

Parameters:
args - String rray of arguments as described in the DUCC CLI reference.
Returns:
IServiceReply object with register status.
Throws:
Exception

unregister

public IServiceReply unregister(String[] args)
                         throws Exception
The unregister API is used to unregister a service. The service manager will stop all instances and remove the service registration.

Parameters:
args - String array of arguments as described in the DUCC CLI reference.
Returns:
IServiceReply object with unregister reply status.
Throws:
Exception

start

public IServiceReply start(String[] args)
                    throws Exception
The start API is used to start one or more instances of a registered service.

Parameters:
args - String array of arguments as described in the DUCC CLI reference.
Returns:
IServiceReply object with start reply status.
Throws:
Exception

stop

public IServiceReply stop(String[] args)
                   throws Exception
The stop API is used to stop one or more service instances.

Parameters:
args - String array of arguments as described in the DUCC CLI reference.
Returns:
IServiceReply object with stop status.
Throws:
Exception

modify

public IServiceReply modify(String[] args)
                     throws Exception
The service 'modify' command is used to change various aspects of a registered service without the need to reregister it.

Parameters:
args - String array of arguments as described in the DUCC CLI reference.
Returns:
IServiceReply object with modify status.
Throws:
Exception

query

public IServiceReply query(String[] args)
                    throws Exception
The query API is used to query the status of services known to the service manager.

Parameters:
args - String array of arguments as described in the DUCC CLI reference.
Returns:
IServiceReply object with query results status.
Throws:
Exception

execute

public boolean execute()
Description copied from class: CliBase
All extenders must implement execute - this method does whatever processing on the input is needed and passes the CLI request to the internal DUCC processes.

Specified by:
execute in class CliBase
Returns:
Return true if execution works, and false otherwise.

main

public static void main(String[] args)
This is the main entrypoint, used by the executable jars and callable directly from the command line. If the invocation is successful, the process exits with return code 0. Otherwise, it exit with return code 1.

Parameters:
args - arguments as described in the DUCC CLI reference.


Copyright © 2012–2014 The Apache Software Foundation. All rights reserved.