jpl.mipl.mdms.FileService.komodo.api
Class ServerGroup

java.lang.Object
  extended by jpl.mipl.mdms.FileService.komodo.api.ServerGroup
All Implemented Interfaces:
Closable

public class ServerGroup
extends Object
implements Closable

Purpose: This class defines all operations that can be performed on a server group.

   Copyright 2005, California Institute of Technology. 
   ALL RIGHTS RESERVED. U.S.
   Government Sponsorship acknowledge. 2005.
 
 ============================================================================
 Modification History :  ----------------------
 
 Date             Who         What 
 ----------------------------------------------------------------------------
 10/11/2005       Nick        Initial release.
 ============================================================================
 

Version:
$Id: ServerGroup.java,v 1.2 2009/08/07 01:00:47 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Constructor Summary
ServerGroup(Session session, List sInfos)
          Constructor
 
Method Summary
 int authenticateUser()
          Method to authenticate user/password for any filetype part of the server group.
 int authenticateUser(String filetype)
          Method to authenticate user/password for a specific filetype as part of the server group.
 int authenticateUser(String user, String password, String filetype)
          Method to authenticate user/password for a specific filetype or some existing filetype without diretly accessing filetypes.
 int close()
          Method to close this file type.
 String getName()
          Accessor method to get the name of this file type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerGroup

public ServerGroup(Session session,
                   List sInfos)
            throws SessionException
Constructor

Parameters:
session - a transfer session, for maintining file types and connections.
sInfos - List of server info instances
Throws:
SessionException - when session failure. If unable to connect to server, errno = CONN_FAILED. If authentication error, errno = INVALID_LOGIN.
Method Detail

getName

public final String getName()
Accessor method to get the name of this file type.

Returns:
file type name

authenticateUser

public int authenticateUser(String user,
                            String password,
                            String filetype)
Method to authenticate user/password for a specific filetype or some existing filetype without diretly accessing filetypes.

Parameters:
user - Username
password - User password
filetype - Name of filetype in server group for which authentication is being performed. If null, then general authentication (can user access at least one filetype?) is performed.
Returns:
the transaction id for tracking this command.

authenticateUser

public int authenticateUser()
Method to authenticate user/password for any filetype part of the server group. Uses username and password from session object.

Returns:
the transaction id for tracking this command.

authenticateUser

public int authenticateUser(String filetype)
Method to authenticate user/password for a specific filetype as part of the server group. Uses username and password from session object.

Parameters:
filetype - Name of filetype in server group for which authentication is being performed. If null, then general authentication ("Can user access at least one filetype?") is performed.
Returns:
the transaction id for tracking this command.

close

public int close()
Method to close this file type. Do this by appending the close command at the head of the requests queue. The ServerProxy will then remove any requests for the file type from the queue. If all file types for this server have been closed, then the connection to the server will be gracefully closed.

Specified by:
close in interface Closable
Returns:
the transaction id for tracking this command.