nl.uva.vlet.util.cog
Class GridProxy

java.lang.Object
  extended by nl.uva.vlet.util.cog.GridProxy

public class GridProxy
extends java.lang.Object

Simple Grid Proxy Util class. Provides some conveniant methods in handling grid proxies.


Field Summary
 boolean valid
           
 
Constructor Summary
GridProxy(GlobusCredential cred)
           
 
Method Summary
static void addGridProxyListener(GridProxyListener listener)
           
 boolean checkGridProxy()
           
 boolean createWithPassword(java.lang.String string)
           
static void Debug(java.lang.String str)
           
 void Destroy()
           
 java.lang.String getCACertificateLocations()
          Return path(s) to certificate locations
static GridProxy getDefault()
          Returns static GridProxy object
 int getDefaultLifeTime()
           
 GlobusCredential getGlobusCredential()
          Retreives current GLobusCrendentail.
static org.ietf.jgss.GSSCredential getHostCredential()
           
 java.lang.String getProxyAsString()
          Load proxy and return it as String uses ResourceLoader.DEFAULT_CHARSET (must match setGlobusCredential(String))
 java.lang.String getProxyFilename()
           
 java.lang.String getSubject()
           
 long getTimeLeft()
           
 long getTimeLeftHours()
           
 long getTimeLeftMinutes()
           
 long getTimeLeftSeconds()
           
 java.lang.String getTimeLeftString()
           
 java.lang.String getUserCertFilename()
           
 java.lang.String getUserCertificateLocation()
          Returns parent directory of Certificate Location
 java.lang.String getUserKeyFilename()
           
 boolean isValid()
           
static GlobusCredential loadGlobusCredentialsFrom(java.lang.String path)
           
protected  void loadProxy()
          (re)load the proxy and it's configuration
static void reloadProxy()
          Triggers reloading of current proxy and it's settings
static void removeGridProxyListener(GridProxyListener listener)
           
 boolean save()
          Save current proxy.
 boolean saveTo(java.lang.String path)
          Save to local path, does not update ProxyFilename in Globus properties
static void setDefaultGlobusCredential(GlobusCredential cred)
           
 void setGlobusCredential(java.lang.String proxyStr)
           
static void setHostCredential(org.ietf.jgss.GSSCredential cred)
           
 boolean setProxyLifetime(int time)
          Sets time of proxy filename
 boolean setProxyLocation(java.lang.String path)
          Sets path of proxy filename (Does not update globus cog properties).
 boolean setUserCertificateLocation(java.lang.String dir)
          Sets parent directory of Certificate (usercert.pem+userkey.pem) Location
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

valid

public boolean valid
Constructor Detail

GridProxy

public GridProxy(GlobusCredential cred)
Method Detail

loadProxy

protected void loadProxy()
                  throws VlException
(re)load the proxy and it's configuration

Throws:
VlException

loadGlobusCredentialsFrom

public static GlobusCredential loadGlobusCredentialsFrom(java.lang.String path)
                                                  throws VlException
Throws:
VlException

setDefaultGlobusCredential

public static void setDefaultGlobusCredential(GlobusCredential cred)

setGlobusCredential

public void setGlobusCredential(java.lang.String proxyStr)
                         throws VlException
Throws:
VlException

checkGridProxy

public boolean checkGridProxy()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

createWithPassword

public boolean createWithPassword(java.lang.String string)
                           throws VlException
Throws:
VlException

getProxyFilename

public java.lang.String getProxyFilename()

getCACertificateLocations

public java.lang.String getCACertificateLocations()
Return path(s) to certificate locations


save

public boolean save()
             throws VlException
Save current proxy. Note that when running as web applet the save might fail !

Returns:
Throws:
VlException

saveTo

public boolean saveTo(java.lang.String path)
               throws VlException
Save to local path, does not update ProxyFilename in Globus properties

Throws:
VlException

isValid

public boolean isValid()

getGlobusCredential

public GlobusCredential getGlobusCredential()
Retreives current GLobusCrendentail. May return null if not valid !


addGridProxyListener

public static void addGridProxyListener(GridProxyListener listener)

removeGridProxyListener

public static void removeGridProxyListener(GridProxyListener listener)

getDefault

public static GridProxy getDefault()
Returns static GridProxy object


Debug

public static void Debug(java.lang.String str)

reloadProxy

public static void reloadProxy()
                        throws VlException
Triggers reloading of current proxy and it's settings

Throws:
VlException

getUserCertFilename

public java.lang.String getUserCertFilename()

getDefaultLifeTime

public int getDefaultLifeTime()

getUserKeyFilename

public java.lang.String getUserKeyFilename()

getUserCertificateLocation

public java.lang.String getUserCertificateLocation()
Returns parent directory of Certificate Location


getTimeLeft

public long getTimeLeft()

getTimeLeftHours

public long getTimeLeftHours()

getTimeLeftMinutes

public long getTimeLeftMinutes()

getTimeLeftSeconds

public long getTimeLeftSeconds()

getTimeLeftString

public java.lang.String getTimeLeftString()

Destroy

public void Destroy()

setHostCredential

public static void setHostCredential(org.ietf.jgss.GSSCredential cred)

getHostCredential

public static org.ietf.jgss.GSSCredential getHostCredential()

getSubject

public java.lang.String getSubject()

setUserCertificateLocation

public boolean setUserCertificateLocation(java.lang.String dir)
Sets parent directory of Certificate (usercert.pem+userkey.pem) Location


setProxyLocation

public boolean setProxyLocation(java.lang.String path)
Sets path of proxy filename (Does not update globus cog properties).


setProxyLifetime

public boolean setProxyLifetime(int time)
Sets time of proxy filename


getProxyAsString

public java.lang.String getProxyAsString()
                                  throws VlException
Load proxy and return it as String uses ResourceLoader.DEFAULT_CHARSET (must match setGlobusCredential(String))

Throws:
VlException