edu.sdsc.grid.io.irods
Class IRODSAccount

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

public class IRODSAccount
extends RemoteAccount

This class extends the RemoteAccount class, adding those values necessary to open a connection to a iRODS server. 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.

Since:
JARGON2.0
See Also:
edu.sdsc.grid.io.irods.RodsFileSystem

Field Summary
protected  java.lang.String authenticationScheme
          The iRODS authorization scheme.
protected  java.lang.String defaultStorageResource
          The default storage resource.
static java.lang.String IRODS_API_VERSION
          iRODS API version "b"
static java.lang.String IRODS_VERSION_0_9
          iRODS version 1.0
static java.lang.String IRODS_VERSION_1_0
          iRODS version 1.0
protected  java.lang.String serverDN
          The iRODS Server DN string.
protected static java.lang.String version
          The iRODS version.
protected  java.lang.String zone
          The iRODS zone.
 
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
IRODSAccount()
          This constructor uses the default info found in the iRODS environment files in the user's local home directory.
IRODSAccount(GeneralFile userInfoDirectory)
          Creates an object to hold iRODS account information.
IRODSAccount(GeneralFile envFile, GeneralFile authFile)
          Creates an object to hold iRODS account information.
IRODSAccount(java.lang.String host, int port, java.lang.String userName, java.lang.String password, java.lang.String homeDirectory, java.lang.String zone, java.lang.String defaultStorageResource)
          Creates an object to hold iRODS account information.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests this local file system 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 getAuthenticationScheme()
          Gets the iRODS options.
 java.lang.String getDefaultStorageResource()
          Gets the default storage resource.
 java.lang.String getServerDN()
           
static java.lang.String getVersion()
          Gets the iRODS version.
 java.lang.String getZone()
           
 void readAuth(GeneralFile authFile)
          Retrieve the Mdas authorization user password
 void setAuthenticationScheme(java.lang.String scheme)
          Set the type of authentication used.
 void setDefaultStorageResource(java.lang.String defaultStorageResource)
          Sets the default storage resource.
 void setHomeDirectory(java.lang.String homeDirectory)
          Sets the home directory of this RemoteAccount.
 void setUserInfo(GeneralFile userInfo)
          Reads the iRODS enviroment files to set the user info.
 void setZone(java.lang.String zone)
           
 
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, toString, wait, wait, wait
 

Field Detail

IRODS_VERSION_0_9

public static final java.lang.String IRODS_VERSION_0_9
iRODS version 1.0

See Also:
Constant Field Values

IRODS_VERSION_1_0

public static final java.lang.String IRODS_VERSION_1_0
iRODS version 1.0

See Also:
Constant Field Values

IRODS_API_VERSION

public static final java.lang.String IRODS_API_VERSION
iRODS API version "b"

See Also:
Constant Field Values

defaultStorageResource

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


authenticationScheme

protected java.lang.String authenticationScheme
The iRODS authorization scheme.


serverDN

protected java.lang.String serverDN
The iRODS Server DN string.


zone

protected java.lang.String zone
The iRODS zone.


version

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

Constructor Detail

IRODSAccount

public IRODSAccount()
             throws java.io.FileNotFoundException,
                    java.io.IOException
This constructor uses the default info found in the iRODS environment 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.

IRODSAccount

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

Parameters:
userInfoDirectory - directory holding the .iRODS 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.

IRODSAccount

public IRODSAccount(GeneralFile envFile,
                    GeneralFile authFile)
             throws java.io.FileNotFoundException,
                    java.io.IOException
Creates an object to hold iRODS account information.

Parameters:
envFile - Location of the ".irodsEnv" file.
authFile - Location of the ".irodsAuth" 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.

IRODSAccount

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

Parameters:
host - the iRODS server domain name
port - the port on the iRODS server
userName - the user name
password - the password
homeDirectory - home directory on the iRODS
zone - the IRODS zone
defaultStorageResource - default storage resource
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.

setDefaultStorageResource

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

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

setAuthenticationScheme

public void setAuthenticationScheme(java.lang.String scheme)
Set the type of authentication used.


setZone

public void setZone(java.lang.String zone)

getDefaultStorageResource

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

Returns:
defaultStorageResource

getAuthenticationScheme

public java.lang.String getAuthenticationScheme()
Gets the iRODS options.

Returns:
options

getVersion

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

Returns:
version

getServerDN

public java.lang.String getServerDN()
Returns:
the Server DN string used by the client.

getZone

public java.lang.String getZone()
Returns:
the Server DN string used by the client.

equals

public boolean equals(java.lang.Object obj)
Tests this local file system account object for equality with the given object. Returns true if and only if the argument is not null and both are account objects for the same filesystem.

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

setUserInfo

public void setUserInfo(GeneralFile userInfo)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Reads the iRODS enviroment files to set the user info.

Parameters:
userInfo - The path to the user info file
Throws:
java.io.FileNotFoundException
java.io.IOException

readAuth

public void readAuth(GeneralFile authFile)
              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