edu.sdsc.grid.io.srb
Class SRBAccount

java.lang.Object
  extended by edu.sdsc.grid.io.GeneralAccount
      extended by edu.sdsc.grid.io.RemoteAccount
          extended by edu.sdsc.grid.io.srb.SRBAccount
All Implemented Interfaces:
java.lang.Cloneable

public class SRBAccount
extends RemoteAccount

This class extends the RemoteAccount class, adding those values necessary to open a connection to the SRB. This class does not actually connect to a filesystem. It only hold user connection information. Setting or getting this information only refers to the contents of the object.


Field Summary
protected  java.lang.String certificateAuthority
          The certificate authority (CA) list.
protected  java.lang.String clientMcatZone
          The client mcat zone.
protected  java.lang.String defaultStorageResource
          The default storage resource.
protected  java.lang.String domainName
          The mdas domain home of the user.
static int ENCRYPT1
          Encrypted text password.
protected  java.lang.String execFile
          The exec file.
static int GSI_AUTH
          GSI authentication protocol
static int GSI_DELEGATE
          GSI delegated authentication protocol
protected  java.lang.Object gssCredential
          Stores the GSSCredential.
protected  int options
          The srb options.
static int PASSWD_AUTH
          Plain text password.
protected  java.lang.String proxyDomainName
          The mdas domain home of the user.
protected  java.lang.String proxyMcatZone
          The proxy mcat zone.
protected  java.lang.String proxyUserName
          The authorizing user name.
static java.lang.String SRB_VERSION_1_1_8
          SRB version 1.1.8.
static java.lang.String SRB_VERSION_2
          All SRB version 2
static java.lang.String SRB_VERSION_3
          SRB version 3.0.0
static java.lang.String SRB_VERSION_3_0_2
          SRB version 3.0.2 to version 3.2
static java.lang.String SRB_VERSION_3_3
          SRB version 3.3
static java.lang.String SRB_VERSION_3_3_1
          SRB version 3.3.1
static java.lang.String SRB_VERSION_3_4
          SRB version 3.4 (same as SRB_VERSION_3_3_1)
protected static java.lang.String version
          The srb version.
 
Fields inherited from class edu.sdsc.grid.io.RemoteAccount
host, password, port, userName
 
Fields inherited from class edu.sdsc.grid.io.GeneralAccount
homeDirectory
 
Constructor Summary
SRBAccount()
          This constructor uses the default info found in the Mdas files in the user's local home directory.
SRBAccount(java.io.File userInfoDirectory)
          Creates an object to hold SRB account information.
SRBAccount(java.io.File mdasEnvFile, java.io.File mdasAuthFile)
          Creates an object to hold SRB account information.
SRBAccount(GeneralFile userInfoDirectory)
          Creates an object to hold SRB account information.
SRBAccount(GeneralFile mdasEnvFile, GeneralFile mdasAuthFile)
          Creates an object to hold SRB account information.
SRBAccount(java.lang.String userInfoDirectory)
          Creates an object to hold SRB account information.
SRBAccount(java.lang.String host, int port, java.lang.Object gssCredential)
          Creates an object to hold SRB account information.
SRBAccount(java.lang.String host, int port, java.lang.Object gssCredential, java.lang.String homeDirectory, java.lang.String defaultStorageResource, int options)
          Creates an object to hold SRB account information.
SRBAccount(java.lang.String host, int port, java.lang.String userName, java.lang.String password, java.lang.String homeDirectory, java.lang.String mdasDomainName, java.lang.String defaultStorageResource)
          Creates an object to hold SRB account information.
SRBAccount(java.lang.String host, int port, java.lang.String userName, java.lang.String password, java.lang.String homeDirectory, java.lang.String mdasDomainName, java.lang.String defaultStorageResource, java.lang.String mcatZone)
          Creates an object to hold SRB account information.
SRBAccount(java.lang.String mdasEnvFile, java.lang.String mdasAuthFile)
          Creates an object to hold SRB account information.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests this account object for equality with the given object.
