Methods Summary |
---|
public static com.sun.enterprise.admin.util.JMXConnectorConfig | getJMXConnectorInfo(com.sun.enterprise.config.ConfigContext configContext, java.lang.String nodeAgentName)Returns mbean server connection info for the named node agent.
JmxConnector connector = NodeAgentHelper.getNodeAgentSystemConnector(
configContext, nodeAgentName);
String adminUser = IdentityManager.getUser();
String adminPassword = IdentityManager.getPassword();
ElementProperty hostProp = connector.getElementPropertyByName(HOST_PROPERTY_NAME);
if (adminUser == null || adminPassword == null || hostProp == null) {
throw new ConfigException(_strMgr.getString("missingAgentConnectorAuth", nodeAgentName));
}
return new JMXConnectorConfig(hostProp.getValue(), connector.getPort(),
adminUser, adminPassword, connector.getProtocol());
|
public static com.sun.enterprise.config.serverbeans.NodeAgent | getNodeAgentByName(com.sun.enterprise.config.ConfigContext configContext, java.lang.String agentName)
final Domain domain = getDomainConfigBean(configContext);
final NodeAgent controller = domain.getNodeAgents().getNodeAgentByName(agentName);
if (controller == null) {
throw new ConfigException(_strMgr.getString("noSuchAgent",
agentName));
}
return controller;
|
public static com.sun.enterprise.config.serverbeans.NodeAgent | getNodeAgentForServer(com.sun.enterprise.config.ConfigContext configContext, java.lang.String instanceName)
final Server server = ServerHelper.getServerByName(configContext, instanceName);
final Domain domain = getDomainConfigBean(configContext);
final NodeAgent controller = domain.getNodeAgents().getNodeAgentByName(
server.getNodeAgentRef());
if (controller == null) {
throw new ConfigException(_strMgr.getString("noSuchAgentForInstance",
instanceName, server.getNodeAgentRef()));
}
return controller;
|
public static com.sun.enterprise.config.serverbeans.JmxConnector | getNodeAgentSystemConnector(com.sun.enterprise.config.ConfigContext configContext, java.lang.String agentName)
final NodeAgent controller = getNodeAgentByName(configContext, agentName);
final String systemConnectorName = controller.getSystemJmxConnectorName();
final JmxConnector connector = controller.getJmxConnector();
if (connector == null) {
throw new ConfigException(_strMgr.getString("noAgentSystemConnector", agentName,
systemConnectorName));
}
return connector;
|
public static java.lang.String | getNodeAgentsAsString(com.sun.enterprise.config.serverbeans.NodeAgent[] nas)Returns Node Agents as comma-separated list with each element being name of NA.
Returns an empty String if there are no node-agents in the array passed or
the parameter is null.
String nasas = "";
if (nas != null) {
for (int i = 0 ; i < nas.length ; i++) {
nasas += nas[i].getName();
if (i < nas.length - 1)
nasas += ",";
}
}
return nasas;
|
public static com.sun.enterprise.config.serverbeans.NodeAgent[] | getNodeAgentsForCluster(com.sun.enterprise.config.ConfigContext configContext, java.lang.String clusterName)
final ArrayList result = new ArrayList();
final Server[] servers = ServerHelper.getServersInCluster(configContext, clusterName);
for (int i = 0; i < servers.length; i++) {
NodeAgent controller = getNodeAgentForServer(configContext,
servers[i].getName());
if (!result.contains(controller)) {
result.add(controller);
}
}
return (NodeAgent[])result.toArray(new NodeAgent[result.size()]);
|
public static com.sun.enterprise.config.serverbeans.NodeAgent[] | getNodeAgentsInDomain(com.sun.enterprise.config.ConfigContext configContext)
final Domain domain = getDomainConfigBean(configContext);
NodeAgent[] nas = new NodeAgent[0];
if (domain.getNodeAgents() != null)
nas = domain.getNodeAgents().getNodeAgent();
return nas;
|
public static boolean | hasNodeAgentRendezvousd(com.sun.enterprise.config.ConfigContext configContext, com.sun.enterprise.config.serverbeans.NodeAgent agent)
ElementProperty rendezvousProperty = agent.getElementPropertyByName(
IAdminConstants.RENDEZVOUS_PROPERTY_NAME);
String rendezvous=rendezvousProperty.getValue();
if (rendezvous != null && rendezvousProperty.getValue().equals(Boolean.TRUE.toString())) {
return true;
}
return false;
|
public static boolean | isANodeAgent(com.sun.enterprise.config.ConfigContext configContext, java.lang.String agentName)
final Domain domain = getDomainConfigBean(configContext);
final NodeAgents controllers = domain.getNodeAgents();
if (controllers == null) {
return false;
}
final NodeAgent controller = controllers.getNodeAgentByName(agentName);
return (controller != null ? true : false);
|