public abstract class AgentUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AgentUtils.ServerEndpoint
A very simple object that encapsulates server endpoint information that can be used
to connect to a server.
|
| Constructor and Description |
|---|
AgentUtils() |
| Modifier and Type | Method and Description |
|---|---|
static AgentUtils.ServerEndpoint |
getServerEndpoint(AgentConfiguration agentConfig,
String server)
Given a server string with an agent's configuration (used to obtain defaults), this will
return an object that contains information that can be used to communicate with the server
(such as its transport, hostname, port, etc).
|
public static AgentUtils.ServerEndpoint getServerEndpoint(AgentConfiguration agentConfig, String server)
agentConfig is not
provided (i.e. null), it will be ignored - but if the server string does not
contain all the necessary information, this method will throw an exception.
The purpose of this method is to allow users to provide a simpler server hostname string
and just have the agent configuration provide the rest of the information.
But it also allows a user to provide a full server URI in case the server in question
is configured differently than the one the agent is, by default, going to talk to (for
example, if by default the agent talks to its server unencrypted but the server string
identifies a server that requires SSL to be communicated with - in that case, the transports
are different).agentConfig - the configuration of the agent (may be null)server - identifies the server; this may be a full server endpoint URI that has all the
information this method needs, or it may just be a hostname string in which
case the agent configuration will be used to determine the rest of the server
endpoint information (such as the port the server is listening on, the transport
to be used and the transport parameters)IllegalArgumentException - if agentConfig is null
and server is only a hostname string and as such
does not provide everything this method needs. This exception
may also be throw if server is a full, but invalid, URI.Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.