protected  void finalize()
          Finalizes the object by explicitly letting go of each of its internally held values.
 java.lang.String getCertificateAuthority()
          Gets the locations of the GSI Certificate Authority (CA).
 java.lang.String getDefaultStorageResource()
          Gets the default storage resource.
 java.lang.String getDomainName()
          Gets the domain name used by the client.
 java.lang.String getExecFile()
           
 java.lang.Object getGSSCredential()
          If one exists, gets the GSSCredential used to make a GSI authentication.
 java.lang.String getMcatZone()
           
 int getOptions()
          Gets the SRB options.
protected  java.lang.String getProxyDomainName()
          Gets the SRB proxyDomainName.
 java.lang.String getProxyMcatZone()
           
protected  java.lang.String getProxyUserName()
          Gets the SRB proxyUserName.
static java.lang.String getVersion()
          Gets the SRB version.
 void readMdasAuth(GeneralFile mdasAuthFile)
          Retrieve the Mdas authorization user password
 void setCertificateAuthority(java.lang.String list)
          Sets the locations of the GSI Certificate Authority (CA).
 void setDefaultStorageResource(java.lang.String defaultStorageResource)
          Sets the default storage resource.
 void setDomainName(java.lang.String domainName)
          Sets the domain name used by the client.
 void setExecFile(java.lang.String execFile)
          Sets the exec file.
 void setGSSCredential(java.lang.Object gssCredential)
          Allows a GSSCredential to be used to make a GSI authentication.
 void setHomeDirectory(java.lang.String homeDirectory)
          Sets the home directory of this RemoteAccount.
 void setMcatZone(java.lang.String clientMcatZone)
          Sets the client mcat zone.
 void setMdasUserInfo(GeneralFile mdasEnvFile)
          Reads the Mdas enviroment file, then sets the user info variables.
 void setOptions(int options)
          Set the type of authentication used, e.g.
protected  void setProxyDomainName(java.lang.String proxyDomainName)
          Sets the proxy domain name.
 void setProxyMcatZone(java.lang.String proxyMcatZone)
          Sets the proxy mcat zone.
protected  void setProxyUserName(java.lang.String proxyUserName)
          Sets the proxy user name.
 void setUserInfo(GeneralFile userInfoDirectory)
          Reads the Mdas enviroment files, then set the user info.
static void setVersion(java.lang.String srbVersion)
          Sets the version.
 java.lang.String toString()
          Returns a string representation of this file system object.
 
Methods inherited from class edu.sdsc.grid.io.RemoteAccount
getHost, getPassword, getPort, getUserName, setHost, setPassword, setPort, setUserName
 
Methods inherited from class edu.sdsc.grid.io.GeneralAccount
clone, getHomeDirectory
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PASSWD_AUTH

public static final int PASSWD_AUTH
Plain text password. Only supported in SRB version 1.1.8

See Also:
Constant Field Values

GSI_AUTH

public static final int GSI_AUTH
GSI authentication protocol

See Also:
Constant Field Values

ENCRYPT1

public static final int ENCRYPT1
Encrypted text password.

See Also:
Constant Field Values

GSI_DELEGATE

public static final int GSI_DELEGATE
GSI delegated authentication protocol

See Also:
Constant Field Values

SRB_VERSION_3_4

public static final java.lang.String SRB_VERSION_3_4
SRB version 3.4 (same as SRB_VERSION_3_3_1)

See Also:
Constant Field Values

SRB_VERSION_3_3_1

public static final java.lang.String SRB_VERSION_3_3_1
SRB version 3.3.1

See Also:
Constant Field Values

SRB_VERSION_3_3

public static final java.lang.String SRB_VERSION_3_3
SRB version 3.3

See Also:
Constant Field Values

SRB_VERSION_3_0_2

public static final java.lang.String SRB_VERSION_3_0_2
SRB version 3.0.2 to version 3.2

See Also:
Constant Field Values

