|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.sdsc.inca.Component
edu.sdsc.inca.Client
edu.sdsc.inca.AgentClient
public class AgentClient
This class allows access to the services provided by an Inca Agent. Along with defining an API that understands the Agent protocol, it defines a main method that allows access to an Agent via a telnet-style interface and provides a means for configuring an Inca installation from the command line.
Field Summary | |
---|---|
static java.lang.String |
AGENT_CLIENT_OPTS
|
protected java.lang.String |
deployPath
|
protected static org.apache.log4j.Logger |
logger
|
Fields inherited from class edu.sdsc.inca.Client |
---|
CLIENT_OPTS, reader, socket, writer |
Fields inherited from class edu.sdsc.inca.Component |
---|
authenticate, cert, certPath, COMPONENT_OPTS, hostname, key, keyPath, logFile, password, port, trusted, trustedPath |
Constructor Summary | |
---|---|
AgentClient()
|
Method Summary | |
---|---|
void |
approve(java.lang.String resource,
edu.sdsc.inca.dataModel.inca.IncaDocument approved)
Approve the enclosed series config changes for the specified resource. |
java.util.Properties[] |
getCatalog(java.lang.String url)
Returns properties for all reporters contained within one repository or all repositories known to the Agent. |
java.lang.String |
getCatalogAsXml(java.lang.String uri)
Like getCatlog, but returns wraps the catalog information into XML instead of an array of Properties. |
java.lang.String |
getConfig()
Returns IncaDocument XML for the Inca deployment configuration. |
java.lang.String |
getDeployPath()
Returns the path to the IncaDocument XML deployment file. |
edu.sdsc.inca.dataModel.inca.IncaDocument |
getProposedChanges(java.lang.String resource)
Request all proposed changes to the reporter manager that have not yet been committed to the manager. |
static void |
main(java.lang.String[] args)
A simple main method for exercising the AgentClient. |
void |
runNow(java.lang.String type,
java.lang.String suite)
Submits the following run now request to the agent |
void |
setConfig(java.lang.String config)
Replaces or updates the Inca deployment configuration. |
void |
setConfiguration(java.util.Properties config)
A convenience function for setting multiple configuration properties at once. |
void |
setDeployPath(java.lang.String path)
Sets the path to the IncaDocument XML deployment file. |
Methods inherited from class edu.sdsc.inca.Client |
---|
close, commandGetLog, commandLogConfig, commandPermit, commandPing, commandRevoke, commandRevokeAll, connect, dialog, getDn, getTempPath, isConnected, read, setServer, setTempPath, telnetDialog, write |
Methods inherited from class edu.sdsc.inca.Component |
---|
addTrustedCert, configComponent, createSocket, getAuthenticate, getCertificate, getCertificatePath, getConfiguration, getDn, 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 AGENT_CLIENT_OPTS
protected static final org.apache.log4j.Logger logger
protected java.lang.String deployPath
Constructor Detail |
---|
public AgentClient()
Method Detail |
---|
public void approve(java.lang.String resource, edu.sdsc.inca.dataModel.inca.IncaDocument approved) throws java.io.IOException, ProtocolException
resource
- The resource the changes are being approved for.approved
- IncaDocument XML specifying changes in the configuration
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.util.Properties[] getCatalog(java.lang.String url) throws java.io.IOException, ProtocolException
url
- the url of the repository to query; if null, a merged catalog
from all repositories known to the Agent is returned
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.lang.String getCatalogAsXml(java.lang.String uri) throws java.io.IOException, ProtocolException
uri
- the url of the repository to query; if null, a merged catalog
from all repositories known to the Agent is returned
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.lang.String getConfig() throws java.io.IOException, ProtocolException
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.lang.String getDeployPath()
public edu.sdsc.inca.dataModel.inca.IncaDocument getProposedChanges(java.lang.String resource) throws java.io.IOException, ProtocolException
resource
- The resource name for the manager we are requesting for
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic void runNow(java.lang.String type, java.lang.String suite) throws java.io.IOException, ProtocolException
suite
- SuiteDocument XML specifying changes in the configurationtype
- A string containing the type of run now request
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic void setConfig(java.lang.String config) throws java.io.IOException, ProtocolException
config
- IncaDocument XML specifying changes in the configuration
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic void setConfiguration(java.util.Properties config) throws ConfigurationException
setConfiguration
in class Client
config
- contains AgentClient configuration values
ConfigurationException
- on a faulty configuration property valuepublic void setDeployPath(java.lang.String path)
path
- the path to the deployment filepublic static void main(java.lang.String[] args)
usage:java inca.AgentClient
-a|--auth boolean Authenticated (secure) connection? -A|--agent str Agent specification; host:port -c|--cert path Path to the authentication certificate -f|--file path Inca installation configuration file path -h|--help null Print help/usage -i|--init path Path to properties file -k|--key path Path to the authentication key -P|--password str Specify how to obtain encryption password -t|--trusted path Path to authentication trusted certificate dir -V|--version null Display program version
args
- command line arguments, as above.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |