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
-
GroupTransfer(String)
- Creates a new Transfer object to send and receive containers.
-
getChannelID()
- Gets the Channel ID.
-
getLocalID()
- Gets the ID of the local user
-
getRemoteID()
- Gets the ID of the remote user
-
getTimeOut()
- Gets the default TimeOut.
-
getTransferPort()
- Gets the port of the transfer.
-
parse(String)
- Parses the constructor argument.
-
process(Container)
- Method for calling the distinguished processing methods for a node to be send.
-
processRec(Container)
- Method for calling the distinguished processing methods for a node received.
-
receiveContainer()
- Method to receive a container.
-
receiveContainer(long)
- Method to receive a container.
-
receivePaymentNode(Node)
- This method is called by processRec(Container) if the node was for payment.
-
receiveStatementNode(Node)
- This method is called by processRec(Container) if the node was for statement.
-
sendContainer(Container)
-
Method for sending a container.
-
setAcquirerComPointAddress(ComPointAddress)
- Sets the Acquirers ComPointAddress.
-
setAcquirerPort(int)
- Sets the port ot the local Acquirers ComPointAddress
-
setLocalAcquirerComPointAddress(ComPointAddress)
- Sets local ComPointAddress with the Acquirer's Port.
-
setLocalID(String)
- Sets the ID of the local user
-
setRemoteAcquirerComPointAddress(ComPointAddress)
- Sets a remote ComPointAddress with the Acquirers Port.
-
setRemoteID(String)
- Sets the ID of the remote user
-
setTimeOut(long)
- Sets the default TimeOut.
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
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.
getTimeOut
public long getTimeOut()
- Gets the default TimeOut.
- Returns:
- the default TimeOut.
setTimeOut
public void setTimeOut(long timeout)
- Sets the default TimeOut. This TimeOut can be overwritten by
the receive method for one transmission.
getTransferPort
public int getTransferPort()
- Gets the port of the transfer.
- Returns:
- the port of the transfer.
getChannelID
public String getChannelID()
- Gets the Channel ID.
- Returns:
- the channel ID which is a concatenation of hostname and date of the first sending.
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
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.
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
setLocalID
public void setLocalID(String local_id)
- Sets the ID of the local user
- Parameters:
- local_id - the ID of the local user
getLocalID
public String getLocalID()
- Gets the ID of the local user
- Returns:
- the ID of the local user
setRemoteID
public void setRemoteID(String remote_id)
- Sets the ID of the remote user
- Parameters:
- remote_id - the ID of the remote user
getRemoteID
public String getRemoteID()
- Gets the ID of the remote user
- Returns:
- the ID of the remote user
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.
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
setAcquirerPort
public void setAcquirerPort(int port)
- Sets the port ot the local Acquirers ComPointAddress
- Parameters:
- port - the port to be set
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
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
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
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
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