jade.core
Class Profile

java.lang.Object
  |
  +--jade.core.Profile
Direct Known Subclasses:
ProfileImpl

public abstract class Profile
extends java.lang.Object

This class allows retrieving configuration-dependent classes.

Version:
1.0, 22/11/00
Author:
Federico Bergenti, Giovanni Caire - TILAB

Field Summary
static java.lang.String ACCEPT_FOREIGN_AGENTS
          This constant is the key of the property whose value (true or false) indicates whether or not this platform accepts foreign agents i.e.
static java.lang.String ACLCODECS
          This constant is the key of the property whose value contains the list of ACLCODECSs that have to be launched at bootstrap time.
static java.lang.String AGENTS
          This constant is the name of the property whose value contains the list of agents that have to be launched at bootstrap time
static java.lang.String CONTAINER_NAME
          This constant is the key of the property whose value contains the desired name of the container.
static java.lang.String DETECT_MAIN
          This constant is the name of the property whose Boolean value tells whether to activate multicast detection of main container.
static java.lang.String DUMP_OPTIONS
          This constant is the name of the property whose Boolean value tells whether startup options should be dumped.
static java.lang.String FILE_DIR
          This constant is the key of the property whose value contains the name of the directory where all the files generated by JADE should be put.
static java.lang.String IMTP
          This constant is the key of the property whose value identifies the IMTP Manager to be created by ProfileImpl
static java.lang.String LOCAL_HOST
          This constant is the name of the property whose value contains the host name the container must bind on.
static java.lang.String LOCAL_PORT
          This constant is the name of the TCP port the container node must listen to for incoming IMTP messages.
static java.lang.String LOCAL_SERVICE_MANAGER
          This constant is the name of the property whose Boolean value tells whether a local Service Manager is exported by this container (only when using JADE support for fault-tolerant platform configurations).
static java.lang.String LOCALHOST_CONSTANT
           
static java.lang.String MAIN
          This constant is the name of the property whose value contains a boolean indicating if this is the Main Container or a peripheral container.
static java.lang.String MAIN_HOST
          This constant is the name of the property whose value is the name (or the IP address) of the network host where the JADE Main Container is running.
static java.lang.String MAIN_PORT
          This constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for container registrations.
static java.lang.String MAIN_PROTO
          This constant is the name of the property whose value is a String indicating the protocol to use to connect to the Main Container.
static java.lang.String MTPS
          This constant is the key of the property whose value contains the list of MTPs that have to be launched at bootstrap time.
static java.lang.String PLATFORM_ID
          This constant is the name of the property whose value contains the unique platform ID of a JADE platform.
static java.lang.String REMOTE_SERVICE_MANAGER_ADDRESSES
          This constant is the name of the property whose value contains the list of addresses through which the platform Service Manager can be reached.
static java.lang.String SERVICES
          This constants is the name of the property whose value contains the list of kernel-level services that have to be launched at bootstrap time
static java.lang.String USERAUTH_KEY
          This constant is the name of the property whose value contains the user authentication type to be used to login to the JADE platform.
 
Constructor Summary
Profile()
           
 
Method Summary
static boolean compareHostNames(java.lang.String host1, java.lang.String host2)
          Compares two host names regardless of whether they include domain or not.
abstract  boolean getBooleanProperty(java.lang.String key, boolean aDefault)
          Retrieve a boolean value for a configuration property.
static java.lang.String getDefaultNetworkName()
           
abstract  java.lang.String getParameter(java.lang.String key, java.lang.String aDefault)
          Retrieve a String value from the configuration properties.
abstract  List getSpecifiers(java.lang.String key)
          Retrieve a list of Specifiers from the configuration properties.
static boolean isLocalHost(java.lang.String host)
           
abstract  void setParameter(java.lang.String key, java.lang.String value)
          Assign the given value to the given property name.
abstract  void setSpecifiers(java.lang.String key, List value)
          Assign the given value to the given property name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIN

public static final java.lang.String MAIN
This constant is the name of the property whose value contains a boolean indicating if this is the Main Container or a peripheral container.

See Also:
Constant Field Values

MAIN_PROTO

public static final java.lang.String MAIN_PROTO
This constant is the name of the property whose value is a String indicating the protocol to use to connect to the Main Container.

See Also:
Constant Field Values

MAIN_HOST

public static final java.lang.String MAIN_HOST
This constant is the name of the property whose value is the name (or the IP address) of the network host where the JADE Main Container is running.

See Also:
Constant Field Values

MAIN_PORT

public static final java.lang.String MAIN_PORT
This constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for container registrations.

See Also:
Constant Field Values

DETECT_MAIN

public static final java.lang.String DETECT_MAIN
This constant is the name of the property whose Boolean value tells whether to activate multicast detection of main container. When true, main containers publish their addresses through a service reachable on a multicast address (by default 239.255.10.99, port 1199) and peripheral containers obtain the address of master main container via a multicast request. The default is false.

See Also:
Constant Field Values

LOCAL_HOST

public static final java.lang.String LOCAL_HOST
This constant is the name of the property whose value contains the host name the container must bind on. The host name must refer to the local machine, and is generally needed only when multiple network interfaces are present or a non-default name is desired.

