com.ibm.retail.AEF.factory
Class AEFSessionFactoryInfo

java.lang.Object
  |
  +--com.ibm.retail.AEF.factory.AEFSessionFactoryInfo
All Implemented Interfaces:
java.io.Serializable

public class AEFSessionFactoryInfo
extends java.lang.Object
implements java.io.Serializable

AEFSessionFactoryInfo encapsulates information about the current status of the factory. It is primarily used to determine factory capability and utilization for the purposes of load balancing among multiple factories through a single SessionServer.

See Also:
Serialized Form

Field Summary
protected  java.lang.String beaconStr
           
protected  int currentPoolSize
           
protected  java.lang.String ID
           
protected  java.lang.String localTerminalNumber
           
protected  java.util.TreeSet reservedTerminalNumberList
           
protected  java.lang.String reservedTerminalNumbers
           
protected  java.util.TreeSet terminalNumberList
           
protected  java.lang.String terminalNumbers
           
protected  int totalAvailableSessions
           
protected  boolean tss
           
protected  java.lang.String URI
           
 
Constructor Summary
AEFSessionFactoryInfo()
          AEFSessionFactoryInfo constructor
 
Method Summary
(package private) static java.lang.String copyright()
           
 java.lang.String getBeaconString()
          Returns a String suitable for a beacon buffer containing the state information of this info object.
 int getCurrentPoolSize()
          Get the total number of sessions currently in the session pool
 java.lang.String getID()
          Get the factory ID
 java.lang.String getLocalTerminalNumber()
          Get the terminal number for AEF running in real terminal.
 java.util.Collection getReservedTerminalNumbers()
          Get the terminal numbers that are considered "reserved" for this factory.
 java.util.Collection getTerminalNumbers()
          Get the terminal numbers that this factory assigns.
 int getTotalAvailableSessions()
          Get the total number of sessions that are available
 int getTotalCapacity()
          Get the total factory capacity
 java.lang.String getURI()
          Get the factory URI if factory is exposed via RMI.
 void initWithBeaconData(java.lang.String beaconStr)
          Initialize the member data from a byte array.
 boolean isTSS()
          Get the TSS (virtual terminals) flag
 boolean isValidTerminalNumber(java.lang.String terminalNumber)
          Determine if this factory can create a specific terminal
protected  java.util.TreeSet parseTerminalNumbers(java.lang.String termNums)
          Set the terminal numbers that this factory assigns Format is a comma separated list or range (e.g., 10-20,22,25)
 void setCurrentPoolSize(int t)
          Set the total number of sessions currently in the session pool
 void setID(java.lang.String s)
          Set the factory ID
 void setLocalTerminalNumber(java.lang.String t)
          Set the local terminal number for this factory (non-tss)
 java.lang.String setReservedTerminalNumbers(java.lang.String t)
          Set the reserved terminal numbers for this factory.
 void setTerminalNumbers(java.lang.String t)
          Set the terminal numbers that this factory assigns.
 void setTotalAvailableSessions(int t)
          Set the total number of sessions that are available
 void setTSS(boolean flag)
          Set the TSS flag
 void setURI(java.lang.String s)
          Set the factory URI
 java.lang.String toString()
          Returns the internal representation of this object as a string.
protected  void validateReservedTerminalNumbers()
          Validate validate that the reserved terminal numbers are contained in the set of specified terminal numbers - if not, a warning is logged and the offending terminals are removed from the set of reserved terminal numbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentPoolSize

protected int currentPoolSize

totalAvailableSessions

protected int totalAvailableSessions

tss

protected boolean tss

localTerminalNumber

protected java.lang.String localTerminalNumber

terminalNumbers

protected java.lang.String terminalNumbers

terminalNumberList

protected java.util.TreeSet terminalNumberList

reservedTerminalNumbers

protected java.lang.String reservedTerminalNumbers

reservedTerminalNumberList

protected java.util.TreeSet reservedTerminalNumberList

ID

protected java.lang.String ID

URI

protected java.lang.String URI

beaconStr

protected java.lang.String beaconStr
Constructor Detail

AEFSessionFactoryInfo

public AEFSessionFactoryInfo()
AEFSessionFactoryInfo constructor

Method Detail

copyright

