Class semper.transfer.GroupTransfer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.transfer.GroupTransfer

java.lang.Object
   |
   +----semper.transfer.GroupTransfer

public class GroupTransfer
extends Object

Constructor Index

 o GroupTransfer(String)
Creates a new Transfer object to send and receive containers.

Method Index

 o getChannelID()
Gets the Channel ID.
 o getLocalID()
Gets the ID of the local user
 o getRemoteID()
Gets the ID of the remote user
 o getTimeOut()
Gets the default TimeOut.
 o getTransferPort()
Gets the port of the transfer.
 o parse(String)
Parses the constructor argument.
 o process(Container, String)
Method for calling the distinguished processing methods for a node to be send.
 o processRec(Container, String)
Method for calling the distinguished processing methods for a node received.
 o receiveContainer()
Method to receive a container.
 o receiveContainer(long)
Method to receive a container.
 o sendContainer(Container)
Method for sending a container.
 o setLocalID(String)
Sets the ID of the local user
 o setRemoteID(String)
Sets the ID of the remote user
 o setTimeOut(long)
Sets the default TimeOut.

Constructors

 o GroupTransfer
  public GroupTransfer(String RemoteAddress) throws TransferServiceException
Creates a new Transfer object to send and receive containers. There are two possibilities to start a transfer. You can create a 'Server object' that is waiting for a client to start communication. Or you make the 'client object' that starts sending its messages to a waiting server. Both are transfer objects but created with different informations in the constructor String.

To create a client object you have to pass the name of the host you want to send to. Optionally you can specify a port, just append it to the hostname separated with ":" (else the default port is used).

To create a server object don't specify a host name. This transfer object can receive containers from any host. Optionally a port can be specified.

If you pass "" to the constructor a server object is created that listens to the default port.

Parameters:
RemoteAddress - specifies the remote address of the peer. This may be an IP address or a host name (provided it is known by DNS).
Throws: TransferServiceException
if the remote address i.e. if the host doesn't exist. a unknown Services is passed or the Business

Methods

 o parse
  protected String parse(String string)
Parses the constructor argument. This method extracts hostname and portnumber out of the constructor string.
Parameters:
string - String to be parsed.
Returns:
the computer name followed by the domain name
(example: stromboli.hd.ibm.de after stromboli.hd.ibm.de:1234)
and overwrites the value of DEFAULT_PORT if a port is specified.
 o getTimeOut
  public long getTimeOut()
Gets the default TimeOut.
Returns:
the default TimeOut.
 o setTimeOut
  public void setTimeOut(long timeout)
Sets the default TimeOut. This TimeOut can be overwritten by the receive method for one transmission.
Parameters:
timeout - Default timeout value.
 o getTransferPort
  public int getTransferPort()
Gets the port of the transfer.
Returns:
The port of the transfer.
 o getChannelID
  public String getChannelID()
Gets the Channel ID.
Returns:
The channel ID which is a concatenation of hostname and date of the first sending.
 o receiveContainer
  public Container receiveContainer() throws TransferServiceException
Method to receive a container. The method returns the container received from another transfer object on a different host. If the remote host is specified ('client' object) only containers from this host will be accepted. If the remote host is not specified the object acts like a server listening to the port for any incoming container. But with receiving the first message the remote host is instantiated and can't be changed furthermore.
Returns:
The received container.
Throws: TransferServiceException
if an error occured during the transfer
 o receiveContainer
  public Container receiveContainer(long timeout) throws TransferServiceException
Method to receive a container. The method returns the container send by another transfer object from a different host. If the remote host is specified ('client' object) only containers from this host are accepted. If the remote host is not specified the object acts like a server listening on the port to any incoming container. But with receiving the first message the remote host is instantiated and can't be changed furthermore.
Parameters:
timeout - Restricts the polling to a certain time.
Returns:
The received Container.
Throws: TransferServiceException
if there's been a reception/procession problem.
 o sendContainer
  public void sendContainer(Container send_container) throws TransferServiceException
Method for sending a container. A container is sent to the remote host on the port used by this object. A NullPointerException will be raised if the remote host has not been specified. If there's a container to be sent to a different host or via a different port the object has to be set to null and then newly instantiated.
Parameters:
send_container - The container to be sent.
Throws: TransferServiceException
if an error occured during the transfer
 o setLocalID
  public void setLocalID(String local_id)
Sets the ID of the local user
Parameters:
local_id - The ID of the local user.
 o getLocalID
  public String getLocalID()
Gets the ID of the local user
Returns:
The ID of the local user.
 o setRemoteID
  public void setRemoteID(String remote_id)
Sets the ID of the remote user
Parameters:
remote_id - The ID of the remote user.
 o getRemoteID
  public String getRemoteID()
Gets the ID of the remote user
Returns:
The ID of the remote user.
 o process
  protected boolean process(Container container,
                            String node_type) throws TransferServiceException
Method for calling the distinguished processing methods for a node to be send. This method calls the methods for payment and statement nodes after receiving a vector of leaves from the container.
Parameters:
container - Container to be processed.
node_type - Type of node to be processed.
Returns:
True if processing was OK.
Throws: TransferServiceException
if an error occured during the transfer
 o processRec
  protected boolean processRec(Container container,
                               String node_type) throws TransferServiceException
Method for calling the distinguished processing methods for a node received. This method calls the methods for payment and statement nodes after receiving a vector of leaves from the container.
Parameters:
container - Container to be processed.
node_type - Type of node to be processed.
Returns:
true if processing was OK
Throws: TransferServiceException
if an error occured during the transfer

All Packages  Class Hierarchy  This Package  Previous  Next  Index