org.jboss.dtf.testframework.serviceregister
Class ServiceRegister

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.jboss.dtf.testframework.serviceregister.ServiceRegister
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, ServiceRegisterInterface

public class ServiceRegister
extends java.rmi.server.UnicastRemoteObject
implements ServiceRegisterInterface

See Also:
Serialized Form

Field Summary
static java.lang.String SERVICE_REGISTER_NAME_SERVICE_ENTRY
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ServiceRegister()
           
 
Method Summary
 void deregisterService(java.lang.String osId, TestNodeInterface testNodeReference)
          Removes a TestNode from the service register.
 void disableProductSupport(short serviceId, java.lang.String productId)
          Disable a given testnodes support for a given product.
 void enableProductSupport(short serviceId, java.lang.String productId)
          Enable a given testnodes support for a given product.
 TestNodeInterface[] getRegister()
          Get an array of all TestNode's registered
static void initialiseRegistry()
           
 TestNodeInterface lookupService(short serviceId)
          Return the TestNodeInterface for the TestNode that is registered with the given unique id
 TestNodeInterface[] lookupService(java.lang.String osId, java.lang.String product)
          Search the service register for TestNodes which are running on the given OS and supporting the product given.
static void main(java.lang.String[] args)
           
 short registerService(java.lang.String osId, java.lang.String[] productList, TestNodeInterface testNodeReference)
          Adds a TestNode into the service register.
protected  boolean removeService(short serviceId)
           
 void reregisterService(short serviceId, java.lang.String[] productList)
          Updates a TestNode in the service register.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SERVICE_REGISTER_NAME_SERVICE_ENTRY

public static final java.lang.String SERVICE_REGISTER_NAME_SERVICE_ENTRY
See Also:
Constant Field Values
Constructor Detail

ServiceRegister

public ServiceRegister()
                throws java.rmi.RemoteException,
                       java.net.UnknownHostException,
                       java.net.SocketException
Throws:
java.rmi.RemoteException
java.net.UnknownHostException
java.net.SocketException
Method Detail

disableProductSupport

public void disableProductSupport(short serviceId,
                                  java.lang.String productId)
                           throws java.rmi.RemoteException,
                                  ServiceNotFound
Disable a given testnodes support for a given product. This is used by a testnode so that it can continue receiving deployments without being involved in test runs. This will usually occur when a test node fails to deploy a product.

Specified by:
disableProductSupport in interface ServiceRegisterInterface
Parameters:
serviceId - The service id. of the testnode who's product support is to be altered.
productId - The name of the product to disable support of.
Throws:
java.rmi.RemoteException
ServiceNotFound

enableProductSupport

public void enableProductSupport(short serviceId,
                                 java.lang.String productId)
                          throws java.rmi.RemoteException,
                                 ServiceNotFound
Enable a given testnodes support for a given product. This is used by a testnode so that it will be involved in test runs.

Specified by:
enableProductSupport in interface ServiceRegisterInterface
Parameters:
serviceId - The service id. of the testnode who's product support is to be altered.
productId - The name of the product to disable support of.
Throws:
java.rmi.RemoteException
ServiceNotFound

registerService

public short registerService(java.lang.String osId,
                             java.lang.String[] productList,
                             TestNodeInterface testNodeReference)
                      throws java.rmi.RemoteException
Description copied from interface: ServiceRegisterInterface
Adds a TestNode into the service register.

Specified by:
registerService in interface ServiceRegisterInterface
Parameters:
osId - The string id. for the OS the TestNode is running on.
productList - An array of product id.'s that the TestNode supports.
testNodeReference - The object reference of the TestNode.
Throws:
java.rmi.RemoteException

reregisterService

public void reregisterService(short serviceId,
                              java.lang.String[] productList)
                       throws java.rmi.RemoteException,
                              ServiceNotFound
Updates a TestNode in the service register.

Specified by:
reregisterService in interface ServiceRegisterInterface
Parameters:
productList - An array of product id.'s that the TestNode supports.
Throws:
java.rmi.RemoteException
ServiceNotFound

lookupService

public TestNodeInterface lookupService(short serviceId)
                                throws java.rmi.RemoteException,
                                       ServiceNotFound
Description copied from interface: ServiceRegisterInterface
Return the TestNodeInterface for the TestNode that is registered with the given unique id

Specified by:
lookupService in interface ServiceRegisterInterface
Parameters:
serviceId - The unique service identifier
Throws:
java.rmi.RemoteException
ServiceNotFound

removeService

protected boolean removeService(short serviceId)

getRegister

public TestNodeInterface[] getRegister()
                                throws java.rmi.RemoteException
Description copied from interface: ServiceRegisterInterface
Get an array of all TestNode's registered

Specified by:
getRegister in interface ServiceRegisterInterface
Throws:
java.rmi.RemoteException

lookupService

public TestNodeInterface[] lookupService(java.lang.String osId,
                                         java.lang.String product)
                                  throws java.rmi.RemoteException,
                                         ServiceNotFound
Description copied from interface: ServiceRegisterInterface
Search the service register for TestNodes which are running on the given OS and supporting the product given.

Specified by:
lookupService in interface ServiceRegisterInterface
product - The string id. for the product the TestNode should support.
Throws:
ServiceNotFound - Thrown if a TestNode cannot be found which supports the given OS/Product combination.
java.rmi.RemoteException

deregisterService

public void deregisterService(java.lang.String osId,
                              TestNodeInterface testNodeReference)
                       throws java.rmi.RemoteException,
                              ServiceNotFound
Description copied from interface: ServiceRegisterInterface
Removes a TestNode from the service register.

Specified by:
deregisterService in interface ServiceRegisterInterface
testNodeReference - The object reference of the TestNode to remove.
Throws:
ServiceNotFound - Thrown if the object reference isn't one of a known TestNode.
java.rmi.RemoteException

initialiseRegistry

public static void initialiseRegistry()

main

public static void main(java.lang.String[] args)