|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.Component edu.sdsc.inca.Server edu.sdsc.inca.Agent
public class Agent
The agent is the Inca component that provides centralized control of the reporters running on the monitored resources. A client of the agent (usually thru incat) can
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.sdsc.inca.Server |
---|
edu.sdsc.inca.Server.ClientDispatcher, edu.sdsc.inca.Server.ServerShutdownHook |
Field Summary | |
---|---|
protected java.lang.String |
checkReporterManagers
|
static java.lang.String |
GLOBUS_IP_PROPERTY
|
static int |
PING_PERIOD
|
protected boolean |
ranShutdown
|
static java.lang.String |
REPOSITORIES_PATH
|
static java.lang.String |
REPOSITORY_CACHE
|
static java.lang.String |
RESOURCES_PATH
|
static java.lang.String |
RMDIR
|
static int |
START_ATTEMPT_PERIOD
|
static java.lang.String |
SUITEDIR_PATH
|
protected java.lang.String |
upgradeReporterManagers
|
protected java.lang.String |
upgradeTargets
|
Fields inherited from class edu.sdsc.inca.Server |
---|
ACCEPT_TIMEOUT, cd, CLIENT_TIMEOUT, SERVER_OPTS, ssocket, tempPath, workerCount, workers, workQueue |
Fields inherited from class edu.sdsc.inca.Component |
---|
authenticate, cert, certPath, COMPONENT_OPTS, hostname, key, keyPath, logFile, password, port, trusted, trustedPath |
Constructor Summary | |
---|---|
Agent()
|
Method Summary | |
---|---|
void |
checkReporterManagers(java.lang.String resourcesToCheck)
Check to see if the reporter manager has been staged to all resources in the specified resource group |
void |
distributePackageUpdate(java.lang.String packageName)
Send a newer version of the specified package to all remote reporter managers. |
void |
distributeSuites(java.util.HashMap suites)
Send the suites to all reporter managers. |
java.lang.String |
getAdminEmail()
Return the email address used to send notifications upon reporter manager restart. |
edu.sdsc.inca.DepotClient |
getDepotClient()
Returns the depot client object to use to communicate to the depot (currently to send suite expanded documents). |
java.lang.String[] |
getDepots()
Get the URIs for the depots. |
static Agent |
getGlobalAgent()
|
int |
getPingPeriod()
Return the current wait period between pinging of a reporter manager. |
ReporterManagerController |
getReporterManager(java.lang.String resource)
Get the controller for the remote reporter manager. |
ReporterManagerTable |
getReporterManagerTable()
|
edu.sdsc.inca.repository.Repositories |
getRepositories()
Returns the list of reporter repositories the agent knows about. |
RepositoryCache |
getRepositoryCache()
Return the repository cache which provides access to packages cached locally on the Agent as they are requested in suites. |
edu.sdsc.inca.util.ResourcesWrapper |
getResources()
Retrieves the current resource configuration stored on the agent. |
int |
getStartAttemptWaitPeriod()
Return the current wait period between start attempts. |
SuiteTable |
getSuites()
Returns the suites stored at the agent. |
boolean |
hasCredentials()
|
static void |
main(java.lang.String[] args)
|
void |
registerReporterManager(java.lang.String resource,
edu.sdsc.inca.protocol.ProtocolReader reader,
edu.sdsc.inca.protocol.ProtocolWriter writer)
Register the given reporter manager with the agent so that the agent can begin to send it requests. |
static void |
reinitialize()
|
void |
reinitializeManagerWorkQueue(java.lang.String resource,
edu.sdsc.inca.util.WorkQueue queue)
Called when a remote reporter manager registers with the agent in order to get the existing suites for this resource. |
void |
restartSuites()
Read the existing suites from disk and restart them. |
void |
runServer()
Starts the Agent server. |
void |
setAdminEmail(java.lang.String adminEmail)
Set the email address of the Inca administrator who should be notified when reporter managers are restarted. |
void |
setAgentTempPath(java.lang.String path)
Sets the directory path where the Agent stores state files such as its list of reporter repositories, reporter cache files, resources, and suites. |
void |
setConfiguration(java.util.Properties config)
Overrides the server's setConfiguration function to configure the agent specific properties. |
void |
setDepots(java.lang.String[] depots)
Set the URIs for the depots. |
static void |
setGlobalAgent(Agent a)
Set a new global agent. |
void |
setPingPeriod(int pingPeriod)
Set the period for how often to ping the reporter manager. |
void |
setRepositories(edu.sdsc.inca.repository.Repository[] repos)
Set the repositories the agent should download reporters from upon receiving a suite (if it hasn't downloaded them before). |
void |
setRepositoryCache(RepositoryCache repositoryCache)
Set the repository cache which provides access to packages cached locally on the Agent as they are requested in suites. |
void |
setResources(edu.sdsc.inca.util.ResourcesWrapper resources)
Sets the resource configuration for the agent. |
void |
setStartAttemptWaitPeriod(int startAttemptWaitPeriod)
Set the current wait period between start attempts. |
void |
setSuites(java.lang.String path)
Create a suite directory for storing the results of suites |
void |
shutdown()
Overrides the server shutdown in order to shutdown the reporter manager's before the general server shutdown. |
void |
updateCachedPackages()
Check for updates on all packages in the repository cache including reporters. |
void |
updateResources(edu.sdsc.inca.util.ResourcesWrapper resources)
Updates the resource configuration on the agent. |
void |
updateSuite(edu.sdsc.inca.util.SuiteWrapper suite)
Receive a set suite request from client and validate the XML. |
java.math.BigInteger |
updateSuiteOnDepot(edu.sdsc.inca.dataModel.suite.SuiteDocument expanded)
Send the suite changes to the depot. |
void |
upgradeReporterManagers(java.lang.String resourcesToUpgrade,
java.lang.String targetsToExecute)
Upgrade the reporter manager distributions on the specified resources read upon configuration. |
Methods inherited from class edu.sdsc.inca.Server |
---|
getTempPath, getWorkerCount, isRunning, setTempPath, setWorkerCount |
Methods inherited from class edu.sdsc.inca.Component |
---|
addTrustedCert, configComponent, createSocket, getAuthenticate, getCertificate, getCertificatePath, getHostname, getKey, getKeyPath, getLogFile, getPassword, getPort, getTrustedCertificates, getTrustedPath, getUri, openResourceStream, readCredentials, readVersion, setAuthenticate, setCertificatePath, setHostname, setKeyPath, setLogFile, setPassword, setPort, setTrustedPath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GLOBUS_IP_PROPERTY
public static final int PING_PERIOD
public static final java.lang.String REPOSITORY_CACHE
public static final java.lang.String REPOSITORIES_PATH
public static final java.lang.String RESOURCES_PATH
public static final java.lang.String RMDIR
public static final int START_ATTEMPT_PERIOD
public static final java.lang.String SUITEDIR_PATH
protected boolean ranShutdown
protected java.lang.String upgradeReporterManagers
protected java.lang.String upgradeTargets
protected java.lang.String checkReporterManagers
Constructor Detail |
---|
public Agent()
Method Detail |
---|
public void checkReporterManagers(java.lang.String resourcesToCheck) throws edu.sdsc.inca.ConfigurationException, java.lang.InterruptedException
resourcesToCheck
- A resource or resource group to check
ConfigurationException
- if missing information about a resource
java.lang.InterruptedException
- if receives interruptpublic void distributePackageUpdate(java.lang.String packageName)
packageName
- The name of the package to update.public void distributeSuites(java.util.HashMap suites)
suites
- A HashMap where the resources are the keys and
each entry is the SuiteDocument that should be distributed to the resource.public java.lang.String getAdminEmail()
public edu.sdsc.inca.DepotClient getDepotClient()
public java.lang.String[] getDepots()
public static Agent getGlobalAgent()
public int getPingPeriod()
public ReporterManagerController getReporterManager(java.lang.String resource)
resource
- The name of the resource.
public ReporterManagerTable getReporterManagerTable()
public edu.sdsc.inca.repository.Repositories getRepositories()
public RepositoryCache getRepositoryCache()
public edu.sdsc.inca.util.ResourcesWrapper getResources()
public int getStartAttemptWaitPeriod()
public SuiteTable getSuites()
public void runServer() throws java.lang.Exception
runServer
in class edu.sdsc.inca.Server
java.lang.Exception
public void setConfiguration(java.util.Properties config) throws edu.sdsc.inca.ConfigurationException
setConfiguration
in class edu.sdsc.inca.Server
config
- contains configuration values
ConfigurationException
- on a faulty configuration property valuepublic void setDepots(java.lang.String[] depots)
depots
- A list of depot URIs in the format: inca[s]://host:portpublic static void setGlobalAgent(Agent a)
a
- The new agent objectpublic void setPingPeriod(int pingPeriod)
pingPeriod
- The period to wait in between pings to the reporter
manager.public void setRepositories(edu.sdsc.inca.repository.Repository[] repos) throws java.io.IOException
repos
- A list of repositories.
java.io.IOException
- if trouble contacting repositoriespublic void setRepositoryCache(RepositoryCache repositoryCache)
repositoryCache
- A repository cache object.public void updateCachedPackages()
public void updateResources(edu.sdsc.inca.util.ResourcesWrapper resources) throws org.apache.xmlbeans.XmlException, edu.sdsc.inca.protocol.ProtocolException, edu.sdsc.inca.ConfigurationException, edu.sdsc.inca.util.CrypterException, java.io.IOException
resources
- A ResourcesWrapper object which contains the new
resource configuration for the agent to utilize.
ConfigurationException
- if trouble reading info about resources
edu.sdsc.inca.util.CrypterException
- if trouble reading resource information
java.io.IOException
- if trouble communicating with resources
edu.sdsc.inca.protocol.ProtocolException
- if problem communicating with resources
org.apache.xmlbeans.XmlException
- if trouble updating resourcespublic void registerReporterManager(java.lang.String resource, edu.sdsc.inca.protocol.ProtocolReader reader, edu.sdsc.inca.protocol.ProtocolWriter writer) throws java.io.IOException
resource
- The resource the reporter manager is running on.reader
- the ProtocolReader for reading responses from the remote
reporter manager.writer
- the ProtocolWriter for sending commands to the remote
reporter manager.
java.io.IOException
- if trouble writing response to reporter managerpublic static void reinitialize()
public void reinitializeManagerWorkQueue(java.lang.String resource, edu.sdsc.inca.util.WorkQueue queue)
resource
- The resource the remote reporter manager is executing on.queue
- The reporter manager's work queue.public void restartSuites()
public void setAdminEmail(java.lang.String adminEmail)
adminEmail
- An email address of the Inca administrator.public void setAgentTempPath(java.lang.String path) throws java.io.IOException
path
- the temporary directory path
java.io.IOException
- if the path does not exist and cannot be createdpublic void setStartAttemptWaitPeriod(int startAttemptWaitPeriod)
startAttemptWaitPeriod
- the new start attempt wait periodpublic void setSuites(java.lang.String path)
path
- A string containing the path to store suitespublic void shutdown() throws java.lang.InterruptedException
shutdown
in class edu.sdsc.inca.Server
java.lang.InterruptedException
- (see server javadoc)public void setResources(edu.sdsc.inca.util.ResourcesWrapper resources) throws org.apache.xmlbeans.XmlException, edu.sdsc.inca.util.CrypterException, java.io.IOException
resources
- The resource configuration information.
edu.sdsc.inca.util.CrypterException
- if trouble encrypting/decrypting resources
java.io.IOException
- if trouble communicating with reporter managers
org.apache.xmlbeans.XmlException
- if trouble reading resourcespublic void updateSuite(edu.sdsc.inca.util.SuiteWrapper suite)
suite
- An update to a suite or a new suite.public java.math.BigInteger updateSuiteOnDepot(edu.sdsc.inca.dataModel.suite.SuiteDocument expanded) throws edu.sdsc.inca.ConfigurationException, java.io.IOException, edu.sdsc.inca.protocol.ProtocolException
expanded
- An expanded suite document that should be sent to depot
ConfigurationException
- if trouble reading config info
java.io.IOException
- if trouble communicating with depot
edu.sdsc.inca.protocol.ProtocolException
- if unexpected responses from depotpublic void upgradeReporterManagers(java.lang.String resourcesToUpgrade, java.lang.String targetsToExecute) throws edu.sdsc.inca.ConfigurationException
resourcesToUpgrade
- A resource name or group to upgradetargetsToExecute
- The makefile target to execute for the upgrade
ConfigurationException
- if trouble reading resource config infopublic boolean hasCredentials()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |