|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread edu.sdsc.inca.Component edu.sdsc.inca.Client edu.sdsc.inca.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, host, port, reader, socket, writer |
Fields inherited from class edu.sdsc.inca.Component |
authenticate, cert, certPath, COMPONENT_OPTS, key, keyPath, logFile, password, trusted, trustedPath |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
AgentClient()
|
Method Summary | |
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. |
static void |
main(java.lang.String[] args)
A simple main method for exercising the AgentClient. |
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, commandPing, connect, dialog, finalize, getHost, getPort, getUri, isConnected, read, setHost, setPort, setServer, telnetDialog, write |
Methods inherited from class edu.sdsc.inca.Component |
addTrustedCert, configComponent, createSocket, getAuthenticate, getCertificate, getCertificatePath, getKey, getKeyPath, getLogFile, getPassword, getTrustedCertificates, getTrustedPath, openResourceStream, readCredentials, readVersion, setAuthenticate, setCertificatePath, setKeyPath, setLogFile, setPassword, setTrustedPath |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, 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 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
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 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 |