uk.ac.ic.doc.automed.p2p
Class AppToolKit

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.AppToolKit

public class AppToolKit
extends java.lang.Object


Nested Class Summary
static class AppToolKit.NodeConfig
          Inner class to define a server configuration
 
Field Summary
static java.lang.String AUTOMED_USER_DIR
           
static java.lang.String CFG_FILE_EXT
           
static java.lang.String DS_REPS_CFG_FILE_PREFIX
           
static java.lang.String PEER_REPS_CFG_FILE_PREFIX
           
 
Constructor Summary
AppToolKit()
          Creates a new instance of AppToolKit
 
Method Summary
static java.util.Properties getCommProperties(java.lang.String protocol)
          Get communication properties for a specific protocol
static java.lang.String getCommProtocol()
          Get communication protocol attributes
static AppToolKit.NodeConfig getConfig(java.lang.String cfgFile)
           
static AppToolKit.NodeConfig getConfig(java.lang.String cfgFile, boolean setActive)
          Return the P2PDirectory config
static java.lang.String getDomain()
          Return the P2PDirectory config.
 int getHelloProtocolChannel()
           
static int getIntProperty(java.lang.String propName, java.lang.String defaultValue)
           
static int getKeepAliveTime()
           
static java.lang.String getLogServerAddress()
           
static int getLogServerPort()
           
static int getPeerDaemonPort()
           
static java.util.Properties getProperties()
           
static java.lang.String getProperty(java.lang.String prop, java.lang.String defValue)
           
static java.lang.String getRegistryAddress()
           
static int getRegistryPort()
           
static java.lang.String getServerAddress()
           
static java.lang.String getServerAddress(java.lang.String protocol)
           
static int getServerPort()
           
static int getServerPort(java.lang.String protocol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTOMED_USER_DIR

public static final java.lang.String AUTOMED_USER_DIR

PEER_REPS_CFG_FILE_PREFIX

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

DS_REPS_CFG_FILE_PREFIX

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

CFG_FILE_EXT

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

AppToolKit

public AppToolKit()
Creates a new instance of AppToolKit

Method Detail

getConfig

public static AppToolKit.NodeConfig getConfig(java.lang.String cfgFile)
                                       throws AutoMedException
Throws:
AutoMedException

getConfig

public static AppToolKit.NodeConfig getConfig(java.lang.String cfgFile,
                                              boolean setActive)
                                       throws AutoMedException
Return the P2PDirectory config

Parameters:
cfgFile - location of the config file to read
setActive - whether to use this file as the active configuration
Throws:
AutoMedException

getDomain

public static java.lang.String getDomain()
Return the P2PDirectory config. P2PConstants.
This method exists only for backward compatible with existing method of loading configuration parameters.
It should be deprecated soon. Use getConfig(String cfgFile) instead.


getCommProtocol

public static java.lang.String getCommProtocol()
                                        throws ApplicationPropertyException
Get communication protocol attributes

Throws:
ApplicationPropertyException

getServerPort

public static int getServerPort()
                         throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getServerPort

public static int getServerPort(java.lang.String protocol)
                         throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getServerAddress

public static java.lang.String getServerAddress()
                                         throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getLogServerAddress

public static java.lang.String getLogServerAddress()
                                            throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getLogServerPort

public static int getLogServerPort()
                            throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getServerAddress

public static java.lang.String getServerAddress(java.lang.String protocol)
                                         throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getPeerDaemonPort

public static int getPeerDaemonPort()
                             throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getHelloProtocolChannel

public int getHelloProtocolChannel()

getCommProperties

public static java.util.Properties getCommProperties(java.lang.String protocol)
                                              throws ApplicationPropertyException
Get communication properties for a specific protocol

Throws:
ApplicationPropertyException

getRegistryAddress

public static java.lang.String getRegistryAddress()
                                           throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getRegistryPort

public static int getRegistryPort()
                           throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getKeepAliveTime

public static int getKeepAliveTime()
                            throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getProperties

public static java.util.Properties getProperties()
                                          throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getProperty

public static java.lang.String getProperty(java.lang.String prop,
                                           java.lang.String defValue)
                                    throws ApplicationPropertyException
Throws:
ApplicationPropertyException

getIntProperty

public static int getIntProperty(java.lang.String propName,
                                 java.lang.String defaultValue)
                          throws ApplicationPropertyException
Throws:
ApplicationPropertyException