See Also:
Constant Field Values

LOCAL_PORT

public static final java.lang.String LOCAL_PORT
This constant is the name of the TCP port the container node must listen to for incoming IMTP messages.

See Also:
Constant Field Values

LOCAL_SERVICE_MANAGER

public static final java.lang.String LOCAL_SERVICE_MANAGER
This constant is the name of the property whose Boolean value tells whether a local Service Manager is exported by this container (only when using JADE support for fault-tolerant platform configurations).

See Also:
Constant Field Values

DUMP_OPTIONS

public static final java.lang.String DUMP_OPTIONS
This constant is the name of the property whose Boolean value tells whether startup options should be dumped. Default is false

See Also:
Constant Field Values

PLATFORM_ID

public static final java.lang.String PLATFORM_ID
This constant is the name of the property whose value contains the unique platform ID of a JADE platform. Agent GUIDs in JADE are made by a platform-unique nickname, the '@' character and the platform ID.

See Also:
Constant Field Values

USERAUTH_KEY

public static final java.lang.String USERAUTH_KEY
This constant is the name of the property whose value contains the user authentication type to be used to login to the JADE platform.

See Also:
Constant Field Values

AGENTS

public static final java.lang.String AGENTS
This constant is the name of the property whose value contains the list of agents that have to be launched at bootstrap time

See Also:
Constant Field Values

SERVICES

public static final java.lang.String SERVICES
This constants is the name of the property whose value contains the list of kernel-level services that have to be launched at bootstrap time

See Also:
Constant Field Values

REMOTE_SERVICE_MANAGER_ADDRESSES

public static final java.lang.String REMOTE_SERVICE_MANAGER_ADDRESSES
This constant is the name of the property whose value contains the list of addresses through which the platform Service Manager can be reached.

See Also:
Constant Field Values

MTPS

public static final java.lang.String MTPS
This constant is the key of the property whose value contains the list of MTPs that have to be launched at bootstrap time. This list must be retrieved via the getSpecifiers(MTPS) method.

See Also:
Constant Field Values

IMTP

public static final java.lang.String IMTP
This constant is the key of the property whose value identifies the IMTP Manager to be created by ProfileImpl

See Also:
Constant Field Values

CONTAINER_NAME

public static final java.lang.String CONTAINER_NAME
This constant is the key of the property whose value contains the desired name of the container. If this container name exists already, then a default name is assigned by the platform. The name of the main-container is always assigned by the platform and cannot be changed.

See Also:
Constant Field Values

ACLCODECS

public static final java.lang.String ACLCODECS
This constant is the key of the property whose value contains the list of ACLCODECSs that have to be launched at bootstrap time. This list must be retrieved via the getSpecifiers(ACLCODECS) method.

See Also:
Constant Field Values

ACCEPT_FOREIGN_AGENTS

public static final java.lang.String ACCEPT_FOREIGN_AGENTS
This constant is the key of the property whose value (true or false) indicates whether or not this platform accepts foreign agents i.e. agents whose names are not of the form @.

See Also:
Constant Field Values

FILE_DIR

public static final java.lang.String FILE_DIR
This constant is the key of the property whose value contains the name of the directory where all the files generated by JADE should be put. The defaul value is the current directory.

See Also:
Constant Field Values

LOCALHOST_CONSTANT

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

Profile

public Profile()
Method Detail

getParameter

public abstract java.lang.String getParameter(java.lang.String key,
                                              java.lang.String aDefault)
Retrieve a String value from the configuration properties. If no parameter corresponding to the specified key is found, return the provided default.

Parameters:
key - The key identifying the parameter to be retrieved among the configuration properties.
aDefault - The value to return when there is no property set for the given key.

getBooleanProperty

public abstract boolean getBooleanProperty(java.lang.String key,
                                           boolean aDefault)
Retrieve a boolean value for a configuration property. If no corresponding property is found or if its string value cannot be converted to a boolean one, a default value is returned.

Parameters:
key - The key identifying the parameter to be retrieved among the configuration properties.
aDefault - The value to return when there is no property set for the given key, or its value cannot be converted to a boolean value.

getSpecifiers

public abstract List getSpecifiers(java.lang.String key)
                            throws ProfileException
Retrieve a list of Specifiers from the configuration properties. Agents, MTPs and other items are specified among the configuration properties in this way. If no list of Specifiers corresponding to the specified key is found, an empty list is returned.

Parameters:
key - The key identifying the list of Specifires to be retrieved among the configuration properties.
ProfileException

setParameter

public abstract void setParameter(java.lang.String key,
                                  java.lang.String value)
Assign the given value to the given property name.

Parameters:
key - is the property name
value - is the property value

setSpecifiers

public abstract void setSpecifiers(java.lang.String key,
                                   List value)
Assign the given value to the given property name.

Parameters:
key - is the property name
value - is the property value

getDefaultNetworkName

public static java.lang.String getDefaultNetworkName()

isLocalHost

public static boolean isLocalHost(java.lang.String host)

compareHostNames

public static boolean compareHostNames(java.lang.String host1,
                                       java.lang.String host2)
Compares two host names regardless of whether they include domain or not. Note: this method does not work if "localhost" is used as host name.



JADE