com.ibm.security.krb5.internal

Class Config

  1. java.lang.Object
  2. extended bycom.ibm.security.krb5.internal.Config

  1. public class Config
  2. extends java.lang.Object
This class maintains key-value pairs of Kerberos configurable constants from configuration file or from user specified system properties.
Version:
1.1, 5/7/07
Author:
Yanni Zhang

Field Summary

Modifier and Type Field and Description
  1. java.lang.String
USER_HOME
DOCUMENT ME!

Constructor Summary

Constructor and Description
Config(java.util.Map map)

Method Summary

Modifier and Type Method and Description
  1. int[]
defaultEtype(java.lang.String enctypes)
Returns the default encryption types.
  1. java.lang.String
getDefault(java.lang.String name)
Gets the default string value for the specified name.
  1. java.lang.String
getDefault(java.lang.String name,java.lang.String section)
Gets the default string value for the specified name in the specified section.
  1. boolean
getDefaultBooleanValue(java.lang.String name)
Gets the default boolean value for the specified name.
  1. boolean
getDefaultBooleanValue(java.lang.String name,java.lang.String section)
Gets the default boolean value for the specified name in the specified section.
  1. int
getDefaultIntValue(java.lang.String name)
Gets the default int value for the specified name.
  1. int
getDefaultIntValue(java.lang.String name,java.lang.String section)
Gets the default int value for the specified name in the specified section.
  1. java.lang.String
getDefaultRealm()
Gets default realm.
  1. static
  2. Config
getInstance()
Gets an instance of Config class.
  1. static
  2. Config
getInstance(java.util.Map map)
Gets an instance of Config class.
  1. java.lang.String
getKDCList(java.lang.String realm)
Returns a list of KDC's with each KDC separated by a space
  1. java.lang.String
getMasterKDC(java.lang.String realm)
Returns the master KDC, viz, the fist KDC on the list of KDC's
  1. int
getType(java.lang.String input)
Get the etype and checksum value for the specified encryption and checksum type.
  1. void
listTable()
For testing purpose.
  1. java.lang.String
mapHostToRealm(java.lang.String name)
  1. static
  2. void
refresh()
DOCUMENT ME!
  1. void
resetDefaultRealm(java.lang.String realm)
Resets the default kdc realm.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

USER_HOME

  1. public final java.lang.String USER_HOME
DOCUMENT ME!

Constructor Detail

Config

  1. public Config(java.util.Map map)
  2. throws KrbException
Throws:

Method Detail

getInstance

  1. public static Config getInstance( )
  2. throws KrbException
Gets an instance of Config class. One and only one instance (the singleton) is returned.
Returns:
DOCUMENT ME!
Throws:
KrbException - if error occurs when constructing a Config instance. Possible causes would be configuration file not found, either of java.security.krb5.realm or java.security.krb5.kdc not specified, error reading configuration file.

getInstance

  1. public static Config getInstance( java.util.Map map)
  2. throws KrbException
Gets an instance of Config class. One and only one instance (the singleton) is returned.
Returns:
DOCUMENT ME!
Throws:
KrbException - if error occurs when constructing a Config instance. Possible causes would be configuration file not found, either of java.security.krb5.realm or java.security.krb5.kdc not specified, error reading configuration file.

refresh

  1. public static void refresh()
  2. throws KrbException
DOCUMENT ME!
Throws:
KrbException - DOCUMENT ME!

getDefaultIntValue

  1. public int getDefaultIntValue(java.lang.String name)
Gets the default int value for the specified name.
Parameters:
name - the name.
Returns:
the default Integer, null is returned if no such name and value are found in configuration file, or error occurs when parsing string to integer.

getDefaultIntValue

  1. public int getDefaultIntValue(java.lang.String name,
  2. java.lang.String section)
Gets the default int value for the specified name in the specified section.
This method is quicker by using section name as the search key.
Parameters:
name - the name.
section - the name string of the section.
Returns:
the default Integer, null is returned if no such name and value are found in configuration file, or error occurs when parsing string to integer.

getDefault

  1. public java.lang.String getDefault( java.lang.String name)
Gets the default string value for the specified name.
Parameters:
name - the name.
Returns:
the default value, null is returned if it cannot be found.

getDefault

  1. public java.lang.String getDefault( java.lang.String name,
  2. java.lang.String section)
Gets the default string value for the specified name in the specified section.
This method is quicker by using the section name as the search key.
Parameters:
name - the name.
section - the name of the section.
Returns:
the default value, null is returned if it cannot be found.

getDefaultBooleanValue

  1. public boolean getDefaultBooleanValue( java.lang.String name)
Gets the default boolean value for the specified name.
Parameters:
name - the name.
Returns:
the default boolean value, false is returned if it cannot be found.

getDefaultBooleanValue

  1. public boolean getDefaultBooleanValue( java.lang.String name,
  2. java.lang.String section)
Gets the default boolean value for the specified name in the specified section.
This method is quicker by using the section name as the search key.
Parameters:
name - the name.
section - the name of the section.
Returns:
the default boolean value, false is returned if it cannot be found.

listTable

  1. public void listTable()
For testing purpose. This method lists all information being parsed from the configuration file to the hashtable.

defaultEtype

  1. public int[] defaultEtype(java.lang.String enctypes)
Returns the default encryption types.
Parameters:
enctypes - DOCUMENT ME!
Returns:
DOCUMENT ME!

getType

  1. public int getType(java.lang.String input)
Get the etype and checksum value for the specified encryption and checksum type.
Parameters:
input - DOCUMENT ME!
Returns:
DOCUMENT ME!

resetDefaultRealm

  1. public void resetDefaultRealm(java.lang.String realm)
Resets the default kdc realm.
Parameters:
realm - DOCUMENT ME!

getDefaultRealm

  1. public java.lang.String getDefaultRealm( )
Gets default realm.
Returns:
DOCUMENT ME!

mapHostToRealm

  1. public java.lang.String mapHostToRealm( java.lang.String name)

getKDCList

  1. public java.lang.String getKDCList( java.lang.String realm)
Returns a list of KDC's with each KDC separated by a space
Parameters:
realm - the realm for which the master KDC is desired
Returns:
the list of KDCs

getMasterKDC

  1. public java.lang.String getMasterKDC( java.lang.String realm)
Returns the master KDC, viz, the fist KDC on the list of KDC's
Parameters:
realm - the realm for which the master KDC is desired
Returns:
the name of the master KDC host