Commit dd44d064 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfs: updated javadoc

parent fe133689
......@@ -15,22 +15,21 @@ import org.dcache.xdr.RpcCall;
public class CompoundContext {
private static final Logger _log = Logger.getLogger(CompoundContext.class.getName());
private FsInode _rootInode = null;
private FsInode _currentInode = null;
private FsInode _savedInode = null;
private final int _minorversion;
private NFSv41Session _session = null;
private final List<nfs_resop4> _processedOps;
private final FileSystemProvider _fs;
private final RpcCall _callInfo;
private final UnixUser _user;
private final ExportFile _exportFile;
private final ExportFile _exportFile;
/**
* Create context of COUMPOUND request.
......@@ -44,7 +43,7 @@ public class CompoundContext {
public CompoundContext(List<nfs_resop4> processedOps, int minorversion, FileSystemProvider fs,
RpcCall call, ExportFile exportFile) {
_processedOps = processedOps;
_minorversion = minorversion;
_minorversion = minorversion;
_fs = fs;
_callInfo = call;
_exportFile = exportFile;
......@@ -62,10 +61,22 @@ public class CompoundContext {
return _fs;
}
/**
* Get NFSv4 minor version number. The version number os provided by client
* for each coumpound.
* @return version number.
*/
public int getMinorversion() {
return _minorversion;
return _minorversion;
}
/**
* Current file handle is a server side variable passed from one operation
* to other inside a coumpound.
*
* @return file handle
* @throws ChimeraNFSException
*/
public FsInode currentInode() throws ChimeraNFSException {
if( _currentInode == null ) {
throw new ChimeraNFSException(nfsstat4.NFS4ERR_NOFILEHANDLE, "no file handle");
......@@ -73,6 +84,12 @@ public class CompoundContext {
return _currentInode;
}
/**
* Set current file handle.
*
* @param inode
* @throws ChimeraNFSException
*/
public void currentInode(FsInode inode) throws ChimeraNFSException {
_currentInode = inode;
_log.log(Level.FINEST, "current Inode: {0}", _currentInode.toString() );
......@@ -87,10 +104,16 @@ public class CompoundContext {
_log.log(Level.FINEST, "root Inode: {0}", _rootInode.toFullString() );
}
/**
* Set the current file handle to the value in the saved file handle.
* If there is no saved filehandle then the server will return the
* error NFS4ERR_RESTOREFH.
* @throws ChimeraNFSException
*/
public void restoreSavedInode() throws ChimeraNFSException {
if( _savedInode == null ) {
throw new ChimeraNFSException(nfsstat4.NFS4ERR_RESTOREFH, "no saved file handle");
}
}
_currentInode = _savedInode;
_log.log(Level.FINEST, "restored Inode: {0}", _currentInode.toString() );
}
......@@ -100,8 +123,14 @@ public class CompoundContext {
throw new ChimeraNFSException(nfsstat4.NFS4ERR_NOFILEHANDLE, "no file handle");
}
return _savedInode;
}
}
/**
* Save the current filehandle. If a previous filehandle was saved then it
* is no longer accessible. The saved filehandle can be restored as
* the current filehandle with the RESTOREFH operator.
* @throws ChimeraNFSException
*/
public void saveCurrentInode() throws ChimeraNFSException {
if( _currentInode == null ) {
throw new ChimeraNFSException(nfsstat4.NFS4ERR_NOFILEHANDLE, "no file handle");
......@@ -115,7 +144,7 @@ public class CompoundContext {
* @param session
*/
public void setSession(NFSv41Session session) {
_session = session;
_session = session;
}
/**
......@@ -123,7 +152,7 @@ public class CompoundContext {
* @return current session
*/
public NFSv41Session getSession() {
return _session;
return _session;
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment