org.ow2.jonas.lib.management.domain.proxy
Class ConnectorUtils

java.lang.Object
  extended by org.ow2.jonas.lib.management.domain.proxy.ConnectorUtils

public class ConnectorUtils
extends Object

JMX Connector related utility methods.

Author:
Guillaume Sauthier

Method Summary
static JMXConnector getConnector(JMXServiceURL url, String username, String password, org.objectweb.util.monolog.api.Logger logger)
          Create a connector client for the connector server at the given address, and establish connection.
static JMXConnector getConnector(String urlString, String username, String password, org.objectweb.util.monolog.api.Logger logger)
          Create a connector client for the connector server at the given address, and establish connection.
static String getProtocolFromJmxConnectorUrl(String url)
          Extract the protocol from a JMX connector URL.
static String getProviderUrlFromJmxConnectorUrl(String url)
          Get the provider url from a JMX connector URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProtocolFromJmxConnectorUrl

public static String getProtocolFromJmxConnectorUrl(String url)
Extract the protocol from a JMX connector URL.

Parameters:
url - JMX connector url to parse
Returns:
protocol associated with the url

getProviderUrlFromJmxConnectorUrl

public static String getProviderUrlFromJmxConnectorUrl(String url)
Get the provider url from a JMX connector URL.

Parameters:
url - JMX connector url to parse
Returns:
provider url associated with the url

getConnector

public static JMXConnector getConnector(String urlString,
                                        String username,
                                        String password,
                                        org.objectweb.util.monolog.api.Logger logger)
                                 throws IOException,
                                        SecurityException,
                                        MalformedURLException
Create a connector client for the connector server at the given address, and establish connection.

Parameters:
urlString - connector server address
logger - caller provided logger
username - user name (or null)
password - decoded password (or null)
Returns:
created connector if connection established, null otherwise
Throws:
IOException - if the connector client or the connection cannot be made because of a communication problem.
SecurityException - if the connection cannot be made for security reasons.
MalformedURLException

getConnector

public static JMXConnector getConnector(JMXServiceURL url,
                                        String username,
                                        String password,
                                        org.objectweb.util.monolog.api.Logger logger)
                                 throws IOException,
                                        SecurityException
Create a connector client for the connector server at the given address, and establish connection.

Parameters:
url - connector server address
logger - caller provided logger
username - user name (or null)
password - decoded password (or null)
Returns:
created connector if connection established, null otherwise
Throws:
IOException - if the connector client or the connection cannot be made because of a communication problem.
SecurityException - if the connection cannot be made for security reasons.


Copyright © 2010 OW2 Consortium. All Rights Reserved.