Sblim CIM-Client is a WBEM service client that is widely used in the domain of system configuration management. In order to meet the standard JSR48 specification, the Sblim CIM Client 2.x version was launched last year, and the original 1.x version will only be maintained. The new version of the software, while we bring new features and new features, but also to users of the methods put forward some new requirements. Some requirements are obvious, while others are less obvious.
Sblim Client Overview
Sblim CIM Client is a JAVA-implemented WBEM service client, typically at the top of the CIM structure, as shown in Figure 1. Because of its open source, simple and easy to use and other characteristics, is widely used in a variety of cim/smis based management software. Users can easily process and communicate with the CIM server, regardless of the encapsulation and parsing of CIM messages, thus focusing on the development of business logic. At the same time, Sblim CIM Client provides a wealth of configuration features that allow users to customize connection pooling, security, XML parsing, logging, and so on.
In order to conform to the standard JSR48 specification, Sblim CIM Client launched the 2.x version last December. The new version of the API does not post-compatibility with the 1.x API. All of the examples in this article will take the 2.1.x version, which is based on JAVA 1.5. In the new Sblim client, the configuration and initialization of clients, query results container, CIM events and other characteristics have a certain degree of change, more in line with the use of habits.
Figure 1. Common structure of CIM programs
Configuring and Initializing Clients
The Sblim CIM Client 2.x version introduces a new client configuration and initialization process. The new standard rejects the use of client-side standard class cimclient and replaces the client interface wbemclient, which enriches the definition of some of these methods, but all of these exposed methods do not have backward compatibility, so users have to modify their original code for this.
Wbemclient initialization is done through a factory class Wbemclientfactory, which provides wbemclient with an implementation of a particular protocol, and here's how to use a simple instance of the factory class, where the user simply calls the static function Getclient (), and named the specific use of the agreement can be.
Listing 1. Factory class Wbemclientfactory Create Wbemclient sample
WBEMClient cc = null;
try {
cc = WBEMClientFactory.getClient("CIM-XML");
} catch (Exception e) {
System.out.println("Received error when trying to retrieve client handle");
System.exit(-1);
}
cc.initialize(cns, s, null);