net.sf.xbus.base.xbussystem
Class XBUSSystem

java.lang.Object
  extended by net.sf.xbus.base.xbussystem.XBUSSystem

public class XBUSSystem
extends java.lang.Object

XBUSSystem is the representation of any neighbor-systems respectively their interfaces. It consists of two informations:


Field Summary
static java.lang.String FILENAME_WILDCARD
           
static java.lang.String FILENAME_WILDCARD_XML
           
 
Constructor Summary
XBUSSystem(java.lang.String name)
          Constructs the XBUSSystem without an address.
XBUSSystem(java.lang.String name, java.util.Hashtable addresses)
          Constructs the XBUSSystem from the name fo the neighbor-system and all address informations for this system
XBUSSystem(java.lang.String name, java.util.Hashtable addresses, boolean broadcast)
          Constructs the XBUSSystem from the name fo the neighbor-system and all address informations for this system and the flag if a broadcast is requested to this system.
 
Method Summary
static AdditionalAddress getAdditionalAddressImplementation(java.lang.String systemName)
          Gets the address implementation (AdditionalAddress) for the given system name.
 java.util.Hashtable getAddresses()
          Returns all address informations of the neighbor-system.
 boolean getBroadcast()
          Is a braodcast requested for all recorded addtional addresses when sending data to this system?
 void getBroadcastData(java.lang.String text)
          Check if the given address string does contain a reference to addtional address information.
 java.lang.String getCompleteName()
           Returns the concatenation of name and all addresses of the neighbor-system by "_" separated.
 int getMaxAge()
          Get the maximal age of the data source.
 int getMinAge()
          Get the minimal age of the data source.
 java.lang.String getName()
          Returns the name of the neighbor-system.
static java.util.List getSystems(java.lang.String name, java.lang.String text)
          Returns a list of XBUSSystems, generated through the replacing of all possible place markers.
 java.lang.String[] replaceAllMarkers(java.lang.String text)
          The given text may contain place markers which will be replaced with their actual values.
 void setAddress(java.lang.String name, java.lang.String address)
          Sets one address information of the neighbor-system.
 java.lang.String toString()
          Returns the concatenation of name and address of the neighbor-system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILENAME_WILDCARD

public static final java.lang.String FILENAME_WILDCARD
See Also:
Constant Field Values

FILENAME_WILDCARD_XML

public static final java.lang.String FILENAME_WILDCARD_XML
See Also:
Constant Field Values
Constructor Detail

XBUSSystem

public XBUSSystem(java.lang.String name)
           throws XException
Constructs the XBUSSystem without an address.

Parameters:
name - name of the neighbor-system
Throws:
XException

XBUSSystem

public XBUSSystem(java.lang.String name,
                  java.util.Hashtable addresses)
           throws XException
Constructs the XBUSSystem from the name fo the neighbor-system and all address informations for this system

Parameters:
name - name of the neighbor-system
addresses - name of the address
Throws:
XException

XBUSSystem

public XBUSSystem(java.lang.String name,
                  java.util.Hashtable addresses,
                  boolean broadcast)
           throws XException
Constructs the XBUSSystem from the name fo the neighbor-system and all address informations for this system and the flag if a broadcast is requested to this system. The addresses do not necessarily contain the reference to additional address information necessary for a broadcast.

Parameters:
name - name of the neighbor-system
addresses - name of the address
broadcast - is broadcast to be done when sending?
Throws:
XException
Method Detail

getName

public java.lang.String getName()
Returns the name of the neighbor-system.

Returns:
name of the neighbor-system

getAddresses

public java.util.Hashtable getAddresses()
Returns all address informations of the neighbor-system. Each address stored as value against its typ.

Example:

Key Value
AddressImplementation Test/Wholesale/std$DEALERNUMBER$.cnf
WILDCARD parts
user KS

Returns:
all addresses of the neighbor-system

setAddress

public void setAddress(java.lang.String name,
                       java.lang.String address)
Sets one address information of the neighbor-system.

Parameters:
name - typ of additional information
address - additional inrformation eventually containing markers with the format $key$.

getCompleteName

public java.lang.String getCompleteName()
Returns the concatenation of name and all addresses of the neighbor-system by "_" separated.
Example:    PartsOrderAutoline_12345

If no address information is found, the name of the neighbor-system will be returned.
Example:    PartsOrderAutoline

Returns:
concatenation of name and all addresses of the neighbor-system or only name if addresses are not exist

getBroadcast

public boolean getBroadcast()
Is a braodcast requested for all recorded addtional addresses when sending data to this system?


getMaxAge

public int getMaxAge()
Get the maximal age of the data source. The value is in milliseconds.


getMinAge

public int getMinAge()
Get the minimal age of the data source. The value is in milliseconds.


replaceAllMarkers

public java.lang.String[] replaceAllMarkers(java.lang.String text)
                                     throws XException
The given text may contain place markers which will be replaced with their actual values. Three types of markers are possible:

Note: If no marker is found, the text will be returned without modifications.

Parameters:
text - text containing markers
Returns:
text array with replacements for markers or without modifications if no marker is found.
Throws:
XException - if the entry is not found or any error occurs

toString

public java.lang.String toString()
Returns the concatenation of name and address of the neighbor-system.

Overrides:
toString in class java.lang.Object
Returns:
concatenation of name and address of the neighbor-system or only name if address is not exist
See Also:
getCompleteName()

getSystems

public static java.util.List getSystems(java.lang.String name,
                                        java.lang.String text)
                                 throws XException
Returns a list of XBUSSystems, generated through the replacing of all possible place markers.

Note: If there are no place markers in the given text, only one system with an empty address is in that list.

Parameters:
name - the name of the system
text - eventually containing place markers
Returns:
list of XBUSSystems
Throws:
XException - if any error occurs

getAdditionalAddressImplementation

public static AdditionalAddress getAdditionalAddressImplementation(java.lang.String systemName)
                                                            throws XException
Gets the address implementation (AdditionalAddress) for the given system name.

Note: If there is no address implementation for the given system created yet, then creates this method one first.
Address implementation name is read from the configuration:
        System_ SystemName _AddressImplementation
If there is no implementation for the address is provided with this system, there must be a global entry used.:
        Base_System_AddressImplementation

Parameters:
systemName - the name of the system
Returns:
address implementation (AdditionalAddress) for the given system name
Throws:
XException - if any error occurs

getBroadcastData

public void getBroadcastData(java.lang.String text)
                      throws XException
Check if the given address string does contain a reference to addtional address information. Update the list of addresses and broadcast flag accordingly.

Parameters:
text - the address text (e.g. file path)
Throws:
XException