org.apache.oodt.cas.resource.system
Class XmlRpcResourceManagerClient

java.lang.Object
  extended by org.apache.oodt.cas.resource.system.XmlRpcResourceManagerClient

public class XmlRpcResourceManagerClient
extends Object

Version:
$Revision$

The XML RPC based resource manager client.

Author:
mattmann

Constructor Summary
XmlRpcResourceManagerClient(URL url)
           Constructs a new XmlRpcResourceManagerClient with the given url.
 
Method Summary
 void addNode(ResourceNode node)
          Adds a node
 void addNodeToQueue(String nodeId, String queueName)
          Addes the node with given id to the queue with the given name
 void addQueue(String queueName)
          Creates a queue with the given name
 String getExecutionNode(String jobId)
           
 Job getJobInfo(String jobId)
           
 int getJobQueueCapacity()
          Gets the max number of Jobs allowed in JobQueue
 int getJobQueueSize()
          Gets the number of Jobs in JobQueue
 ResourceNode getNodeById(String nodeId)
           
 String getNodeLoad(String nodeId)
          Report on the load of the requested node
 List getNodes()
           
 List<String> getNodesInQueue(String queueName)
          Gets a list of ids of the nodes in the given queue
 List<String> getQueues()
          Gets a list of currently supported queue names
 List<String> getQueuesWithNode(String nodeId)
          Gets a list of queues which contain the node with the given nodeId
 URL getResMgrUrl()
           
 boolean isAlive()
           
 boolean isJobComplete(String jobId)
           
 boolean killJob(String jobId)
           
static void main(String[] args)
           
 void removeNode(String nodeId)
          Removes the node with the given id
 void removeNodeFromQueue(String nodeId, String queueName)
          Remove the node with the given id from the queue with the given name
 void removeQueue(String queueName)
          Removes the queue with the given name
 void setNodeCapacity(String nodeId, int capacity)
           
 void setResMgrUrl(URL resMgrUrl)
           
 String submitJob(Job exec, JobInput in)
           
 boolean submitJob(Job exec, JobInput in, URL hostUrl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRpcResourceManagerClient

public XmlRpcResourceManagerClient(URL url)

Constructs a new XmlRpcResourceManagerClient with the given url.

Parameters:
url - The url pointer to the xml rpc resource manager service.
Method Detail

main

public static void main(String[] args)

isJobComplete

public boolean isJobComplete(String jobId)
                      throws JobRepositoryException
Throws:
JobRepositoryException

getJobInfo

public Job getJobInfo(String jobId)
               throws JobRepositoryException
Throws:
JobRepositoryException

isAlive

public boolean isAlive()

getJobQueueSize

public int getJobQueueSize()
                    throws JobRepositoryException
Gets the number of Jobs in JobQueue

Returns:
Number of Jobs in JobQueue
Throws:
JobRepositoryException - On Any Exception

getJobQueueCapacity

public int getJobQueueCapacity()
                        throws JobRepositoryException
Gets the max number of Jobs allowed in JobQueue

Returns:
Max number of Jobs
Throws:
JobRepositoryException - On Any Exception

killJob

public boolean killJob(String jobId)

getExecutionNode

public String getExecutionNode(String jobId)

submitJob

public String submitJob(Job exec,
                        JobInput in)
                 throws JobExecutionException
Throws:
JobExecutionException

submitJob

public boolean submitJob(Job exec,
                         JobInput in,
                         URL hostUrl)
                  throws JobExecutionException
Throws:
JobExecutionException

getNodes

public List getNodes()
              throws MonitorException
Throws:
MonitorException

getNodeById

public ResourceNode getNodeById(String nodeId)
                         throws MonitorException
Throws:
MonitorException

getResMgrUrl

public URL getResMgrUrl()
Returns:
the resMgrUrl

setResMgrUrl

public void setResMgrUrl(URL resMgrUrl)
Parameters:
resMgrUrl - the resMgrUrl to set

addQueue

public void addQueue(String queueName)
              throws QueueManagerException
Creates a queue with the given name

Parameters:
queueName - The name of the queue to be created
Throws:
QueueManagerException - on any error

removeQueue

public void removeQueue(String queueName)
                 throws QueueManagerException
Removes the queue with the given name

Parameters:
queueName - The name of the queue to be removed
Throws:
QueueManagerException - on any error

addNode

public void addNode(ResourceNode node)
             throws MonitorException
Adds a node

Parameters:
node - The node to be added
Throws:
MonitorException - on any error

removeNode

public void removeNode(String nodeId)
                throws MonitorException
Removes the node with the given id

Parameters:
nodeId - The id of the node to be removed
Throws:
MonitorException - on any error

setNodeCapacity

public void setNodeCapacity(String nodeId,
                            int capacity)
                     throws MonitorException
Throws:
MonitorException

addNodeToQueue

public void addNodeToQueue(String nodeId,
                           String queueName)
                    throws QueueManagerException
Addes the node with given id to the queue with the given name

Parameters:
nodeId - The id of the node to be added to the given queueName
queueName - The name of the queue to add the given node
Throws:
QueueManagerException - on any error

removeNodeFromQueue

public void removeNodeFromQueue(String nodeId,
                                String queueName)
                         throws QueueManagerException
Remove the node with the given id from the queue with the given name

Parameters:
nodeId - The id of the node to be remove from the given queueName
queueName - The name of the queue from which to remove the given node
Throws:
QueueManagerException - on any error

getQueues

public List<String> getQueues()
                       throws QueueManagerException
Gets a list of currently supported queue names

Returns:
A list of currently supported queue names
Throws:
QueueManagerException - on any error

getNodesInQueue

public List<String> getNodesInQueue(String queueName)
                             throws QueueManagerException
Gets a list of ids of the nodes in the given queue

Parameters:
queueName - The name of the queue to get node ids from
Returns:
List of node ids in the given queueName
Throws:
QueueManagerException - on any error

getQueuesWithNode

public List<String> getQueuesWithNode(String nodeId)
                               throws QueueManagerException
Gets a list of queues which contain the node with the given nodeId

Parameters:
nodeId - The id of the node to get queues it belongs to
Returns:
List of queues which contain the give node
Throws:
QueueManagerException - on any error

getNodeLoad

public String getNodeLoad(String nodeId)
                   throws MonitorException
Report on the load of the requested node

Parameters:
nodeId - The id of the node to be polled
Returns:
A String showing a fraction of the loads node over its capacity
Throws:
MonitorException - on any error


Copyright © 1999-2013
Apache OODT. All Rights Reserved.