APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.krb5

public final Class KdcComm

extends Object
Class Inheritance
Imports
java.security.Security, java.util.Locale, .StringTokenizer, .ArrayList, .List, .Set, .HashSet, .Iterator, sun.security.krb5.internal.Krb5, .NetClient, .KRBError, java.io.IOException, java.net.SocketTimeoutException

KDC-REQ/KDC-REP communication. No more base class for KrbAsReq and KrbTgsReq. This class is now communication only.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
KdcComm.BpType

What to do when a KDC is unavailable, specified in the java.security file with key krb5.kdc.bad.policy.

pack-priv static class
KdcComm.KdcAccessibility

Maintains a KDC accessible list.

Field Summary

Modifier and TypeField and Description
private static KdcComm.BpType
private static int
defaultKdcRetryLimit

max retry time for a single KDC, default Krb5.KDC_RETRY_LIMIT (3), Must be > 0.

private static int
defaultKdcTimeout

timeout requesting a ticket from KDC, in millisec, default Krb5.KDC_TIMEOUT (30000).

private static int
defaultUdpPrefLimit

max UDP packet size, default Krb5.KDC_DEFAULT_UDP_PREF_LIMIT (1465).

private final String
realm

The instance fields

private static int
private static int

Constructor Summary

AccessConstructor and Description
public
KdcComm(String realm)

Method Summary

Modifier and TypeMethod and Description
private int

Returns:

a value for the key
getRealmSpecificValue
(String
the given realm in which the setting is requested. Returns the global setting if null
realm
,
String
the key for the setting
key
,
int
default value
defValue
,
boolean
true if value must be >0, false if value must be >=0
mustBePositive
)

Returns krb5.conf setting of key for a specific realm, which can be: 1.

public static void
initStatic()

Read global settings

private static int
private static int

Returns:

the integer value in milliseconds, or -1 if input is null or has an invalid format
parseTimeString
(String
the time string
s
)

Parses a time value string.

public byte[]
private byte[]
send(KrbKdcReq req, boolean useTCP)

private byte[]
send(KrbKdcReq req, String tempKdc, boolean useTCP)

private byte[]
sendIfPossible(KrbKdcReq req, String tempKdc, boolean useTCP)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

badPolicyback to summary
private static KdcComm.BpType badPolicy
defaultKdcRetryLimitback to summary
private static int defaultKdcRetryLimit

max retry time for a single KDC, default Krb5.KDC_RETRY_LIMIT (3), Must be > 0.

defaultKdcTimeoutback to summary
private static int defaultKdcTimeout

timeout requesting a ticket from KDC, in millisec, default Krb5.KDC_TIMEOUT (30000). Must be > 0.

defaultUdpPrefLimitback to summary
private static int defaultUdpPrefLimit

max UDP packet size, default Krb5.KDC_DEFAULT_UDP_PREF_LIMIT (1465). Must be >= 0 and <= Krb5.KDC_HARD_UDP_LIMIT (32700).

realmback to summary
private final String realm

The instance fields

tryLessMaxRetriesback to summary
private static int tryLessMaxRetries
tryLessTimeoutback to summary
private static int tryLessTimeout

Constructor Detail

KdcCommback to summary
public KdcComm(String realm) throws KrbException

Method Detail

getRealmSpecificValueback to summary
private int getRealmSpecificValue(String realm, String key, int defValue, boolean mustBePositive)

Returns krb5.conf setting of key for a specific realm, which can be: 1. defined in the sub-stanza for the given realm inside [realms], or 2. defined in [libdefaults], or 3. defValue

Parameters
realm:String

the given realm in which the setting is requested. Returns the global setting if null

key:String

the key for the setting

defValue:int

default value

mustBePositive:boolean

true if value must be >0, false if value must be >=0

Returns:int

a value for the key

initStaticback to summary
public static void initStatic()

Read global settings

parseNonNegativeIntStringback to summary
private static int parseNonNegativeIntString(String intString)
parseTimeStringback to summary
private static int parseTimeString(String s)

Parses a time value string. If it ends with "s", parses as seconds. Otherwise, parses as milliseconds.

Parameters
s:String

the time string

Returns:int

the integer value in milliseconds, or -1 if input is null or has an invalid format

sendback to summary
public byte[] send(KrbKdcReq req) throws IOException, KrbException
sendback to summary
private byte[] send(KrbKdcReq req, boolean useTCP) throws IOException, KrbException
sendback to summary
private byte[] send(KrbKdcReq req, String tempKdc, boolean useTCP) throws IOException, KrbException
sendIfPossibleback to summary
private byte[] sendIfPossible(KrbKdcReq req, String tempKdc, boolean useTCP) throws IOException, KrbException
sun.security.krb5 back to summary

private final Enum KdcComm.BpType

extends Enum<KdcComm.BpType>
Class Inheritance

What to do when a KDC is unavailable, specified in the java.security file with key krb5.kdc.bad.policy. Possible values can be TRY_LAST or TRY_LESS. Reloaded when refreshed.

Field Summary

Modifier and TypeField and Description
public static final KdcComm.BpType
public static final KdcComm.BpType
public static final KdcComm.BpType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static KdcComm.BpType
public static KdcComm.BpType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

NONEback to summary
public static final KdcComm.BpType NONE
TRY_LASTback to summary
public static final KdcComm.BpType TRY_LAST
TRY_LESSback to summary
public static final KdcComm.BpType TRY_LESS

Constructor Detail

BpTypeback to summary
private BpType()

Method Detail

valueOfback to summary
public static KdcComm.BpType valueOf(String name)
valuesback to summary
public static KdcComm.BpType[] values()
sun.security.krb5 back to summary

pack-priv Class KdcComm.KdcAccessibility

extends Object
Class Inheritance

Maintains a KDC accessible list. Unavailable KDCs are put into a secondary KDC list. When a KDC in the secondary list is available, it is removed from there. No insertion order in the secondary KDC list. There are two methods to deal with KDCs in the secondary KDC list. 1. Only try them when they are the only known KDCs. 2. Still try them, but with fewer retries and a smaller timeout value.

Field Summary

Modifier and TypeField and Description
private static Set<String>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static synchronized void
private static synchronized boolean
private static synchronized List<String>
list(String kdcList)

private static synchronized void
private static synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

badsback to summary
private static Set<String> bads

Constructor Detail

KdcAccessibilityback to summary
pack-priv KdcAccessibility()

Method Detail

addBadback to summary
private static synchronized void addBad(String kdc)
isBadback to summary
private static synchronized boolean isBad(String kdc)
listback to summary
private static synchronized List<String> list(String kdcList)
removeBadback to summary
private static synchronized void removeBad(String kdc)
resetback to summary
private static synchronized void reset()