Class S3CFG
- java.lang.Object
-
- edu.isi.pegasus.common.credential.impl.Abstract
-
- edu.isi.pegasus.common.credential.impl.S3CFG
-
- All Implemented Interfaces:
CredentialHandler
public class S3CFG extends Abstract implements CredentialHandler
A convenience class that allows us to determine the path to the user s3cfg file.- Version:
- $Revision$
- Author:
- Mats Rynge, 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.StringDESCRIPTIONThe descriptionprivate java.lang.StringmLocalCredentialPathThe local path to the credentialstatic java.lang.StringS3CFG_FILE_VARIABLEThe name of the environment variable that specifies the path to the s3cfg file.private static java.lang.StringS3CFG_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 S3CFG()The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBaseName(java.lang.String site)returns the basename of the path to the local credentialjava.lang.StringgetDescription()Returns the description for the implementing handlerjava.lang.StringgetEnvironmentVariable(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.StringgetLocalPath()Returns the path to user cred on the local site.java.lang.StringgetPath(java.lang.String site)Returns the path to S3CFG .java.lang.StringgetProfileKey()Returns the env or pegasus profile key that needs to be associated for the credential.voidinitialize(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
-
S3CFG_FILE_VARIABLE
public static final java.lang.String S3CFG_FILE_VARIABLE
The name of the environment variable that specifies the path to the s3cfg file.- See Also:
- Constant Field Values
-
S3CFG_PEGASUS_PROFILE_KEY
private static final java.lang.String S3CFG_PEGASUS_PROFILE_KEY
-
DESCRIPTION
private static final java.lang.String DESCRIPTION
The description- See Also:
- Constant Field Values
-
mLocalCredentialPath
private java.lang.String mLocalCredentialPath
The local path to the credential
-
-
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:
initializein interfaceCredentialHandler- Overrides:
initializein classAbstract- Parameters:
bag- the bag of Pegasus objects.
-
getPath
public java.lang.String getPath(java.lang.String site)
Returns the path to S3CFG . The order of preference is as follows - If a S3CFG is specified as a Pegasus Profile in the site catalog - Else the path on the local site- Specified by:
getPathin interfaceCredentialHandler- Parameters:
site- the site handle- Returns:
- the path to S3CFG.S3CFG_FILE_VARIABLE for the site.
-
getLocalPath
public java.lang.String getLocalPath()
Returns the path to user cred on the local site. The order of preference is as follows - If a S3CFG.S3CFG_FILE_VARIABLE is specified in the site catalog entry as a Pegasus Profile that is used, else the corresponding env profile for backward support - Else S3CFG.S3CFG_FILE_VARIABLE Pegasus Profile specified in the properties, else the corresponding env profile for backward support - Else the one pointed to by the environment variable S3CFG.S3CFG_FILE_VARIABLE - Else the default path of ~/.pegasus/s3cfg - Else the legacy default path of ~/.s3cfg- Parameters:
site- the site catalog entry object.- Returns:
- the path to user cred.
-
getBaseName
public java.lang.String getBaseName(java.lang.String site)
returns the basename of the path to the local credential- Specified by:
getBaseNamein 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:
getProfileKeyin 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:
getEnvironmentVariablein interfaceCredentialHandler- Returns:
- the name of the environment variable.
-
getDescription
public java.lang.String getDescription()
Returns the description for the implementing handler- Specified by:
getDescriptionin interfaceCredentialHandler- Returns:
- description
-
-