All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.util.msgtools.Negotiation

java.lang.Object
   |
   +----semper.util.msgtools.Negotiation

public class Negotiation
extends Object
A communication channel for Negotiations. In this class, we provide a generic method for opening a communication channel. Once the channel is opened, negotiation or other messages can be exchanged via it. We also provide some pairs of methods implementing simple cases of negotiation.

Version:
$Revision: 1.4 $ $Date: 1996/09/03 11:27:42 $
Author:
N. Asokan (aso@zurich.ibm.com)

Constructor Index

 o Negotiation()

Method Index

 o choose(String, String, ComPointAddress, Vector, Vector, String[])
Select acceptable values from the list proposed by the client.
 o choose(Vector, ComPointAddress, Vector, String[])
Select acceptable values from the list proposed by the client.
 o confirm(String, String, ComPointAddress, Vector, Vector, String[])
confirm (or refuse) an incoming proposal for the value of a parameter.
 o openInitiatorChannel(ComPointAddress, long, long, Vector, String)
Open a channel to the peer as initiator.
 o openResponderChannel(ComPointAddress, long[], long[], Vector, String[])
Open a channel as responder.
 o requestChoice(String, String, ComPointAddress, Vector, Vector, String)
Propose a list of values for the parameters and request the server to choose from it.
 o requestChoice(Vector, ComPointAddress, Vector, String)
Propose a list of values for the parameters and request the server to choose from it.
 o requestConfirm(String, String, ComPointAddress, Object, Vector, String)
Ask if a specific value is a acceptable for the specified parameter.

Constructors

 o Negotiation
 public Negotiation()

Methods

 o openInitiatorChannel
 public static ComPoint openInitiatorChannel(ComPointAddress peer,
                                             long my_transaction_id,
                                             long your_transaction_id,
                                             Vector options,
                                             String ext_ref) throws ComPointException
Open a channel to the peer as initiator. For now, this is a communiation manager channel (ComPoint). Later, this will be a channel via the transfer manager.

Parameters:
peer - address of the peer manager
my_transaction_id - ID of the transaction at the local end, where the message originated (0 for message from manager)
your_transaction_id - ID of the transaction at the peer end that to which the message is being sent (0 for message addressed to the manager)
options - a Vector (placeholder to support security options in the future (currently ignored))
external - reference string
Returns:
channel
Throws: ComPointException
on communication errors.
See Also:
MessageListHead, openResponderChannel
 o openResponderChannel
 public static ComPoint openResponderChannel(ComPointAddress me,
                                             long a_my_transaction_id[],
                                             long a_your_transaction_id[],
                                             Vector options,
                                             String a_ext_ref[]) throws NegotiationException, ComPointException
Open a channel as responder. Parameters that are single element arrays are used to pass basic types by reference.

Parameters:
me - address of the localmanager
a_my_transaction_id - one element array containing ID of the transaction at the local end on the local end, for which the message is destined (0 for message to the manager)
a_your_transaction_id - one element array containing ID of the transaction at the peer end that sent the message (0 for message from manager)
options - a Vector (placeholder to support security options in the future (currently ignored))
a_ext_ref - one element array containing external reference string. If the element is null, then the incoming external reference will be filled in. If it is not then a check is made to ensure that the specified string matches the incoming string.
Returns:
channel
Throws: ComPointException
when channel open fails.
Throws: NegotiationException
when external reference strings do not match.
See Also:
MessageListHead, openInitiatorChannel
 o requestConfirm
 public static boolean requestConfirm(String param_name,
                                      String param_class,
                                      ComPointAddress peer_address,
                                      Object value,
                                      Vector options,
                                      String ext_ref) throws NegotiationException
Ask if a specific value is a acceptable for the specified parameter.

Parameters:
param_name - name of parameter.
param_class - class name of the values for this parameter.
peer_address - address of the peer manager.
value - proposed value of parameter.
options - a Vector (place holder to support security options).
ext_ref - external reference string.
Returns:
yes/no depending on whether the proposed value was accepted.
Throws: NegotiationException
passed up from confirm().
See Also:
confirm, requestChoice
 o confirm
 public static Object confirm(String param_name,
                              String param_class,
                              ComPointAddress my_address,
                              Vector list_of_values,
                              Vector options,
                              String a_ext_ref[]) throws NegotiationException
confirm (or refuse) an incoming proposal for the value of a parameter.

Parameters:
param_name - name of parameter.
param_class - class name of the values for this parameter.
my_address - local ComPoint address to listen in on.
list_of_values - list of acceptable values for the parameter.
options - a Vector (place holder to support security options).
a_ext_ref - one element array containing the external reference string (if the element is null on input, the incoming reference string will be returned in its place)
Returns:
the value proposed by the client, if accepted or null.
Throws: NegotiationException
on misc errors.
See Also:
requestConfirm, choose
 o requestChoice
 public static Vector requestChoice(String param_name,
                                    String param_class,
                                    ComPointAddress peer_address,
                                    Vector list_of_values,
                                    Vector options,
                                    String ext_ref) throws NegotiationException
Propose a list of values for the parameters and request the server to choose from it.

Parameters:
param_name - name of parameter.
param_class - class name of the values for this parameter.
peer_address - address of the peer manager.
list_of_values - list of acceptable values for the parameter.
options - a Vector (place holder to support security options).
ext_ref - external reference string.
Returns:
Vector containing values common to both client and server.
Throws: NegotiationException
on misc errors.
See Also:
choose
 o requestChoice
 public static Vector requestChoice(Vector array_of_values,
                                    ComPointAddress peer_address,
                                    Vector options,
                                    String ext_ref) throws NegotiationException
Propose a list of values for the parameters and request the server to choose from it.

Parameters:
param_name - name of parameter.
param_class - class name of the values for this parameter.
peer_address - address of the peer manager.
list_of_values - list of acceptable values for the parameter.
options - a Vector (place holder to support security options).
ext_ref - external reference string.
Returns:
Vector containing values common to both client and server.
Throws: NegotiationException
on misc errors.
See Also:
choose
 o choose
 public static Vector choose(Vector array_of_values,
                             ComPointAddress my_address,
                             Vector options,
                             String a_ext_ref[]) throws NegotiationException
Select acceptable values from the list proposed by the client.

Parameters:
param_name - name of parameter.
param_class - class name of the values for this parameter.
my_address - local ComPoint address to listen in on.
list_of_values - list of acceptable values for the parameter.
options - a Vector (place holder to support security options).
a_ext_ref - one element array containing the external reference string (if the element is null on input, the incoming reference string will be returned in its place).
Returns:
Vector containing values common to both client and server.
Throws: NegotiationException
on misc errors.
See Also:
requestChoice
 o choose
 public static Vector choose(String param_name,
                             String param_class,
                             ComPointAddress my_address,
                             Vector list_of_values,
                             Vector options,
                             String a_ext_ref[]) throws NegotiationException
Select acceptable values from the list proposed by the client.

Parameters:
param_name - name of parameter.
param_class - class name of the values for this parameter.
my_address - local ComPoint address to listen in on.
list_of_values - list of acceptable values for the parameter.
options - a Vector (place holder to support security options).
a_ext_ref - one element array containing the external reference string (if the element is null on input, the incoming reference string will be returned in its place).
Returns:
Vector containing values common to both client and server.
Throws: NegotiationException
on misc errors.
See Also:
requestChoice

All Packages  Class Hierarchy  This Package  Previous  Next  Index