static java.lang.String copyright()

initWithBeaconData

public void initWithBeaconData(java.lang.String beaconStr)
Initialize the member data from a byte array. This method is intended to populate the info object with the data from the factory beacon.

The beacon data is of the form
f|factory_id|RMI_URI|current_pools_size|total_available_sessions|is_TSS(T or F)|terminal_numbers


getID

public java.lang.String getID()
Get the factory ID

Returns:
ID

getURI

public java.lang.String getURI()
Get the factory URI if factory is exposed via RMI. If not, this method returns "local".

Returns:
URI

getTotalCapacity

public int getTotalCapacity()
Get the total factory capacity

Returns:
total number of sessions this factory can create

isTSS

public boolean isTSS()
Get the TSS (virtual terminals) flag

Returns:
true if TSS factory

getCurrentPoolSize

public int getCurrentPoolSize()
Get the total number of sessions currently in the session pool

Returns:
total number of sessions in pool

getTerminalNumbers

public java.util.Collection getTerminalNumbers()
Get the terminal numbers that this factory assigns.

Returns:
Collection of terminal numbers as string values

getReservedTerminalNumbers

public java.util.Collection getReservedTerminalNumbers()
Get the terminal numbers that are considered "reserved" for this factory.

Returns:
Collection of reserved terminal numbers as string values

getLocalTerminalNumber

public java.lang.String getLocalTerminalNumber()
Get the terminal number for AEF running in real terminal.

Returns:
terminal number

getTotalAvailableSessions

public int getTotalAvailableSessions()
Get the total number of sessions that are available

Returns:
total available sessions

setID

public void setID(java.lang.String s)
Set the factory ID

Parameters:
s - factory ID

setURI

public void setURI(java.lang.String s)
Set the factory URI

Parameters:
s - factory URI

setTerminalNumbers

public void setTerminalNumbers(java.lang.String t)
Set the terminal numbers that this factory assigns. Format is a comma separated list or range (e.g., 10-20,22,25)

Parameters:
t - terminal numbers as comma separated list

setReservedTerminalNumbers

public java.lang.String setReservedTerminalNumbers(java.lang.String t)
Set the reserved terminal numbers for this factory. Format is a comma separated list or range (e.g., 10-20,22,25).

This list of terminal numbers is validated against the overall set of terminal numbers (set by setTerminalNumbers(String). Any terminal numbers in the reserved list that are not in the overall list are removed. A String representation of the validated list (which may have been modified) is returned.

Parameters:
t - terminal numbers as comma separated list
Returns:
the validated list of reserved terminal numbers.

parseTerminalNumbers

protected java.util.TreeSet parseTerminalNumbers(java.lang.String termNums)
Set the terminal numbers that this factory assigns Format is a comma separated list or range (e.g., 10-20,22,25)


validateReservedTerminalNumbers

protected void validateReservedTerminalNumbers()
Validate validate that the reserved terminal numbers are contained in the set of specified terminal numbers - if not, a warning is logged and the offending terminals are removed from the set of reserved terminal numbers. Reconstruct the String representation of the set of reserved terminal numbers.


setCurrentPoolSize

public void setCurrentPoolSize(int t)
Set the total number of sessions currently in the session pool

Parameters:
t - total number of sessions in pool

setLocalTerminalNumber

public void setLocalTerminalNumber(java.lang.String t)
Set the local terminal number for this factory (non-tss)

Parameters:
t - local terminal number

setTotalAvailableSessions

public void setTotalAvailableSessions(int t)
Set the total number of sessions that are available

Parameters:
t - total available sessions

setTSS

public void setTSS(boolean flag)
Set the TSS flag

Parameters:
flag - true if TSS (virtual terminals) factory

isValidTerminalNumber

public boolean isValidTerminalNumber(java.lang.String terminalNumber)
Determine if this factory can create a specific terminal

Parameters:
terminalNumber - identifies a terminal
Returns:
true if this is the factory handling a specified terminal number

getBeaconString

public java.lang.String getBeaconString()
Returns a String suitable for a beacon buffer containing the state information of this info object.

Returns:
String

toString

public java.lang.String toString()
Returns the internal representation of this object as a string.

Overrides:
toString in class java.lang.Object
Returns:
String


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