Package com.hp.ucmdb.api
Class UcmdbServiceFactory
java.lang.Object
com.hp.ucmdb.api.UcmdbServiceFactory
Entry point for UCMDB API services.
To obtain a reference to the UCMDB:
1) Get a reference to UcmdbServiceProvider by calling one of the
2) Call one of the UcmdbServiceProvider
To obtain a reference to the UCMDB:
1) Get a reference to UcmdbServiceProvider by calling one of the
getServiceProvider methods.2) Call one of the UcmdbServiceProvider
connect methods.
Example:
final String HOST_NAME = "localhost";
final int PORT = 8080;
UcmdbServiceProvider provider = UcmdbServiceFactory.getServiceProvider(HOST_NAME, PORT);
final String USERNAME = "integration_user";
final String PASSWORD = "integration_password";
Credentials credentials = provider.createCredentials(USERNAME, PASSWORD),
ClientContext clientContext = provider.createClientContext("Example");
UcmdbService ucmdbService = provider.connect(credentials, clientContext);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDisables host name verfication (used in case of NAT networks)static interfaceInternal implementation.static classThe X509TrustManager implementation.static interfaceInternal implementation.static interfaceInternal implementation. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic UcmdbServiceProvidergetLocalFirstServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy) Returns an instance of a UCMDB service provider from local then remote.static UcmdbServiceProvidergetLocalFirstServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy, String apiClientJarFilePath) Parametric polymorphism of above methodstatic PKIXBuilderParametersgetPkixBuilderParameters(KeyStore ts, boolean enableCertRevocationChecking) static UcmdbServiceProvidergetServiceProvider(String host, int port) Returns an instance of a UCMDB service provider from the specified host and port.static UcmdbServiceProvidergetServiceProvider(String protocol, String host, int port) static UcmdbServiceProvidergetServiceProvider(String protocol, String host, int port, String rootContext) Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.static UcmdbServiceProvidergetServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy) Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.static UcmdbServiceProvidergetServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy, SSLContext sslContext) Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.static UcmdbServiceProvidergetServiceProvider(String protocol, String host, int port, String rootContext, SSLContext sslContext) Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.static voidinitSSL()Initializes the secure socket layer.static SSLContextinitSSL(SSLContext sslContext) static Collection<CRL>static StringvalidateFilePath(String filePath)
-
Field Details
-
PKIX_CERT_TYPE
- See Also:
-
CERT_CRL_PATH
- See Also:
-
KEY_STORE_PATH
- See Also:
-
TRUST_STORE_PATH
- See Also:
-
KEY_STORE_PASWORD
- See Also:
-
TRUST_STORE_PASWORD
- See Also:
-
SSL_CHECK_REVOCATION
- See Also:
-
CERTIFICATE_FULL_VALIDATION
- See Also:
-
-
Method Details
-
getClientVersion
-
getServiceProvider
public static UcmdbServiceProvider getServiceProvider(String host, int port) throws MalformedURLException, IncompatibleVersionException Returns an instance of a UCMDB service provider from the specified host and port. The connection is made using HTTP.- Parameters:
host- name of the web server host.port- port the web server listens on. Generally 80 or 8080.- Returns:
- an instance of the service provider.
- Throws:
MalformedURLException- if the host name results in an invalid URL.IncompatibleVersionException- if the version of the client is unsupported by the version running on the server.
-
getServiceProvider
public static UcmdbServiceProvider getServiceProvider(String protocol, String host, int port, String rootContext) throws MalformedURLException, IncompatibleVersionException Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.- Parameters:
protocol- either "http" or "https".host- name of the web server host.port- port the web server listens on. Generally 80 or 8080 for http, 443 for https.- Returns:
- an instance of the service provider.
- Throws:
MalformedURLException- if the host name results in an invalid URL.IncompatibleVersionException- if the version of the client is unsupported by the version running on the server.
-
getLocalFirstServiceProvider
public static UcmdbServiceProvider getLocalFirstServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy) Returns an instance of a UCMDB service provider from local then remote.- Parameters:
protocol- either "http" or "https".host- name of the web server host.port- port the web server listens on. Generally 80 or 8080 for http, 443 for https.- Returns:
- an instance of the service provider.
- Throws:
MalformedURLException- if the host name results in an invalid URL.IncompatibleVersionException- if the version of the client is unsupported by the version running on the server.
-
getLocalFirstServiceProvider
public static UcmdbServiceProvider getLocalFirstServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy, String apiClientJarFilePath) Parametric polymorphism of above method- Parameters:
apiClientJarFilePath- indicates where api client jar file lies.
-
getServiceProvider
public static UcmdbServiceProvider getServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy) throws MalformedURLException Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.- Parameters:
protocol- either "http" or "https".host- name of the web server host.port- port the web server listens on. Generally 80 or 8080 for http, 443 for https.proxy- the Proxy through which this connection will be made.- Returns:
- an instance of the service provider.
- Throws:
MalformedURLException- if the host name results in an invalid URL.IncompatibleVersionException- if the version of the client is unsupported by the version running on the server.
-
getServiceProvider
public static UcmdbServiceProvider getServiceProvider(String protocol, String host, int port, String rootContext, SSLContext sslContext) throws MalformedURLException Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.- Parameters:
protocol- either "http" or "https".host- name of the web server host.port- port the web server listens on. Generally 80 or 8080 for http, 443 for https.sslContext- the Proxy through which this connection will be made.- Returns:
- an instance of the service provider.
- Throws:
MalformedURLException- if the host name results in an invalid URL.IncompatibleVersionException- if the version of the client is unsupported by the version running on the server.
-
getServiceProvider
public static UcmdbServiceProvider getServiceProvider(String protocol, String host, int port, String rootContext, Proxy proxy, SSLContext sslContext) throws MalformedURLException Returns an instance of a UCMDB service provider from the specified host port using the specified protocol.- Parameters:
protocol- either "http" or "https".host- name of the web server host.port- port the web server listens on. Generally 80 or 8080 for http, 443 for https.proxy- the Proxy through which this connection will be made.sslContext- the sslCntext through which this connection will be made.- Returns:
- an instance of the service provider.
- Throws:
MalformedURLException- if the host name results in an invalid URL.IncompatibleVersionException- if the version of the client is unsupported by the version running on the server.
-
getServiceProvider
public static UcmdbServiceProvider getServiceProvider(String protocol, String host, int port) throws MalformedURLException, IncompatibleVersionException -
initSSL
public static void initSSL()Initializes the secure socket layer. -
initSSL
-
getPkixBuilderParameters
public static PKIXBuilderParameters getPkixBuilderParameters(KeyStore ts, boolean enableCertRevocationChecking) throws Exception - Throws:
Exception
-
loadCRL
public static Collection<CRL> loadCRL(List<String> crlPaths) throws IOException, CertificateException, CRLException -
validateFilePath
- Throws:
IOException
-