edu.sdsc.inca.agent
Class ReporterManagerProxy

java.lang.Object
  extended by edu.sdsc.inca.agent.ReporterManagerProxy

public class ReporterManagerProxy
extends java.lang.Object

Class for managing Grid proxy credentials. This class is used for 2 purposes: 1) When using remoteInvocationMethod 'globus', we use the Globus CoG API to transfer files and launch processes on a remote resource. The CoG API uses Globus services on the remote resource which needs a valid credential to authenticate. A proxy credential is a limited lifetime credential which allows you to authenticate to Globus services without typing in a password. Since a proxy has a limited lifetime and we anticipate the Reporter Agent and Reporter Manager to be long living processes, we can either create a long running proxy credential (not so good) or provide the ability to retrieve new proxy credentials from a MyProxy server. This class stores all the information to retrieve proxy credentials automatically from a MyProxy server. 2) Most likely the Reporter Managers will be executing reporters that need a valid proxy credential as part of their test, benchmark, or whatever. As with above, we need a way to refresh a proxy credential automatically. The information in this class will be passed to a remote reporter manager so that a process can be forked to retrieve new proxy credentials periodically.

Author:
Shava Smallen <ssmallen@sdsc.edu>

Constructor Summary
ReporterManagerProxy(java.lang.String hostname, int port, java.lang.String username, java.lang.String password, java.lang.String dn, int lifetime)
          Create a new Reporter Manager proxy object with the following fields already set:
ReporterManagerProxy(java.lang.String resource, edu.sdsc.inca.util.ResourcesWrapper resources)
          Create a new Reporter Manager proxy object.
 
Method Summary
 java.lang.String getDN()
          Return the subject DN of the MyProxy server.
 java.lang.String getHostname()
          Return the hostname of the MyProxy server.
 int getLifetime()
          Return the lifetime of which we will request proxy credentials from the MyProxy server.
 java.lang.String getPassword()
          The password to use to authenticate to the MyProxy server.
 int getPort()
          Return port of MyProxy server.
 org.ietf.jgss.GSSCredential getProxy()
          Retrieve a new proxy credential from the MyProxy server and return it.
 java.lang.String getUsername()
          Return username that the credential is stored under.
 void send(edu.sdsc.inca.protocol.ProtocolWriter writer, edu.sdsc.inca.protocol.ProtocolReader reader)
          Send the MyProxy information stored in this object to the specified writer.
 void setDN(java.lang.String dn)
          Set the subject DN for the MyProxy server if needed (i.e., if Globus will not accept host DN)
 void setHostname(java.lang.String hostname)
          Set the hostname of the MyProxy server.
 void setLifetime(int lifetime)
          Set the lifetime for new proxy credentials.
 void setPassword(java.lang.String password)
          Set the password for retrieving proxy credentials from the MyProxy server.
 void setPort(int port)
          Set the port of the MyProxy server if needed.
 void setUsername(java.lang.String username)
          Set the username for retrieving proxy credentials from the MyProxy server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReporterManagerProxy

public ReporterManagerProxy(java.lang.String resource,
                            edu.sdsc.inca.util.ResourcesWrapper resources)
                     throws edu.sdsc.inca.ConfigurationException
Create a new Reporter Manager proxy object.

Parameters:
resource - The name of the resource to send proxies to.
resources - The resource configuration information.
Throws:
edu.sdsc.inca.ConfigurationException

ReporterManagerProxy

public ReporterManagerProxy(java.lang.String hostname,
                            int port,
                            java.lang.String username,
                            java.lang.String password,
                            java.lang.String dn,
                            int lifetime)
Create a new Reporter Manager proxy object with the following fields already set:

Parameters:
hostname - The host where the MyProxy server is running on
port - The port where the MyProxy server is running on [default: 7512]
username - The username the proxy credential is stored under
password - The password to authenticate to the MyProxy server
dn - The DN of the MyProxy server (use null if standard DN)
lifetime - The lifetime of the new proxy credential [default: 12 hours]
Method Detail

getDN

public java.lang.String getDN()
Return the subject DN of the MyProxy server.

Returns:
the subject DN of the MyProxy server or null if not set

getHostname

public java.lang.String getHostname()
Return the hostname of the MyProxy server.

Returns:
the hostname of the MyProxy server or null if not set.

getLifetime

public int getLifetime()
Return the lifetime of which we will request proxy credentials from the MyProxy server.

Returns:
Lifetime we'll request for proxy certificates.

getPassword

public java.lang.String getPassword()
The password to use to authenticate to the MyProxy server.

Returns:
Password or null if not set.

getProxy

public org.ietf.jgss.GSSCredential getProxy()
                                     throws org.globus.myproxy.MyProxyException
Retrieve a new proxy credential from the MyProxy server and return it.

Returns:
New proxy credential
Throws:
org.globus.myproxy.MyProxyException - if problem retrieving proxy credential

getPort

public int getPort()
Return port of MyProxy server.

Returns:
Port of MyProxy server.

getUsername

public java.lang.String getUsername()
Return username that the credential is stored under.

Returns:
Username to retrieve proxy credential from MyProxy server.

send

public void send(edu.sdsc.inca.protocol.ProtocolWriter writer,
                 edu.sdsc.inca.protocol.ProtocolReader reader)
          throws java.io.IOException,
                 edu.sdsc.inca.protocol.ProtocolException
Send the MyProxy information stored in this object to the specified writer.

Parameters:
writer - Writer to remote process to send MyProxy information.
reader - Reader to remote process to read confirmation from.
Throws:
java.io.IOException
edu.sdsc.inca.protocol.ProtocolException

setDN

public void setDN(java.lang.String dn)
Set the subject DN for the MyProxy server if needed (i.e., if Globus will not accept host DN)

Parameters:
dn - Subject DN of MyProxy server

setHostname

public void setHostname(java.lang.String hostname)
Set the hostname of the MyProxy server.

Parameters:
hostname - hostname of the MyProxy server.

setLifetime

public void setLifetime(int lifetime)
Set the lifetime for new proxy credentials. Default value is 12 hours.

Parameters:
lifetime - The period of validity for new proxy credentials in hours.

setPassword

public void setPassword(java.lang.String password)
Set the password for retrieving proxy credentials from the MyProxy server.

Parameters:
password - A password of at least 6 characters.

setPort

public void setPort(int port)
Set the port of the MyProxy server if needed. Default value is 7512.

Parameters:
port - Port number.

setUsername

public void setUsername(java.lang.String username)
Set the username for retrieving proxy credentials from the MyProxy server.

Parameters:
username - A username.