|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.sdsc.grid.io.GeneralFileSystem
edu.sdsc.grid.io.RemoteFileSystem
edu.sdsc.grid.io.srb.SRBFileSystem
public class SRBFileSystem
The SRBFileSystem class is the class for connection implementations to SRB servers. It provides the framework to support a wide range of SRB semantics. Specifically, the functions needed to interact with a SRB server.
Many of the methods remain package private, though a few "srb..." methods have been made public. These methods are generally very low level and their use is not recommended. Clear, high level equivalents are being developed elsewhere in the JARGON API, and in the SRBAdmin tool. If you require the functionality of any of these methods and it is not yet available as a high level method, please notify the administrator of the JARGON package and we will try to include your request in the next release.
SRBCommands| Field Summary | |
|---|---|
static java.lang.String |
PATH_SEPARATOR
Deprecated. Use SRBFile separator and pathSeparator |
static int |
PORTAL_OFF
Used for proxy commands, no result. |
static int |
PORTAL_ON
Used for proxy commands, create a portal and put it in env PORTAL_ENV. |
static int |
PORTAL_STD_IN_OUT
Used for proxy commands, send result to the InputStream |
static java.lang.String |
SRB_ROOT
The SRB only has one root, "/". |
| Fields inherited from class edu.sdsc.grid.io.GeneralFileSystem |
|---|
account, DEBUG, roots |
| Constructor Summary | |
|---|---|
SRBFileSystem()
Opens a socket connection to read from and write to. |
|
SRBFileSystem(SRBAccount srbAccount)
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. |
java.io.InputStream |
executeProxyCommand(java.lang.String command,
java.lang.String commandArgs)
Proxy Operation that executes a command. |
java.io.InputStream |
executeProxyCommand(java.lang.String command,
java.lang.String commandArgs,
java.lang.String hostAddress,
int portalFlag)
Proxy Operation that executes a command. |
java.io.InputStream |
executeProxyCommand(java.lang.String command,
java.lang.String commandArgs,
java.lang.String hostAddress,
java.lang.String fileName,
int portalFlag)
Proxy Operation that executes a command. |
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 SRBFileSystem. |
java.lang.String |
getDefaultStorageResource()
|
java.lang.String |
getDomainName()
|
java.lang.String |
getExecFile()
|
java.lang.String |
getMcatZone()
|
int |
getOptions()
|
java.lang.String |
getPassword()
Returns the password used by this RemoteAccount. |
java.lang.String |
getProxyDomainName()
|
java.lang.String |
getProxyMcatZone()
|
java.lang.String |
getProxyUserName()
|
int |
getQueryRecordsWanted()
|
java.lang.String[] |
getRootDirectories()
Returns the root directories of the SRB file system. |
java.lang.String |
getVersion()
|
float |
getVersionNumber()
|
static int |
getWriteBufferSize()
Get the buffer size used by the SRB socket write. |
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)
Queries the file server to find all files that match a set of conditions. |
MetaDataRecordList[] |
query(MetaDataCondition[] conditions,
MetaDataSelect[] selects,
int recordsWanted)
Queries the file server to find all files that match a set of conditions. |
MetaDataRecordList[] |
query(MetaDataCondition[] conditions,
MetaDataSelect[] selects,
int recordsWanted,
boolean orderBy)
Queries the file server to find all files that match a set of conditions. |
MetaDataRecordList[] |
query(MetaDataCondition[] conditions,
MetaDataSelect[] selects,
int recordsWanted,
boolean orderBy,
boolean nonDistinct)
Queries the file server to find all files that match a set of conditions. |
MetaDataRecordList[] |
query(MetaDataSelect select)
Queries all files in the metadata catalog and uses one metadata value, select, to be returned. |
MetaDataRecordList[] |
query(MetaDataSelect[] selects)
Queries all files in the metadata catalog and uses metadata values, selects, to be returned. |
MetaDataRecordList[] |
query(MetaDataSelect[] selects,
int recordsWanted)
Queries all files in the metadata catalog and uses metadata values, selects, to be returned. |
MetaDataRecordList[] |
query(java.lang.String fieldName)
Queries all files in the metadata catalog and uses metadata values, fieldName, to be returned. |
MetaDataRecordList[] |
query(java.lang.String[] fieldNames)
Queries all files in the metadata catalog and uses metadata values, selects, to be returned. |
void |
registerURL(SRBFile file,
java.net.URL url)
If this resource is a 'http file system' type resource, then the url will be registered with that resource as
the abstract pathname file. |
protected void |
setAccount(GeneralAccount account)
Loads the account information for this file system. |
void |
setFirewallPorts(int minPort,
int maxPort)
Used to specify a port range available through a firewall. |
void |
setQueryRecordsWanted(int num)
Sets the default number of records that will be returned by a query. |
static void |
setWriteBufferSize(int bufferSize)
Set the buffer size used by the SRB socket write. |
void |
srbDeleteValue(int valueType,
java.lang.String deleteValue)
Delete a Value; a single MCAT entry. |
SRBAccount |
srbGetUserByDn(int catType,
java.lang.String userDn)
Get the zone and user@domain given the user's dn |
void |
srbIngestToken(java.lang.String typeName,
java.lang.String newValue,
java.lang.String parentValue)
Ingest Token. |
void |
srbModifyRescInfo(int catType,
java.lang.String resourceName,
int actionType,
java.lang.String dataValue1,
java.lang.String dataValue2,
java.lang.String dataValue3,
java.lang.String dataValue4)
Modify/create/delete a SRB resource. |
void |
srbModifyUser(int catType,
java.lang.String dataValue1,
java.lang.String dataValue2,
int actionType)
Modify a user info. |
void |
srbModifyZone(int catType,
java.lang.String zoneName,
java.lang.String dataValue1,
java.lang.String dataValue2,
java.lang.String dataValue3,
java.lang.String dataValue4,
java.lang.String dataValue5,
int actionType)
Modify and Insert SRB zone and zone information in the Metadata Catalog. |
void |
srbRegisterLocation(java.lang.String locName,
java.lang.String fullAddr,
java.lang.String parentLoc,
java.lang.String serverUser,
java.lang.String serverUserDomain)
Register location information. |
void |
srbRegisterLogicalResource(java.lang.String rescName,
java.lang.String rescType,
java.lang.String phyResc,
java.lang.String phyPath)
Register Logical Resource. |
void |
srbRegisterReplicateResourceInfo(java.lang.String physicalRescName,
java.lang.String rescType,
java.lang.String oldLogicalRescName,
java.lang.String inDefaultPath)
srbRegisterReplicateResourceInfo Input - String physicalRescName - The physical resource name. |
void |
srbRegisterResource(java.lang.String rescName,
java.lang.String rescType,
java.lang.String location,
java.lang.String phyPath,
java.lang.String className,
int size)
Register Resource. |
void |
srbRegisterUser(int catType,
java.lang.String userName,
java.lang.String userDomain,
java.lang.String userPasswd,
java.lang.String userType,
java.lang.String userAddress,
java.lang.String userPhone,
java.lang.String userEmail)
Register a user. |
void |
srbRegisterUserGrp(int catType,
java.lang.String userGrpName,
java.lang.String userGrpPasswd,
java.lang.String userGrpType,
java.lang.String userGrpAddress,
java.lang.String userGrpPhone,
java.lang.String userGrpEmail)
Register a user group |
java.lang.String |
toString()
Returns a string representation of this file system object. |
| Methods inherited from class edu.sdsc.grid.io.RemoteFileSystem |
|---|
getHost, 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 |
|---|
public static final java.lang.String SRB_ROOT
public static final int PORTAL_OFF
public static final int PORTAL_ON
public static final int PORTAL_STD_IN_OUT
public static final java.lang.String PATH_SEPARATOR
GeneralFile.PATH_SEPARATOR_CHAR.
| Constructor Detail |
|---|
public SRBFileSystem()
throws java.io.FileNotFoundException,
java.io.IOException
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.
java.io.FileNotFoundException - if the user data file cannot be found.
java.io.IOException - if an IOException occurs.
public SRBFileSystem(SRBAccount srbAccount)
throws java.io.IOException,
java.lang.NullPointerException
srbAccount - The SRB account information object.
java.lang.NullPointerException - if srbAccount is null.
java.io.IOException - if an IOException occurs.| Method Detail |
|---|
protected void finalize()
throws java.lang.Throwable
finalize in class GeneralFileSystemjava.lang.Throwable
protected void setAccount(GeneralAccount account)
throws java.io.IOException
setAccount in class GeneralFileSystemjava.io.IOExceptionpublic static void setWriteBufferSize(int bufferSize)
bufferSize - The buffer size used by the SRB socket write.public static int getWriteBufferSize()
public GeneralAccount getAccount()
throws java.lang.NullPointerException
getAccount in class GeneralFileSystemjava.lang.NullPointerExceptionpublic java.lang.String[] getRootDirectories()
getRootDirectories in class GeneralFileSystem
public void setFirewallPorts(int minPort,
int maxPort)
public void setQueryRecordsWanted(int num)
public int getQueryRecordsWanted()
public java.lang.String getPassword()
RemoteFileSystem
getPassword in class RemoteFileSystempublic java.lang.String getProxyUserName()
public java.lang.String getProxyDomainName()
public int getOptions()
public java.lang.String getDomainName()
public java.lang.String getVersion()
public java.lang.String getDefaultStorageResource()
public java.lang.String getProxyMcatZone()
public java.lang.String getMcatZone()
public java.lang.String getExecFile()
public float getVersionNumber()
public MetaDataRecordList[] query(java.lang.String fieldName)
throws java.io.IOException
fieldName, to be returned.
This is a convenience method, the same as the code:
query( MetaDataSet.newSelection( fieldName ) );
fieldName - The string name used to form the select object.
fieldName
java.io.IOException
public MetaDataRecordList[] query(java.lang.String[] fieldNames)
throws java.io.IOException
selects, to be returned.
This is a convenience method, the same as the code:
query( MetaDataSet.newSelection( fieldNames ) );
fieldNames - The string names used to form the select objects.
fieldNames
java.io.IOException
public MetaDataRecordList[] query(MetaDataSelect select)
throws java.io.IOException
select, to be returned.
java.io.IOException
public MetaDataRecordList[] query(MetaDataSelect[] selects)
throws java.io.IOException
selects, to be returned.
java.io.IOException
public MetaDataRecordList[] query(MetaDataSelect[] selects,
int recordsWanted)
throws java.io.IOException
selects, to be returned.
java.io.IOException
public MetaDataRecordList[] query(MetaDataCondition[] conditions,
MetaDataSelect[] selects)
throws java.io.IOException
query in class GeneralFileSystemconditions - The conditional statements that describe
the values to query the server, like WHERE in SQL.selects - The attributes to be returned from those values that
met the conditions, like SELECT in SQL.
java.io.IOException
public MetaDataRecordList[] query(MetaDataCondition[] conditions,
MetaDataSelect[] selects,
int recordsWanted)
throws java.io.IOException
query in class GeneralFileSystemconditions - The conditional statements that describe
the values to query the server, like WHERE in SQL.selects - The attributes to be returned from those values that
met the conditions, like SELECT in SQL.recordsWanted - The number of values to return with the query,
use the getMoreRecords() method in MetaDataRecordList to
continue the search, if more records are available.
java.io.IOException
public MetaDataRecordList[] query(MetaDataCondition[] conditions,
MetaDataSelect[] selects,
int recordsWanted,
boolean orderBy)
throws java.io.IOException
conditions - The conditional statements that describe
the values to query the server, like WHERE in SQL.selects - The attributes to be returned from those values that
met the conditions, like SELECT in SQL.recordsWanted - The number of values to return with the query,
use the getMoreRecords() method in MetaDataRecordList to
continue the search, if more records are available.orderBy - sorts the query's returned values. Ordered matching
the order of the selects array.
java.io.IOException
public MetaDataRecordList[] query(MetaDataCondition[] conditions,
MetaDataSelect[] selects,
int recordsWanted,
boolean orderBy,
boolean nonDistinct)
throws java.io.IOException
While condition and select array objects have all been checked for self-consistency during their construction, there are additional problems that must be detected at query time:
For instance, it is possible to build a condition object appropriate for the SRB, then pass that object in a local file system query. That will find that the condition is incompatible and generate a mismatch exception.
Query is implemented by the file-server-specific classes, like that for the SRB, FTP, etc. Those classes must re-map condition and select field names and operator codes to those required by a particular file server and protocol version. Once re-mapped, they issue the query and get results. The results are then mapped back to the standard public field names of the MetaDataGroups.
The orderBy variable sorts the query's returned values. The order
will match the order of the selects array.
E.g., where selects[0] = SIZE
and selects[1] = OWNER
The files returned
conditions - The conditional statements that describe
the values to query the server, like WHERE in SQL and all conditions
in the array will be AND-ed together to form the query.selects - The attributes to be returned from those values that
met the conditions, like SELECT in SQL.recordsWanted - The number of values to return with the query,
use the getMoreRecords() method in MetaDataRecordList to
continue the search, if more records are available.orderBy - sorts the query's returned values. Ordered matching
the order of the selects array.nonDistinct - If true, allows redundencies in returned data.
java.io.IOExceptionpublic boolean equals(java.lang.Object obj)
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.
equals in class GeneralFileSystemobj - The object to be compared with this abstract pathname
true if and only if the objects are the same;
false otherwisepublic boolean isConnected()
public java.lang.String toString()
toString in class GeneralFileSystem
public void close()
throws java.io.IOException
java.io.IOException
public boolean isClosed()
throws java.io.IOException
java.io.IOException
public java.io.InputStream executeProxyCommand(java.lang.String command,
java.lang.String commandArgs)
throws java.io.IOException
command - The command to run.commandArgs - The command argument string.
java.io.IOException - If an IOException occurs.
public java.io.InputStream executeProxyCommand(java.lang.String command,
java.lang.String commandArgs,
java.lang.String hostAddress,
int portalFlag)
throws java.io.IOException
command - The command to run.commandArgs - The command argument string.hostAddress - The host address where this proxy operation
should be performed. null = the server for the
current connect.portalFlag - The portal flag.
Valid flags are - PORTAL_OFF, PORTAL_ON, PORTAL_STD_IN_OUT.
java.io.IOException - If an IOException occurs.
public java.io.InputStream executeProxyCommand(java.lang.String command,
java.lang.String commandArgs,
java.lang.String hostAddress,
java.lang.String fileName,
int portalFlag)
throws java.io.IOException
command - The command to run.commandArgs - The command argument string.hostAddress - The host address where this proxy operation
should be performed. null = the server for the
current connect.fileName - The SRB path to a file to perform proxy operation on.portalFlag - The portal flag.
Valid flags are - PORTAL_OFF, PORTAL_ON, PORTAL_STD_IN_OUT.
java.io.IOException - If an IOException occurs.
public void registerURL(SRBFile file,
java.net.URL url)
throws java.io.IOException
url will be registered with that resource as
the abstract pathname file. The URL can then be read
using the SRBFile, SRBRandomAccessFile and others as
if it were a standard SRB file.
java.io.IOException
public void srbRegisterUserGrp(int catType,
java.lang.String userGrpName,
java.lang.String userGrpPasswd,
java.lang.String userGrpType,
java.lang.String userGrpAddress,
java.lang.String userGrpPhone,
java.lang.String userGrpEmail)
throws java.io.IOException
catType - catalog type. e.g., MDAS_CATALOG.userGrpName - The name of the user group to register.userGrpPasswd - The user group passwd.userGrpType - The user group type. Currently, at SDSC valid
userType are:
"staff", "sdsc staff", "sdsc staff scientist",
"sdsc senior staff scientist", "pto staff", "ucsd staff"
"student", "sdsc student", "uva student", "project",
"umd student", "public", "sysadmin", " deleted"userGrpAddress - The mailing address of the user group.userGrpPhone - The phone number of the user group.userGrpEmail - The Email address of the user group.
java.io.IOException - If an IOException occurs
public void srbRegisterUser(int catType,
java.lang.String userName,
java.lang.String userDomain,
java.lang.String userPasswd,
java.lang.String userType,
java.lang.String userAddress,
java.lang.String userPhone,
java.lang.String userEmail)
throws java.io.IOException
catType - catalog type. e.g., MDAS_CATALOG.userName - The name of the user to register.userDomain - The domain of the user to register.userPasswd - The user passwd.userType - The user type. Currently, at SDSC valid userType
are:
"staff", "sdsc staff", "sdsc staff scientist",
"sdsc senior staff scientist", "pto staff", "ucsd staff"
"student", "sdsc student", "uva student", "project",
"umd student", "public", "sysadmin", " deleted"userAddress - The mailing address of the user.userPhone - The phone number of the user.userEmail - The Email address of the user.
java.io.IOException - If an IOException occurs
public void srbModifyUser(int catType,
java.lang.String dataValue1,
java.lang.String dataValue2,
int actionType)
throws java.io.IOException
catType - catalog type. e.g., MDAS_CATALOG.dataValue1, - String dataValue2 and int actionType -
They are used to specify the user attributes to modify. A normal
user may use it to modify his/her own password and a limited
set of attributes. A user with MDAS sys admin privilege can
also use these input values to modify other user's attributes.
java.io.IOException - If an IOException occurs
public void srbModifyRescInfo(int catType,
java.lang.String resourceName,
int actionType,
java.lang.String dataValue1,
java.lang.String dataValue2,
java.lang.String dataValue3,
java.lang.String dataValue4)
throws java.io.IOException
java.io.IOException
public void srbRegisterLocation(java.lang.String locName,
java.lang.String fullAddr,
java.lang.String parentLoc,
java.lang.String serverUser,
java.lang.String serverUserDomain)
throws java.io.IOException
java.io.IOException
public void srbIngestToken(java.lang.String typeName,
java.lang.String newValue,
java.lang.String parentValue)
throws java.io.IOException
java.io.IOException
public void srbRegisterResource(java.lang.String rescName,
java.lang.String rescType,
java.lang.String location,
java.lang.String phyPath,
java.lang.String className,
int size)
throws java.io.IOException
java.io.IOException
public void srbRegisterLogicalResource(java.lang.String rescName,
java.lang.String rescType,
java.lang.String phyResc,
java.lang.String phyPath)
throws java.io.IOException
java.io.IOException
public void srbRegisterReplicateResourceInfo(java.lang.String physicalRescName,
java.lang.String rescType,
java.lang.String oldLogicalRescName,
java.lang.String inDefaultPath)
throws java.io.IOException
java.io.IOException
public void srbDeleteValue(int valueType,
java.lang.String deleteValue)
throws java.io.IOException
valueType - - the value (token) type.deleteValue - - The value (name) that is being deleted.
java.io.IOException
public void srbModifyZone(int catType,
java.lang.String zoneName,
java.lang.String dataValue1,
java.lang.String dataValue2,
java.lang.String dataValue3,
java.lang.String dataValue4,
java.lang.String dataValue5,
int actionType)
throws java.io.IOException
catType - - catalog type. e,g., MDAS_CATALOG.zone_name - - name of the zonedataValue1 - - Input value 1.dataValue2 - - Input value 2.dataValue3 - - Input value 3.dataValue4 - - Input value 4.dataValue5 - - Input value 5.actionType - - The type of action. performed
values supported are:java.io.IOException
public SRBAccount srbGetUserByDn(int catType,
java.lang.String userDn)
throws java.io.IOException
catType - catalog type. e,g., MDAS_CATALOG.userDn - The Dn of the user
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||