Class ControlPanel
- Author:
- Christopher Mindus
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionstatic void
Sorts and displays the system properties.static boolean
Checks the setting for HTTPS host name verification.static InetAddress[]
getAllByName
(String host, boolean isVerbose) Given the name of a host, returns an array of its IP addresses, based on the configured name service on the system.static InetAddress
Determines the IP address of a host, given the host's name.static HashSet<X509Certificate>[]
getCertificates
(boolean isVerbose) Loads the certificates: CA, JSSE and Trusted Certificates (Code Signing).static String[]
Gets the file name for the System Client Certificates keystore.static KeyManager[]
getDeploymentClientCertificates
(ICertificateUI callback, boolean isVerbose) Gets the array of client certificates from deployment information.static String
Gets the "WHO" string with certificate validity and issuer.static String
Formats a Principal entry.static byte[]
getIPv4Address
(String name) Gets the IPv4 byte address.getProxies
(URL url, ArrayList<Proxy> cmdLineProxies, boolean isVerbose) Gets the proxies to use for a particular host URL.static String
getTS()
Gets a timestamp string.static boolean
initDeployData
(boolean isVerbose) Initializes the control panel to load the deployment data.static boolean
isLocalAddress
(String host, boolean isVerbose) Checks if it's a local (intranet) host address.static boolean
isLocalhost
(String name) Check if it's localhost.static void
readSystemProxies
(boolean isApplet, boolean isVerbose) Get a fresh list of the proxies defined.static boolean
Checks if system proxies are used by default.
Constructor Details
ControlPanel
public ControlPanel()
Method Details
getIPv4Address
Gets the IPv4 byte address.- Returns:
- null if not number address.
isLocalhost
Check if it's localhost.useSystemProxies
public static boolean useSystemProxies()Checks if system proxies are used by default.doVerifyServerHostName
public static boolean doVerifyServerHostName()Checks the setting for HTTPS host name verification.- Returns:
- true if the server host name should be checked, false otherwise.
displaySystemProperties
public static void displaySystemProperties()Sorts and displays the system properties.initDeployData
public static boolean initDeployData(boolean isVerbose) Initializes the control panel to load the deployment data.- Parameters:
isVerbose
- Flag to display verbose output.- Returns:
- true for success, false for failure.
readSystemProxies
public static void readSystemProxies(boolean isApplet, boolean isVerbose) Get a fresh list of the proxies defined.getProxies
public static ArrayList<Proxy> getProxies(URL url, ArrayList<Proxy> cmdLineProxies, boolean isVerbose) Gets the proxies to use for a particular host URL.getTS
Gets a timestamp string.getByName
Determines the IP address of a host, given the host's name.The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.
If the host is null then an InetAddress representing an address of the loop-back interface is returned.
- Parameters:
host
- The specified host, or null.isVerbose
- Verbose output flag.- Returns:
- An IP address for the given host name.
- Throws:
UnknownHostException
- if no IP address for the host could be found, or if a scope_id was specified for a global IPv6 address.
getAllByName
public static InetAddress[] getAllByName(String host, boolean isVerbose) throws UnknownHostException Given the name of a host, returns an array of its IP addresses, based on the configured name service on the system.The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.
For host specified in literal IPv6 address, either the form defined in RFC 2732 or the literal IPv6 address format defined in RFC 2373 is accepted. A literal IPv6 address may also be qualified by appending a scoped zone identifier or scope_id.
If the host is null then an InetAddress representing an address of the loop-back interface is returned.
- Parameters:
host
- host - the name of the host, or null.isVerbose
- Verbose output flag.- Returns:
- An array of all the IP addresses for a given host name.
- Throws:
UnknownHostException
- if no IP address for the host could be found, or if a scope_id was specified for a global IPv6 address.
isLocalAddress
Checks if it's a local (intranet) host address.- Parameters:
host
- The host name.isVerbose
- Verbose output flag.- Returns:
- true if local intranet host address, false otherwise.
getCertificates
Loads the certificates: CA, JSSE and Trusted Certificates (Code Signing). This method can only be called once the methodinitDeployData()
has been called.- Returns:
- An array of 3
ArrayList<X509Certificate>
. The first list contains the CA certificates, the second, the JSSE trusted certificates, and the third the Trusted (code signing) certificates.
getClientCertificatesKeystoreFileNames
Gets the file name for the System Client Certificates keystore. This method can only be called once the methodinitDeployData()
has been called.- Returns:
- The file names for the KeyStore's of System and User, array size of 2. Note: the file might not exist.
getDescription
Formats a Principal entry.getDescription
Gets the "WHO" string with certificate validity and issuer.getDeploymentClientCertificates
public static KeyManager[] getDeploymentClientCertificates(ICertificateUI callback, boolean isVerbose) Gets the array of client certificates from deployment information.