edu.sdsc.grid.io.irods
Class IRODSFileSystem

java.lang.Object
  extended by edu.sdsc.grid.io.GeneralFileSystem
      extended by edu.sdsc.grid.io.RemoteFileSystem
          extended by edu.sdsc.grid.io.irods.IRODSFileSystem
All Implemented Interfaces:
java.lang.Cloneable

public class IRODSFileSystem
extends RemoteFileSystem

The IRODSFileSystem class is the class for connection implementations to iRods servers. It provides the framework to support a wide range of iRODS semantics. Specifically, the functions needed to interact with a iRODS server.

Since:
JARGON2.0
See Also:
edu.sdsc.grid.io.rods.RodsCommands

Field Summary
static java.lang.String IRODS_ROOT
          The iRODS like Unix only has one root, "/".
 
Fields inherited from class edu.sdsc.grid.io.GeneralFileSystem
account, DEFAULT_RECORDS_WANTED, PATH_SEPARATOR, roots
 
Constructor Summary
IRODSFileSystem()
          Opens a socket connection to read from and write to.
IRODSFileSystem(IRODSAccount iRODSAccount)
          Opens a socket connection to read from and write to.
 
Method Summary
 void close()
          Closes the connection to the SRB file system.
 boolean equals(java.lang.Object obj)
          Tests this filesystem object for equality with the given object.
protected  void finalize()
          Finalizes the object by explicitly letting go of each of its internally held values.
 GeneralAccount getAccount()
          Returns the account used by this IRODSFileSystem.
 java.lang.String getAuthenticationScheme()
           
 java.lang.String getDefaultStorageResource()
           
 java.lang.String[] getRootDirectories()
          Returns the root directories of the iRODS file system.
 java.lang.String getServerDN()
           
 java.lang.String getVersion()
           
 float getVersionNumber()
           
 boolean isClosed()
          Returns if the connection to the SRB has been closed or not.
 boolean isConnected()
          Checks if the socket is connected.
 MetaDataRecordList[] query(MetaDataCondition[] conditions, MetaDataSelect[] selects)
           
 MetaDataRecordList[] query(MetaDataCondition[] conditions, MetaDataSelect[] selects, int numberOfRecordsWanted)
           
protected  void setAccount(GeneralAccount account)
          Loads the account information for this file system.
 java.lang.String toString()
          Returns a string representation of this file system object.
 
Methods inherited from class edu.sdsc.grid.io.RemoteFileSystem
getHost, getPassword, getPort, getUserName
 
Methods inherited from class edu.sdsc.grid.io.GeneralFileSystem
clone, getHomeDirectory
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IRODS_ROOT

public static final java.lang.String IRODS_ROOT
The iRODS like Unix only has one root, "/".

See Also:
Constant Field Values
Constructor Detail

IRODSFileSystem

public IRODSFileSystem()
                throws java.io.IOException
Opens a socket connection to read from and write to. Loads the default iRODS user account information from their home directory. The account information stored in this object cannot be changed once instantiated.

This constructor is provided for convenience however, it is recommended that all necessary data be sent to the constructor and not left to the defaults.

Throws:
FileNotFoundException - if the user data file cannot be found.
java.io.IOException - if an IOException occurs.

IRODSFileSystem

public IRODSFileSystem(IRODSAccount iRODSAccount)
                throws java.io.IOException,
                       java.lang.NullPointerException
Opens a socket connection to read from and write to. Opens the account held in the IRODSAccount object. The account information stored in this object cannot be changed once constructed.

Parameters:
iRODSAccount - The iRODS account information object.
Throws:
java.lang.NullPointerException - if IRODSAccount is null.
java.io.IOException - if an IOException occurs.
Method Detail

finalize

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

Overrides:
finalize in class GeneralFileSystem
Throws:
java.lang.Throwable

setAccount

protected void setAccount(GeneralAccount account)
                   throws java.io.IOException
Loads the account information for this file system.

Specified by:
setAccount in class GeneralFileSystem
Throws:
java.io.IOException

getAccount

public GeneralAccount getAccount()
                          throws java.lang.NullPointerException
Returns the account used by this IRODSFileSystem.

Overrides:
getAccount in class GeneralFileSystem
Throws:
java.lang.NullPointerException

getRootDirectories

public java.lang.String[] getRootDirectories()
Returns the root directories of the iRODS file system.

Specified by:
getRootDirectories in class GeneralFileSystem

getDefaultStorageResource

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

getAuthenticationScheme

public java.lang.String getAuthenticationScheme()
Returns:
the options

getServerDN

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

getVersion

public java.lang.String getVersion()
Returns:
the iRODS version

getVersionNumber

public float getVersionNumber()
Returns:
the version number

equals

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

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

isConnected

public boolean isConnected()
Checks if the socket is connected.


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 GeneralFileSystem

close

public void close()
           throws java.io.IOException
Closes the connection to the SRB file system. The filesystem cannot be reconnected after this method is called. If this object, or another object which uses this filesystem, tries to send a command to the server a ClosedChannelException will be thrown.

Throws:
java.io.IOException

isClosed

public boolean isClosed()
                 throws java.io.IOException
Returns if the connection to the SRB has been closed or not.

Returns:
true if the connection has been closed
Throws:
java.io.IOException

query

public MetaDataRecordList[] query(MetaDataCondition[] conditions,
                                  MetaDataSelect[] selects)
                           throws java.io.IOException
Specified by:
query in class GeneralFileSystem
Throws:
java.io.IOException

query

public MetaDataRecordList[] query(MetaDataCondition[] conditions,
                                  MetaDataSelect[] selects,
                                  int numberOfRecordsWanted)
                           throws java.io.IOException
Specified by:
query in class GeneralFileSystem
Throws:
java.io.IOException