SRB_VERSION_3

public static final java.lang.String SRB_VERSION_3
SRB version 3.0.0

See Also:
Constant Field Values

SRB_VERSION_2

public static final java.lang.String SRB_VERSION_2
All SRB version 2

See Also:
Constant Field Values

SRB_VERSION_1_1_8

public static final java.lang.String SRB_VERSION_1_1_8
SRB version 1.1.8. The earliest SRB version tested for compatibility with this API.

See Also:
Constant Field Values

proxyUserName

protected java.lang.String proxyUserName
The authorizing user name.


proxyDomainName

protected java.lang.String proxyDomainName
The mdas domain home of the user.


domainName

protected java.lang.String domainName
The mdas domain home of the user. A domain is a string used to identify a site or project. Users are uniquely identified by their usernames combined with their domain 'smith.sdsc'. A SRB admin has the authority to create domains.


defaultStorageResource

protected java.lang.String defaultStorageResource
The default storage resource.


options

protected int options
The srb options. Used to select an authorization scheme.

proxyMcatZone

protected java.lang.String proxyMcatZone
The proxy mcat zone.


clientMcatZone

protected java.lang.String clientMcatZone
The client mcat zone. Added as of SRB3.0. Used to address a user within federated MCATs. Federatation of SRBs allows multiple SRBs to communicate with each even if they use different MCAT database. use differ


execFile

protected java.lang.String execFile
The exec file.


certificateAuthority

protected java.lang.String certificateAuthority
The certificate authority (CA) list. By default, the CA definition comes from the user's cog.properties file.


gssCredential

protected java.lang.Object gssCredential
Stores the GSSCredential. This object should be of the Interface org.ietf.jgss.GSSCredential Unfortunately to allow instances of that interface in this class creates a whole set of complex problems (for any non-GSI-developers using this API. Not problems internal to the JARGON API).
This means though if you put a non GSSCredential object in here, the ClassCastException won't be thrown until trying to connect to the SRB.


version

protected static java.lang.String version
The srb version.

Constructor Detail

SRBAccount

public SRBAccount()
           throws java.io.FileNotFoundException,
                  java.io.IOException
This constructor uses the default info found in the Mdas files in the user's local home directory.

Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(java.lang.String userInfoDirectory)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Creates an object to hold SRB account information.

Parameters:
userInfoDirectory - the local directory holding the .Mdas files
Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(java.io.File userInfoDirectory)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Creates an object to hold SRB account information.

Parameters:
userInfoDirectory - directory holding the .Mdas files
Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(GeneralFile userInfoDirectory)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Creates an object to hold SRB account information.

Parameters:
userInfoDirectory - directory holding the .Mdas files
Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(java.lang.String mdasEnvFile,
                  java.lang.String mdasAuthFile)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Creates an object to hold SRB account information.

Parameters:
mdasEnvFile - Location of the ".MdasEnv" file.
mdasAuthFile - Location of the ".MdasAuth" file.
Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(java.io.File mdasEnvFile,
                  java.io.File mdasAuthFile)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Creates an object to hold SRB account information.

Parameters:
mdasEnvFile - Location of the ".MdasEnv" file.
mdasAuthFile - Location of the ".MdasAuth" file.
Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(GeneralFile mdasEnvFile,
                  GeneralFile mdasAuthFile)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Creates an object to hold SRB account information.

Parameters:
mdasEnvFile - Location of the ".MdasEnv" file.
mdasAuthFile - Location of the ".MdasAuth" file.
Throws:
java.io.FileNotFoundException - if the user info cannot be found.
java.io.IOException - if the user info exists but cannot be opened or created for any other reason.

SRBAccount

public SRBAccount(java.lang.String host,
                  int port,
                  java.lang.String userName,
                  java.lang.String password,
                  java.lang.String homeDirectory,
                  java.lang.String mdasDomainName,
                  java.lang.String defaultStorageResource)
Creates an object to hold SRB account information. This constructor does not use any default info.

