Class Proxy
- java.lang.Object
-
- edu.isi.pegasus.common.credential.impl.Abstract
-
- edu.isi.pegasus.common.credential.impl.Proxy
-
- All Implemented Interfaces:
CredentialHandler
public class Proxy extends Abstract implements CredentialHandler
A convenice class that allows us to determine the path to the user proxy.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.isi.pegasus.common.credential.CredentialHandler
CredentialHandler.TYPE
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DESCRIPTION
The description.private java.lang.String
mLocalProxyPath
The local path to the user proxystatic java.lang.String
X509_USER_PROXY_KEY
The name of the environment variable that specifies the path to the proxy.private static java.lang.String
X509_USER_PROXY_PEGASUS_PROFILE_KEY
-
Fields inherited from class edu.isi.pegasus.common.credential.impl.Abstract
mLogger, mProps, mSiteStore
-
Fields inherited from interface edu.isi.pegasus.common.credential.CredentialHandler
VERSION
-
-
Constructor Summary
Constructors Constructor Description Proxy()
The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBaseName(java.lang.String site)
returns the basename of the path to the local credentialjava.lang.String
getDescription()
Returns the description for the implementing handlerjava.lang.String
getEnvironmentVariable(java.lang.String site)
Returns the name of the environment variable that needs to be set for the job associated with the credential.java.lang.String
getLocalPath()
Returns the path to user proxy on the local site.java.lang.String
getPath(java.lang.String site)
Returns the path to user proxy.java.lang.String
getProfileKey()
Returns the env or pegasus profile key that needs to be associated for the credential.void
initialize(PegasusBag bag)
Initializes the credential implementation.-
Methods inherited from class edu.isi.pegasus.common.credential.impl.Abstract
getPath, getSiteNameForEnvironmentKey
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.isi.pegasus.common.credential.CredentialHandler
getPath
-
-
-
-
Field Detail
-
X509_USER_PROXY_KEY
public static final java.lang.String X509_USER_PROXY_KEY
The name of the environment variable that specifies the path to the proxy.- See Also:
- Constant Field Values
-
X509_USER_PROXY_PEGASUS_PROFILE_KEY
private static final java.lang.String X509_USER_PROXY_PEGASUS_PROFILE_KEY
-
DESCRIPTION
private static final java.lang.String DESCRIPTION
The description.- See Also:
- Constant Field Values
-
mLocalProxyPath
private java.lang.String mLocalProxyPath
The local path to the user proxy
-
-
Method Detail
-
initialize
public void initialize(PegasusBag bag)
Initializes the credential implementation. Implementations require access to the logger, properties and the SiteCatalog Store.- Specified by:
initialize
in interfaceCredentialHandler
- Overrides:
initialize
in classAbstract
- Parameters:
bag
- the bag of Pegasus objects.
-
getPath
public java.lang.String getPath(java.lang.String site)
Returns the path to user proxy. The order of preference is as follows - If a X509_USER_PROXY is specified as a Pegasus Profile in the site catalog - Else the path on the local site- Specified by:
getPath
in interfaceCredentialHandler
- Parameters:
site
- the site catalog entry object.- Returns:
- the path to user proxy.
-
getLocalPath
public java.lang.String getLocalPath()
Returns the path to user proxy on the local site. The order of preference is as follows - If a proxy is specified in the site catalog entry as a Pegasus Profile that is used, else the corresponding env profile for backward support - Else X509_USER_PROXY as Pegasus Profile specified in the properties, else the corresponding env profile for backward support - Else the one pointed to by the environment variable X509_USER_PROXY - Else the default path to the proxy in /tmp is created as determined by CoGProperties.getDefault().getProxyFile()- Parameters:
site
- the site catalog entry object.- Returns:
- the path to user proxy.
-
getBaseName
public java.lang.String getBaseName(java.lang.String site)
returns the basename of the path to the local credential- Specified by:
getBaseName
in interfaceCredentialHandler
- Parameters:
site
- the site handle- Returns:
-
getProfileKey
public java.lang.String getProfileKey()
Returns the env or pegasus profile key that needs to be associated for the credential.- Specified by:
getProfileKey
in interfaceCredentialHandler
- Returns:
- the name of the environment variable.
-
getEnvironmentVariable
public java.lang.String getEnvironmentVariable(java.lang.String site)
Returns the name of the environment variable that needs to be set for the job associated with the credential.- Specified by:
getEnvironmentVariable
in interfaceCredentialHandler
- Returns:
- the name of the environment variable.
-
getDescription
public java.lang.String getDescription()
Returns the description for the implementing handler- Specified by:
getDescription
in interfaceCredentialHandler
- Returns:
- description
-
-