com.wm.app.tn.delivery
Class ServiceMgr

java.lang.Object
  extended by com.wm.app.tn.delivery.ServiceMgr

public class ServiceMgr
extends java.lang.Object

Handles registration of delivery services.


Method Summary
static ServiceMgr create()
          Returns a ServiceMgr object.
 DeliveryService getRegisteredService(java.lang.String name)
          Retrieve a delivery service by name.
 java.lang.String[] getRegisteredServices(int type)
           
 void refreshServiceCache()
          Refresh the delivery service cache for this server.
 void registerService(java.lang.String name, java.lang.String ifc, java.lang.String svc, boolean scheduled)
          Register a local service to be used for guaranteed delivery.
 void registerService(java.lang.String name, java.lang.String host, java.lang.String port, java.lang.String user, java.lang.String password, java.lang.String ifc, java.lang.String svc, boolean scheduled)
          Register a service to be used for guaranteed delivery.
 void removeService(java.lang.String name)
          Remove (unregister) a service for guaranteed delivery.
 boolean serviceRegistered(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ServiceMgr create()
                         throws DeliveryException
Returns a ServiceMgr object. This should be called in place of a constructor.

Throws:
DeliveryException

getRegisteredService

public DeliveryService getRegisteredService(java.lang.String name)
Retrieve a delivery service by name.

Parameters:
name - name of the delivery service to retrieve
Returns:
the delivery service identified by name

getRegisteredServices

public java.lang.String[] getRegisteredServices(int type)
Returns:
all registered services

refreshServiceCache

public void refreshServiceCache()
                         throws DeliveryException
Refresh the delivery service cache for this server.

Throws:
DeliveryException

registerService

public void registerService(java.lang.String name,
                            java.lang.String host,
                            java.lang.String port,
                            java.lang.String user,
                            java.lang.String password,
                            java.lang.String ifc,
                            java.lang.String svc,
                            boolean scheduled)
                     throws DeliveryException
Register a service to be used for guaranteed delivery. This service is expected to return an IData containing a "status" key with either "success" or "fail" for values, a "statusMessage" key, and and IData a "serviceOutput" key.

Parameters:
host - unique service name
host - name of host to invoke service - if null the service will run locally (and only ifc and svc are necessary)
port - host port
user - user name
password - user password
ifc - interface name (eg, wm.tn.delivery)
svc - service name (eg, http)
scheduled - indicates if this is a scheduled delivery service
Throws:
DeliveryException

registerService

public void registerService(java.lang.String name,
                            java.lang.String ifc,
                            java.lang.String svc,
                            boolean scheduled)
                     throws DeliveryException
Register a local service to be used for guaranteed delivery.

Parameters:
name - name of the delivery service
ifc - interface name (eg, wm.tn.delivery)
svc - service name (eg, http)
scheduled - indicates if this is a scheduled delivery service
Throws:
com.wm.app.tn.Delivery.DeliveryException
DeliveryException

removeService

public void removeService(java.lang.String name)
                   throws DeliveryException
Remove (unregister) a service for guaranteed delivery.

Parameters:
name - name of service to remove
Throws:
DeliveryException

serviceRegistered

public boolean serviceRegistered(java.lang.String name)
Returns:
true if the service has been registered