public class KdcServerConnectionVerification extends Object
It has two potential clients.
Modifier and Type | Class and Description |
---|---|
static class |
KdcServerConnectionVerification.ConnectionProtocol
A connection protocol to use to for connecting to the KDC
|
Constructor and Description |
---|
KdcServerConnectionVerification(Configuration config) |
Modifier and Type | Method and Description |
---|---|
int |
getConnectionTimeout()
Get the timeout value.
|
protected org.apache.directory.kerberos.client.KdcConnection |
getKdcConnection(org.apache.directory.kerberos.client.KdcConfig config)
Get a KDC UDP connection for the given configuration.
|
boolean |
isKdcReachable(String kdcHost)
Given server IP or hostname, checks if server is reachable i.e.
|
boolean |
isKdcReachable(String server,
int port)
Given a host and port, checks if server is reachable meaning that we
can communicate with it.
|
boolean |
isKdcReachable(String server,
int port,
KdcServerConnectionVerification.ConnectionProtocol connectionProtocol)
Attempt to communicate with KDC server over a specified communication protocol (TCP or UDP).
|
protected int |
parsePort(String port)
Parses port number from given string.
|
void |
setConnectionTimeout(int timeoutSeconds)
Set the connection timeout.
|
@Inject public KdcServerConnectionVerification(Configuration config)
public boolean isKdcReachable(String kdcHost)
kdcHost
- KDC server IP or hostname (with optional port number)public boolean isKdcReachable(String server, int port)
server
- KDC server IP or hostnameport
- KDC portpublic boolean isKdcReachable(String server, int port, KdcServerConnectionVerification.ConnectionProtocol connectionProtocol)
server
- KDC hostname or IP addressport
- KDC server portconnectionProtocol
- the type of connection to useprotected org.apache.directory.kerberos.client.KdcConnection getKdcConnection(org.apache.directory.kerberos.client.KdcConfig config)
config
- KDC connection configurationpublic void setConnectionTimeout(int timeoutSeconds)
timeoutSeconds
- timeout in secondspublic int getConnectionTimeout()
protected int parsePort(String port)
port
- port number stringNumberFormatException
- if given string cannot be parsedIllegalArgumentException
- if given string is null or emptyCopyright © 2022 Apache Software Foundation. All rights reserved.