p2ps.imp.peer
Class ConfigFactory

java.lang.Object
  extended byp2ps.imp.peer.ConfigFactory

public class ConfigFactory
extends java.lang.Object

A factory constructor for creating P2PS Peers.

Version:
$Revision: 295 $
Author:
Matthew Shields

Field Summary
static int CONFIG_WINDOW_ALWAYS
           
static int CONFIG_WINDOW_IF_REQUIRED
           
static int CONFIG_WINDOW_NEVER
           
static java.lang.String P2PS_DEFAULT
           
static java.lang.String P2PS_PORT_MAX
           
static java.lang.String P2PS_PORT_MIN
           
static java.lang.String P2PS_REMOTE_RENDEZVOUS
           
static java.lang.String P2PS_RENDEZVOUS_PROTOCOL
           
static java.lang.String P2PS_UDP_MULTICAST
           
 
Constructor Summary
ConfigFactory()
           
 
Method Summary
static Config applySystemConfiguration(Config config)
          Applies the config specified in the Java net properties to the specified config.
static Config getConfig(int configwindow)
          Loads a peer configuration, optionally displaying a configuration dialog.
static Config getConfig(int configwindow, java.lang.String title)
          Loads a peer configuration, optionally displaying a configuration dialog.
static char[] getPassword(Config config)
          Retreives the password for a peer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_WINDOW_NEVER

public static final int CONFIG_WINDOW_NEVER
See Also:
Constant Field Values

CONFIG_WINDOW_ALWAYS

public static final int CONFIG_WINDOW_ALWAYS
See Also:
Constant Field Values

CONFIG_WINDOW_IF_REQUIRED

public static final int CONFIG_WINDOW_IF_REQUIRED
See Also:
Constant Field Values

P2PS_DEFAULT

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

P2PS_RENDEZVOUS_PROTOCOL

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

P2PS_REMOTE_RENDEZVOUS

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

P2PS_UDP_MULTICAST

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

P2PS_PORT_MIN

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

P2PS_PORT_MAX

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

ConfigFactory

public ConfigFactory()
Method Detail

getConfig

public static final Config getConfig(int configwindow)
Loads a peer configuration, optionally displaying a configuration dialog.

Parameters:
configwindow - either CONFIG_WINDOW_NEVER, CONFIG_WINDOW_IF_REQUIRED or CONFIG_WINDOW_ALWAYS
Returns:
a peer configuration

getConfig

public static final Config getConfig(int configwindow,
                                     java.lang.String title)
Loads a peer configuration, optionally displaying a configuration dialog.

Parameters:
configwindow - either CONFIG_WINDOW_NEVER, CONFIG_WINDOW_IF_REQUIRED or CONFIG_WINDOW_ALWAYS
title - the title for the configuration dialog
Returns:
a peer configuration

getPassword

public static final char[] getPassword(Config config)
Retreives the password for a peer. This is either the password entered in the configuration dialog that returned the specified config, or a new dialog is displayed prompting for the password. If the config is using a temporary keystore then null if returned.

Parameters:
config - the peer configuration
Returns:
the password for the peer, or null if a temporary key store is being generated

applySystemConfiguration

public static Config applySystemConfiguration(Config config)
Applies the config specified in the Java net properties to the specified config.