Parameters:
host - the SRB server domain name
port - the port on the SRB server
userName - the user name
password - the password
homeDirectory - home directory on the SRB
mdasDomainName - the mdas home domain
defaultStorageResource - default storage resource

SRBAccount

public SRBAccount(java.lang.String host,
                  int port,
                  java.lang.String userName,
                  java.lang.String password,
                  java.lang.String homeDirectory,
                  java.lang.String mdasDomainName,
                  java.lang.String defaultStorageResource,
                  java.lang.String mcatZone)
Creates an object to hold SRB account information. This constructor does not use any default info.

Parameters:
host - the SRB server domain name
port - the port on the SRB server
userName - the user name
password - the password
homeDirectory - home directory on the SRB
mdasDomainName - the mdas home domain
defaultStorageResource - default storage resource
mcatZone - mcat zone

SRBAccount

public SRBAccount(java.lang.String host,
                  int port,
                  java.lang.Object gssCredential)
Creates an object to hold SRB account information. Uses the GSSCredential to discover the connection information. Sets the authentication option to GSI_AUTH. The gssCredential parameter should be an interface of: org.ietf.jgss.GSSCredential Unfortunately to allow instances of that interface in this class creates a whole set of complex problems (See also, the US export control laws on encryption, then write your congressional representatives.)
This means though if you put a non GSSCredential object in here, a ClassCastException (or UnsupportedOperationException) won't be thrown until trying to connect to the SRB.

Parameters:
host - the SRB server domain name
port - the port on the SRB server
gssCredential - the org.ietf.jgss.GSSCredential object

SRBAccount

public SRBAccount(java.lang.String host,
                  int port,
                  java.lang.Object gssCredential,
                  java.lang.String homeDirectory,
                  java.lang.String defaultStorageResource,
                  int options)
Creates an object to hold SRB account information. Uses the GSSCredential to discover the connection information. The gssCredential parameter should be an interface of: org.ietf.jgss.GSSCredential Unfortunately to allow instances of that interface in this class creates a whole set of complex problems (See also, the US export control laws on encryption, then write your congressional representatives.)
This means though if you put a non GSSCredential object in here, a ClassCastException (or UnsupportedOperationException) won't be thrown until trying to connect to the SRB.

Parameters:
host - the SRB server domain name
port - the port on the SRB server
gssCredential - the org.ietf.jgss.GSSCredential object
homeDirectory - home directory on the SRB
defaultStorageResource - default storage resource
options - authentication protocol, e.g GSI_AUTH
Method Detail

finalize

protected void finalize()
Finalizes the object by explicitly letting go of each of its internally held values.

Overrides:
finalize in class RemoteAccount

setHomeDirectory

public void setHomeDirectory(java.lang.String homeDirectory)
Sets the home directory of this RemoteAccount.

Specified by:
setHomeDirectory in class GeneralAccount
Throws:
java.lang.NullPointerException - if homeDirectory is null.

setProxyUserName

protected void setProxyUserName(java.lang.String proxyUserName)
Sets the proxy user name.

Throws:
java.lang.NullPointerException - if proxyUserName is null.

setProxyDomainName

protected void setProxyDomainName(java.lang.String proxyDomainName)
Sets the proxy domain name.

Throws:
java.lang.NullPointerException - if proxyDomainName is null.

setDomainName

public void setDomainName(java.lang.String domainName)
Sets the domain name used by the client.

Throws:
java.lang.NullPointerException - if domainName is null.

setDefaultStorageResource

public void setDefaultStorageResource(java.lang.String defaultStorageResource)
Sets the default storage resource.

Throws:
java.lang.NullPointerException - if defaultStorageResource is null.

setOptions

public void setOptions(int options)
Set the type of authentication used, e.g. ENCRYPT1, GSI_AUTH.


setVersion

public static void setVersion(java.lang.String srbVersion)
Sets the version.

Throws:
java.lang.NullPointerException - if version is null.

setProxyMcatZone

