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)
Method for calling the distinguished processing methods for a node to be send.
 o processRec(Container)
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 receivePaymentNode(Node)
This method is called by processRec(Container) if the node was for payment.
 o receiveStatementNode(Node)
This method is called by processRec(Container) if the node was for statement.
 o sendContainer(Container)
Method for sending a container.
 o setAcquirerComPointAddress(ComPointAddress)
Sets the Acquirers ComPointAddress.
 o setAcquirerPort(int)
Sets the port ot the local Acquirers ComPointAddress
 o setLocalAcquirerComPointAddress(ComPointAddress)
Sets local ComPointAddress with the Acquirer's Port.
 o setLocalID(String)
Sets the ID of the local user
 o setRemoteAcquirerComPointAddress(ComPointAddress)
Sets a remote ComPointAddress with the Acquirers Port.
 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 opposite client or server.
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.
Returns:
the computer name followed by the domain name (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.
 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 container received
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 - it restricts the polling to a certain time.
Returns:
the Container received
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 setAcquirerComPointAddress
  public void setAcquirerComPointAddress(ComPointAddress acquirerCPA) throws TransferServiceException
Sets the Acquirers ComPointAddress. The Acquirer resides on it's own host and usually uses a different Port then the one for transfer.
Parameters:
acquirerCPA - the Acquirers ComPointAddress
Throws: TransferServiceException
if an error occured during the Transfer.
 o setLocalAcquirerComPointAddress
  public void setLocalAcquirerComPointAddress(ComPointAddress localAcquirerCPA)
Sets local ComPointAddress with the Acquirer's Port. This ComPointAddress is used for Communication of local host and Acquirer.
Parameters:
localAcquirerCPA - the local Acquirers ComPointAddress
 o setAcquirerPort
  public void setAcquirerPort(int port)
Sets the port ot the local Acquirers ComPointAddress
Parameters:
port - the port to be set
 o setRemoteAcquirerComPointAddress
  public void setRemoteAcquirerComPointAddress(ComPointAddress remoteAcquirerCPA)
Sets a remote ComPointAddress with the Acquirers Port. This ComPointAddress is used to tell the Acquirer about the remote peer.
Parameters:
remoteAcquirerCPA - the remote Acquirers ComPointAddress
 o process
  protected boolean process(Container container) 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 - to be processed
Returns:
true if processing was OK
 o receiveStatementNode
  public boolean receiveStatementNode(Node node) throws TransferServiceException
This method is called by processRec(Container) if the node was for statement.
Parameters:
node - the node to be processed
Returns:
true if processing was OK added by SAScha Matthes
 o processRec
  protected boolean processRec(Container container) 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 - to be processed
Returns:
true if processing was OK
 o receivePaymentNode
  public boolean receivePaymentNode(Node node)
This method is called by processRec(Container) if the node was for payment.
Parameters:
node - the node to be processed after the receipt
Returns:
true if processing was OK

All Packages  Class Hierarchy  This Package  Previous  Next  Index