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

pack-priv Class KrbServiceLocator

extends Object
Class Inheritance
Imports
java.util.Arrays, .Hashtable, .Random, .StringTokenizer, javax.naming.*, javax.naming.directory.*, javax.naming.spi.NamingManager

This class discovers the location of Kerberos services by querying DNS, as defined in RFC 4120.
Author
Seema Malkani
Since
1.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
KrbServiceLocator.SrvRecord

This class holds a DNS service (SRV) record.

Field Summary

Modifier and TypeField and Description
private static final Random
private static final String
private static final String[]
private static final String
private static final String[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String[]
extractHostports(KrbServiceLocator.SrvRecord[] srvRecords)

Extract hosts and port numbers from a list of SRV records.

pack-priv static String[]

Returns:

An ordered list of hostports for the Kerberos service or null if the service has not been located.
getKerberosService
(String
A string realm name.
realmName
)

Locates the KERBEROS service for a given domain.

pack-priv static String[]

Returns:

An ordered list of hostports for the Kerberos service or null if the service has not been located.
getKerberosService
(String
A string realm name.
realmName
,
String
the protocol string, can be "_udp" or "_tcp"
protocol
)

Locates the KERBEROS service for a given domain.

private static String
selectHostport(KrbServiceLocator.SrvRecord[] srvRecords, int head, int tail)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

randomback to summary
private static final Random random
SRV_RRback to summary
private static final String SRV_RR
SRV_RR_ATTRback to summary
private static final String[] SRV_RR_ATTR
SRV_TXTback to summary
private static final String SRV_TXT
SRV_TXT_ATTRback to summary
private static final String[] SRV_TXT_ATTR

Constructor Detail

KrbServiceLocatorback to summary
private KrbServiceLocator()

Method Detail

extractHostportsback to summary
private static String[] extractHostports(KrbServiceLocator.SrvRecord[] srvRecords)

Extract hosts and port numbers from a list of SRV records. An array of hostports is returned or null if none were found.

getKerberosServiceback to summary
pack-priv static String[] getKerberosService(String realmName)

Locates the KERBEROS service for a given domain. Queries DNS for a list of KERBEROS Service Text Records (TXT) for a given domain name. Information on the mapping of DNS hostnames and domain names to Kerberos realms is stored using DNS TXT records

Parameters
realmName:String

A string realm name.

Returns:String[]

An ordered list of hostports for the Kerberos service or null if the service has not been located.

getKerberosServiceback to summary
pack-priv static String[] getKerberosService(String realmName, String protocol)

Locates the KERBEROS service for a given domain. Queries DNS for a list of KERBEROS Service Location Records (SRV) for a given domain name.

Parameters
realmName:String

A string realm name.

protocol:String

the protocol string, can be "_udp" or "_tcp"

Returns:String[]

An ordered list of hostports for the Kerberos service or null if the service has not been located.

selectHostportback to summary
private static String selectHostport(KrbServiceLocator.SrvRecord[] srvRecords, int head, int tail)
sun.security.krb5 back to summary

pack-priv Class KrbServiceLocator.SrvRecord

extends Object
implements Comparable<KrbServiceLocator.SrvRecord>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

This class holds a DNS service (SRV) record. See http://www.ietf.org/rfc/rfc2782.txt

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
SrvRecord(String srvRecord)

Creates a service record object from a string record.

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(KrbServiceLocator.SrvRecord that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hostportback to summary
pack-priv String hostport
priorityback to summary
pack-priv int priority
sumback to summary
pack-priv int sum
weightback to summary
pack-priv int weight

Constructor Detail

SrvRecordback to summary
pack-priv SrvRecord(String srvRecord) throws Exception

Creates a service record object from a string record. DNS supplies the string record in the following format:

          " "  " "  " " 

Method Detail

compareToback to summary
public int compareTo(KrbServiceLocator.SrvRecord that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.