public void setProxyMcatZone(java.lang.String proxyMcatZone)
Sets the proxy mcat zone.


setMcatZone

public void setMcatZone(java.lang.String clientMcatZone)
Sets the client mcat zone.


setExecFile

public void setExecFile(java.lang.String execFile)
Sets the exec file.


setCertificateAuthority

public void setCertificateAuthority(java.lang.String list)
Sets the locations of the GSI Certificate Authority (CA). The list can contain multiple files that are comma separated. By default, the CA definition comes from the user's cog.properties file.


setGSSCredential

public void setGSSCredential(java.lang.Object gssCredential)
Allows a GSSCredential to be used to make a GSI authentication. The gssCredential parameter should be an interface of: org.ietf.jgss.GSSCredential Unfortunately to allow instances of that interface in this class creates a whole set of complex problems (See also, the US export control laws on encryption, then write your congressional representatives.)
This means though if you put a non GSSCredential object in here, a ClassCastException (or UnsupportedOperationException) won't be thrown until trying to connect to the SRB.


getProxyUserName

protected java.lang.String getProxyUserName()
Gets the SRB proxyUserName.

Returns:
proxyUserName

getProxyDomainName

protected java.lang.String getProxyDomainName()
Gets the SRB proxyDomainName.

Returns:
proxyDomainName

getDomainName

public java.lang.String getDomainName()
Gets the domain name used by the client. Only different from the proxyDomainName for ticketed users.


getDefaultStorageResource

public java.lang.String getDefaultStorageResource()
Gets the default storage resource.

Returns:
defaultStorageResource

getOptions

public int getOptions()
Gets the SRB options.

Returns:
options

getVersion

public static java.lang.String getVersion()
Gets the SRB version.

Returns:
version

getProxyMcatZone

public java.lang.String getProxyMcatZone()
Returns:
the proxy mcat zone.

getMcatZone

public java.lang.String getMcatZone()
Returns:
the client mcat zone.

getExecFile

public java.lang.String getExecFile()
Returns:
the exec file.

getCertificateAuthority

public java.lang.String getCertificateAuthority()
Gets the locations of the GSI Certificate Authority (CA). By default, the CA definition comes from the user's cog.properties file.


getGSSCredential

public java.lang.Object getGSSCredential()
If one exists, gets the GSSCredential used to make a GSI authentication. This object should be of the Interface org.ietf.jgss.GSSCredential Unfortunately to allow instances of that interface in this class creates a whole set of complex problems (for any non-GSI-developers using this API. Not problems internal to the JARGON API).
This means though if you put a non GSSCredential object in here, the ClassCastException won't be thrown until trying to connect to the SRB.


equals

public boolean equals(java.lang.Object obj)
Tests this account object for equality with the given object. Returns true if and only if the argument is not null and both are account objects with equivalent connection parameters.

Specified by:
equals in class GeneralAccount
Parameters:
obj - The object to be compared with this abstract pathname
Returns:
true if and only if the objects are the same; false otherwise

toString

public java.lang.String toString()
Returns a string representation of this file system object. The string is formated according to the SRB URI model. Note: the user password will not be included in the URI.

Overrides:
toString in class java.lang.Object

setUserInfo

public void setUserInfo(GeneralFile userInfoDirectory)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Reads the Mdas enviroment files, then set the user info.

Parameters:
userInfoDirectory - The path to the user info files
Throws:
java.io.FileNotFoundException
java.io.IOException

setMdasUserInfo

public void setMdasUserInfo(GeneralFile mdasEnvFile)
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Reads the Mdas enviroment file, then sets the user info variables.

Parameters:
mdasEnvFile - The mdas file which stores the user info
Throws:
java.io.FileNotFoundException
java.io.IOException

readMdasAuth

public void readMdasAuth(GeneralFile mdasAuthFile)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
Retrieve the Mdas authorization user password

Parameters:
mdasAuthFile - The file which contains the Mdas authorization
Throws:
java.io.FileNotFoundException
java.io.IOException