org.ow2.jonas.lib.management.extensions.util
Class ConnectorUtils

java.lang.Object
  extended by org.ow2.jonas.lib.management.extensions.util.ConnectorUtils

public class ConnectorUtils
extends Object

JMX Connector related utility methods. TODO The bellow comments are temporary: This is class is based on the org.ow2.lib.management.domain.proxy.ConnectorUtils. The difference is that the present class doesn't use jonas classes any more. The old class will dissapear once the transition of management code to the new management sub-projet will be ended.

Author:
Guillaume Sauthier, Adriana Danes

Method Summary
static JMXConnector getConnector(JMXServiceURL url, String username, String password)
          Create a connector client for the connector server at the given address, and establish connection.
static JMXConnector getConnector(String urlString, String username, String password)
          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

getConnector

public static JMXConnector getConnector(JMXServiceURL url,
                                        String username,
                                        String password)
                                 throws IOException,
                                        SecurityException
Create a connector client for the connector server at the given address, and establish connection. TODO support for IIOP protocol need to be done.

Parameters:
url - connector server address
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.

getConnector

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

Parameters:
urlString - connector server address
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

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


Copyright © 2010 OW2 Consortium. All Rights Reserved.