All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.EndpointDescriptor

java.lang.Object
   |
   +----sun.server.EndpointDescriptor

public class EndpointDescriptor
extends Object
Endpoint descriptors are used to administer network services. Each network service is made available at a particular transport address, and with certain characteristics. Those characteristics are described using an endpoint descriptor, administered as part of the service.

Characteristics of a transport endpoint include addressing information, some kinds of security characteristics, compression, bandwidth, latency, and more. In particular, there are different kinds of transport endpoints, corresponding to different qualities of service, such as:

Higher level aspects of the configuration for a network service are administered using different interfaces. Endpoint Descriptors only affect provide administrative support for transport level characteristics, and application protocols usually depend on having a particular kind of transport protocol.


Endpoint descriptors usually need to be persistent. The strategy used may be defined by the descriptor; it may come from a network service, a hardware device, ROM, a file, or any other storage scheme.

A default implementation is provided, which initializes an internal hashtable from properties or a properties file. That may then be saved to a file, if desired. This default implementation may be completely replaced by any given subclass, but clients of that subclass will need to understand the persistence scheme being used.

In the atypical case that an EndpointDescriptor doesn't need to be made persistent, the properties object may be created directly, and not stored in any file.


Variable Index

 o file
A File object to which the descriptor state may be saved.
 o header
header to use on the optional properties file
 o properties
A hashtable which may be used to hold properties of this endpoint.
 o propname
Name of the property used to identify which classs is instantiated.

Constructor Index

 o EndpointDescriptor()

Method Index

 o fromFile(File)
This initializes EndpointDescriptors created using the property set representation (see fromProperties), loading it from a file.
 o fromProperties(Properties)
 o getAdminAppletClass()
Placeholder for the hook to administer these objects.
 o getCriticalKeys()
Lists the keys which initializeDescriptor absolutely requires to be made available to it.
 o getDefault(Object)
Returns the default value of a given key.
 o getDescriptorKeys()
Lists the keys understood by initializeDescriptor, including ones which have default values.
 o getValue(Object)
Returns the current value corresponding to a given key.
 o initialize(Hashtable)
Initializes the descriptor from the key/value pairs found in a hashtable.
 o save()
Saves the endpoint descriptor to the persistent storage location last used to store it.
 o save(File)
Saves the endpoint descriptor to the named file.
 o setValue(Object, Object)
Sets the value corresponding to a given key.

Variables

 o properties
  protected Hashtable properties
A hashtable which may be used to hold properties of this endpoint. This does not need to be used by subclasses.

If there is a value for this member, and it corresponds to a properties object, and a file member is non-null, the save() operation saves the properties to that file.

 o file
  protected File file
A File object to which the descriptor state may be saved.

Desirable to just use serialization of the entire server configuration ...

 o header
  protected String header
header to use on the optional properties file

 o propname
  public final static String propname
Name of the property used to identify which classs is instantiated.

Constructors

 o EndpointDescriptor
  public EndpointDescriptor()

Methods

 o fromFile
  public static EndpointDescriptor fromFile(File f) throws IOException, FileNotFoundException, ConfigurationException
This initializes EndpointDescriptors created using the property set representation (see fromProperties), loading it from a file.

Parameters:
f - the file holding the property set
Throws: IOException
when there is a problem reading the file
Throws: FileNotFoundException
if the file does not exist
Throws: ConfigurationException
indicates that the data in the hashtable has problems.
 o fromProperties
  public static EndpointDescriptor fromProperties(Properties props) throws ConfigurationException
 o getAdminAppletClass
  public abstract String getAdminAppletClass()
Placeholder for the hook to administer these objects. The assumption here is that it suffices to just return the name of a class which can be instantiated by the admin applet and then given a reference to the object it's administering.

 o getCriticalKeys
  public abstract Vector getCriticalKeys()
Lists the keys which initializeDescriptor absolutely requires to be made available to it. All other keys have default values. Note that subclasses may provide defaults for values that superclasses provide.

 o getDescriptorKeys
  public abstract Vector getDescriptorKeys()
Lists the keys understood by initializeDescriptor, including ones which have default values.

 o getDefault
  public Object getDefault(Object key)
Returns the default value of a given key.

Parameters:
key - identifies which default value is requested
 o getValue
  public Object getValue(Object key)
Returns the current value corresponding to a given key.

Parameters:
key - identifies which current value is requested
 o initialize
  public void initialize(Hashtable props) throws ConfigurationException
Initializes the descriptor from the key/value pairs found in a hashtable. The keys and values understood by the descriptor are specific to the kind of connection, although conventions are defined for the following string-valued keys:

Keys provided in the hashtable must be understood by the descriptor; it is an error to provide keys which are not explicitly supported by the descriptor. Similarly, it is an error not to provide values for the "critical" keys.

Parameters:
props - a set of key/value pairs used to initialize the descriptor (CONSUMED).
Throws: ConfigurationException
indicates that the data in the hashtable has problems.
See Also:
getDescriptorKeys, getCriticalKeys
 o save
  public void save() throws IOException
Saves the endpoint descriptor to the persistent storage location last used to store it.

 o save
  public void save(File f) throws IOException
Saves the endpoint descriptor to the named file.

Parameters:
f - the file to which the descriptor will be saved
 o setValue
  public void setValue(Object key,
                       Object value)
Sets the value corresponding to a given key.

Parameters:
key - the key used to look up the value
value - the value being set

All Packages  Class Hierarchy  This Package  Previous  Next  Index