All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jnfs.FileServer

public interface interface FileServer
extends UserManager
The Java Network File System.

Provides a factory interface to the remote file classes, since these objects cannot be instantiated by classes outside of the jnfs package. The server side consists of an implementation of the file system interface (provided by FileServerStarter) and the client side must obtain a remote reference to the server (provided by the FileServerHandle).

Version:
$Id: FileServer.java,v 2.19 1997/05/20 17:59:24 mjr Exp $
Author:
Michael John Radwin
See Also:
RemoteFile, RemoteFileInputStream, RemoteFileOutputStream, RemoteRandomAccessFile, FileServerHandle, FileServerStarter

Variable Index

 o serviceName
Name we use in the rmiregistry for this service.

Method Index

 o finishAuthentication(Response)
Completes the authentication process by verifying the user's credentials and issuing a Token for use in further transactions.
 o getFile(Token, File)
Creates a RemoteFile instance that represents the file whose pathname is the given file argument.
 o getFileInputStream(Token, File)
Creates an input file stream to read from the specified File object.
 o getFileOutputStream(Token, File)
Creates a file output stream to write to the specified File object.
 o getFileOutputStream(Token, File, boolean)
Creates a file output stream to write to the specified File object for appending or overwriting.
 o getRandomAccessFile(Token, File, String)
Creates a random access file stream to read from, and optionally to write to, the file specified by the File argument.
 o getRootDirectoryName()
Returns the name of the root of the filesystem for this server
 o initAuthentication(String)
Generates a Challenge for user to sign with their private key.

Variables

 o serviceName
 public static final String serviceName
Name we use in the rmiregistry for this service.

To get a handle to the FileServer, use a snippet of code such as:

 jnfs.FileServer srv = 
   (jnfs.FileServer) java.rmi.Naming.lookup("rmi://" + hostname + "/" +
                                            jnfs.FileServer.serviceName);
 

See Also:
lookup

Methods

 o initAuthentication
 public abstract Challenge initAuthentication(String user) throws RemoteException, AuthenticationException
Generates a Challenge for user to sign with their private key. The user responds by creating a Response object using the Challenge.issueRespose method, and then sends the credentials back in the finishAuthentication method.

Parameters:
user - the user that wishes to be authenticated.
Throws: AuthenticationException
if user is not found in the user table.
See Also:
issueResponse, finishAuthentication
 o finishAuthentication
 public abstract Token finishAuthentication(Response credentials) throws RemoteException, AuthenticationException
Completes the authentication process by verifying the user's credentials and issuing a Token for use in further transactions.

Parameters:
credentials - the signed version of the Challenge issued previously.
Throws: AuthenticationException
if the authentication of user fails.
See Also:
issueResponse, initAuthentication
 o getFile
 public abstract RemoteFile getFile(Token token,
                                    File file) throws RemoteException, AuthenticationException, FileTableFullException
Creates a RemoteFile instance that represents the file whose pathname is the given file argument.

Parameters:
file - the file object.
Throws: NullPointerException
if the file path is equal to null.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: AuthenticationException
if the authentication of user fails.
See Also:
File
 o getFileInputStream
 public abstract RemoteFileInputStream getFileInputStream(Token token,
                                                          File file) throws IOException, RemoteException, AuthenticationException, PermissionDeniedException
Creates an input file stream to read from the specified File object.

Parameters:
file - the file to be opened for reading.
Throws: IOException
if the file is not found.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of this File argument to see if the application is allowed read access to the file.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
FileInputStream
 o getFileOutputStream
 public abstract RemoteFileOutputStream getFileOutputStream(Token token,
                                                            File file) throws IOException, RemoteException, AuthenticationException, PermissionDeniedException
Creates a file output stream to write to the specified File object.

Parameters:
file - the file to be opened for writing.
Throws: IOException
if the file could not be opened for writing.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of the File argument to see if the application is allowed write access to the file. This may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
FileOutputStream
 o getFileOutputStream
 public abstract RemoteFileOutputStream getFileOutputStream(Token token,
                                                            File file,
                                                            boolean append) throws IOException, RemoteException, AuthenticationException, PermissionDeniedException
Creates a file output stream to write to the specified File object for appending or overwriting.

Parameters:
file - the file to be opened for writing.
append - if the file should be opened for appending.
Throws: IOException
if the file could not be opened for writing.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkWrite method is called with the pathname of the File argument to see if the application is allowed write access to the file. This may result in a security exception.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
FileOutputStream
 o getRandomAccessFile
 public abstract RemoteRandomAccessFile getRandomAccessFile(Token token,
                                                            File file,
                                                            String mode) throws IOException, RemoteException, AuthenticationException, PermissionDeniedException
Creates a random access file stream to read from, and optionally to write to, the file specified by the File argument.

The mode argument must either be equal to "r" or to "rw", indicating either to open the file for input, or for both input and output, respectively.

Parameters:
file - the file object.
mode - the access mode.
Throws: IllegalArgumentException
if the mode argument is not equal to "r" or to "rw".
Throws: IOException
if an I/O error occurs.
Throws: FileTableFullException
if this file cannot be opend because the system file table is full.
Throws: SecurityException
if a security manager exists, its checkRead method is called with the pathname of the File argument to see if the application is allowed read access to the file. If the mode argument is equal to "rw", its checkWrite method also is called with the pathname to see if the application is allowed write access to the file.
Throws: AuthenticationException
if the authentication of user fails.
Throws: PermissionDeniedException
if the user has insufficient privileges to open this file.
See Also:
RandomAccessFile
 o getRootDirectoryName
 public abstract String getRootDirectoryName() throws RemoteException
Returns the name of the root of the filesystem for this server


All Packages  Class Hierarchy  This Package  Previous  Next  Index