edu.sdsc.inca
Class ManagerClient

java.lang.Object
  extended byedu.sdsc.inca.Component
      extended byedu.sdsc.inca.Client
          extended byedu.sdsc.inca.ManagerClient

public class ManagerClient
extends Client

Created by IntelliJ IDEA.

Author:
Shava Smallen <ssmallen@sdsc.edu>

Field Summary
 java.lang.String resourceName
           
 
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
 
Constructor Summary
ManagerClient()
           
 
Method Summary
 java.lang.String commandPing(java.lang.String data)
          Send a ping to the server and return the response data.
 ProtocolReader getReader()
          Return the reader connected to the remote reporter manager.
 java.lang.String getResourceName()
          Return the name of the resource this manager client is attached to.
 ProtocolWriter getWriter()
          Return the writer connected to the remote reporter manager.
 void sendPackage(java.lang.String filename, java.lang.String installPath, java.lang.String name, byte[] packageContent, java.lang.String permissions, java.lang.String dependencies, java.lang.String version)
          Send the provided package information and content to the manager.
 void sendProxyRenewInfo(java.lang.String dn, java.lang.String hostname, int lifetime, java.lang.String password, int port, java.lang.String username)
          Send the provided proxy renewal information to the manager.
 void sendSuite(java.lang.String resource, edu.sdsc.inca.dataModel.suite.SuiteDocument suite)
          Send the specified suite document to the remote reporter manager.
 void setReader(ProtocolReader reader)
          Set the reader connected to the remote reporter manager.
 void setResourceName(java.lang.String resourceName)
          Set the name of the resource the remote reporter manager is hosted on.
 void setWriter(ProtocolWriter writer)
          Set the writer connected to the remote reporter manager.
 
Methods inherited from class edu.sdsc.inca.Client
close, commandGetLog, commandLogConfig, connect, dialog, getHost, getPort, getUri, isConnected, main, read, setConfiguration, 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceName

public java.lang.String resourceName
Constructor Detail

ManagerClient

public ManagerClient()
Method Detail

commandPing

public java.lang.String commandPing(java.lang.String data)
                             throws java.io.IOException,
                                    ProtocolException
Send a ping to the server and return the response data. Differs from the Component's commandPing by doing a readSocketWithSocketTimeout().

Overrides:
commandPing in class Client
Parameters:
data - the ping message data
Returns:
the ping response data
Throws:
java.io.IOException - on read/write error
ProtocolException - on an invalid message

getReader

public ProtocolReader getReader()
Return the reader connected to the remote reporter manager.

Returns:
The reader for the manager client.

getResourceName

public java.lang.String getResourceName()
Return the name of the resource this manager client is attached to.

Returns:
The name of the resource the remote reporter manager is hosted on.

getWriter

public ProtocolWriter getWriter()
Return the writer connected to the remote reporter manager.

Returns:
The writer for the manager client.

sendPackage

public void sendPackage(java.lang.String filename,
                        java.lang.String installPath,
                        java.lang.String name,
                        byte[] packageContent,
                        java.lang.String permissions,
                        java.lang.String dependencies,
                        java.lang.String version)
                 throws java.io.IOException,
                        ProtocolException
Send the provided package information and content to the manager.

Parameters:
filename - The name of the file to store this package as.
installPath - The path relative to the package cache directory to store this package at.
name - The repository name for this package.
packageContent - The package content
permissions - The permissions to set on the package once installed or null to use default permissions.
dependencies - The dependencies (space delimited) on this package or null if no dependencies.
version - The version of this package.
Throws:
java.io.IOException - on read/write error
ProtocolException - on an invalid message

sendProxyRenewInfo

public void sendProxyRenewInfo(java.lang.String dn,
                               java.lang.String hostname,
                               int lifetime,
                               java.lang.String password,
                               int port,
                               java.lang.String username)
                        throws java.io.IOException,
                               ProtocolException
Send the provided proxy renewal information to the manager.

Parameters:
dn - The DN of the MyProxy server (use null if standard DN)
hostname - The host where the MyProxy server is running on
lifetime - The lifetime of the new proxy credential
password - The password to authenticate to the MyProxy server [default: 24 hours]
port - The port where the MyProxy server is running on [default: 7512]
username - The username the proxy credential is stored under
Throws:
java.io.IOException - on read/write error
ProtocolException - on an invalid message

sendSuite

public void sendSuite(java.lang.String resource,
                      edu.sdsc.inca.dataModel.suite.SuiteDocument suite)
               throws java.io.IOException,
                      ProtocolException
Send the specified suite document to the remote reporter manager.

Parameters:
resource - The name of the resource the suite is being sent to.
suite - A suite to send to the reporter manager.
Throws:
java.io.IOException - on read/write error
ProtocolException - on an invalid message

setReader

public void setReader(ProtocolReader reader)
Set the reader connected to the remote reporter manager.

Parameters:
reader - The reader for the manager client

setResourceName

public void setResourceName(java.lang.String resourceName)
Set the name of the resource the remote reporter manager is hosted on.

Parameters:
resourceName - The name of the remote reporter manager.

setWriter

public void setWriter(ProtocolWriter writer)
Set the writer connected to the remote reporter manager.

Parameters:
writer - The reader for the manager client