com.ibm.retail.AEF.server
Class AEFBase.AEFMulticastThread

java.lang.Object
  |
  +--com.ibm.retail.AEF.server.AEFBase.AEFMulticastThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
AEFBase

public class AEFBase.AEFMulticastThread
extends java.lang.Object
implements java.lang.Runnable

AEFMulticastThread is a thread which can handle listening to the multicast socket for beaconing factories, as well as beacon on behalf of a factory.


Field Summary
protected  byte[] blankBuf
           
protected  byte[] broadcastBuf
           
protected  long lastBeaconTime
           
protected  byte[] receiveBuf
           
protected  byte[] serverURIBuf
           
protected  int timeout
           
 
Constructor Summary
AEFBase.AEFMulticastThread()
          Construct AEFMulticastThread object
 
Method Summary
protected  java.net.DatagramPacket listenForIncoming()
          Listens on the multicast socket for an incoming message.
protected  void processDuplicateTerminalNumber(java.lang.String incomingBuffer)
          Process the incoming duplicate terminal message.
protected  void processFactoryBeacon(java.lang.String factoryBeacon, java.net.DatagramPacket incomingPacket)
          Process the incoming factory beacon.
protected  void processServerBeacon(java.lang.String serverBeacon)
          Process the incoming server beacon.
protected  void processServerRequest(java.lang.String serverRequest, java.net.DatagramPacket incomingPacket)
          Process the incoming server request.
 void run()
          Main processing loop
protected  void sendDuplicateTermNumMessage(java.net.DatagramPacket incomingPacket, java.lang.String factoryID)
          Send a directed packet back to the originator of the factory beacon to indicate that the factory is trying to come on-line with a terminal number already duplicated in another factory.
protected  void sendFactoryBeacon(boolean honorBeaconInterval)
          Send the factory beacon
protected  void sendServerBeacon()
          Send an outgoing message containing the server's URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeout

protected int timeout

lastBeaconTime

protected long lastBeaconTime

broadcastBuf

protected byte[] broadcastBuf

receiveBuf

protected byte[] receiveBuf

blankBuf

protected byte[] blankBuf

serverURIBuf

protected byte[] serverURIBuf
Constructor Detail

AEFBase.AEFMulticastThread

public AEFBase.AEFMulticastThread()
Construct AEFMulticastThread object

Method Detail

run

public void run()
Main processing loop

Specified by:
run in interface java.lang.Runnable

sendFactoryBeacon

protected void sendFactoryBeacon(boolean honorBeaconInterval)
Send the factory beacon

Parameters:
honorBeaconInterval - If true, this method will not send the beacon unless the time since the last beacon is greater than the beacon interval.

processFactoryBeacon

protected void processFactoryBeacon(java.lang.String factoryBeacon,
                                    java.net.DatagramPacket incomingPacket)
Process the incoming factory beacon.


processServerRequest

protected void processServerRequest(java.lang.String serverRequest,
                                    java.net.DatagramPacket incomingPacket)
Process the incoming server request. A server request is issued to discover SessionServers on the network. The request may be issued for all servers, or a specific server by name.


processServerBeacon

protected void processServerBeacon(java.lang.String serverBeacon)
Process the incoming server beacon.


processDuplicateTerminalNumber

protected void processDuplicateTerminalNumber(java.lang.String incomingBuffer)
Process the incoming duplicate terminal message.


sendServerBeacon

protected void sendServerBeacon()
Send an outgoing message containing the server's URI.


sendDuplicateTermNumMessage

protected void sendDuplicateTermNumMessage(java.net.DatagramPacket incomingPacket,
                                           java.lang.String factoryID)
Send a directed packet back to the originator of the factory beacon to indicate that the factory is trying to come on-line with a terminal number already duplicated in another factory.


listenForIncoming

protected java.net.DatagramPacket listenForIncoming()
Listens on the multicast socket for an incoming message. We'll block for the timeout period. If we didn't receive anything, a null string is returned.

Returns:
DatagramPacket An incoming packet, or null if we timed out.


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004