|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.agent.ReporterManagerController
public class ReporterManagerController
Manages a reporter manager instance on a remote machine. It maintains a persistent connection to the manager and provides the ability to send packages and suites to the remote reporter manager. It also has the ability to detect a fault of the reporter manager by regularly pinging it and and restarting it if necessary.
Field Summary | |
---|---|
protected Agent |
agent
|
static java.lang.String |
BATCH_REPORTER
|
static int |
ISREADY_PERIOD
|
static int |
SUITE_CHECK_PERIOD
|
Constructor Summary | |
---|---|
ReporterManagerController(ReporterManagerController rm)
Create a new reporter manager object, whose configuration is identical to rm, which will manage an instance of a reporter manager on a remote resource. |
|
ReporterManagerController(java.lang.String resource,
Agent agent)
Create a reporter manager object which will manage a instance of a reporter manager on a remote resource. |
Method Summary | |
---|---|
void |
addPackage(java.lang.String packageName)
Add the specified package to the work queue so that the register thread can pick it up and send it to the reporter manager. |
void |
addSuite(edu.sdsc.inca.dataModel.suite.SuiteDocument suite)
Add the specified suite to the work queue so that the register thread can pick it up and send it to the reporter manager. |
edu.sdsc.inca.dataModel.catalog.PackageType[] |
extractReportersFromSuite(edu.sdsc.inca.dataModel.suite.SuiteDocument s)
Extract the reporters from the specified suite document which do not already exist on the remote reporter manager. |
edu.sdsc.inca.ManagerClient |
getManagerClient()
Return the client connection to the remote reporter manager. |
edu.sdsc.inca.dataModel.catalog.PackageType[] |
getPackages()
Return the packages that are installed on the reporter manager. |
ReporterManagerProxy |
getProxy()
Return the proxy object for this resource. |
ReporterManagerStarter |
getReporterManagerStarter()
|
java.lang.String |
getResource()
Return the name of this resource. |
java.lang.String |
getTemporaryDirectory()
Gets the directory path where the temporary files can be stored. |
boolean |
hasPackage(java.lang.String name,
java.lang.String version)
Return true if the manager has been sent the given package; otherwise return false. |
boolean |
hasProxy()
Return whether or not proxy information is listed for this resource. |
boolean |
isRemoteManagerAlive()
Pings the reporter manager to check whether it is still running on the remote resource and returns the status. |
boolean |
isRunning()
Return true if the reporter manager is currently registered and running. |
void |
register(edu.sdsc.inca.protocol.ProtocolReader reader,
edu.sdsc.inca.protocol.ProtocolWriter writer)
Register the specified reporter manager with the agent so that the agent can send it commands. |
void |
restart()
Restart this reporter manager. |
protected void |
sendReporters(edu.sdsc.inca.dataModel.catalog.PackageType[] reporters)
Send the specified reporters and their package dependencies to the remote reporter manager. |
void |
sendSuite(edu.sdsc.inca.dataModel.suite.SuiteDocument suiteDoc)
Send the specified suite and any needed reporters to the remote reporter manager. |
void |
setManagerClient(edu.sdsc.inca.ManagerClient managerClient)
Set the client connection to the remote reporter manager. |
void |
setProxy(ReporterManagerProxy proxy)
Set the proxy renewal information so it can be passed to the remote reporter manager on registration. |
void |
setRunning(boolean isRunning)
Set the status of the reporter manager to running and notify any waiting threads. |
void |
setTempDir(java.lang.String tempDir)
Set the location of the temporary directory. |
void |
shutdown()
Cleanly shutdown the reporter manager by signaling the register thread to exit and sending an END statement to the remote reporter manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ISREADY_PERIOD
public static final int SUITE_CHECK_PERIOD
public static final java.lang.String BATCH_REPORTER
protected Agent agent
Constructor Detail |
---|
public ReporterManagerController(java.lang.String resource, Agent agent) throws edu.sdsc.inca.ConfigurationException
resource
- Name of the resource (from the resource configuration
file) to start the reporter manager on.agent
- The agent the reporter manager is registered with
edu.sdsc.inca.ConfigurationException
- if there is missing configuration information
for the resource.public ReporterManagerController(ReporterManagerController rm)
rm
- A reporter manager object that will be used to configure this
reporter manager object.Method Detail |
---|
public void addPackage(java.lang.String packageName)
packageName
- The name of the package to send to the remote reporter
manager.public void addSuite(edu.sdsc.inca.dataModel.suite.SuiteDocument suite)
suite
- A suite document to send to the reporter manager.public edu.sdsc.inca.dataModel.catalog.PackageType[] extractReportersFromSuite(edu.sdsc.inca.dataModel.suite.SuiteDocument s)
s
- A suite document that will be sent to the reporter manager
public edu.sdsc.inca.ManagerClient getManagerClient()
public edu.sdsc.inca.dataModel.catalog.PackageType[] getPackages()
public ReporterManagerProxy getProxy()
public java.lang.String getResource()
public boolean isRunning()
public ReporterManagerStarter getReporterManagerStarter()
public java.lang.String getTemporaryDirectory()
public boolean hasPackage(java.lang.String name, java.lang.String version)
name
- The name of the package to check for.version
- The version of the package to check for.
public boolean hasProxy()
public boolean isRemoteManagerAlive()
public void register(edu.sdsc.inca.protocol.ProtocolReader reader, edu.sdsc.inca.protocol.ProtocolWriter writer)
reader
- the ProtocolReader for reading responses from the remote
reporter manager.writer
- the ProtocolWriter for sending commands to the remotepublic void sendSuite(edu.sdsc.inca.dataModel.suite.SuiteDocument suiteDoc) throws java.io.IOException, java.lang.InterruptedException
suiteDoc
- The suite to send to the remote reporter manager.
java.io.IOException
- if trouble sending suite
java.lang.InterruptedException
- if interrupted during send of suitepublic void setManagerClient(edu.sdsc.inca.ManagerClient managerClient)
managerClient
- The manager client object connected to the remote reporter
manager.public void setProxy(ReporterManagerProxy proxy)
proxy
- Contains MyProxy information that can be used to retrieve
a new proxy for the remote reporter manager.public void setRunning(boolean isRunning)
isRunning
- True indicates the reporter manager is running on the
remote machine and available; false otherwise.public void setTempDir(java.lang.String tempDir)
tempDir
- A path to a directory where temporary files can be stored.public void shutdown()
protected void sendReporters(edu.sdsc.inca.dataModel.catalog.PackageType[] reporters) throws java.io.IOException, java.lang.InterruptedException
reporters
- A list of reporters to send to the remote reporter
manager.
java.io.IOException
- if problem sending reporters
java.lang.InterruptedException
- if interrupted during send of reporterspublic void restart()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |