group(3): timezone offset... in minutes (sigh)
- */
- private static final Pattern CIM_DATETIME_PATTERN = Pattern
- .compile("^([0-9]{14})(?:\\.([0-9]{3,6}))?([+-][0-9]{3})$");
-
- /**
- * Convert a String holding a CIM_DATETIME (i.e. a string in the form of
- * yyyymmddHHMMSS.mmmmmmsUUU) to an OffsetDateTime object
- *
- * @param stringValue String value with a CIM_DATETIME
- * @return OffsetDateTime instance
- */
- public static OffsetDateTime convertCimDateTime(final String stringValue) {
-
- if (stringValue == null) {
- return null;
- }
-
- final Matcher dateTimeMatcher = CIM_DATETIME_PATTERN.matcher(stringValue);
- if (!dateTimeMatcher.find()) {
- throw new IllegalArgumentException("Not a valid CIM_DATETIME value: " + stringValue);
- }
-
- // LocalDateTime
- final LocalDateTime localDateTime = LocalDateTime.parse(dateTimeMatcher.group(1), WBEM_CIM_DATETIME_FORMATTER);
-
- // Note: we're not taking the milliseconds and microseconds into account from
- // group(2)
-
- // Zone Offset
- final String zoneOffset = dateTimeMatcher.group(3);
- if (zoneOffset == null) {
- throw new IllegalStateException(
- "Unable to get the timezone offset from CIM_DATETIME value: " + stringValue);
- }
- final int secondsOffset = Integer.parseInt(zoneOffset) * 60;
- final ZoneOffset offset = ZoneOffset.ofTotalSeconds(secondsOffset);
-
- return OffsetDateTime.of(localDateTime, offset);
- }
-
-}
+package org.metricshub.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Utils {
+
+ /**
+ * Check if the required argument is not null.
+ *
+ * @param argument
+ * @param name
+ * @throws IllegalArgumentException if the argument is null
+ */
+ public static void checkNonNull(final T argument, final String name) {
+ if (argument == null) {
+ throw new IllegalArgumentException(name + " must not be null.");
+ }
+ }
+
+ /**
+ * Default separator for array values
+ */
+ public static final String DEFAULT_ARRAY_SEPARATOR = "|";
+
+ public static final String EMPTY = "";
+
+ /**
+ * Formatter/Parser of the first part of CIM_DATETIME
+ */
+ public static final DateTimeFormatter WBEM_CIM_DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+
+ /**
+ * Regex that matches with a CIM_DATETIME string format See
+ * https://docs.microsoft.com/en-us/windows/win32/wmisdk/cim-datetime
+ *
+ *
group(1): yyyymmddHHMMSS
+ *
group(2): optional fraction of seconds
+ *
group(3): timezone offset... in minutes (sigh)
+ */
+ private static final Pattern CIM_DATETIME_PATTERN = Pattern
+ .compile("^([0-9]{14})(?:\\.([0-9]{3,6}))?([+-][0-9]{3})$");
+
+ /**
+ * Convert a String holding a CIM_DATETIME (i.e. a string in the form of
+ * yyyymmddHHMMSS.mmmmmmsUUU) to an OffsetDateTime object
+ *
+ * @param stringValue String value with a CIM_DATETIME
+ * @return OffsetDateTime instance
+ */
+ public static OffsetDateTime convertCimDateTime(final String stringValue) {
+
+ if (stringValue == null) {
+ return null;
+ }
+
+ final Matcher dateTimeMatcher = CIM_DATETIME_PATTERN.matcher(stringValue);
+ if (!dateTimeMatcher.find()) {
+ throw new IllegalArgumentException("Not a valid CIM_DATETIME value: " + stringValue);
+ }
+
+ // LocalDateTime
+ final LocalDateTime localDateTime = LocalDateTime.parse(dateTimeMatcher.group(1), WBEM_CIM_DATETIME_FORMATTER);
+
+ // Note: we're not taking the milliseconds and microseconds into account from
+ // group(2)
+
+ // Zone Offset
+ final String zoneOffset = dateTimeMatcher.group(3);
+ if (zoneOffset == null) {
+ throw new IllegalStateException(
+ "Unable to get the timezone offset from CIM_DATETIME value: " + stringValue);
+ }
+ final int secondsOffset = Integer.parseInt(zoneOffset) * 60;
+ final ZoneOffset offset = ZoneOffset.ofTotalSeconds(secondsOffset);
+
+ return OffsetDateTime.of(localDateTime, offset);
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/client/WbemCimDataHandler.java b/src/main/java/org/metricshub/wbem/client/WbemCimDataHandler.java
similarity index 81%
rename from src/main/java/org/sentrysoftware/wbem/client/WbemCimDataHandler.java
rename to src/main/java/org/metricshub/wbem/client/WbemCimDataHandler.java
index e97dfc3..538e136 100644
--- a/src/main/java/org/sentrysoftware/wbem/client/WbemCimDataHandler.java
+++ b/src/main/java/org/metricshub/wbem/client/WbemCimDataHandler.java
@@ -1,185 +1,183 @@
-package org.sentrysoftware.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.sentrysoftware.wbem.javax.cim.CIMDataType;
-import org.sentrysoftware.wbem.javax.cim.CIMDateTimeAbsolute;
-import org.sentrysoftware.wbem.javax.cim.CIMDateTimeInterval;
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-import org.sentrysoftware.wbem.javax.cim.CIMProperty;
-
-/**
- * Handler for CIMProperty conversion to string.
- *
- */
-public class WbemCimDataHandler {
-
- private WbemCimDataHandler() { }
-
- public static final String PATH_PROPERTY = "__Path";
-
- private static final Map> CONVERT_MAP;
- static {
- final Map> map = new HashMap<>();
- map.put(CIMDataType.STRING, String::valueOf);
- map.put(CIMDataType.BOOLEAN, String::valueOf);
- map.put(CIMDataType.SINT8, String::valueOf);
- map.put(CIMDataType.SINT16, String::valueOf);
- map.put(CIMDataType.SINT32, String::valueOf);
- map.put(CIMDataType.SINT64, String::valueOf);
- map.put(CIMDataType.CHAR16, String::valueOf);
- map.put(CIMDataType.REAL32, String::valueOf);
- map.put(CIMDataType.REAL64, String::valueOf);
- map.put(CIMDataType.OBJECT, String::valueOf);
- map.put(CIMDataType.DATETIME, WbemCimDataHandler::convertDateTime);
- map.put(CIMDataType.UINT8, String::valueOf);
- map.put(CIMDataType.UINT16, String::valueOf);
- map.put(CIMDataType.UINT32, String::valueOf);
- map.put(CIMDataType.UINT64, String::valueOf);
- map.put(CIMDataType.REFERENCE, WbemCimDataHandler::convertReference);
- CONVERT_MAP = Collections.unmodifiableMap(map);
- }
-
- /**
- * Get the value of the CIM property.
- *
- * @param property The property name.
- * @param cimInstance The CIM instance.
- * @param arraySeparator The array separator value. default value '|'
- * @return
- */
- public static String getCimPropertyAsString(
- final String property,
- final CIMInstance cimInstance,
- final String arraySeparator) {
- Utils.checkNonNull(property, "property");
- Utils.checkNonNull(cimInstance, "cimInstance");
-
- if (PATH_PROPERTY.equalsIgnoreCase(property)) {
- final CIMObjectPath objectPath = cimInstance.getObjectPath();
- Utils.checkNonNull(objectPath, "objectPath");
- return convertReference(objectPath);
- }
-
- // first check getProperty
- CIMProperty> cimProperty = cimInstance.getProperty(property);
-
- // then, if null, check getKeys
- final String separator = arraySeparator == null? Utils.DEFAULT_ARRAY_SEPARATOR : arraySeparator;
- if (cimProperty == null && cimInstance.getKeys() != null) {
- return Stream.of(cimInstance.getKeys())
- .filter(key -> key.getName() != null && key.getName().equalsIgnoreCase(property))
- .findFirst()
- .map(cp -> convertCimPropertyValue(cp, separator))
- .orElse(Utils.EMPTY);
- }
-
- return cimProperty == null ?
- Utils.EMPTY : convertCimPropertyValue(cimProperty, separator);
- }
-
- /**
- * Convert the CIM property value into a String.
- *
- * @param cimProperty The CIM property.
- * @param arraySeparator The array separator value.
- * @return
- */
- private static String convertCimPropertyValue(
- final CIMProperty> cimProperty,
- final String arraySeparator) {
- final Object cimPropertyValue = cimProperty.getValue();
- if (cimPropertyValue == null) {
- return Utils.EMPTY;
- }
-
- final CIMDataType dataType = cimProperty.getDataType();
- if (dataType == null) {
- return cimPropertyValue.toString();
- }
-
- return dataType.isArray() ?
- convertArray(cimProperty, arraySeparator) :
- CONVERT_MAP.getOrDefault(dataType.getType(), Object::toString).apply(cimPropertyValue);
- }
-
- /**
- * Convert a CIM property value array.
- *
- * @param cimProperty The CIM property.
- * @param arraySeparator The array separator value.
- * @return
- */
- private static String convertArray(
- final CIMProperty> cimProperty,
- final String arraySeparator) {
- return Arrays.stream((Object[]) cimProperty.getValue())
- .map(obj -> (obj == null) ? Utils.EMPTY : CONVERT_MAP.getOrDefault(cimProperty.getDataType().getType(), Object::toString).apply(obj))
- .collect(Collectors.joining(arraySeparator, Utils.EMPTY, arraySeparator));
- }
-
- /**
- * Convert a CIMObjectPath reference to string:
- *
take the part after ':'
- *
escape back slash
- *
escape double quotes
- *
- * @param cimPropertyValue
- * @return
- */
- private static String convertReference(final Object cimPropertyValue) {
- final CIMObjectPath objectPath = (CIMObjectPath) cimPropertyValue;
- final String str = objectPath.toString();
- return str
- .substring(str.indexOf(':') + 1) // take the part after : (if exists)
- .replace("\\\\", "\\") // Replace \\ by \
- .replace("\\\"", "\""); // Replace \" by "
- }
-
- /**
- * Convert a CIMDateTime into a string containing to Epoch time milliseconds.
- *
- * @param cimPropertyValue
- * @return
- */
- private static String convertDateTime(final Object cimPropertyValue) {
- if (cimPropertyValue == null) {
- return Utils.EMPTY;
- }
-
- if (cimPropertyValue instanceof CIMDateTimeAbsolute) {
- final String dateTimeString = ((CIMDateTimeAbsolute) cimPropertyValue).getDateTimeString();
- return String.valueOf(Utils.convertCimDateTime(dateTimeString).toInstant().toEpochMilli());
- }
- return String.valueOf(((CIMDateTimeInterval) cimPropertyValue).getTotalMilliseconds());
- }
-}
+package org.metricshub.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.metricshub.wbem.javax.cim.CIMDataType;
+import org.metricshub.wbem.javax.cim.CIMDateTimeAbsolute;
+import org.metricshub.wbem.javax.cim.CIMDateTimeInterval;
+import org.metricshub.wbem.javax.cim.CIMInstance;
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.javax.cim.CIMProperty;
+
+/**
+ * Handler for CIMProperty conversion to string.
+ *
+ */
+public class WbemCimDataHandler {
+
+ private WbemCimDataHandler() { }
+
+ public static final String PATH_PROPERTY = "__Path";
+
+ private static final Map> CONVERT_MAP;
+ static {
+ final Map> map = new HashMap<>();
+ map.put(CIMDataType.STRING, String::valueOf);
+ map.put(CIMDataType.BOOLEAN, String::valueOf);
+ map.put(CIMDataType.SINT8, String::valueOf);
+ map.put(CIMDataType.SINT16, String::valueOf);
+ map.put(CIMDataType.SINT32, String::valueOf);
+ map.put(CIMDataType.SINT64, String::valueOf);
+ map.put(CIMDataType.CHAR16, String::valueOf);
+ map.put(CIMDataType.REAL32, String::valueOf);
+ map.put(CIMDataType.REAL64, String::valueOf);
+ map.put(CIMDataType.OBJECT, String::valueOf);
+ map.put(CIMDataType.DATETIME, WbemCimDataHandler::convertDateTime);
+ map.put(CIMDataType.UINT8, String::valueOf);
+ map.put(CIMDataType.UINT16, String::valueOf);
+ map.put(CIMDataType.UINT32, String::valueOf);
+ map.put(CIMDataType.UINT64, String::valueOf);
+ map.put(CIMDataType.REFERENCE, WbemCimDataHandler::convertReference);
+ CONVERT_MAP = Collections.unmodifiableMap(map);
+ }
+
+ /**
+ * Get the value of the CIM property.
+ *
+ * @param property The property name.
+ * @param cimInstance The CIM instance.
+ * @param arraySeparator The array separator value. default value '|'
+ * @return
+ */
+ public static String getCimPropertyAsString(
+ final String property,
+ final CIMInstance cimInstance,
+ final String arraySeparator) {
+ Utils.checkNonNull(property, "property");
+ Utils.checkNonNull(cimInstance, "cimInstance");
+
+ if (PATH_PROPERTY.equalsIgnoreCase(property)) {
+ final CIMObjectPath objectPath = cimInstance.getObjectPath();
+ Utils.checkNonNull(objectPath, "objectPath");
+ return convertReference(objectPath);
+ }
+
+ // first check getProperty
+ CIMProperty> cimProperty = cimInstance.getProperty(property);
+
+ // then, if null, check getKeys
+ final String separator = arraySeparator == null? Utils.DEFAULT_ARRAY_SEPARATOR : arraySeparator;
+ if (cimProperty == null && cimInstance.getKeys() != null) {
+ return Stream.of(cimInstance.getKeys())
+ .filter(key -> key.getName() != null && key.getName().equalsIgnoreCase(property))
+ .findFirst()
+ .map(cp -> convertCimPropertyValue(cp, separator))
+ .orElse(Utils.EMPTY);
+ }
+
+ return cimProperty == null ?
+ Utils.EMPTY : convertCimPropertyValue(cimProperty, separator);
+ }
+
+ /**
+ * Convert the CIM property value into a String.
+ *
+ * @param cimProperty The CIM property.
+ * @param arraySeparator The array separator value.
+ * @return
+ */
+ private static String convertCimPropertyValue(
+ final CIMProperty> cimProperty,
+ final String arraySeparator) {
+ final Object cimPropertyValue = cimProperty.getValue();
+ if (cimPropertyValue == null) {
+ return Utils.EMPTY;
+ }
+
+ final CIMDataType dataType = cimProperty.getDataType();
+ if (dataType == null) {
+ return cimPropertyValue.toString();
+ }
+
+ return dataType.isArray() ?
+ convertArray(cimProperty, arraySeparator) :
+ CONVERT_MAP.getOrDefault(dataType.getType(), Object::toString).apply(cimPropertyValue);
+ }
+
+ /**
+ * Convert a CIM property value array.
+ *
+ * @param cimProperty The CIM property.
+ * @param arraySeparator The array separator value.
+ * @return
+ */
+ private static String convertArray(
+ final CIMProperty> cimProperty,
+ final String arraySeparator) {
+ return Arrays.stream((Object[]) cimProperty.getValue())
+ .map(obj -> (obj == null) ? Utils.EMPTY : CONVERT_MAP.getOrDefault(cimProperty.getDataType().getType(), Object::toString).apply(obj))
+ .collect(Collectors.joining(arraySeparator, Utils.EMPTY, arraySeparator));
+ }
+
+ /**
+ * Convert a CIMObjectPath reference to string:
+ *
take the part after ':'
+ *
escape back slash
+ *
escape double quotes
+ *
+ * @param cimPropertyValue
+ * @return
+ */
+ private static String convertReference(final Object cimPropertyValue) {
+ final CIMObjectPath objectPath = (CIMObjectPath) cimPropertyValue;
+ final String str = objectPath.toString();
+ return str
+ .substring(str.indexOf(':') + 1) // take the part after : (if exists)
+ .replace("\\\\", "\\") // Replace \\ by \
+ .replace("\\\"", "\""); // Replace \" by "
+ }
+
+ /**
+ * Convert a CIMDateTime into a string containing to Epoch time milliseconds.
+ *
+ * @param cimPropertyValue
+ * @return
+ */
+ private static String convertDateTime(final Object cimPropertyValue) {
+ if (cimPropertyValue == null) {
+ return Utils.EMPTY;
+ }
+
+ if (cimPropertyValue instanceof CIMDateTimeAbsolute) {
+ final String dateTimeString = ((CIMDateTimeAbsolute) cimPropertyValue).getDateTimeString();
+ return String.valueOf(Utils.convertCimDateTime(dateTimeString).toInstant().toEpochMilli());
+ }
+ return String.valueOf(((CIMDateTimeInterval) cimPropertyValue).getTotalMilliseconds());
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/client/WbemClient.java b/src/main/java/org/metricshub/wbem/client/WbemClient.java
similarity index 76%
rename from src/main/java/org/sentrysoftware/wbem/client/WbemClient.java
rename to src/main/java/org/metricshub/wbem/client/WbemClient.java
index 6dfbdd7..1ed9248 100644
--- a/src/main/java/org/sentrysoftware/wbem/client/WbemClient.java
+++ b/src/main/java/org/metricshub/wbem/client/WbemClient.java
@@ -1,229 +1,227 @@
-package org.sentrysoftware.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.security.auth.Subject;
-
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-import org.sentrysoftware.wbem.javax.cim.CIMProperty;
-import org.sentrysoftware.wbem.javax.wbem.CloseableIterator;
-import org.sentrysoftware.wbem.javax.wbem.WBEMException;
-import org.sentrysoftware.wbem.javax.wbem.client.EnumerateResponse;
-import org.sentrysoftware.wbem.javax.wbem.client.PasswordCredential;
-import org.sentrysoftware.wbem.javax.wbem.client.UserPrincipal;
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClient;
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClientConstants;
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClientFactory;
-
-/**
- * Matsya WBEM client for query execution.
- *
- */
-public class WbemClient implements AutoCloseable {
-
- private static final Locale[] FIXED_AVAILABLE_LOCALES_ARRAY = {Locale.ENGLISH};
-
- private WBEMClient client;
-
- private CloseableIterator iterator;
-
- /**
- * Connect to WBEM client.
- *
- * @param url
- * @param username
- * @param password
- * @param timeout
- * @throws WBEMException
- */
- public void connect(
- final URL url,
- final String username,
- final char[] password,
- int timeout) throws WBEMException {
-
- Utils.checkNonNull(url, "url");
- Utils.checkNonNull(username, "username");
- Utils.checkNonNull(password, "password");
-
- final CIMObjectPath cimObjectPath = new CIMObjectPath(
- url.getProtocol(),
- url.getHost(),
- String.valueOf(url.getPort()),
- null,
- null,
- null);
-
- final Subject subject = new Subject();
- subject.getPrincipals().add(new UserPrincipal(username));
- subject.getPrivateCredentials().add(new PasswordCredential(password));
-
- // Create and initialize a WBEM client.
- client = WBEMClientFactory.getClient("CIM-XML");
- client.setProperty(WBEMClientConstants.PROP_TIMEOUT, String.valueOf(timeout));
- client.initialize(cimObjectPath, subject, FIXED_AVAILABLE_LOCALES_ARRAY);
- }
-
- @Override
- public void close() {
- if (iterator != null) {
- iterator.close();
- }
-
- if (client != null) {
- client.close();
- }
- }
-
- /**
- * Execute a WQL query on remote.
- * @param wqlQuery The query handler.
- * @param namespace The WBEM namespace.
- * @param arraySeparator The array separator value. default value '|'
- * @return
- * @throws WBEMException
- */
- public WbemQueryResult executeWql(
- final WqlQuery wqlQuery,
- final String namespace,
- final String arraySeparator) throws WBEMException {
-
- Utils.checkNonNull(wqlQuery, "wqlQuery");
- Utils.checkNonNull(namespace, "namespace");
-
- if (client == null) {
- throw new IllegalStateException("client must be connected first.");
- }
-
- iterator = client.enumerateInstances(
- new CIMObjectPath(null, null, null, namespace, wqlQuery.getClassName(), null),
- true,
- false,
- true,
- wqlQuery.getPropertiesArray());
-
- return enumerateInstances(wqlQuery, iterator, arraySeparator);
- }
-
- /**
- * Get associators.
- * @param wqlQuery The query handler.
- * @param objectPathAssociators The object path for ASSOCIATORS.
- * @param arraySeparator The array separator value. default value '|'
- * @return
- * @throws WBEMException
- */
- public WbemQueryResult getAssociators(
- final WqlQuery wqlQuery,
- final String objectPathAssociators,
- final String arraySeparator) throws WBEMException {
-
- Utils.checkNonNull(wqlQuery, "wqlQuery");
- Utils.checkNonNull(objectPathAssociators, "objectPathAssociators");
-
- if (client == null) {
- throw new IllegalStateException("client must be connected first.");
- }
-
- final EnumerateResponse response = client.associators(
- new CIMObjectPath(objectPathAssociators),
- wqlQuery.getClassName(),
- null,
- null,
- null,
- false,
- wqlQuery.getPropertiesArray(),
- null,
- null,
- null,
- false,
- null);
- iterator = response.getResponses();
-
- return enumerateInstances(wqlQuery, iterator, arraySeparator);
- }
-
- public static WbemQueryResult enumerateInstances(
- final WqlQuery wqlQuery,
- final CloseableIterator iterator,
- final String arraySeparator) {
- if (iterator == null) {
- return new WbemQueryResult(new ArrayList<>(), new ArrayList<>());
- }
-
- Set properties = null;
- List originalProperties = null;
- final List> values = new ArrayList<>();
-
- while (iterator.hasNext()) {
- final CIMInstance cimInstance = iterator.next();
-
- if (properties == null) {
- properties =
- wqlQuery.getProperties().isEmpty() ?
- Stream.of(cimInstance.getProperties())
- .map(CIMProperty::getName)
- .collect(Collectors.toCollection(LinkedHashSet::new)) :
- wqlQuery.getProperties();
- }
-
- if (originalProperties == null) {
- originalProperties = wqlQuery.hasDuplicateProperties() ?
- wqlQuery.getOriginalProperties() :
- properties.stream().collect(Collectors.toList());
- }
-
- final List row;
- if (wqlQuery.hasDuplicateProperties()) {
-
- final Map cimProperties = properties.stream().collect(Collectors.toMap(
- String::toLowerCase,
- property -> WbemCimDataHandler.getCimPropertyAsString(property, cimInstance, arraySeparator)));
-
- row = originalProperties.stream()
- .map(property -> cimProperties.get(property.toLowerCase()))
- .collect(Collectors.toList());
-
- } else {
- row = properties.stream()
- .map(property -> WbemCimDataHandler.getCimPropertyAsString(property, cimInstance, arraySeparator))
- .collect(Collectors.toList());
- }
-
- values.add(row);
- }
-
- return new WbemQueryResult(originalProperties, values);
- }
-}
+package org.metricshub.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.security.auth.Subject;
+
+import org.metricshub.wbem.javax.cim.CIMInstance;
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.javax.wbem.CloseableIterator;
+import org.metricshub.wbem.javax.wbem.WBEMException;
+import org.metricshub.wbem.javax.wbem.client.EnumerateResponse;
+import org.metricshub.wbem.javax.wbem.client.PasswordCredential;
+import org.metricshub.wbem.javax.wbem.client.UserPrincipal;
+import org.metricshub.wbem.javax.wbem.client.WBEMClient;
+import org.metricshub.wbem.javax.wbem.client.WBEMClientConstants;
+import org.metricshub.wbem.javax.wbem.client.WBEMClientFactory;
+import org.metricshub.wbem.javax.cim.CIMProperty;
+
+/**
+ * Matsya WBEM client for query execution.
+ *
+ */
+public class WbemClient implements AutoCloseable {
+
+ private static final Locale[] FIXED_AVAILABLE_LOCALES_ARRAY = {Locale.ENGLISH};
+
+ private WBEMClient client;
+
+ private CloseableIterator iterator;
+
+ /**
+ * Connect to WBEM client.
+ *
+ * @param url
+ * @param username
+ * @param password
+ * @param timeout
+ * @throws WBEMException
+ */
+ public void connect(
+ final URL url,
+ final String username,
+ final char[] password,
+ int timeout) throws WBEMException {
+
+ Utils.checkNonNull(url, "url");
+ Utils.checkNonNull(username, "username");
+ Utils.checkNonNull(password, "password");
+
+ final CIMObjectPath cimObjectPath = new CIMObjectPath(
+ url.getProtocol(),
+ url.getHost(),
+ String.valueOf(url.getPort()),
+ null,
+ null,
+ null);
+
+ final Subject subject = new Subject();
+ subject.getPrincipals().add(new UserPrincipal(username));
+ subject.getPrivateCredentials().add(new PasswordCredential(password));
+
+ // Create and initialize a WBEM client.
+ client = WBEMClientFactory.getClient("CIM-XML");
+ client.setProperty(WBEMClientConstants.PROP_TIMEOUT, String.valueOf(timeout));
+ client.initialize(cimObjectPath, subject, FIXED_AVAILABLE_LOCALES_ARRAY);
+ }
+
+ @Override
+ public void close() {
+ if (iterator != null) {
+ iterator.close();
+ }
+
+ if (client != null) {
+ client.close();
+ }
+ }
+
+ /**
+ * Execute a WQL query on remote.
+ * @param wqlQuery The query handler.
+ * @param namespace The WBEM namespace.
+ * @param arraySeparator The array separator value. default value '|'
+ * @return
+ * @throws WBEMException
+ */
+ public WbemQueryResult executeWql(
+ final WqlQuery wqlQuery,
+ final String namespace,
+ final String arraySeparator) throws WBEMException {
+
+ Utils.checkNonNull(wqlQuery, "wqlQuery");
+ Utils.checkNonNull(namespace, "namespace");
+
+ if (client == null) {
+ throw new IllegalStateException("client must be connected first.");
+ }
+
+ iterator = client.enumerateInstances(
+ new CIMObjectPath(null, null, null, namespace, wqlQuery.getClassName(), null),
+ true,
+ false,
+ true,
+ wqlQuery.getPropertiesArray());
+
+ return enumerateInstances(wqlQuery, iterator, arraySeparator);
+ }
+
+ /**
+ * Get associators.
+ * @param wqlQuery The query handler.
+ * @param objectPathAssociators The object path for ASSOCIATORS.
+ * @param arraySeparator The array separator value. default value '|'
+ * @return
+ * @throws WBEMException
+ */
+ public WbemQueryResult getAssociators(
+ final WqlQuery wqlQuery,
+ final String objectPathAssociators,
+ final String arraySeparator) throws WBEMException {
+
+ Utils.checkNonNull(wqlQuery, "wqlQuery");
+ Utils.checkNonNull(objectPathAssociators, "objectPathAssociators");
+
+ if (client == null) {
+ throw new IllegalStateException("client must be connected first.");
+ }
+
+ final EnumerateResponse response = client.associators(
+ new CIMObjectPath(objectPathAssociators),
+ wqlQuery.getClassName(),
+ null,
+ null,
+ null,
+ false,
+ wqlQuery.getPropertiesArray(),
+ null,
+ null,
+ null,
+ false,
+ null);
+ iterator = response.getResponses();
+
+ return enumerateInstances(wqlQuery, iterator, arraySeparator);
+ }
+
+ public static WbemQueryResult enumerateInstances(
+ final WqlQuery wqlQuery,
+ final CloseableIterator iterator,
+ final String arraySeparator) {
+ if (iterator == null) {
+ return new WbemQueryResult(new ArrayList<>(), new ArrayList<>());
+ }
+
+ Set properties = null;
+ List originalProperties = null;
+ final List> values = new ArrayList<>();
+
+ while (iterator.hasNext()) {
+ final CIMInstance cimInstance = iterator.next();
+
+ if (properties == null) {
+ properties =
+ wqlQuery.getProperties().isEmpty() ?
+ Stream.of(cimInstance.getProperties())
+ .map(CIMProperty::getName)
+ .collect(Collectors.toCollection(LinkedHashSet::new)) :
+ wqlQuery.getProperties();
+ }
+
+ if (originalProperties == null) {
+ originalProperties = wqlQuery.hasDuplicateProperties() ?
+ wqlQuery.getOriginalProperties() :
+ properties.stream().collect(Collectors.toList());
+ }
+
+ final List row;
+ if (wqlQuery.hasDuplicateProperties()) {
+
+ final Map cimProperties = properties.stream().collect(Collectors.toMap(
+ String::toLowerCase,
+ property -> WbemCimDataHandler.getCimPropertyAsString(property, cimInstance, arraySeparator)));
+
+ row = originalProperties.stream()
+ .map(property -> cimProperties.get(property.toLowerCase()))
+ .collect(Collectors.toList());
+
+ } else {
+ row = properties.stream()
+ .map(property -> WbemCimDataHandler.getCimPropertyAsString(property, cimInstance, arraySeparator))
+ .collect(Collectors.toList());
+ }
+
+ values.add(row);
+ }
+
+ return new WbemQueryResult(originalProperties, values);
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/client/WbemExecutor.java b/src/main/java/org/metricshub/wbem/client/WbemExecutor.java
similarity index 81%
rename from src/main/java/org/sentrysoftware/wbem/client/WbemExecutor.java
rename to src/main/java/org/metricshub/wbem/client/WbemExecutor.java
index b9212d9..08014b8 100644
--- a/src/main/java/org/sentrysoftware/wbem/client/WbemExecutor.java
+++ b/src/main/java/org/metricshub/wbem/client/WbemExecutor.java
@@ -1,194 +1,192 @@
-package org.sentrysoftware.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.net.URL;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.sentrysoftware.wbem.client.exceptions.WqlQuerySyntaxException;
-import org.sentrysoftware.wbem.javax.wbem.WBEMException;
-
-/**
- * Functions to execute WBEM query.
- *
- */
-public class WbemExecutor {
-
- private WbemExecutor() { }
-
- /**
- * Execute a WBEM query on remote.
- *
- * @param url The remote URL.
- * @param namespace The WBEM namespace.
- * @param username The user name.
- * @param password The Password.
- * @param query The WQL Query to execute.
- * @param timeout Timeout in milliseconds.
- * @param arraySeparator The array separator value. default value '|'
- * @return
- * @throws WqlQuerySyntaxException On WQL syntax errors.
- * @throws WBEMException On WBEM errors.
- * @throws TimeoutException To notify userName of timeout.
- * @throws InterruptedException
- */
- public static WbemQueryResult executeWql(
- final URL url,
- final String namespace,
- final String username,
- final char[] password,
- final String query,
- int timeout,
- final String arraySeparator)
- throws WqlQuerySyntaxException,
- WBEMException,
- TimeoutException,
- InterruptedException {
- return executeMethod(
- url,
- namespace,
- username,
- password,
- query,
- null,
- timeout,
- arraySeparator);
- }
-
- /**
- * Execute WBEM get associators on remote.
- *
- * @param url The remote URL.
- * @param username The user name.
- * @param password The Password.
- * @param query The WQL Query to execute.
- * @param objectPathAssociators The object path for ASSOCIATORS.
- * @param timeout Timeout in milliseconds.
- * @param arraySeparator The array separator value. default value '|'
- * @return
- * @throws WqlQuerySyntaxException On WQL syntax errors.
- * @throws WBEMException On WBEM errors.
- * @throws TimeoutException To notify userName of timeout.
- * @throws InterruptedException
- */
- public static WbemQueryResult getAssociators(
- final URL url,
- final String username,
- final char[] password,
- final String query,
- final String objectPathAssociators,
- int timeout,
- final String arraySeparator)
- throws WqlQuerySyntaxException,
- WBEMException,
- TimeoutException,
- InterruptedException {
- return executeMethod(
- url,
- null,
- username,
- password,
- query,
- objectPathAssociators,
- timeout,
- arraySeparator);
- }
-
- /**
- * Execute the WBEM method with timeout.
- *
- * @param url
- * @param namespace
- * @param username
- * @param password
- * @param query
- * @param objectPathAssociators
- * @param timeout
- * @param arraySeparator
- * @return
- * @throws InterruptedException
- * @throws TimeoutException
- * @throws WBEMException
- * @throws WqlQuerySyntaxException
- */
- private static WbemQueryResult executeMethod(
- final URL url,
- final String namespace,
- final String username,
- final char[] password,
- final String query,
- final String objectPathAssociators,
- int timeout,
- final String arraySeparator)
- throws InterruptedException,
- TimeoutException,
- WBEMException,
- WqlQuerySyntaxException {
-
- Utils.checkNonNull(url, "url");
- Utils.checkNonNull(username, "username");
- Utils.checkNonNull(password, "password");
-
- final WqlQuery wqlQuery = WqlQuery.parseQuery(query);
-
- final ExecutorService executor = Executors.newSingleThreadExecutor();
-
- final Future future = executor.submit(() -> {
- try (final WbemClient matsyaWbemClient = new WbemClient()) {
- matsyaWbemClient.connect(url, username, password, timeout);
-
- return objectPathAssociators == null ?
- matsyaWbemClient.executeWql(wqlQuery, namespace, arraySeparator) :
- matsyaWbemClient.getAssociators(wqlQuery, objectPathAssociators, arraySeparator);
- }
- });
-
- try {
- return future.get(timeout, TimeUnit.MILLISECONDS);
-
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw (InterruptedException) e;
-
- } catch (TimeoutException e) {
- future.cancel(true);
- throw e;
-
- } catch (ExecutionException e) {
- if (e.getCause() instanceof WBEMException) {
- throw (WBEMException) e.getCause();
- }
- // else should be RunTimeException as matsyaWbemClient only thrown
- // WBEMException as checked exceptions.
- throw (RuntimeException) e.getCause();
- }
- finally {
- executor.shutdownNow();
- }
- }
-}
+package org.metricshub.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.net.URL;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.metricshub.wbem.client.exceptions.WqlQuerySyntaxException;
+import org.metricshub.wbem.javax.wbem.WBEMException;
+
+/**
+ * Functions to execute WBEM query.
+ *
+ */
+public class WbemExecutor {
+
+ private WbemExecutor() { }
+
+ /**
+ * Execute a WBEM query on remote.
+ *
+ * @param url The remote URL.
+ * @param namespace The WBEM namespace.
+ * @param username The user name.
+ * @param password The Password.
+ * @param query The WQL Query to execute.
+ * @param timeout Timeout in milliseconds.
+ * @param arraySeparator The array separator value. default value '|'
+ * @return
+ * @throws WqlQuerySyntaxException On WQL syntax errors.
+ * @throws WBEMException On WBEM errors.
+ * @throws TimeoutException To notify userName of timeout.
+ * @throws InterruptedException
+ */
+ public static WbemQueryResult executeWql(
+ final URL url,
+ final String namespace,
+ final String username,
+ final char[] password,
+ final String query,
+ int timeout,
+ final String arraySeparator)
+ throws WqlQuerySyntaxException,
+ WBEMException,
+ TimeoutException,
+ InterruptedException {
+ return executeMethod(
+ url,
+ namespace,
+ username,
+ password,
+ query,
+ null,
+ timeout,
+ arraySeparator);
+ }
+
+ /**
+ * Execute WBEM get associators on remote.
+ *
+ * @param url The remote URL.
+ * @param username The user name.
+ * @param password The Password.
+ * @param query The WQL Query to execute.
+ * @param objectPathAssociators The object path for ASSOCIATORS.
+ * @param timeout Timeout in milliseconds.
+ * @param arraySeparator The array separator value. default value '|'
+ * @return
+ * @throws WqlQuerySyntaxException On WQL syntax errors.
+ * @throws WBEMException On WBEM errors.
+ * @throws TimeoutException To notify userName of timeout.
+ * @throws InterruptedException
+ */
+ public static WbemQueryResult getAssociators(
+ final URL url,
+ final String username,
+ final char[] password,
+ final String query,
+ final String objectPathAssociators,
+ int timeout,
+ final String arraySeparator)
+ throws WqlQuerySyntaxException,
+ WBEMException,
+ TimeoutException,
+ InterruptedException {
+ return executeMethod(
+ url,
+ null,
+ username,
+ password,
+ query,
+ objectPathAssociators,
+ timeout,
+ arraySeparator);
+ }
+
+ /**
+ * Execute the WBEM method with timeout.
+ *
+ * @param url
+ * @param namespace
+ * @param username
+ * @param password
+ * @param query
+ * @param objectPathAssociators
+ * @param timeout
+ * @param arraySeparator
+ * @return
+ * @throws InterruptedException
+ * @throws TimeoutException
+ * @throws WBEMException
+ * @throws WqlQuerySyntaxException
+ */
+ private static WbemQueryResult executeMethod(
+ final URL url,
+ final String namespace,
+ final String username,
+ final char[] password,
+ final String query,
+ final String objectPathAssociators,
+ int timeout,
+ final String arraySeparator)
+ throws InterruptedException,
+ TimeoutException,
+ WBEMException,
+ WqlQuerySyntaxException {
+
+ Utils.checkNonNull(url, "url");
+ Utils.checkNonNull(username, "username");
+ Utils.checkNonNull(password, "password");
+
+ final WqlQuery wqlQuery = WqlQuery.parseQuery(query);
+
+ final ExecutorService executor = Executors.newSingleThreadExecutor();
+
+ final Future future = executor.submit(() -> {
+ try (final WbemClient matsyaWbemClient = new WbemClient()) {
+ matsyaWbemClient.connect(url, username, password, timeout);
+
+ return objectPathAssociators == null ?
+ matsyaWbemClient.executeWql(wqlQuery, namespace, arraySeparator) :
+ matsyaWbemClient.getAssociators(wqlQuery, objectPathAssociators, arraySeparator);
+ }
+ });
+
+ try {
+ return future.get(timeout, TimeUnit.MILLISECONDS);
+
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw (InterruptedException) e;
+
+ } catch (TimeoutException e) {
+ future.cancel(true);
+ throw e;
+
+ } catch (ExecutionException e) {
+ if (e.getCause() instanceof WBEMException) {
+ throw (WBEMException) e.getCause();
+ }
+ // else should be RunTimeException as matsyaWbemClient only thrown
+ // WBEMException as checked exceptions.
+ throw (RuntimeException) e.getCause();
+ }
+ finally {
+ executor.shutdownNow();
+ }
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/client/WbemQueryResult.java b/src/main/java/org/metricshub/wbem/client/WbemQueryResult.java
similarity index 51%
rename from src/main/java/org/sentrysoftware/wbem/client/WbemQueryResult.java
rename to src/main/java/org/metricshub/wbem/client/WbemQueryResult.java
index 91b01c8..c402f41 100644
--- a/src/main/java/org/sentrysoftware/wbem/client/WbemQueryResult.java
+++ b/src/main/java/org/metricshub/wbem/client/WbemQueryResult.java
@@ -1,53 +1,51 @@
-package org.sentrysoftware.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.List;
-
-/**
- * Wrapper class for WBEM query result.
- *
- */
-public class WbemQueryResult {
-
- /** List of the properties of the query. */
- private final List properties;
-
- /** Query results. */
- private final List> values;
-
- public WbemQueryResult(
- final List properties,
- final List> values) {
- this.properties = properties;
- this.values = values;
- }
-
- public List getProperties() {
- return properties;
- }
-
- public List> getValues() {
- return values;
- }
-}
+package org.metricshub.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.List;
+
+/**
+ * Wrapper class for WBEM query result.
+ *
+ */
+public class WbemQueryResult {
+
+ /** List of the properties of the query. */
+ private final List properties;
+
+ /** Query results. */
+ private final List> values;
+
+ public WbemQueryResult(
+ final List properties,
+ final List> values) {
+ this.properties = properties;
+ this.values = values;
+ }
+
+ public List getProperties() {
+ return properties;
+ }
+
+ public List> getValues() {
+ return values;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/client/WqlQuery.java b/src/main/java/org/metricshub/wbem/client/WqlQuery.java
similarity index 79%
rename from src/main/java/org/sentrysoftware/wbem/client/WqlQuery.java
rename to src/main/java/org/metricshub/wbem/client/WqlQuery.java
index ec2405a..489326a 100644
--- a/src/main/java/org/sentrysoftware/wbem/client/WqlQuery.java
+++ b/src/main/java/org/metricshub/wbem/client/WqlQuery.java
@@ -1,138 +1,136 @@
-package org.sentrysoftware.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.sentrysoftware.wbem.client.exceptions.WqlQuerySyntaxException;
-
-/**
- * Handler for WQL query.
- *
- */
-public class WqlQuery {
-
- private WqlQuery() { }
-
- private static final String ID = "[^\\s]+";
- private static final String LIST_SEPARATOR = "\\s*,\\s*";
-
- private static final Pattern CHECK_SELECT_PATTERN = Pattern.compile(
- "^\\s*SELECT\\s+(\\*|(?!SELECT|FROM|WHERE)\\w+|((?!SELECT|FROM|WHERE)\\w+\\s*,\\s*)+((?!SELECT|FROM|WHERE)\\w+))\\s+FROM\\s+((?!SELECT|WHERE|FROM)\\w+)\\s*?$",
- Pattern.CASE_INSENSITIVE);
-
- private static final Pattern EXTRACT_SELECT_PATTERN= Pattern.compile(
- "^\\s*SELECT\\s+(.+)\\s+FROM\\s+("+ID+")\\s*$",
- Pattern.CASE_INSENSITIVE);
- private static final int SELECT_GROUP_CLASSNAME = 2;
- private static final int SELECT_GROUP_FIELDS = 1;
- private static final int SELECT_GROUP_COUNT = 2;
-
- private String className;
- private Set properties;
- private List originalProperties;
-
- /**
- * Constructor for WQL query.
- *
- * @param query the WQL query.
- * @throws WqlQuerySyntaxException On WQL Syntax exception.
- */
- public static WqlQuery parseQuery(final String query) throws WqlQuerySyntaxException {
-
- Utils.checkNonNull(query, "query");
-
- if (CHECK_SELECT_PATTERN.matcher(query).find()) {
- final WqlQuery wqlQuery = new WqlQuery();
- wqlQuery.parseSelect(query);
- return wqlQuery;
- }
- throw new WqlQuerySyntaxException(query);
- }
-
- public String getClassName() {
- return className;
- }
-
- public String[] getPropertiesArray() {
- return properties.isEmpty() ?
- null :
- properties.stream()
- .filter(property -> !WbemCimDataHandler.PATH_PROPERTY.equalsIgnoreCase(property))
- .toArray(String[]::new);
- }
-
- public Set getProperties() {
- return properties;
- }
-
- public List getOriginalProperties() {
- return originalProperties;
- }
-
- public boolean hasDuplicateProperties() {
- return properties != null && originalProperties != null && properties.size() != originalProperties.size();
- }
-
- private void parseSelect(
- final String query) throws WqlQuerySyntaxException {
-
- final Matcher matcher = EXTRACT_SELECT_PATTERN.matcher(query);
- if (!matcher.find()) {
- throw new WqlQuerySyntaxException(query);
- }
- if (matcher.groupCount() < SELECT_GROUP_COUNT) {
- throw new WqlQuerySyntaxException(query);
- }
-
- className = matcher.group(SELECT_GROUP_CLASSNAME);
-
- final String fieldsList = matcher.group(SELECT_GROUP_FIELDS);
- final String[] fieldArray = Optional.ofNullable(fieldsList)
- .filter(s -> !"*".equals(s))
- .map(s -> s.split(LIST_SEPARATOR))
- .orElse(new String[0]);
-
- originalProperties = Stream.of(fieldArray)
- .map(String::trim)
- .collect(Collectors.toList());
-
- // using a map, so the properties will keep the case and the order of the query.
- final Map originalMap = new HashMap<>();
- originalProperties.stream().forEach(
- property -> originalMap.computeIfAbsent(property.toLowerCase(), prop -> property));
-
- properties = originalProperties.stream()
- .map(property -> originalMap.get(property.toLowerCase()))
- .collect(Collectors.toCollection(LinkedHashSet::new));
- }
-}
+package org.metricshub.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.metricshub.wbem.client.exceptions.WqlQuerySyntaxException;
+
+/**
+ * Handler for WQL query.
+ *
+ */
+public class WqlQuery {
+
+ private WqlQuery() { }
+
+ private static final String ID = "[^\\s]+";
+ private static final String LIST_SEPARATOR = "\\s*,\\s*";
+
+ private static final Pattern CHECK_SELECT_PATTERN = Pattern.compile(
+ "^\\s*SELECT\\s+(\\*|(?!SELECT|FROM|WHERE)\\w+|((?!SELECT|FROM|WHERE)\\w+\\s*,\\s*)+((?!SELECT|FROM|WHERE)\\w+))\\s+FROM\\s+((?!SELECT|WHERE|FROM)\\w+)\\s*?$",
+ Pattern.CASE_INSENSITIVE);
+
+ private static final Pattern EXTRACT_SELECT_PATTERN= Pattern.compile(
+ "^\\s*SELECT\\s+(.+)\\s+FROM\\s+("+ID+")\\s*$",
+ Pattern.CASE_INSENSITIVE);
+ private static final int SELECT_GROUP_CLASSNAME = 2;
+ private static final int SELECT_GROUP_FIELDS = 1;
+ private static final int SELECT_GROUP_COUNT = 2;
+
+ private String className;
+ private Set properties;
+ private List originalProperties;
+
+ /**
+ * Constructor for WQL query.
+ *
+ * @param query the WQL query.
+ * @throws WqlQuerySyntaxException On WQL Syntax exception.
+ */
+ public static WqlQuery parseQuery(final String query) throws WqlQuerySyntaxException {
+
+ Utils.checkNonNull(query, "query");
+
+ if (CHECK_SELECT_PATTERN.matcher(query).find()) {
+ final WqlQuery wqlQuery = new WqlQuery();
+ wqlQuery.parseSelect(query);
+ return wqlQuery;
+ }
+ throw new WqlQuerySyntaxException(query);
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public String[] getPropertiesArray() {
+ return properties.isEmpty() ?
+ null :
+ properties.stream()
+ .filter(property -> !WbemCimDataHandler.PATH_PROPERTY.equalsIgnoreCase(property))
+ .toArray(String[]::new);
+ }
+
+ public Set getProperties() {
+ return properties;
+ }
+
+ public List getOriginalProperties() {
+ return originalProperties;
+ }
+
+ public boolean hasDuplicateProperties() {
+ return properties != null && originalProperties != null && properties.size() != originalProperties.size();
+ }
+
+ private void parseSelect(
+ final String query) throws WqlQuerySyntaxException {
+
+ final Matcher matcher = EXTRACT_SELECT_PATTERN.matcher(query);
+ if (!matcher.find()) {
+ throw new WqlQuerySyntaxException(query);
+ }
+ if (matcher.groupCount() < SELECT_GROUP_COUNT) {
+ throw new WqlQuerySyntaxException(query);
+ }
+
+ className = matcher.group(SELECT_GROUP_CLASSNAME);
+
+ final String fieldsList = matcher.group(SELECT_GROUP_FIELDS);
+ final String[] fieldArray = Optional.ofNullable(fieldsList)
+ .filter(s -> !"*".equals(s))
+ .map(s -> s.split(LIST_SEPARATOR))
+ .orElse(new String[0]);
+
+ originalProperties = Stream.of(fieldArray)
+ .map(String::trim)
+ .collect(Collectors.toList());
+
+ // using a map, so the properties will keep the case and the order of the query.
+ final Map originalMap = new HashMap<>();
+ originalProperties.stream().forEach(
+ property -> originalMap.computeIfAbsent(property.toLowerCase(), prop -> property));
+
+ properties = originalProperties.stream()
+ .map(property -> originalMap.get(property.toLowerCase()))
+ .collect(Collectors.toCollection(LinkedHashSet::new));
+ }
+}
diff --git a/src/main/java/org/metricshub/wbem/client/exceptions/WqlQuerySyntaxException.java b/src/main/java/org/metricshub/wbem/client/exceptions/WqlQuerySyntaxException.java
new file mode 100644
index 0000000..08c7189
--- /dev/null
+++ b/src/main/java/org/metricshub/wbem/client/exceptions/WqlQuerySyntaxException.java
@@ -0,0 +1,38 @@
+package org.metricshub.wbem.client.exceptions;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+/**
+ * Exception for a syntax error in the WQL Query parameter.
+ *
+ */
+public class WqlQuerySyntaxException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public WqlQuerySyntaxException(final String wqlQuery) {
+ super("Syntax error in WQL Query: " + wqlQuery);
+ }
+
+ public WqlQuerySyntaxException(final Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/cim/CIMArgument.java b/src/main/java/org/metricshub/wbem/javax/cim/CIMArgument.java
similarity index 80%
rename from src/main/java/org/sentrysoftware/wbem/javax/cim/CIMArgument.java
rename to src/main/java/org/metricshub/wbem/javax/cim/CIMArgument.java
index 6c11b0d..fc076cb 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/cim/CIMArgument.java
+++ b/src/main/java/org/metricshub/wbem/javax/cim/CIMArgument.java
@@ -1,102 +1,100 @@
-/*
- (C) Copyright IBM Corp. 2006, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-10-06 ebak Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2750520 2009-04-10 blaschke-oss Code cleanup from empty statement et al
- * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
- * 2935258 2010-01-22 blaschke-oss Sync up javax.cim.* javadoc with JSR48 1.0.0
- * 2944839 2010-02-08 blaschke-oss Remove redundant toString() methods
- * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues
- * 3565581 2012-09-07 blaschke-oss TCK: remove unnecessary overriding methods
- */
-
-package org.sentrysoftware.wbem.javax.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:58 EST 2010
-/**
- * This class represents an instance of a CIMParameter used for a
- * method invocation. A CIMArgument has a name, data type and
- * value. A CIMArgument corresponds to a CIMParameter
- * defined for a CIMMethod.
- *
- * @param
- * Type parameter.
- *
- * @see CIMParameter
- */
-public class CIMArgument extends CIMValuedElement {
-
- private static final long serialVersionUID = 4727439564059428267L;
-
- /**
- * Constructs a CIMArgument to be used for method invocations.
- * A CIMArgument corresponds to a CIMParameter.
- * For each CIMParameter being populated during a method
- * invocation a CIMArgument object must be created.
- *
- * @param pName
- * Name of the CIM argument.
- * @param pType
- * CIMDataType of the argument.
- * @param pValue
- * Value of the argument.
- * @throws IllegalArgumentException
- * If the value does not match the type.
- * @see CIMParameter
- */
- public CIMArgument(String pName, CIMDataType pType, E pValue) throws IllegalArgumentException {
- super(pName, pType, pValue);
- }
-
- /**
- * Compares this object against the specified object. The result is
- * true if and only if the argument is not null
- * and is a CIMArgument that represents the same name, type and
- * value as this CIMArgument.
- *
- * @param pObj
- * The object to compare with.
- * @return true if the objects are the same; false
- * otherwise.
- */
- @Override
- public boolean equals(Object pObj) {
- if (!(pObj instanceof CIMArgument)) return false;
- return super.equals(pObj);
- }
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, ebak@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-10-06 ebak Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2750520 2009-04-10 blaschke-oss Code cleanup from empty statement et al
+ * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
+ * 2935258 2010-01-22 blaschke-oss Sync up javax.cim.* javadoc with JSR48 1.0.0
+ * 2944839 2010-02-08 blaschke-oss Remove redundant toString() methods
+ * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues
+ * 3565581 2012-09-07 blaschke-oss TCK: remove unnecessary overriding methods
+ */
+
+package org.metricshub.wbem.javax.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:58 EST 2010
+/**
+ * This class represents an instance of a CIMParameter used for a
+ * method invocation. A CIMArgument has a name, data type and
+ * value. A CIMArgument corresponds to a CIMParameter
+ * defined for a CIMMethod.
+ *
+ * @param
+ * Type parameter.
+ *
+ * @see CIMParameter
+ */
+public class CIMArgument extends CIMValuedElement {
+
+ private static final long serialVersionUID = 4727439564059428267L;
+
+ /**
+ * Constructs a CIMArgument to be used for method invocations.
+ * A CIMArgument corresponds to a CIMParameter.
+ * For each CIMParameter being populated during a method
+ * invocation a CIMArgument object must be created.
+ *
+ * @param pName
+ * Name of the CIM argument.
+ * @param pType
+ * CIMDataType of the argument.
+ * @param pValue
+ * Value of the argument.
+ * @throws IllegalArgumentException
+ * If the value does not match the type.
+ * @see CIMParameter
+ */
+ public CIMArgument(String pName, CIMDataType pType, E pValue) throws IllegalArgumentException {
+ super(pName, pType, pValue);
+ }
+
+ /**
+ * Compares this object against the specified object. The result is
+ * true if and only if the argument is not null
+ * and is a CIMArgument that represents the same name, type and
+ * value as this CIMArgument.
+ *
+ * @param pObj
+ * The object to compare with.
+ * @return true if the objects are the same; false
+ * otherwise.
+ */
+ @Override
+ public boolean equals(Object pObj) {
+ if (!(pObj instanceof CIMArgument)) return false;
+ return super.equals(pObj);
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/cim/CIMClass.java b/src/main/java/org/metricshub/wbem/javax/cim/CIMClass.java
similarity index 92%
rename from src/main/java/org/sentrysoftware/wbem/javax/cim/CIMClass.java
rename to src/main/java/org/metricshub/wbem/javax/cim/CIMClass.java
index 24f06e5..30ea988 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/cim/CIMClass.java
+++ b/src/main/java/org/metricshub/wbem/javax/cim/CIMClass.java
@@ -1,575 +1,573 @@
-/*
- (C) Copyright IBM Corp. 2006, 2013
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-10-06 ebak Make SBLIM client JSR48 compliant
- * 1669961 2006-04-16 lupusalex CIMTypedElement.getType() =>getDataType()
- * 1737123 2007-06-15 ebak Differences to JSR48 public review draft
- * 1783288 2007-09-10 ebak CIMClass.isAssociation() not working for retrieved classes.
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2750520 2009-04-10 blaschke-oss Code cleanup from empty statement et al
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
- * 2823494 2009-08-03 rgummada Change Boolean constructor to static
- * 2935258 2010-01-22 blaschke-oss Sync up javax.cim.* javadoc with JSR48 1.0.0
- * 2944842 2010-02-08 blaschke-oss Missing thrown ArrayIndexOutOfBoundsException
- * 2975917 2010-03-24 blaschke-oss TCK: CIMClass.getProperty() does not handle null property
- * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues
- * 3496301 2012-03-02 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final
- * 3500619 2012-03-16 blaschke-oss JSR48 1.0.0: CIMClass association/key clean up
- * 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors
- * 3565581 2012-09-07 blaschke-oss TCK: remove unnecessary overriding methods
- * 2719 2013-12-10 blaschke-oss TCK: CIM APIs should not generate NullPointerException
- * 2716 2013-12-11 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final V
- */
-
-package org.sentrysoftware.wbem.javax.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.TreeSet;
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.cim.CIMElementSorter;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.cim.CIMQualifiedElementInterfaceImpl;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.util.MOF;
-
-//Sync'd against JSR48 1.0.0 javadoc (version 1.7.0_03) on Tue Dec 10 07:02:50 EST 2013
-/**
- * This class represents a CIM class as defined by the Distributed Management
- * Task Force (DMTF) CIM Infrastructure
- * Specification (DSP004). A CIMClass has the following attributes:
- *
- *
an object path describing the location and name of the class
- *
superclass name (can be null if no superclass)
- *
an array of qualifiers for the class
- *
an array of properties
- *
an array of methods
- *
- */
-public class CIMClass extends CIMElement implements CIMQualifiedElementInterface,
- CIMNamedElementInterface {
-
- private static final long serialVersionUID = -5634561913210025100L;
-
- private CIMQualifiedElementInterfaceImpl iQualiImpl;
-
- private CIMObjectPath iObjPath;
-
- private String iSuperClass;
-
- private CIMClassProperty>[] iProps;
-
- private CIMMethod>[] iMethods;
-
- private boolean iIsKeyed;
-
- private boolean iIsAssoc;
-
- /**
- * Creates and instantiates a Java object representing a CIM Class. This
- * method may or may not validate the pIsAssociation and
- * pIsKeyed parameters. If an invalid value is supplied (i.e.
- * the class is an association, but the pIsAssociation was set
- * to false), it may or may not be corrected.
- *
- * @param pPath
- * Object Name of the CIM class.
- * @param pSuperClass
- * Name of the superclass.
- * @param pQualifiers
- * List of qualifiers of the CIM class.
- * @param pProperties
- * List of properties of the CIM class.
- * @param pMethods
- * List of methods of the CIM class.
- * @param pIsAssociation
- * true if the CIM class is an Association,
- * false otherwise.
- * @param pIsKeyed
- * true if the CIM class has Keys,
- * false otherwise.
- * @throws IllegalArgumentException
- * If pPath is null.
- *
- */
- public CIMClass(CIMObjectPath pPath, String pSuperClass, CIMQualifier>[] pQualifiers,
- CIMClassProperty>[] pProperties, CIMMethod>[] pMethods, boolean pIsAssociation,
- boolean pIsKeyed) {
- this(pPath, pSuperClass, pQualifiers, pProperties, pMethods);
- // if (this.isAssociation() != pIsAssociation) {
- // throw new IllegalArgumentException(
- // "pIsAssociation does not match pQualifiers! pIsAssociation is " +
- // pIsAssociation
- // + " while pQualifiers "
- // + (this.isAssociation() ? "contains" : "does not contain")
- // + " qualifier with association in class " +
- // this.iObjPath.getObjectName());
- // }
- // if (this.isKeyed() != pIsKeyed) {
- // throw new IllegalArgumentException(
- // "pIsKeyed does not match pProperties! pIsKeyed is " + pIsKeyed
- // + " while pProperties "
- // + (this.isKeyed() ? "contains" : "does not contain")
- // + " property with key qualifier in class " +
- // this.iObjPath.getObjectName());
- // }
- }
-
- /**
- * Creates and instantiates a Java object representing a CIM Class. This
- * constructor will inspect the class to determine if it is an association
- * or has keys.
- *
- * @param pName
- * Name of the CIM class.
- * @param pSuperClass
- * Name of the superclass.
- * @param pQualifiers
- * List of qualifiers of the CIM class.
- * @param pProperties
- * List of properties of the CIM class.
- * @param pMethods
- * List of methods of the CIM class.
- * @throws IllegalArgumentException
- * If pName is null.
- */
- public CIMClass(String pName, String pSuperClass, CIMQualifier>[] pQualifiers,
- CIMClassProperty>[] pProperties, CIMMethod>[] pMethods) {
- this(new CIMObjectPath(null, null, null, null, pName, null), pSuperClass, pQualifiers,
- pProperties, pMethods);
- }
-
- /**
- * This private constructor does the actual work for the two public
- * constructors and sets the iIsAssoc and iIsKeyed instance variables based
- * on whether there is qualifier with name="Association" and value=true and
- * a property with a qualifier with name="Key" and value=true, respectively.
- */
- private CIMClass(CIMObjectPath pPath, String pSuperClass, CIMQualifier>[] pQualifiers,
- CIMClassProperty>[] pProperties, CIMMethod>[] pMethods) {
- super(pPath == null ? null : pPath.getObjectName());
- this.iObjPath = pPath;
- this.iSuperClass = pSuperClass;
- this.iQualiImpl = new CIMQualifiedElementInterfaceImpl(pQualifiers);
- this.iProps = (CIMClassProperty[]) CIMElementSorter.sort(pProperties);
- this.iMethods = (CIMMethod[]) CIMElementSorter.sort(pMethods);
- this.iIsAssoc = this.iQualiImpl.hasQualifierValue("Association", Boolean.TRUE);
- this.iIsKeyed = hasKey(pProperties);
- }
-
- /**
- * Indicates whether the specified CIMClass is equal to this
- * CIMClass.
- *
- * @param pObj
- * The CIMClass object with which to compare.
- * @return true if this object is the same as the
- * pObj argument; false otherwise.
- */
- @Override
- public boolean equals(Object pObj) {
- if (!(pObj instanceof CIMClass)) return false;
- CIMClass that = (CIMClass) pObj;
- if (!super.equals(that)) return false;
- if (this.iSuperClass == null ? that.iSuperClass != null : !this.iSuperClass
- .equalsIgnoreCase(that.iSuperClass)) return false;
- if (!this.iQualiImpl.equals(that.iQualiImpl) || !Arrays.equals(this.iProps, that.iProps)
- || !Arrays.equals(this.iMethods, that.iMethods) || this.iIsAssoc != that.iIsAssoc
- || isKeyed() != that.isKeyed()) return false;
- return true;
- }
-
- /**
- * This method returns a new CIMClass with properties filtered
- * according to the input parameters. Inclusion of class origin and
- * qualifiers can also be controlled. Methods will not be included in the
- * class returned.
- *
- * @param pLocalOnly
- * If true only the elements defined in this class
- * are included; otherwise all elements are included.
- * @param pIncludeQualifiers
- * If true qualifiers are included on all elements;
- * otherwise no qualifiers are included.
- * @param pIncludeClassOrigin
- * If true, the ClassOrigin attribute is included.
- * @param pPropertyList
- * If the PropertyList input parameter is not
- * null, the members of the array define one or more
- * Property names. The CIMClass returned does not
- * include elements for any Properties missing from this list. If
- * the PropertyList input parameter is an empty
- * array this signifies that no Properties are included in the
- * class returned. If the PropertyList input
- * parameter is null this specifies that all
- * Properties are included in the class returned. If the
- * PropertyList contains duplicate elements or
- * invalid property names, they are ignored.
- * @return CIMClass matching the requested criteria.
- */
- public CIMClass filterProperties(boolean pLocalOnly, boolean pIncludeQualifiers,
- boolean pIncludeClassOrigin, String[] pPropertyList) {
- ArrayList> newPropAList = new ArrayList>();
- // place pPropertyList into a set, for easy and fast search
- TreeSet set;
- if (pPropertyList != null) {
- set = new TreeSet();
- for (int i = 0; i < pPropertyList.length; i++)
- set.add(pPropertyList[i].toUpperCase());
- } else set = null;
- for (int i = 0; i < getPropertyCount(); i++) {
- CIMClassProperty> refProp = getProperty(i);
- if (pLocalOnly && refProp.isPropagated()) continue;
- if (set == null || set.contains(refProp.getName().toUpperCase())) newPropAList
- .add(new CIMClassProperty
- * @param pOutputArguments
- * The CIMArgument array of method output
- * parameters. The array should be allocated large enough to hold
- * all returned parameters.
- * @return The return value of the specified method.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED (implementation DOES NOT support ANY
- * Extrinsic Method Invocation)
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (for this method)
- * CIM_ERR_NOT_FOUND (if instance does not exist)
- * CIM_ERR_METHOD_NOT_FOUND
- * CIM_ERR_METHOD_NOT_AVAILABLE
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public Object invokeMethod(CIMObjectPath pName, String pMethodName,
- CIMArgument>[] pInputArguments, CIMArgument>[] pOutputArguments)
- throws WBEMException;
-
- /**
- * Modify the CIMClass.
- *
- * @param pClass
- * CIMClass to be modified.
- * @throws UnsupportedOperationException
- * If the client implementation (or protocol) does not support
- * the operation.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
- * or otherwise incorrect parameters)
- * CIM_ERR_INVALID_SUPERCLASS (the putative CIM Class declares a
- * non-existent superclass)
- * CIM_ERR_CLASS_HAS_CHILDREN (the modification could not be performed
- * because it was not possible to update the subclasses of the Class
- * in a consistent fashion)
- * CIM_ERR_CLASS_HAS_INSTANCES (the modification could not be performed
- * because it was not possible to update the instances of the Class in
- * a consistent fashion)
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public void modifyClass(CIMClass pClass) throws WBEMException;
-
- /**
- * Modify some or all of the properties of the specified
- * CIMInstance.
- *
- * @param pInstance
- * CIMInstance to be modified. All Keys must be
- * populated.
- * @param pPropertyList
- * An array of property names used to specify which values from
- * the CIMInstance specified to set. Properties not
- * specified in this list but set in the CIMInstance
- * specified are not modified. Duplicate property names are
- * ignored and the request is otherwise processed normally. If
- * the pPropertyList contains invalid property names
- * for the instance to be modified, the server shall reject the
- * request. An empty array indicates that no properties should be
- * modified. A null value indicates that all
- * properties should be modified.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (for this method)
- * CIM_ERR_INVALID_CLASS (in this namespace)
- * CIM_ERR_NOT_FOUND (if instance does not exist)
- * CIM_ERR_NO_SUCH_PROPERTY (in this instance)
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public void modifyInstance(CIMInstance pInstance, String[] pPropertyList) throws WBEMException;
-
- /**
- * Enumerates the Association classes that refer to a specified source CIM
- * Class.
- *
- * @param pObjectName
- * CIMObjectPath defining the source CIM class whose
- * referring classes are to be returned. pObjectName
- * shall contain the scheme, host, namespace and object name
- * (class name).
- * @param pResultClass
- * This string shall either contain a valid CIM Class name or be
- * null. The pResultClass filters the
- * classes returned to contain only the classes of this Class
- * name or one of its subclasses.
- * @param pRole
- * This string MUST either contain a valid Property name or be
- * null. It filters the Objects returned to contain
- * only Objects referring to the source Object via a Property
- * with the specified name. If "Antecedent" is specified, then
- * only Associations in which the source Object is the
- * "Antecedent" reference are returned.
- * @param pIncludeQualifiers
- * If true, all Qualifiers for each Object
- * (including Qualifiers on the Object and on any returned
- * Properties) shall be included in the classes returned. If
- * false, no Qualifiers shall be present in each
- * class returned.
- * @param pIncludeClassOrigin
- * The class origin attribute is the name of the class that first
- * defined the property or method. If true, the
- * class Origin attribute shall be present for each property and
- * method on all classes returned. If false, the
- * class origin shall not be present.
- * @param pPropertyList
- * An array of property names used to filter what is contained in
- * the Objects returned. Each CIMClass returned
- * shall only contains elements for the properties of the names
- * specified. Duplicate and invalid property names are ignored
- * and the request is otherwise processed normally. An empty
- * array indicates that no properties should be included in the
- * classes returned. A null value indicates that all
- * properties should be contained in the classes returned.
- * @return If successful, a CloseableIterator referencing zero
- * or more CIMClasses meeting the specified criteria.
- * @throws UnsupportedOperationException
- * If the client implementation (or protocol) does not support
- * the operation.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes shall be
- * returned along with zero or more instance of
- * CIM_Error. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
- * or otherwise incorrect parameters)
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
-
- CloseableIterator referenceClasses(CIMObjectPath pObjectName, String pResultClass,
- String pRole, boolean pIncludeQualifiers, boolean pIncludeClassOrigin,
- String[] pPropertyList) throws WBEMException;
-
- /**
- * Enumerates the Association instances that refer to a specified source CIM
- * Instance.
- *
- * @param pObjectName
- * CIMObjectPath defining the source CIM Instance
- * whose referring instances are to be returned. The
- * pObjectName shall include the host, object name
- * and keys.
- * @param pResultClass
- * This string shall either contain a valid CIM Class name or be
- * null. It filters the instances returned to
- * contain only the instances of this Class name or one of its
- * subclasses.
- * @param pRole
- * This string shall either contain a valid Property name or be
- * null. The role filters the instances returned to
- * contain only instances referring to the source instance via a
- * property with the specified name. For example, If "Antecedent"
- * is specified, then only Associations in which the source
- * instance is the "Antecedent" reference are returned.
- * @param pIncludeClassOrigin
- * The class origin attribute is the name of the class that first
- * defined the property. If true, the class origin
- * attribute may be present for each property and on all
- * instances returned, even if requested the server may ignore
- * the request and not return the class origin. If
- * false, the class origin shall not be present.
- * @param pPropertyList
- * An array of property names used to filter what is contained in
- * the instances returned. Each CIMInstance returned
- * shall only contain elements for the properties of the names
- * specified. Duplicate and invalid property names are ignored
- * and the request is otherwise processed normally. An empty
- * array indicates that no properties should be included in the
- * instances returned. A null value indicates that
- * all properties supported shall be contained in the instance
- * returned.
- * @return If successful, a CloseableIterator referencing zero
- * or more CIMInstances meeting the specified criteria.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes shall be
- * returned along with zero or more CIM_Error
- * instances. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
- * or otherwise incorrect parameters)
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- CloseableIterator referenceInstances(CIMObjectPath pObjectName,
- String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList)
- throws WBEMException;
-
- /**
- * Enumerates the CIMObjectPaths of Association Objects that
- * refer to a particular source CIM Object. If the source Object is a CIM
- * Class, then a CloseableIterator of
- * CIMObjectPaths of the Association classes that refer to the
- * source Object is returned. If the source Object is a CIM Instance, then a
- * CloseableIterator of CIMObjectPaths of the
- * CIMInstance objects that refer to the source Object is
- * returned.
- *
- * @param pObjectName
- * CIMObjectPath defining the source CIM Object
- * whose referring Objects are to be returned. This argument may
- * contain either a Class name or the modelpath of an Instance.
- * (i.e. Keys populated)
- * @param pResultClass
- * This string MUST either contain a valid CIM Class name or be
- * null. It filters the Objects returned to contain
- * only the Objects of this Class name or one of its subclasses.
- * @param pRole
- * This string MUST either contain a valid Property name or be
- * null. It filters the Objects returned to contain
- * only Objects referring to the source Object via a Property
- * with the specified name. If "Antecedent" is specified, then
- * only Associations in which the source Object is the
- * "Antecedent" reference are returned.
- * @return If successful, a CloseableIterator referencing zero
- * or more CIMObjectPaths of CIMClasses or
- * CIMInstances meeting the specified criteria.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
- * or otherwise incorrect parameters)
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public CloseableIterator referenceNames(CIMObjectPath pObjectName,
- String pResultClass, String pRole) throws WBEMException;
-
- /**
- * referencePaths shall start an enumeration session for
- * association instances that have references that refer to the instance
- * defined in the pInstancePath parameter and return zero or
- * more CIMObjectPath objects.
- *
- * @param pInstancePath
- * The CIMObjectPath for the instance for which the
- * enumeration is to be performed.
- * @param pResultClass
- * This string MUST either contain a valid CIM Class name or be
- * null. It filters the Objects returned to contain
- * only the Objects of this Class name or one of its subclasses.
- * @param pRole
- * This string MUST either contain a valid Property name or be
- * null. It filters the Objects returned to contain
- * only Objects referring to the source Object via a Property
- * with the specified name. If "Antecedent" is specified, then
- * only Associations in which the source Object is the
- * "Antecedent" reference are returned.
- * @param pFilterQueryLanguage
- * The pFilterQueryLanguage represents the query
- * language for the pFilterQuery argument. This must
- * be left null if a pFilterQuery is
- * not supplied. If the implementation does not support the query
- * language specified, the
- * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
- * be returned. If the implementation does not support filtered
- * enumerations, the
- * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
- * shall be returned.
- * @param pFilterQuery
- * The pFilterQuery specifies a query in the form of
- * the query language specified by the
- * pFilterQueryLanguage parameter. If this value is
- * not null, the pFilterQueryLanguage
- * parameter must be non-null. This value shall act
- * as an additional filter on the result set. If the
- * implementation does not support the query language specified,
- * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
- * shall be returned. If the implementation does not support
- * filtered enumerations, the
- * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
- * shall be returned.
- * @param pTimeout
- * This input parameter determines the minimum time the CIM
- * server shall maintain the open enumeration session after the
- * last Open or Pull operation (unless the enumeration session is
- * closed). If the operation timeout is exceeded, the
- * implementation may close the enumeration session at any time,
- * releasing any resources allocated to the enumeration session.
- * A pTimeout of 0 means that there is no operation
- * timeout. That is, the enumeration session is never closed
- * based on time. If pTimeout is null,
- * the implementation shall choose an operation timeout. All
- * other values for pTimeout specify the operation
- * timeout in seconds. A implementation may restrict the set of
- * allowable values for pTimeout. Specifically, the
- * implementation may not allow 0 (no timeout). If the specified
- * value is not an allowable value, the implementation shall
- * return failure with the status code
- * CIM_ERR_INVALID_OPERATION_TIMEOUT.
- * @param pContinueOnError
- * If true, requests that the operation resume when
- * an error is received. If a implementation does not support
- * continuation on error and pContinueOnError is
- * true, it shall throw a WBEMException
- * with the status code
- * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
- * implementation supports continuation on error and
- * pContinueOnError is true, the
- * enumeration session shall remain open when a Pull operation
- * fails, and any subsequent successful Pull operations shall
- * return the set of elements that would have been returned if
- * the failing Pull operations were successful. This behavior is
- * subject to the consistency rules defined for pulled
- * enumerations. If pContinueOnError is
- * false, the enumeration session shall be closed
- * when either the operation completes successfully or when a
- * WBEMExcetpion is thrown.
- * @param pMaxObjects
- * Defines the maximum number of elements that this Open
- * operation can return. The implementation may deliver any
- * number of elements up to pMaxObjects but shall
- * not deliver more than pMaxObjects elements. An
- * implementation may choose to never return any elements during
- * an Open operation, regardless of the value of
- * pMaxObjects. Note that a CIM client can use a
- * pMaxObjects value of 0 to specify that it does
- * not want to retrieve any instances in the Open operation.
- * @return The return value of a successful Open operation is an array of
- * enumerated elements with a number of entries from 0 up to a
- * maximum defined by pMaxObjects. These entries meet
- * the criteria defined in the Open operation. Note that returning
- * no entries in the array does not imply that the enumeration
- * session is exhausted. Client must evaluate the
- * EnumerateResponse.isEnd() to determine if there are
- * more elements.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_SERVER_IS_SHUTTING_DOWN
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_OPERATION_TIMEOUT
- * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
- * CIM_ERR_INVALID_PARAMETER
- * CIM_ERR_NOT_FOUND (the source instance was not found)
- * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
- * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
- * CIM_ERR_INVALID_QUERY
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public EnumerateResponse referencePaths(CIMObjectPath pInstancePath,
- String pResultClass, String pRole, String pFilterQueryLanguage, String pFilterQuery,
- UnsignedInteger32 pTimeout, boolean pContinueOnError, UnsignedInteger32 pMaxObjects)
- throws WBEMException;
-
- /**
- * references shall start an enumeration session for
- * association instances that have references that refer to the instance
- * defined in the pInstancePath parameter and return zero or
- * more CIMInstance objects.
- *
- * @param pInstancePath
- * The CIMObjectPath for the instance for which the
- * enumeration is to be performed.
- * @param pResultClass
- * This string shall either contain a CIM Class name or be
- * null. It filters the instances returned to
- * contain only the instances of this Class name or one of its
- * subclasses.
- * @param pRole
- * This string shall either contain a Property name or be
- * null. It filters the instances returned to
- * contain only instances referring to the source instance via a
- * Property with the specified name. If "Antecedent" is
- * specified, then only Associations in which the source instance
- * is the "Antecedent" reference are returned.
- * @param pIncludeClassOrigin
- * The class origin attribute is the name of the class that first
- * defined the property. If true, the class origin
- * attribute may be present for each property on all instances
- * returned, even if requested the server may ignore the request
- * and not return the class origin. If false, the
- * class origin shall not be present.
- * @param pPropertyList
- * An array of property names used to filter what is contained in
- * the instances returned. Each CIMInstance returned
- * only contains elements for the properties of the names
- * specified. Duplicate and invalid property names are ignored
- * and the request is otherwise processed normally. An empty
- * array indicates that no properties should be included in the
- * Objects returned. A null value indicates that all
- * non-null properties of the instance are included.
- * @param pFilterQueryLanguage
- * The pFilterQueryLanguage represents the query
- * language for the pFilterQuery argument. This must
- * be left null if a pFilterQuery is
- * not supplied. If the implementation does not support the query
- * language specified, the
- * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
- * be returned. If the implementation does not support filtered
- * enumerations, the
- * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
- * shall be returned.
- * @param pFilterQuery
- * The pFilterQuery specifies a query in the form of
- * the query language specified by the
- * pFilterQueryLanguage parameter. If this value is
- * not null, the pFilterQueryLanguage
- * parameter must be non-null. This value shall act
- * as an additional filter on the result set. If the
- * implementation does not support the query language specified,
- * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
- * shall be returned. If the implementation does not support
- * filtered enumerations, the
- * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
- * shall be returned.
- * @param pTimeout
- * This input parameter determines the minimum time the CIM
- * server shall maintain the open enumeration session after the
- * last Open or Pull operation (unless the enumeration session is
- * closed). If the operation timeout is exceeded, the
- * implementation may close the enumeration session at any time,
- * releasing any resources allocated to the enumeration session.
- * A pTimeout of 0 means that there is no operation
- * timeout. That is, the enumeration session is never closed
- * based on time. If pTimeout is null,
- * the implementation shall choose an operation timeout. All
- * other values for pTimeout specify the operation
- * timeout in seconds. A implementation may restrict the set of
- * allowable values for pTimeout. Specifically, the
- * implementation may not allow 0 (no timeout). If the specified
- * value is not an allowable value, the implementation shall
- * return failure with the status code
- * CIM_ERR_INVALID_OPERATION_TIMEOUT.
- * @param pContinueOnError
- * If true, requests that the operation resume when
- * an error is received. If a implementation does not support
- * continuation on error and pContinueOnError is
- * true, it shall throw a WBEMException
- * with the status code
- * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
- * implementation supports continuation on error and
- * pContinueOnError is true, the
- * enumeration session shall remain open when a Pull operation
- * fails, and any subsequent successful Pull operations shall
- * return the set of elements that would have been returned if
- * the failing Pull operations were successful. This behavior is
- * subject to the consistency rules defined for pulled
- * enumerations. If pContinueOnError is
- * false, the enumeration session shall be closed
- * when either the operation completes successfully or when a
- * WBEMExcetpion is thrown.
- * @param pMaxObjects
- * Defines the maximum number of elements that this Open
- * operation can return. The implementation may deliver any
- * number of elements up to pMaxObjects but shall
- * not deliver more than pMaxObjects elements. An
- * implementation may choose to never return any elements during
- * an Open operation, regardless of the value of
- * pMaxObjects. Note that a CIM client can use a
- * pMaxObjects value of 0 to specify that it does
- * not want to retrieve any instances in the Open operation.
- * @return The return value of a successful Open operation is an array of
- * enumerated elements with a number of entries from 0 up to a
- * maximum defined by pMaxObjects. These entries meet
- * the criteria defined in the Open operation. Note that returning
- * no entries in the array does not imply that the enumeration
- * session is exhausted. Client must evaluate the
- * EnumerateResponse.isEnd() to determine if there are
- * more elements.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_SERVER_IS_SHUTTING_DOWN
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_OPERATION_TIMEOUT
- * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
- * CIM_ERR_INVALID_PARAMETER
- * CIM_ERR_NOT_FOUND (the source instance was not found)
- * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
- * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
- * CIM_ERR_INVALID_QUERY
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public EnumerateResponse references(CIMObjectPath pInstancePath,
- String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList,
- String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pTimeout,
- boolean pContinueOnError, UnsignedInteger32 pMaxObjects) throws WBEMException;
-
- /**
- * Change the locales that were provided during initialization.
- *
- * @param pLocales
- * An array of locales in order of priority of preference.
- */
- public void setLocales(Locale[] pLocales);
-
- /**
- * Set properties that enable options or protocol specific properties. See
- * WBEMClientConstants for a list of standard properties.
- *
- * @param pKey
- * The name of the property.
- * @param pValue
- * The value of the property.
- * @throws IllegalArgumentException
- * If the name is not a supported property name.
- * @see WBEMClientConstants
- */
- public void setProperty(String pKey, String pValue);
-
- /**
- * Add a CIMQualifierType to the specified namespace if it does
- * not already exist. Otherwise, it modifies the qualifier type to the value
- * specified.
- *
- * @param pQualifierType
- * The CIM qualifier type to be added.
- * @throws UnsupportedOperationException
- * If the client implementation (or protocol) does not support
- * the operation.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_ACCESS_DENIED
- * CIM_ERR_NOT_SUPPORTED
- * CIM_ERR_INVALID_NAMESPACE
- * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
- * or otherwise incorrect parameters)
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public void setQualifierType(CIMQualifierType> pQualifierType) throws WBEMException;
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2013
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
+ * 1686000 2007-04-19 ebak modifyInstance() missing from WBEMClient
+ * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
+ * 2845211 2009-08-27 raman_arora Pull Enumeration Feature (SAX Parser)
+ * 2858933 2009-10-12 raman_arora JSR48 new APIs: associatorClasses & associatorInstances
+ * 2886829 2009-11-18 raman_arora JSR48 new APIs: referenceClasses & referenceInstances
+ * 2959586 2010-03-01 blaschke-oss Sync up WBEMClient javadoc with JSR48 1.0.0
+ * 2961592 2010-03-01 blaschke-oss Remove WBEMClient.setLocales() UnsupportedOperationException
+ * 3496301 2012-03-02 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final
+ * 3496343 2012-03-02 blaschke-oss JSR48 1.0.0: deprecate WBEMClient associators and references
+ * 3514537 2012-04-03 blaschke-oss TCK: execQueryInstances requires boolean, not Boolean
+ * 3521131 2012-04-24 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final II
+ * 3521328 2012-04-25 blaschke-oss JSR48 1.0.0: remove WBEMClient associators and references
+ * 3525657 2012-05-10 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final III
+ * 3555752 2012-09-13 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final IV
+ * 2716 2013-12-11 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final V
+ */
+
+package org.metricshub.wbem.javax.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Locale;
+
+import org.metricshub.wbem.javax.cim.CIMArgument;
+import org.metricshub.wbem.javax.cim.CIMClass;
+import org.metricshub.wbem.javax.cim.CIMInstance;
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.javax.cim.CIMQualifierType;
+import org.metricshub.wbem.javax.wbem.CloseableIterator;
+import org.metricshub.wbem.javax.wbem.WBEMException;
+import org.metricshub.wbem.javax.cim.UnsignedInteger32;
+import org.metricshub.wbem.javax.cim.UnsignedInteger64;
+import javax.security.auth.Subject;
+
+//Sync'd against JSR48 1.0.0 javadoc (version 1.7.0_03) on Tue Dec 10 07:02:50 EST 2013
+/**
+ * The WBEMClient interface is used to invoke WBEM operations
+ * against a WBEM Server. A WBEMClient implementation can be
+ * retrieved from the WBEMClientFactory specifying the protocol to
+ * be used.
+ *
+ * @see WBEMClientFactory
+ */
+public interface WBEMClient {
+
+ /**
+ * Enumerates CIM classes that are associated to a specified source CIM
+ * class.
+ *
+ * @param pObjectName
+ * CIMObjectPath defining the source CIM Class whose
+ * associated classes are to be returned. The
+ * pObjectName shall include the host, namespace and
+ * object name. The keys shall not be populated.
+ * @param pAssociationClass
+ * This string shall contain a valid CIM Association class name
+ * or be null. It filters the classes returned to
+ * contain only classes associated to the source Object via this
+ * CIM Association class or one of its subclasses.
+ * @param pResultClass
+ * This string shall either contain a valid CIM Class name or be
+ * null. It filters the classes returned to contain
+ * only the classes of this class name or one of its subclasses.
+ * @param pRole
+ * This string shall either contain a valid Property name or be
+ * null. It filters the classes returned to contain
+ * only classes associated to the source class via an Association
+ * class in which the source class plays the specified
+ * role. (i.e. the Property name in the Association class that
+ * refers to the source class matches this value) For
+ * example, if "Antecedent" is specified, then only Associations
+ * in which the source class is the "Antecedent" reference are
+ * examined.
+ * @param pResultRole
+ * This string shall either contain a valid Property name or be
+ * null. It filters the classes returned to contain
+ * only classes associated to the source class via an Association
+ * class in which the class returned plays the specified
+ * role. (i.e. the Property name in the Association class that
+ * refers to the class returned matches this value)
+ * @param pIncludeQualifiers
+ * If true, all Qualifiers for each class (including
+ * Qualifiers on the Object and on any returned Properties) MUST
+ * be included in the classes returned. If false, no
+ * Qualifiers are present in each class returned.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property or method. If true, the
+ * class origin attribute shall be present for each property and
+ * method on all classes returned. If false, the
+ * class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the classes returned. Each CIMClass returned
+ * shall only contain elements for the properties of the names
+ * specified. Duplicate and invalid property names are ignored
+ * and the request is otherwise processed normally. An empty
+ * array indicates that no properties should be included in the
+ * classes returned. A null value indicates that all
+ * properties should be contained in the classes returned.
+ * @return If successful, a CloseableIterator containing zero
+ * or more CIMClasses meeting the specified criteria
+ * are returned.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes shall be
+ * returned along with zero or more instances of
+ * CIM_Error. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator associatorClasses(CIMObjectPath pObjectName,
+ String pAssociationClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException;
+
+ /**
+ * Enumerates CIM Instances associated to a specified source CIM Instance.
+ *
+ * @param pObjectName
+ * CIMObjectPath defining the source CIM Instance
+ * whose associated instances are to be returned. The
+ * pObjectName must contain the host, namespace,
+ * object name and keys for the instance.
+ * @param pAssociationClass
+ * This string shall either contain a valid CIM Association class
+ * name or be null. It filters the instances
+ * returned to contain only instances associated to the source
+ * instance via this CIM Association class or one of its
+ * subclasses.
+ * @param pResultClass
+ * This string shall either contain a valid CIM Class name or be
+ * null. It filters the instances returned to
+ * contain only the instances of this Class name or one of its
+ * subclasses.
+ * @param pRole
+ * This string shall either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the source Object plays the
+ * specified role. (i.e. the Property name in the Association
+ * class that refers to the source Object matches this
+ * value) If "Antecedent" is specified, then only Associations in
+ * which the source Object is the "Antecedent" reference are
+ * examined.
+ * @param pResultRole
+ * This string shall either contain a valid Property name or be
+ * null. It filters the instances returned to
+ * contain only instances associated to the source instance via
+ * an Association class in which the instance returned
+ * plays the specified role. (i.e. the Property name in the
+ * Association class that refers to the instance returned
+ * matches this value) For example, if "Dependent" is specified,
+ * then only Associations in which the instance returned is the
+ * "Dependent" reference are examined.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property on all instances
+ * returned, even if requested the server may ignore the request
+ * and not return the class origin. If false, the
+ * class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the Objects returned. Each CIMInstance returned
+ * only contains elements for the properties of the names
+ * specified. Duplicate and invalid property names are ignored
+ * and the request is otherwise processed normally. An empty
+ * array indicates that no properties should be included in the
+ * instances returned. A null value indicates that
+ * all properties should be contained in the instances returned.
+ * @return If successful, a CloseableIterator containing zero
+ * or more CIMInstances meeting the specified criteria
+ * is returned.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes shall be
+ * returned along with zero or more instances of
+ * CIM_Error. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator associatorInstances(CIMObjectPath pObjectName,
+ String pAssociationClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException;
+
+ /**
+ * Enumerates the CIMObjectPaths of CIM Objects that are
+ * associated to a particular source CIM Object. If the source Object is a
+ * CIM Class, then a CloseableIterator of
+ * CIMObjectPath s of the classes associated to the source
+ * Object is returned. If the source Object is a CIM Instance, then a
+ * CloseableIterator of CIMObjectPaths of the
+ * CIMInstance objects associated to the source Object is
+ * returned.
+ *
+ * @param pObjectName
+ * CIMObjectPath defining the source CIM Object
+ * whose associated Objects are to be returned. This argument may
+ * contain either a Class name or the modelpath of an Instance.
+ * (i.e. Keys populated)
+ * @param pAssociationClass
+ * This string MUST either contain a valid CIM Association class
+ * name or be null. It filters the Objects returned
+ * to contain only Objects associated to the source Object via
+ * this CIM Association class or one of its subclasses.
+ * @param pResultClass
+ * This string MUST either contain a valid CIM Class name or be
+ * null. It filters the Objects returned to contain
+ * only the Objects of this Class name or one of its subclasses.
+ * @param pRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the source Object plays the
+ * specified role. (i.e. the Property name in the Association
+ * class that refers to the source Object matches this
+ * value) If "Antecedent" is specified, then only Associations in
+ * which the source Object is the "Antecedent" reference are
+ * examined.
+ * @param pResultRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the Object returned plays
+ * the specified role. (i.e. the Property name in the Association
+ * class that refers to the Object returned matches this
+ * value) If "Dependent" is specified, then only Associations in
+ * which the Object returned is the "Dependent" reference are
+ * examined.
+ * @return If successful, a CloseableIterator containing zero
+ * or more CIMObjectPath objects of the CIM Classes or
+ * CIM Instances meeting the specified criteria is returned.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator associatorNames(CIMObjectPath pObjectName,
+ String pAssociationClass, String pResultClass, String pRole, String pResultRole)
+ throws WBEMException;
+
+ /**
+ * associatorPaths shall start an enumeration session for
+ * traversing associations starting from the instance defined in the
+ * pInstancePath parameter using any specified filtering
+ * criteria and return zero or more CIMObjectPath objects.
+ *
+ * @param pInstancePath
+ * The CIMObjectPath for the instance for which the
+ * enumeration is to be performed.
+ * @param pAssociationClass
+ * This string MUST either contain a valid CIM Association class
+ * name or be null. It filters the Objects returned
+ * to contain only Objects associated to the source Object via
+ * this CIM Association class or one of its subclasses.
+ * @param pResultClass
+ * This string MUST either contain a valid CIM Class name or be
+ * null. It filters the Objects returned to contain
+ * only the Objects of this Class name or one of its subclasses.
+ * @param pRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the source Object plays the
+ * specified role. (i.e. the Property name in the Association
+ * class that refers to the source Object matches this
+ * value) If "Antecedent" is specified, then only Associations in
+ * which the source Object is the "Antecedent" reference are
+ * examined.
+ * @param pResultRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the Object returned plays
+ * the specified role. (i.e. the Property name in the Association
+ * class that refers to the Object returned matches this
+ * value) If "Dependent" is specified, then only Associations in
+ * which the Object returned is the "Dependent" reference are
+ * examined.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a pFilterQuery is
+ * not supplied. If the implementation does not support the query
+ * language specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_NOT_FOUND (the source instance was not found)
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
+ * CIM_ERR_INVALID_QUERY
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse associatorPaths(CIMObjectPath pInstancePath,
+ String pAssociationClass, String pResultClass, String pRole, String pResultRole,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * associators shall start an enumeration session for
+ * traversing associations starting from the instance defined in the
+ * pInstancePath parameter using any specified filtering
+ * criteria and return zero or more CIMInstance objects.
+ *
+ * @param pInstancePath
+ * The CIMObjectPath for the instance for which the
+ * enumeration is to be performed.
+ * @param pAssociationClass
+ * This string MUST either contain a valid CIM Association class
+ * name or be null. It filters the Objects returned
+ * to contain only Objects associated to the source Object via
+ * this CIM Association class or one of its subclasses.
+ * @param pResultClass
+ * This string MUST either contain a valid CIM Class name or be
+ * null. It filters the Objects returned to contain
+ * only the Objects of this Class name or one of its subclasses.
+ * @param pRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the source Object plays the
+ * specified role. (i.e. the Property name in the Association
+ * class that refers to the source Object matches this
+ * value) If "Antecedent" is specified, then only Associations in
+ * which the source Object is the "Antecedent" reference are
+ * examined.
+ * @param pResultRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects associated to the source Object via an
+ * Association class in which the Object returned plays
+ * the specified role. (i.e. the Property name in the Association
+ * class that refers to the Object returned matches this
+ * value) If "Dependent" is specified, then only Associations in
+ * which the Object returned is the "Dependent" reference are
+ * examined.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property on all instances
+ * returned, even if requested the server may ignore the request
+ * and not return the class origin. If false, the
+ * class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the Objects returned. Each CIMClass or
+ * CIMInstance returned only contains elements for
+ * the properties of the names specified. Duplicate and invalid
+ * property names are ignored and the request is otherwise
+ * processed normally. An empty array indicates that no
+ * properties should be included in the Objects returned. A
+ * null value indicates that all properties should
+ * be contained in the Objects returned. NOTE: Properties
+ * should not be specified in this parameter unless a non-
+ * null value is specified in the
+ * pResultClass parameter.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a filterQuery is not supplied. If
+ * the implementation does not support the query language
+ * specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_NOT_FOUND (The source instance was not found)
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
+ * CIM_ERR_INVALID_QUERY
+ * CIM_ERR_FAILED (Some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse associators(CIMObjectPath pInstancePath,
+ String pAssociationClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeClassOrigin, String[] pPropertyList, String pFilterQueryLanguage,
+ String pFilterQuery, UnsignedInteger32 pTimeout, boolean pContinueOnError,
+ UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * Closes the WBEMClient session.
+ */
+ public void close();
+
+ /**
+ * closeEnumeration shall close an enumeration session that has
+ * been previously started but not yet completed. Clients should always use
+ * this method when an enumeration session has been started and the client
+ * does not retrieve all the results. If a client has started an enumeration
+ * session and retrieves all the results until the
+ * EnumerationResponse.isEnd() is true, this method shall not
+ * be called.
+ *
+ * @param pPath
+ * The CIMObjectPath representing the namespace to
+ * be used.
+ * @param pContext
+ * The enumeration context to close.
+ * @throws WBEMException
+ */
+ public void closeEnumeration(CIMObjectPath pPath, String pContext) throws WBEMException;
+
+ /**
+ * Create a CIM class. The namespace from the
+ * CIMClass.getObjectPath() shall be used.
+ *
+ * @param pClass
+ * The CIMClass to be created.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_ALREADY_EXISTS (the CIM Class already exists)
+ * CIM_ERR_INVALID_SUPERCLASS (the putative CIM Class declares a
+ * non-existent superclass)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void createClass(CIMClass pClass) throws WBEMException;
+
+ /**
+ * Create a CIM Instance. The namespace from the
+ * CIMInstance.getObjectPath() shall be used. The keys of the
+ * CIMInstance may be modified by the implementation and the
+ * client must use the returned object path to determine the name of the
+ * instance. It is possible for a client to leave keys of instances empty/
+ * null and the provider can fill them in. This is
+ * implementation specific unless specified by a CIM Schema or in a DMTF
+ * Profile.
+ *
+ * @param pInstance
+ * The CIMInstance to be created.
+ * @return CIMObjectPath of the instance created.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_INVALID_CLASS (in this namespace)
+ * CIM_ERR_ALREADY_EXISTS
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CIMObjectPath createInstance(CIMInstance pInstance) throws WBEMException;
+
+ /**
+ * Deletes the CIM class for the object specified by the CIM object path.
+ *
+ * @param pPath
+ * The CIMObjectPath identifying the namespace and
+ * class name to delete.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_NOT_FOUND (the CIM Class to be deleted does not exist)
+ * CIM_ERR_CLASS_HAS_CHILDREN (the CIM Class has one or more subclasses
+ * which cannot be deleted)
+ * CIM_ERR_CLASS_HAS_INSTANCES (the CIM Class has one or more instances
+ * which cannot be deleted)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void deleteClass(CIMObjectPath pPath) throws WBEMException;
+
+ /**
+ * Delete the CIM instance specified by the CIM object path.
+ *
+ * @param pPath
+ * The object path of the instance to be deleted. It must include
+ * all of the keys.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_INVALID_CLASS (in this namespace)
+ * CIM_ERR_NOT_FOUND (if the instance does not exist)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void deleteInstance(CIMObjectPath pPath) throws WBEMException;
+
+ /**
+ * Delete a CIM Qualifier type.
+ *
+ * @param pPath
+ * The CIMObjectPath identifying the name and
+ * namespace of the CIM qualifier type to delete.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_NOT_FOUND (the Qualifier did not exist)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void deleteQualifierType(CIMObjectPath pPath) throws WBEMException;
+
+ /**
+ * Enumerate CIM Classes.
+ *
+ * @param pPath
+ * The object path of the class to be enumerated. Only the
+ * namespace and object name should be populated. If the object
+ * name is set to an empty string (i.e. ""), then all base
+ * classes in the target namespace are returned.
+ * @param pDeep
+ * If true, the classes returned shall include
+ * subclasses. If false, the classes returned shall
+ * not include subclasses.
+ * @param pLocalOnly
+ * If true, only elements (properties, methods and
+ * qualifiers) defined in, or overridden in the class are
+ * included in the response. If false, all elements
+ * of the class definition are returned.
+ * @param pIncludeQualifiers
+ * If true, all Qualifiers for each Class and its
+ * elements (properties, methods, references) are included. If
+ * false, no Qualifiers are present in the classes
+ * returned.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property or method. If true, the
+ * class origin attribute shall be present for each property and
+ * method on all returned CIMClasses. If
+ * false, the class origin shall not be present.
+ * @return A CloseableIterator of CIMClasses.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_INVALID_CLASS (the CIM Class that is the basis for this
+ * enumeration does not exist)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator enumerateClasses(CIMObjectPath pPath, boolean pDeep,
+ boolean pLocalOnly, boolean pIncludeQualifiers, boolean pIncludeClassOrigin)
+ throws WBEMException;
+
+ /**
+ * Enumerate the names of CIM Classes.
+ *
+ * @param pPath
+ * The CIMObjectPath identifying the class to be
+ * enumerated. If the class name in the object path specified is
+ * an empty string (i.e. ""), all base classes in the target
+ * namespace are returned. Note that only the namespace and the
+ * name components should be populated.
+ * @param pDeep
+ * If true, the enumeration returned shall contain
+ * the names of all classes derived from the class being
+ * enumerated. If false, the enumeration returned
+ * contains only the names of the first level children of the
+ * class.
+ * @return A CloseableIterator of CIMObjectPaths.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_INVALID_CLASS (the CIM Class that is the basis for this
+ * enumeration does not exist)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator enumerateClassNames(CIMObjectPath pPath, boolean pDeep)
+ throws WBEMException;
+
+ /**
+ * Enumerate the names of the instances for a specified class. The names of
+ * all subclass instances are returned.
+ *
+ * @param pPath
+ * The CIMObjectPath identifying the class whose
+ * instances are to be enumerated. Only the namespace and class
+ * name components are used. All other information (e.g. Keys) is
+ * ignored.
+ * @return CloseabelIterator of CIMObjectPaths.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_INVALID_CLASS (in this namespace)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator enumerateInstanceNames(CIMObjectPath pPath)
+ throws WBEMException;
+
+ /**
+ * enumerateInstancePaths shall enumerate the instances of the
+ * specified class in pClassPath and return zero or more
+ * CIMObjectPaths.
+ *
+ * @param pClassPath
+ * The CIMObjectPath for the class for which the
+ * enumeration is to be performed.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a pFilterQuery is
+ * not supplied. If the implementation does not support the query
+ * language specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_INVALID_CLASS (the source class does not exist)
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
+ * CIM_ERR_INVALID_QUERY
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse enumerateInstancePaths(CIMObjectPath pClassPath,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * Enumerate the instances of a class. The instances of all subclasses are
+ * also returned.
+ *
+ * @param pPath
+ * The object path of the class to be enumerated. Only the
+ * namespace and class name components are used. Any other
+ * information (e.g. Keys) is ignored.
+ * @param pDeep
+ * If true, this specifies that, for each returned
+ * Instance of the Class, all properties of the Instance must be
+ * present (subject to constraints imposed by the other
+ * parameters), including any which were added by subclassing the
+ * specified Class. If false, each returned Instance
+ * includes only properties defined for the specified Class in
+ * path.
+ * @param pLocalOnly
+ * If true, only properties that were instantiated
+ * in the instance are returned. WBEM Servers may ignore this
+ * parameter and return all properties.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property on all returned
+ * CIMInstances, even if requested the server may ignore the
+ * request and not return the class origin. If false
+ * , the class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the instances returned. Each instance returned only contains
+ * elements for the properties of the names specified. Duplicate
+ * and invalid property names are ignored and the request is
+ * otherwise processed normally. An empty array indicates that no
+ * properties should be returned. A null value indicates
+ * that all properties should be returned.
+ * @return A CloseableIterator of CIMInstances.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_INVALID_CLASS (in this namespace)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator enumerateInstances(CIMObjectPath pPath, boolean pDeep,
+ boolean pLocalOnly, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException;
+
+ /**
+ * enumerateInstances shall enumerate the instances of the
+ * specified class in pClassPath and return zero or more
+ * CIMInstances.
+ *
+ * @param pClassPath
+ * The CIMObjectPath for the class for which the
+ * enumeration is to be performed.
+ * @param pDeepInheritance
+ * If true, this specifies that, for each returned
+ * Instance of the Class, all properties of the Instance must be
+ * present (subject to constraints imposed by the other
+ * parameters), including any which were added by subclassing the
+ * specified Class. If false, each returned Instance
+ * includes only properties defined for the specified Class in
+ * path.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property on all instances
+ * returned, even if requested the server may ignore the request
+ * and not return the class origin. If false, the
+ * class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the Objects returned. Each CIMInstance returned
+ * only contains elements for the properties of the names
+ * specified. Duplicate and invalid property names are ignored
+ * and the request is otherwise processed normally. An empty
+ * array indicates that no properties should be included in the
+ * Objects returned. A null value indicates that all
+ * properties should be contained in the Objects returned.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a pFilterQuery is
+ * not supplied. If the implementation does not support the query
+ * language specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_INVALID_CLASS (the source class does not exist)
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
+ * CIM_ERR_INVALID_QUERY
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse enumerateInstances(CIMObjectPath pClassPath,
+ boolean pDeepInheritance, boolean pIncludeClassOrigin, String[] pPropertyList,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * Enumerates the CIM Qualifier types for a specific namespace.
+ *
+ * @param pPath
+ * The CIMObjectPath identifying the namespace whose
+ * qualifier types are to be enumerated.
+ * @return A CloseableIterator of CIMQualifierType
+ * s.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator> enumerateQualifierTypes(CIMObjectPath pPath)
+ throws WBEMException;
+
+ /**
+ * enumerationCount provides an estimated count of the total
+ * number of objects in an open enumeration session represented by an
+ * enumeration context.
+ *
+ * @param pPath
+ * The namespace for the enumeration context.
+ * @param pEnumerationContext
+ * The enumeration context to count.
+ * @return The estimated number of objects.
+ * @throws UnsupportedOperationException
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_INVALID_ENUMERATION_CONTEXT
+ * CIM_ERR_SERVER_LIMITS_EXCEEDED
+ * CIM_ERR_FAILED
+ *
+ *
+ */
+ public UnsignedInteger64 enumerationCount(CIMObjectPath pPath, String pEnumerationContext)
+ throws WBEMException;
+
+ /**
+ * execQuery shall execute a query to retrieve objects.
+ *
+ * @param pPath
+ * CIMObjectPath identifying the class to query.
+ * Only the namespace and class name components are used. All
+ * other information (e.g. Keys) is ignored.
+ * @param pQuery
+ * A string containing the text of the query.
+ * @param pQueryLanguage
+ * A string that identifies the query language to use to parse
+ * the query string specified.
+ * @return A CloseableIterator of CIMInstances.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED (the requested query language
+ * is not recognized)
+ * CIM_ERR_INVALID_QUERY (the query is not a valid query in the specified
+ * query language)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator execQuery(CIMObjectPath pPath, String pQuery,
+ String pQueryLanguage) throws WBEMException;
+
+ /**
+ * execQueryInstances shall execute a query to retrieve
+ * instances.
+ *
+ * @param pObjectName
+ * The CIMObjectPath representing the namespace to
+ * be used.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a pFilterQuery is
+ * not supplied. If the implementation does not support the query
+ * language specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pReturnQueryResultClass
+ * The pReturnQueryResultClass controls whether a
+ * class definition is returned in pQueryResultClass
+ * . If it is set to false,
+ * pQueryResultClass shall be set to
+ * null on output. If it is set to true
+ * , the value of the pQueryResultClass on output
+ * shall be a class definition that defines the properties
+ * (columns) of each row of the query result.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @param pQueryResultClass
+ * The pQueryResultClass is an output argument. It
+ * shall be null if the
+ * pReturnQueryResultClass input parameter is set to
+ * false. Otherwise, it shall return a class
+ * definition where each property of the class corresponds to one
+ * entry of the query select list. The class definition
+ * corresponds to one row of the query result. The class name of
+ * this returned class shall be "CIM_QueryResult". This class
+ * definition is valid only in the context of this enumeration.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws UnsupportedOperationException
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED (the requested filter query
+ * language is not recognized)
+ * CIM_ERR_INVALID_QUERY (the filter query is not a valid query in the
+ * specified filter query language)
+ * CIM_ERR_QUERY_FEATURE_NOT_SUPPORTED (the query requires support for
+ * features that are not supported)
+ * CIM_ERR_FAILED (Some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse execQueryInstances(CIMObjectPath pObjectName,
+ String pFilterQuery, String pFilterQueryLanguage, boolean pReturnQueryResultClass,
+ UnsignedInteger32 pTimeout, boolean pContinueOnError, UnsignedInteger32 pMaxObjects,
+ CIMClass pQueryResultClass) throws WBEMException;
+
+ /**
+ * Returns the CIMClass for the specified
+ * CIMObjectPath.
+ *
+ * @param pName
+ * The object path of the class to be returned. Only the name
+ * space and class name components are used. All other
+ * information (e.g. keys) is ignored.
+ * @param pLocalOnly
+ * If true, only elements (properties, methods,
+ * references) overridden or defined in the class are included in
+ * the CIMClassreturned. If false, all
+ * elements of the class definition are returned.
+ * @param pIncludeQualifiers
+ * If true, all Qualifiers for the class and its
+ * elements are included in the CIMClass returned.
+ * If false, no Qualifier information is contained
+ * in the CIMClass returned.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property or method. If true, the
+ * class origin attribute shall be present for each property and
+ * method on all returned CIMClasses. If
+ * false, the class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the CIMClass returned. The CIMClass
+ * returned only contains elements for the properties of the
+ * names specified. Duplicate and invalid property names are
+ * ignored and the request is otherwise processed normally. An
+ * empty array indicates that no properties should be returned. A
+ * null value indicates that all properties should
+ * be returned.
+ * @return CIMClass meeting the criteria specified.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_NOT_FOUND (the requested CIM Class does not exist in the
+ * specified namespace)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CIMClass getClass(CIMObjectPath pName, boolean pLocalOnly, boolean pIncludeQualifiers,
+ boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException;
+
+ /**
+ * Get a CIMInstance.
+ *
+ * @param pName
+ * The object path of the instance to be returned. The Keys in
+ * this CIMObjectPath must be populated.
+ * @param pLocalOnly
+ * If true, only properties overridden or defined in
+ * the class are included in the CIMInstance
+ * returned. If false, all properties of the class
+ * definition are returned. WBEM Servers may ignore this
+ * parameter and return all properties.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property of the
+ * CIMInstance, even if requested the server may
+ * ignore the request and not return the class origin. If
+ * false, the class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the CIMClass returned. The CIMClass
+ * returned only contains elements for the properties of the
+ * names specified. Duplicate and invalid property names are
+ * ignored and the request is otherwise processed normally. An
+ * empty array indicates that no properties should be returned. A
+ * null value indicates that all properties should
+ * be returned.
+ * @return CIMInstance identified by the
+ * CIMObjectPath specified.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_INVALID_CLASS (in this namespace)
+ * CIM_ERR_NOT_FOUND (if instance does not exist)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CIMInstance getInstance(CIMObjectPath pName, boolean pLocalOnly,
+ boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException;
+
+ /**
+ * getInstancePaths shall get the CIMObjectPaths
+ * using an enumeration context.
+ *
+ * @param pPath
+ * The CIMObjectPath representing the namespace to
+ * be used.
+ * @param pContext
+ * The enumeration context value for the enumeration session to
+ * be used.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects.
+ * @return EnumerateResponse that includes zero or more
+ * CIMObjectPath objects.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_INVALID_ENUMERATION_CONTEXT
+ * CIM_ERR_SERVER_LIMITS_EXCEEDED
+ * CIM_ERR_PULL_HAS_BEEN_ABANDONED
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse getInstancePaths(CIMObjectPath pPath, String pContext,
+ UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * getInstances shall get the instances from an enumeration
+ * session started by execQueryInstances.
+ *
+ * @param pPath
+ * The CIMObjectPath representing the namespace to
+ * be used.
+ * @param pContext
+ * The enumeration context value for the enumeration session to
+ * be used.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return EnumerateResponse that includes zero or more
+ * CIMObjectPath objects.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_INVALID_ENUMERATION_CONTEXT
+ * CIM_ERR_SERVER_LIMITS_EXCEEDED
+ * CIM_ERR_PULL_HAS_BEEN_ABANDONED
+ * CIM_ERR_FAILED
+ *
+ */
+ public EnumerateResponse getInstances(CIMObjectPath pPath, String pContext,
+ UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * getInstancesWithPath shall use the enumeration context
+ * provided to get the next set of instances for the enumeration session.
+ *
+ * @param pPath
+ * The CIMObjectPath representing the namespace to
+ * be used.
+ * @param pContext
+ * The enumeration context value for the enumeration session to
+ * be used.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects.
+ * @return EnumerateResponse that includes zero or more
+ * CIMObjectPath. objects.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_INVALID_ENUMERATION_CONTEXT
+ * CIM_ERR_SERVER_LIMITS_EXCEEDED
+ * CIM_ERR_PULL_HAS_BEEN_ABANDONED
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse getInstancesWithPath(CIMObjectPath pPath,
+ String pContext, UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * Get property values. See WBEMClientConstants for a list of
+ * standard properties.
+ *
+ * @param pKey
+ * The name of the property.
+ * @return The value of the property.
+ * @see WBEMClientConstants
+ */
+ public String getProperty(String pKey);
+
+ /**
+ * Get a CIMQualifierType.
+ *
+ * @param pName
+ * CIMObjectPath that identifies the
+ * CIMQualifierType to return.
+ * @return The CIMQualifierType object.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_NOT_FOUND (the requested Qualifier declaration did not exist)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CIMQualifierType> getQualifierType(CIMObjectPath pName) throws WBEMException;
+
+ /**
+ * Initialize the client connection. This must be called before any
+ * operations. This must only be called once.
+ *
+ * @param pName
+ * The protocol and host to use (e.g. http://192.168.1.128/). Any
+ * other fields shall be ignored.
+ * @param pSubject
+ * The principal/credential pairs for this connection.
+ * @param pLocales
+ * An array of locales in order of priority of preference.
+ * @throws IllegalArgumentException
+ * If the host or scheme portion of the object path is null, or
+ * if the protocol is not supported.
+ * @throws WBEMException
+ * If the protocol adapter or security cannot be initialized.
+ */
+ public void initialize(CIMObjectPath pName, Subject pSubject, Locale[] pLocales)
+ throws IllegalArgumentException, WBEMException;
+
+ /**
+ * Executes the specified method on the specified object.
+ *
+ * @param pName
+ * CIM object path of the object whose method must be invoked. It
+ * must include all of the keys.
+ * @param pMethodName
+ * The name of the method to be invoked.
+ * @param pInputArguments
+ * The CIMArgument array of method input parameters.
+ *
+ * @param pOutputArguments
+ * The CIMArgument array of method output
+ * parameters. The array should be allocated large enough to hold
+ * all returned parameters.
+ * @return The return value of the specified method.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (implementation DOES NOT support ANY
+ * Extrinsic Method Invocation)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_NOT_FOUND (if instance does not exist)
+ * CIM_ERR_METHOD_NOT_FOUND
+ * CIM_ERR_METHOD_NOT_AVAILABLE
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public Object invokeMethod(CIMObjectPath pName, String pMethodName,
+ CIMArgument>[] pInputArguments, CIMArgument>[] pOutputArguments)
+ throws WBEMException;
+
+ /**
+ * Modify the CIMClass.
+ *
+ * @param pClass
+ * CIMClass to be modified.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_INVALID_SUPERCLASS (the putative CIM Class declares a
+ * non-existent superclass)
+ * CIM_ERR_CLASS_HAS_CHILDREN (the modification could not be performed
+ * because it was not possible to update the subclasses of the Class
+ * in a consistent fashion)
+ * CIM_ERR_CLASS_HAS_INSTANCES (the modification could not be performed
+ * because it was not possible to update the instances of the Class in
+ * a consistent fashion)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void modifyClass(CIMClass pClass) throws WBEMException;
+
+ /**
+ * Modify some or all of the properties of the specified
+ * CIMInstance.
+ *
+ * @param pInstance
+ * CIMInstance to be modified. All Keys must be
+ * populated.
+ * @param pPropertyList
+ * An array of property names used to specify which values from
+ * the CIMInstance specified to set. Properties not
+ * specified in this list but set in the CIMInstance
+ * specified are not modified. Duplicate property names are
+ * ignored and the request is otherwise processed normally. If
+ * the pPropertyList contains invalid property names
+ * for the instance to be modified, the server shall reject the
+ * request. An empty array indicates that no properties should be
+ * modified. A null value indicates that all
+ * properties should be modified.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED (provider does not support this method)
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (for this method)
+ * CIM_ERR_INVALID_CLASS (in this namespace)
+ * CIM_ERR_NOT_FOUND (if instance does not exist)
+ * CIM_ERR_NO_SUCH_PROPERTY (in this instance)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void modifyInstance(CIMInstance pInstance, String[] pPropertyList) throws WBEMException;
+
+ /**
+ * Enumerates the Association classes that refer to a specified source CIM
+ * Class.
+ *
+ * @param pObjectName
+ * CIMObjectPath defining the source CIM class whose
+ * referring classes are to be returned. pObjectName
+ * shall contain the scheme, host, namespace and object name
+ * (class name).
+ * @param pResultClass
+ * This string shall either contain a valid CIM Class name or be
+ * null. The pResultClass filters the
+ * classes returned to contain only the classes of this Class
+ * name or one of its subclasses.
+ * @param pRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects referring to the source Object via a Property
+ * with the specified name. If "Antecedent" is specified, then
+ * only Associations in which the source Object is the
+ * "Antecedent" reference are returned.
+ * @param pIncludeQualifiers
+ * If true, all Qualifiers for each Object
+ * (including Qualifiers on the Object and on any returned
+ * Properties) shall be included in the classes returned. If
+ * false, no Qualifiers shall be present in each
+ * class returned.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property or method. If true, the
+ * class Origin attribute shall be present for each property and
+ * method on all classes returned. If false, the
+ * class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the Objects returned. Each CIMClass returned
+ * shall only contains elements for the properties of the names
+ * specified. Duplicate and invalid property names are ignored
+ * and the request is otherwise processed normally. An empty
+ * array indicates that no properties should be included in the
+ * classes returned. A null value indicates that all
+ * properties should be contained in the classes returned.
+ * @return If successful, a CloseableIterator referencing zero
+ * or more CIMClasses meeting the specified criteria.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes shall be
+ * returned along with zero or more instance of
+ * CIM_Error. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+
+ CloseableIterator referenceClasses(CIMObjectPath pObjectName, String pResultClass,
+ String pRole, boolean pIncludeQualifiers, boolean pIncludeClassOrigin,
+ String[] pPropertyList) throws WBEMException;
+
+ /**
+ * Enumerates the Association instances that refer to a specified source CIM
+ * Instance.
+ *
+ * @param pObjectName
+ * CIMObjectPath defining the source CIM Instance
+ * whose referring instances are to be returned. The
+ * pObjectName shall include the host, object name
+ * and keys.
+ * @param pResultClass
+ * This string shall either contain a valid CIM Class name or be
+ * null. It filters the instances returned to
+ * contain only the instances of this Class name or one of its
+ * subclasses.
+ * @param pRole
+ * This string shall either contain a valid Property name or be
+ * null. The role filters the instances returned to
+ * contain only instances referring to the source instance via a
+ * property with the specified name. For example, If "Antecedent"
+ * is specified, then only Associations in which the source
+ * instance is the "Antecedent" reference are returned.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property and on all
+ * instances returned, even if requested the server may ignore
+ * the request and not return the class origin. If
+ * false, the class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the instances returned. Each CIMInstance returned
+ * shall only contain elements for the properties of the names
+ * specified. Duplicate and invalid property names are ignored
+ * and the request is otherwise processed normally. An empty
+ * array indicates that no properties should be included in the
+ * instances returned. A null value indicates that
+ * all properties supported shall be contained in the instance
+ * returned.
+ * @return If successful, a CloseableIterator referencing zero
+ * or more CIMInstances meeting the specified criteria.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes shall be
+ * returned along with zero or more CIM_Error
+ * instances. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ CloseableIterator referenceInstances(CIMObjectPath pObjectName,
+ String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException;
+
+ /**
+ * Enumerates the CIMObjectPaths of Association Objects that
+ * refer to a particular source CIM Object. If the source Object is a CIM
+ * Class, then a CloseableIterator of
+ * CIMObjectPaths of the Association classes that refer to the
+ * source Object is returned. If the source Object is a CIM Instance, then a
+ * CloseableIterator of CIMObjectPaths of the
+ * CIMInstance objects that refer to the source Object is
+ * returned.
+ *
+ * @param pObjectName
+ * CIMObjectPath defining the source CIM Object
+ * whose referring Objects are to be returned. This argument may
+ * contain either a Class name or the modelpath of an Instance.
+ * (i.e. Keys populated)
+ * @param pResultClass
+ * This string MUST either contain a valid CIM Class name or be
+ * null. It filters the Objects returned to contain
+ * only the Objects of this Class name or one of its subclasses.
+ * @param pRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects referring to the source Object via a Property
+ * with the specified name. If "Antecedent" is specified, then
+ * only Associations in which the source Object is the
+ * "Antecedent" reference are returned.
+ * @return If successful, a CloseableIterator referencing zero
+ * or more CIMObjectPaths of CIMClasses or
+ * CIMInstances meeting the specified criteria.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator referenceNames(CIMObjectPath pObjectName,
+ String pResultClass, String pRole) throws WBEMException;
+
+ /**
+ * referencePaths shall start an enumeration session for
+ * association instances that have references that refer to the instance
+ * defined in the pInstancePath parameter and return zero or
+ * more CIMObjectPath objects.
+ *
+ * @param pInstancePath
+ * The CIMObjectPath for the instance for which the
+ * enumeration is to be performed.
+ * @param pResultClass
+ * This string MUST either contain a valid CIM Class name or be
+ * null. It filters the Objects returned to contain
+ * only the Objects of this Class name or one of its subclasses.
+ * @param pRole
+ * This string MUST either contain a valid Property name or be
+ * null. It filters the Objects returned to contain
+ * only Objects referring to the source Object via a Property
+ * with the specified name. If "Antecedent" is specified, then
+ * only Associations in which the source Object is the
+ * "Antecedent" reference are returned.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a pFilterQuery is
+ * not supplied. If the implementation does not support the query
+ * language specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_NOT_FOUND (the source instance was not found)
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
+ * CIM_ERR_INVALID_QUERY
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse referencePaths(CIMObjectPath pInstancePath,
+ String pResultClass, String pRole, String pFilterQueryLanguage, String pFilterQuery,
+ UnsignedInteger32 pTimeout, boolean pContinueOnError, UnsignedInteger32 pMaxObjects)
+ throws WBEMException;
+
+ /**
+ * references shall start an enumeration session for
+ * association instances that have references that refer to the instance
+ * defined in the pInstancePath parameter and return zero or
+ * more CIMInstance objects.
+ *
+ * @param pInstancePath
+ * The CIMObjectPath for the instance for which the
+ * enumeration is to be performed.
+ * @param pResultClass
+ * This string shall either contain a CIM Class name or be
+ * null. It filters the instances returned to
+ * contain only the instances of this Class name or one of its
+ * subclasses.
+ * @param pRole
+ * This string shall either contain a Property name or be
+ * null. It filters the instances returned to
+ * contain only instances referring to the source instance via a
+ * Property with the specified name. If "Antecedent" is
+ * specified, then only Associations in which the source instance
+ * is the "Antecedent" reference are returned.
+ * @param pIncludeClassOrigin
+ * The class origin attribute is the name of the class that first
+ * defined the property. If true, the class origin
+ * attribute may be present for each property on all instances
+ * returned, even if requested the server may ignore the request
+ * and not return the class origin. If false, the
+ * class origin shall not be present.
+ * @param pPropertyList
+ * An array of property names used to filter what is contained in
+ * the instances returned. Each CIMInstance returned
+ * only contains elements for the properties of the names
+ * specified. Duplicate and invalid property names are ignored
+ * and the request is otherwise processed normally. An empty
+ * array indicates that no properties should be included in the
+ * Objects returned. A null value indicates that all
+ * non-null properties of the instance are included.
+ * @param pFilterQueryLanguage
+ * The pFilterQueryLanguage represents the query
+ * language for the pFilterQuery argument. This must
+ * be left null if a pFilterQuery is
+ * not supplied. If the implementation does not support the query
+ * language specified, the
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error shall
+ * be returned. If the implementation does not support filtered
+ * enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pFilterQuery
+ * The pFilterQuery specifies a query in the form of
+ * the query language specified by the
+ * pFilterQueryLanguage parameter. If this value is
+ * not null, the pFilterQueryLanguage
+ * parameter must be non-null. This value shall act
+ * as an additional filter on the result set. If the
+ * implementation does not support the query language specified,
+ * the CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED error
+ * shall be returned. If the implementation does not support
+ * filtered enumerations, the
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED error
+ * shall be returned.
+ * @param pTimeout
+ * This input parameter determines the minimum time the CIM
+ * server shall maintain the open enumeration session after the
+ * last Open or Pull operation (unless the enumeration session is
+ * closed). If the operation timeout is exceeded, the
+ * implementation may close the enumeration session at any time,
+ * releasing any resources allocated to the enumeration session.
+ * A pTimeout of 0 means that there is no operation
+ * timeout. That is, the enumeration session is never closed
+ * based on time. If pTimeout is null,
+ * the implementation shall choose an operation timeout. All
+ * other values for pTimeout specify the operation
+ * timeout in seconds. A implementation may restrict the set of
+ * allowable values for pTimeout. Specifically, the
+ * implementation may not allow 0 (no timeout). If the specified
+ * value is not an allowable value, the implementation shall
+ * return failure with the status code
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT.
+ * @param pContinueOnError
+ * If true, requests that the operation resume when
+ * an error is received. If a implementation does not support
+ * continuation on error and pContinueOnError is
+ * true, it shall throw a WBEMException
+ * with the status code
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED. If a
+ * implementation supports continuation on error and
+ * pContinueOnError is true, the
+ * enumeration session shall remain open when a Pull operation
+ * fails, and any subsequent successful Pull operations shall
+ * return the set of elements that would have been returned if
+ * the failing Pull operations were successful. This behavior is
+ * subject to the consistency rules defined for pulled
+ * enumerations. If pContinueOnError is
+ * false, the enumeration session shall be closed
+ * when either the operation completes successfully or when a
+ * WBEMExcetpion is thrown.
+ * @param pMaxObjects
+ * Defines the maximum number of elements that this Open
+ * operation can return. The implementation may deliver any
+ * number of elements up to pMaxObjects but shall
+ * not deliver more than pMaxObjects elements. An
+ * implementation may choose to never return any elements during
+ * an Open operation, regardless of the value of
+ * pMaxObjects. Note that a CIM client can use a
+ * pMaxObjects value of 0 to specify that it does
+ * not want to retrieve any instances in the Open operation.
+ * @return The return value of a successful Open operation is an array of
+ * enumerated elements with a number of entries from 0 up to a
+ * maximum defined by pMaxObjects. These entries meet
+ * the criteria defined in the Open operation. Note that returning
+ * no entries in the array does not imply that the enumeration
+ * session is exhausted. Client must evaluate the
+ * EnumerateResponse.isEnd() to determine if there are
+ * more elements.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_SERVER_IS_SHUTTING_DOWN
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_OPERATION_TIMEOUT
+ * CIM_ERR_CONTINUATION_ON_ERROR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_PARAMETER
+ * CIM_ERR_NOT_FOUND (the source instance was not found)
+ * CIM_ERR_FILTERED_ENUMERATION_NOT_SUPPORTED
+ * CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED
+ * CIM_ERR_INVALID_QUERY
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public EnumerateResponse references(CIMObjectPath pInstancePath,
+ String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjects) throws WBEMException;
+
+ /**
+ * Change the locales that were provided during initialization.
+ *
+ * @param pLocales
+ * An array of locales in order of priority of preference.
+ */
+ public void setLocales(Locale[] pLocales);
+
+ /**
+ * Set properties that enable options or protocol specific properties. See
+ * WBEMClientConstants for a list of standard properties.
+ *
+ * @param pKey
+ * The name of the property.
+ * @param pValue
+ * The value of the property.
+ * @throws IllegalArgumentException
+ * If the name is not a supported property name.
+ * @see WBEMClientConstants
+ */
+ public void setProperty(String pKey, String pValue);
+
+ /**
+ * Add a CIMQualifierType to the specified namespace if it does
+ * not already exist. Otherwise, it modifies the qualifier type to the value
+ * specified.
+ *
+ * @param pQualifierType
+ * The CIM qualifier type to be added.
+ * @throws UnsupportedOperationException
+ * If the client implementation (or protocol) does not support
+ * the operation.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_ACCESS_DENIED
+ * CIM_ERR_NOT_SUPPORTED
+ * CIM_ERR_INVALID_NAMESPACE
+ * CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ * or otherwise incorrect parameters)
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public void setQualifierType(CIMQualifierType> pQualifierType) throws WBEMException;
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/client/WBEMClientConstants.java b/src/main/java/org/metricshub/wbem/javax/wbem/client/WBEMClientConstants.java
similarity index 85%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/client/WBEMClientConstants.java
rename to src/main/java/org/metricshub/wbem/javax/wbem/client/WBEMClientConstants.java
index becaeab..5d4ecf9 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/wbem/client/WBEMClientConstants.java
+++ b/src/main/java/org/metricshub/wbem/javax/wbem/client/WBEMClientConstants.java
@@ -1,160 +1,158 @@
-/*
- (C) Copyright IBM Corp. 2009, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Dave Blaschke, blaschke@us.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
- * 2884718 2009-10-23 blaschke-oss Merge JSR48 and SBLIM client properties
- * 2930341 2010-01-12 blaschke-oss Sync up WBEMClientConstants with JSR48 1.0.0
- * 2959264 2010-02-25 blaschke-oss Sync up javax.client.* javadoc with JSR48 1.0.0
- * 3496301 2012-03-02 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final
- * 3496355 2012-03-02 blaschke-oss JSR48 1.0.0: add new WBEMClientConstants
- * 3521157 2012-05-10 blaschke-oss JSR48 1.0.0: PROP_ENABLE_*_LOGGING is Level, not 0/1
- */
-package org.sentrysoftware.wbem.javax.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.6.0_18) on Thu Mar 01 12:21:26 EST 2012
-/**
- * This class defines the constants used for WBEMClient
- * configuration. If a property is tagged as optional an implementation may or
- * may not support the property. If the implementation does not support the
- * property, it must throw an IllegalArgumentException if the
- * property value is attempted to be set.
- */
-public class WBEMClientConstants {
-
- /**
- * Use this property to set the list of ciphers the client will support.
- * Setting this value to null will use the default set of ciphers provided
- * by the version of Java being used. Optional.
- */
- public static final String PROP_CLIENT_CIPHERS = "javax.wbem.client.ciphers";
-
- /**
- * This property along with the PROP_CLIENT_KEYSTORE_PASSWORD and
- * PROP_CLIENT_TRUSTSTORE are used to configure mutual authentication. This
- * property is used to provide the filename of the keystore. The path can be
- * relative or full. Optional.
- */
- public static final String PROP_CLIENT_KEYSTORE = "javax.wbem.client.keyStore";
-
- /**
- * This property along with the PROP_CLIENT_KEYSTORE and
- * PROP_CLIENT_TRUSTSTORE are used to configure mutual authentication. This
- * property is used to provide the password of the keystore. Optional.
- */
- public static final String PROP_CLIENT_KEYSTORE_PASSWORD = "javax.wbem.client.keyStorePassword";
-
- /**
- * This property along with the PROP_CLIENT_KEYSTORE and
- * PROP_CLIENT_KEYSTORE_PASSWORD are used to configure mutual
- * authentication. This property is used to provide the filename of the
- * truststore. The path can be relative or full. Optional.
- */
- public static final String PROP_CLIENT_TRUSTSTORE = "javax.wbem.client.trustStore";
-
- /**
- * The value for this property is the level of debug requested.
- */
- public static final String PROP_ENABLE_CONSOLE_LOGGING = "javax.wbem.client.log.console.enabled";
-
- /**
- * The value for this property is the level of debug requested.
- */
- public static final String PROP_ENABLE_FILE_LOGGING = "javax.wbem.client.log.file.enabled";
-
- /**
- * The maximum size in bytes for each log file. The default is 5MB. Note
- * that when the last entry is written, it may go past the limit.
- */
- public static final String PROP_LOG_BYTE_LIMIT = "javax.wbem.client.log.maxfilesize";
-
- /**
- * Set this property to the directory where the log files are created. The
- * default is the directory in which the WBEM client program is run.
- */
- public static final String PROP_LOG_DIR = "javax.wbem.client.log.dir";
-
- /**
- * The name of the client log file. For a WBEM client using the CIM-XML or
- * WS-Management protocol the default is cimclient_log_N.txt where N is the
- * logfile number. The first client log file number is 0.
- */
- public static final String PROP_LOG_FILENAME = "javax.wbem.client.log.filename";
-
- /**
- * The number of log files that will be used. They will be used in
- * round-robin fashion. The default is 3.
- */
- public static final String PROP_LOG_NUM_FILES = "javax.wbem.client.log.numfiles";
-
- /**
- * The timeout for the client to wait for connections. This value is in
- * milliseconds. The default is 0 - unlimited. This value must be a valid
- * integer.
- */
- public static final String PROP_TIMEOUT = "javax.wbem.client.timeout";
-
- /**
- * This property will enable HTTP chunking for a client request. Set this
- * property to "1" to use chunking. Set to "0" to not use chunking. The
- * default is 1. Optional.
- */
- public static final String PROPERTY_WBEM_CHUNKING = "javax.wbem.chunking";
-
- /**
- * The CIM-XML Protocol as defined by the DMTF in the following
- * specifications:
- *
- *
- * DSP0200 - CIM Operations over HTTP
- * DSP0201 - Representation of CIM Using XML
- * DSP0203 - CIM DTD
- *
- */
- public static final String PROTOCOL_CIMXML = "CIM-XML";
-
- /**
- * The WS-Management Protocol as defined by the DMTF in the following
- * specifications:
- *
- *
- * DSP0226 - WS-Management
- * DSP0227 - WS-Management CIM Binding Specification
- * DSP0230 - WS-CIM Mapping Specification
- *
- */
- public static final String PROTOCOL_WSMANAGEMENT = "WS-Management";
-}
+/*
+ (C) Copyright IBM Corp. 2009, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Dave Blaschke, blaschke@us.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
+ * 2884718 2009-10-23 blaschke-oss Merge JSR48 and SBLIM client properties
+ * 2930341 2010-01-12 blaschke-oss Sync up WBEMClientConstants with JSR48 1.0.0
+ * 2959264 2010-02-25 blaschke-oss Sync up javax.client.* javadoc with JSR48 1.0.0
+ * 3496301 2012-03-02 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final
+ * 3496355 2012-03-02 blaschke-oss JSR48 1.0.0: add new WBEMClientConstants
+ * 3521157 2012-05-10 blaschke-oss JSR48 1.0.0: PROP_ENABLE_*_LOGGING is Level, not 0/1
+ */
+package org.metricshub.wbem.javax.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.6.0_18) on Thu Mar 01 12:21:26 EST 2012
+/**
+ * This class defines the constants used for WBEMClient
+ * configuration. If a property is tagged as optional an implementation may or
+ * may not support the property. If the implementation does not support the
+ * property, it must throw an IllegalArgumentException if the
+ * property value is attempted to be set.
+ */
+public class WBEMClientConstants {
+
+ /**
+ * Use this property to set the list of ciphers the client will support.
+ * Setting this value to null will use the default set of ciphers provided
+ * by the version of Java being used. Optional.
+ */
+ public static final String PROP_CLIENT_CIPHERS = "javax.wbem.client.ciphers";
+
+ /**
+ * This property along with the PROP_CLIENT_KEYSTORE_PASSWORD and
+ * PROP_CLIENT_TRUSTSTORE are used to configure mutual authentication. This
+ * property is used to provide the filename of the keystore. The path can be
+ * relative or full. Optional.
+ */
+ public static final String PROP_CLIENT_KEYSTORE = "javax.wbem.client.keyStore";
+
+ /**
+ * This property along with the PROP_CLIENT_KEYSTORE and
+ * PROP_CLIENT_TRUSTSTORE are used to configure mutual authentication. This
+ * property is used to provide the password of the keystore. Optional.
+ */
+ public static final String PROP_CLIENT_KEYSTORE_PASSWORD = "javax.wbem.client.keyStorePassword";
+
+ /**
+ * This property along with the PROP_CLIENT_KEYSTORE and
+ * PROP_CLIENT_KEYSTORE_PASSWORD are used to configure mutual
+ * authentication. This property is used to provide the filename of the
+ * truststore. The path can be relative or full. Optional.
+ */
+ public static final String PROP_CLIENT_TRUSTSTORE = "javax.wbem.client.trustStore";
+
+ /**
+ * The value for this property is the level of debug requested.
+ */
+ public static final String PROP_ENABLE_CONSOLE_LOGGING = "javax.wbem.client.log.console.enabled";
+
+ /**
+ * The value for this property is the level of debug requested.
+ */
+ public static final String PROP_ENABLE_FILE_LOGGING = "javax.wbem.client.log.file.enabled";
+
+ /**
+ * The maximum size in bytes for each log file. The default is 5MB. Note
+ * that when the last entry is written, it may go past the limit.
+ */
+ public static final String PROP_LOG_BYTE_LIMIT = "javax.wbem.client.log.maxfilesize";
+
+ /**
+ * Set this property to the directory where the log files are created. The
+ * default is the directory in which the WBEM client program is run.
+ */
+ public static final String PROP_LOG_DIR = "javax.wbem.client.log.dir";
+
+ /**
+ * The name of the client log file. For a WBEM client using the CIM-XML or
+ * WS-Management protocol the default is cimclient_log_N.txt where N is the
+ * logfile number. The first client log file number is 0.
+ */
+ public static final String PROP_LOG_FILENAME = "javax.wbem.client.log.filename";
+
+ /**
+ * The number of log files that will be used. They will be used in
+ * round-robin fashion. The default is 3.
+ */
+ public static final String PROP_LOG_NUM_FILES = "javax.wbem.client.log.numfiles";
+
+ /**
+ * The timeout for the client to wait for connections. This value is in
+ * milliseconds. The default is 0 - unlimited. This value must be a valid
+ * integer.
+ */
+ public static final String PROP_TIMEOUT = "javax.wbem.client.timeout";
+
+ /**
+ * This property will enable HTTP chunking for a client request. Set this
+ * property to "1" to use chunking. Set to "0" to not use chunking. The
+ * default is 1. Optional.
+ */
+ public static final String PROPERTY_WBEM_CHUNKING = "javax.wbem.chunking";
+
+ /**
+ * The CIM-XML Protocol as defined by the DMTF in the following
+ * specifications:
+ *
+ *
+ * DSP0200 - CIM Operations over HTTP
+ * DSP0201 - Representation of CIM Using XML
+ * DSP0203 - CIM DTD
+ *
+ */
+ public static final String PROTOCOL_CIMXML = "CIM-XML";
+
+ /**
+ * The WS-Management Protocol as defined by the DMTF in the following
+ * specifications:
+ *
+ *
+ * DSP0226 - WS-Management
+ * DSP0227 - WS-Management CIM Binding Specification
+ * DSP0230 - WS-CIM Mapping Specification
+ *
+ */
+ public static final String PROTOCOL_WSMANAGEMENT = "WS-Management";
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/client/WBEMClientFactory.java b/src/main/java/org/metricshub/wbem/javax/wbem/client/WBEMClientFactory.java
similarity index 77%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/client/WBEMClientFactory.java
rename to src/main/java/org/metricshub/wbem/javax/wbem/client/WBEMClientFactory.java
index ec48a00..b896b10 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/wbem/client/WBEMClientFactory.java
+++ b/src/main/java/org/metricshub/wbem/javax/wbem/client/WBEMClientFactory.java
@@ -1,116 +1,113 @@
-/*
- (C) Copyright IBM Corp. 2006, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
- * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
- * 2959264 2010-02-25 blaschke-oss Sync up javax.client.* javadoc with JSR48 1.0.0
- * 3490355 2012-02-21 blaschke-oss TCK: Cannot instantiate WBEMClientFactory
- */
-
-package org.sentrysoftware.wbem.javax.wbem.client;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import org.sentrysoftware.wbem.javax.wbem.WBEMException;
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.WBEMClientCIMXML;
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:59 EST 2010
-/**
- * This class defines the functionality of a WBEMClient factory,
- * which is used to retrieve a WBEMClient for a specified protocol.
- * An example of how to use the factory is included below.
- *
- *
- */
-
-public class WBEMClientFactory extends Object {
-
- private static final String[] cProtocols = { WBEMClientConstants.PROTOCOL_CIMXML };
-
- /**
- *
- */
- public WBEMClientFactory() { /**/}
-
- /**
- * Get a WBEMClient for a protocol.
- *
- * @param pProtocol
- * The protocol name (e.g. "CIM-XML").
- * @return The WBEMClient implementation for the protocol
- * specified.
- * @throws IllegalArgumentException
- *
If the protocol is
- * null or empty.
If the protocol is not
- * supported.
- * @throws WBEMException
- * If the protocol implementation could not be loaded.
- */
- public static WBEMClient getClient(String pProtocol) throws WBEMException {
-
- if (WBEMClientConstants.PROTOCOL_CIMXML.equalsIgnoreCase(pProtocol)) { return new WBEMClientCIMXML(); }
-
- throw new IllegalArgumentException("\"" + pProtocol + "\" is not a supported protocol");
- }
-
- /**
- * Get the names of the supported protocols.
- *
- * @return A string array of the supported protocols.
- */
- public static String[] getSupportedProtocols() {
- return cProtocols;
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
+ * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
+ * 2959264 2010-02-25 blaschke-oss Sync up javax.client.* javadoc with JSR48 1.0.0
+ * 3490355 2012-02-21 blaschke-oss TCK: Cannot instantiate WBEMClientFactory
+ */
+
+package org.metricshub.wbem.javax.wbem.client;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import org.metricshub.wbem.javax.wbem.WBEMException;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.WBEMClientCIMXML;
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:59 EST 2010
+/**
+ * This class defines the functionality of a WBEMClient factory,
+ * which is used to retrieve a WBEMClient for a specified protocol.
+ * An example of how to use the factory is included below.
+ *
+ *
+ */
+
+public class WBEMClientFactory extends Object {
+
+ private static final String[] cProtocols = { WBEMClientConstants.PROTOCOL_CIMXML };
+
+ /**
+ *
+ */
+ public WBEMClientFactory() { /**/}
+
+ /**
+ * Get a WBEMClient for a protocol.
+ *
+ * @param pProtocol
+ * The protocol name (e.g. "CIM-XML").
+ * @return The WBEMClient implementation for the protocol
+ * specified.
+ * @throws IllegalArgumentException
+ *
If the protocol is
+ * null or empty.
If the protocol is not
+ * supported.
+ * @throws WBEMException
+ * If the protocol implementation could not be loaded.
+ */
+ public static WBEMClient getClient(String pProtocol) throws WBEMException {
+
+ if (WBEMClientConstants.PROTOCOL_CIMXML.equalsIgnoreCase(pProtocol)) { return new WBEMClientCIMXML(); }
+
+ throw new IllegalArgumentException("\"" + pProtocol + "\" is not a supported protocol");
+ }
+
+ /**
+ * Get the names of the supported protocols.
+ *
+ * @return A string array of the supported protocols.
+ */
+ public static String[] getSupportedProtocols() {
+ return cProtocols;
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/client/package.html b/src/main/java/org/metricshub/wbem/javax/wbem/client/package.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/client/package.html
rename to src/main/java/org/metricshub/wbem/javax/wbem/client/package.html
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/IndicationListener.java b/src/main/java/org/metricshub/wbem/javax/wbem/listener/IndicationListener.java
similarity index 70%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/IndicationListener.java
rename to src/main/java/org/metricshub/wbem/javax/wbem/listener/IndicationListener.java
index 5fc1a9e..137e86c 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/IndicationListener.java
+++ b/src/main/java/org/metricshub/wbem/javax/wbem/listener/IndicationListener.java
@@ -1,70 +1,68 @@
-/*
- (C) Copyright IBM Corp. 2006, 2010
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-12-14 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2959240 2010-02-25 blaschke-oss Sync up javax.listener.* javadoc with JSR48 1.0.0
- */
-
-package org.sentrysoftware.wbem.javax.wbem.listener;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.EventListener;
-
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:59 EST 2010
-/**
- * This interface is implemented by the code that wants to create a listener for
- * indications. See the WBEMListenerFactory class for an example.
- */
-public interface IndicationListener extends EventListener {
-
- /**
- * Called when an indication has been received by the listener
- *
- * @param pIndicationURL
- * The URL to which the indication was posted. For example if the
- * indication was delivered over the https protocol to the
- * destination listener https://hostname:6111/, pIndicationURL
- * would be set to https://hostname:6111/.
- * @param pIndication
- * The indication received.
- */
- public void indicationOccured(String pIndicationURL, CIMInstance pIndication);
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2010
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-12-14 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2959240 2010-02-25 blaschke-oss Sync up javax.listener.* javadoc with JSR48 1.0.0
+ */
+
+package org.metricshub.wbem.javax.wbem.listener;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.EventListener;
+
+import org.metricshub.wbem.javax.cim.CIMInstance;
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:59 EST 2010
+/**
+ * This interface is implemented by the code that wants to create a listener for
+ * indications. See the WBEMListenerFactory class for an example.
+ */
+public interface IndicationListener extends EventListener {
+
+ /**
+ * Called when an indication has been received by the listener
+ *
+ * @param pIndicationURL
+ * The URL to which the indication was posted. For example if the
+ * indication was delivered over the https protocol to the
+ * destination listener https://hostname:6111/, pIndicationURL
+ * would be set to https://hostname:6111/.
+ * @param pIndication
+ * The indication received.
+ */
+ public void indicationOccured(String pIndicationURL, CIMInstance pIndication);
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListener.java b/src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListener.java
similarity index 80%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListener.java
rename to src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListener.java
index f7cbce3..7b09f81 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListener.java
+++ b/src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListener.java
@@ -1,124 +1,122 @@
-/*
- (C) Copyright IBM Corp. 2006, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-12-14 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2959240 2010-02-25 blaschke-oss Sync up javax.listener.* javadoc with JSR48 1.0.0
- * 3496385 2012-03-02 blaschke-oss JSR48 1.0.0: add WBEMListener get/setProperty
- */
-
-package org.sentrysoftware.wbem.javax.wbem.listener;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.IOException;
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.6.0_18) on Thu Mar 01 12:21:26 EST 2012
-/**
- * The WBEMListener interface is used to add/remove WBEM Indication
- * Listeners. The implementation of a WBEMListener can be retrieved
- * from the WBEMListenerFactor by specifying the protocol to use to
- * listen for indications.
- */
-public interface WBEMListener {
-
- /**
- * Add a new listener using the specified port.
- *
- * @param pListener
- * The Indication Listener that will be called when an indication
- * is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @return The port that was used.
- * @throws IOException
- * If the port is already in use.
- */
- public int addListener(IndicationListener pListener, int pPort, String pTransport)
- throws IOException;
-
- /**
- * Add a new listener using the specified port.
- *
- * @param pListener
- * The Indication Listener that will be called when an indication
- * is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @param localAddr
- * The local IP address to bind to. This is only needed in
- * multi-homed systems.
- * @return The port that was used.
- * @throws IOException
- * If the port is already in use.
- */
- public int addListener(IndicationListener pListener, int pPort, String pTransport,
- String localAddr) throws IOException;
-
- /**
- * Get a property value.
- *
- * @param pName
- * The name of the property.
- * @return The value of the property.
- */
- public String getProperty(String pName);
-
- /**
- * Remove the listener associated with the specified port.
- *
- * @param pPort
- * The port.
- */
- public void removeListener(int pPort);
-
- /**
- * Set a property for the WBEM Listener.
- *
- * @param pName
- * The name of the property.
- * @param pValue
- * The value of the property.
- * @throws IllegalArgumentException
- * If the name is not a supported property name.
- */
- public void setProperty(String pName, String pValue);
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-12-14 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2959240 2010-02-25 blaschke-oss Sync up javax.listener.* javadoc with JSR48 1.0.0
+ * 3496385 2012-03-02 blaschke-oss JSR48 1.0.0: add WBEMListener get/setProperty
+ */
+
+package org.metricshub.wbem.javax.wbem.listener;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.IOException;
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.6.0_18) on Thu Mar 01 12:21:26 EST 2012
+/**
+ * The WBEMListener interface is used to add/remove WBEM Indication
+ * Listeners. The implementation of a WBEMListener can be retrieved
+ * from the WBEMListenerFactor by specifying the protocol to use to
+ * listen for indications.
+ */
+public interface WBEMListener {
+
+ /**
+ * Add a new listener using the specified port.
+ *
+ * @param pListener
+ * The Indication Listener that will be called when an indication
+ * is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @return The port that was used.
+ * @throws IOException
+ * If the port is already in use.
+ */
+ public int addListener(IndicationListener pListener, int pPort, String pTransport)
+ throws IOException;
+
+ /**
+ * Add a new listener using the specified port.
+ *
+ * @param pListener
+ * The Indication Listener that will be called when an indication
+ * is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @param localAddr
+ * The local IP address to bind to. This is only needed in
+ * multi-homed systems.
+ * @return The port that was used.
+ * @throws IOException
+ * If the port is already in use.
+ */
+ public int addListener(IndicationListener pListener, int pPort, String pTransport,
+ String localAddr) throws IOException;
+
+ /**
+ * Get a property value.
+ *
+ * @param pName
+ * The name of the property.
+ * @return The value of the property.
+ */
+ public String getProperty(String pName);
+
+ /**
+ * Remove the listener associated with the specified port.
+ *
+ * @param pPort
+ * The port.
+ */
+ public void removeListener(int pPort);
+
+ /**
+ * Set a property for the WBEM Listener.
+ *
+ * @param pName
+ * The name of the property.
+ * @param pValue
+ * The value of the property.
+ * @throws IllegalArgumentException
+ * If the name is not a supported property name.
+ */
+ public void setProperty(String pName, String pValue);
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListenerConstants.java b/src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListenerConstants.java
similarity index 76%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListenerConstants.java
rename to src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListenerConstants.java
index 3408129..4645fa0 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListenerConstants.java
+++ b/src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListenerConstants.java
@@ -1,81 +1,79 @@
-/*
- (C) Copyright IBM Corp. 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Dave Blaschke, blaschke@us.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 3496380 2012-03-02 blaschke-oss JSR48 1.0.0: add new WBEMListenerConstants
- */
-package org.sentrysoftware.wbem.javax.wbem.listener;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.6.0_18) on Thu Mar 01 12:21:26 EST 2012
-/**
- * This class defines the constants used for WBEMListener
- * configuration. If a property is tagged as optional an implementation may or
- * may not support the property. If the implementation does not support the
- * property, it must throw an IllegalArgumentException if the
- * property value is attempted to be set.
- */
-public class WBEMListenerConstants {
-
- /**
- * Use this property to set the list of ciphers the listener will support.
- * Setting this value to null will use the default set of ciphers provided
- * by the version of Java being used. Optional.
- */
- public static final String PROP_LISTENER_CIPHERS = "javax.wbem.listener.ciphers";
-
- /**
- * This property along with the PROP_LISTENER_KEYSTORE_PASSWORD and
- * PROP_LISTENER_TRUSTSTORE are used to configure mutual authentication.
- * This property is used to provide the filename of the keystore. The path
- * can be relative or full. Optional.
- */
- public static final String PROP_LISTENER_KEYSTORE = "javax.wbem.listener.keyStore";
-
- /**
- * This property along with the PROP_LISTENER_KEYSTORE and
- * PROP_LISTENER_TRUSTSTORE are used to configure mutual authentication.
- * This property is used to provide the password of the keystore. Optional.
- */
- public static final String PROP_LISTENER_KEYSTORE_PASSWORD = "javax.wbem.listener.keyStorePassword";
-
- /**
- * This property along with the PROP_LISTENER_KEYSTORE and
- * PROP_LISTENER_KEYSTORE_PASSWORD are used to configure mutual
- * authentication. This property is used to provide the filename of the
- * truststore. The path can be relative or full. Optional.
- */
- public static final String PROP_LISTENER_TRUSTSTORE = "javax.wbem.listener.trustStore";
-}
+/*
+ (C) Copyright IBM Corp. 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Dave Blaschke, blaschke@us.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 3496380 2012-03-02 blaschke-oss JSR48 1.0.0: add new WBEMListenerConstants
+ */
+package org.metricshub.wbem.javax.wbem.listener;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.6.0_18) on Thu Mar 01 12:21:26 EST 2012
+/**
+ * This class defines the constants used for WBEMListener
+ * configuration. If a property is tagged as optional an implementation may or
+ * may not support the property. If the implementation does not support the
+ * property, it must throw an IllegalArgumentException if the
+ * property value is attempted to be set.
+ */
+public class WBEMListenerConstants {
+
+ /**
+ * Use this property to set the list of ciphers the listener will support.
+ * Setting this value to null will use the default set of ciphers provided
+ * by the version of Java being used. Optional.
+ */
+ public static final String PROP_LISTENER_CIPHERS = "javax.wbem.listener.ciphers";
+
+ /**
+ * This property along with the PROP_LISTENER_KEYSTORE_PASSWORD and
+ * PROP_LISTENER_TRUSTSTORE are used to configure mutual authentication.
+ * This property is used to provide the filename of the keystore. The path
+ * can be relative or full. Optional.
+ */
+ public static final String PROP_LISTENER_KEYSTORE = "javax.wbem.listener.keyStore";
+
+ /**
+ * This property along with the PROP_LISTENER_KEYSTORE and
+ * PROP_LISTENER_TRUSTSTORE are used to configure mutual authentication.
+ * This property is used to provide the password of the keystore. Optional.
+ */
+ public static final String PROP_LISTENER_KEYSTORE_PASSWORD = "javax.wbem.listener.keyStorePassword";
+
+ /**
+ * This property along with the PROP_LISTENER_KEYSTORE and
+ * PROP_LISTENER_KEYSTORE_PASSWORD are used to configure mutual
+ * authentication. This property is used to provide the filename of the
+ * truststore. The path can be relative or full. Optional.
+ */
+ public static final String PROP_LISTENER_TRUSTSTORE = "javax.wbem.listener.trustStore";
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListenerFactory.java b/src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListenerFactory.java
similarity index 76%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListenerFactory.java
rename to src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListenerFactory.java
index d52009b..3e20ed4 100644
--- a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/WBEMListenerFactory.java
+++ b/src/main/java/org/metricshub/wbem/javax/wbem/listener/WBEMListenerFactory.java
@@ -1,108 +1,106 @@
-/*
- (C) Copyright IBM Corp. 2006, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-12-14 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2798931 2009-06-01 raman_arora Fix spelling of getPROTOCOLS()
- * 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
- * 2959240 2010-02-25 blaschke-oss Sync up javax.listener.* javadoc with JSR48 1.0.0
- * 3490009 2012-02-21 blaschke-oss TCK: Too many WBEMListenerFactory class methods
- * 3529062 2012-05-23 blaschke-oss WBEMListenerFactory should return new instance
- */
-
-package org.sentrysoftware.wbem.javax.wbem.listener;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClientConstants;
-
-import org.sentrysoftware.wbem.sblim.cimclient.WBEMListenerSBLIM;
-
-//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:59 EST 2010
-/**
- * This class is a factory for getting a WBEMListener
- * implementation for a specified protocol. An example of how to use the factory
- * is included below.
- *
- *
- */
-public class WBEMListenerFactory extends Object {
-
- private static final String[] PROTOCOLS = { WBEMClientConstants.PROTOCOL_CIMXML };
-
- /**
- *
- */
- public WBEMListenerFactory() { /**/}
-
- /**
- * Get a WBEM Listener implementation for the specified protocol.
- *
- * @param pProtocol
- * The protocol name.
- * @return Implementation of WBEMListener.
- * @throws IllegalArgumentException
- * Could not load protocol implementation.
- */
- public static WBEMListener getListener(String pProtocol) throws IllegalArgumentException {
-
- if (WBEMClientConstants.PROTOCOL_CIMXML.equalsIgnoreCase(pProtocol)) { return new WBEMListenerSBLIM(); }
- throw new IllegalArgumentException("Protocol: " + pProtocol
- + " is not supported! Invoke getProtocols() for the list of "
- + "supported protocols.");
- }
-
- /**
- * Get the names of the supported protocols.
- *
- * @return A string array of the protocol names supported.
- */
- public static String[] getProtocols() {
- return PROTOCOLS;
- }
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-12-14 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2798931 2009-06-01 raman_arora Fix spelling of getPROTOCOLS()
+ * 2882448 2009-10-21 blaschke-oss Add WBEMClientConstants from JSR48
+ * 2959240 2010-02-25 blaschke-oss Sync up javax.listener.* javadoc with JSR48 1.0.0
+ * 3490009 2012-02-21 blaschke-oss TCK: Too many WBEMListenerFactory class methods
+ * 3529062 2012-05-23 blaschke-oss WBEMListenerFactory should return new instance
+ */
+
+package org.metricshub.wbem.javax.wbem.listener;
+
+import org.metricshub.wbem.sblim.cimclient.WBEMListenerSBLIM;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import org.metricshub.wbem.javax.wbem.client.WBEMClientConstants;
+
+//Sync'd against JSR48 1.0.0 javadoc (build 1.5.0_10) on Wed Jan 20 02:20:59 EST 2010
+/**
+ * This class is a factory for getting a WBEMListener
+ * implementation for a specified protocol. An example of how to use the factory
+ * is included below.
+ *
+ *
+ */
+public class WBEMListenerFactory extends Object {
+
+ private static final String[] PROTOCOLS = { WBEMClientConstants.PROTOCOL_CIMXML };
+
+ /**
+ *
+ */
+ public WBEMListenerFactory() { /**/}
+
+ /**
+ * Get a WBEM Listener implementation for the specified protocol.
+ *
+ * @param pProtocol
+ * The protocol name.
+ * @return Implementation of WBEMListener.
+ * @throws IllegalArgumentException
+ * Could not load protocol implementation.
+ */
+ public static WBEMListener getListener(String pProtocol) throws IllegalArgumentException {
+
+ if (WBEMClientConstants.PROTOCOL_CIMXML.equalsIgnoreCase(pProtocol)) { return new WBEMListenerSBLIM(); }
+ throw new IllegalArgumentException("Protocol: " + pProtocol
+ + " is not supported! Invoke getProtocols() for the list of "
+ + "supported protocols.");
+ }
+
+ /**
+ * Get the names of the supported protocols.
+ *
+ * @return A string array of the protocol names supported.
+ */
+ public static String[] getProtocols() {
+ return PROTOCOLS;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/package.html b/src/main/java/org/metricshub/wbem/javax/wbem/listener/package.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/listener/package.html
rename to src/main/java/org/metricshub/wbem/javax/wbem/listener/package.html
diff --git a/src/main/java/org/sentrysoftware/wbem/javax/wbem/package.html b/src/main/java/org/metricshub/wbem/javax/wbem/package.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/javax/wbem/package.html
rename to src/main/java/org/metricshub/wbem/javax/wbem/package.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/CIMXMLTraceListener.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/CIMXMLTraceListener.java
similarity index 68%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/CIMXMLTraceListener.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/CIMXMLTraceListener.java
index 18cfdf6..c789c16 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/CIMXMLTraceListener.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/CIMXMLTraceListener.java
@@ -1,68 +1,66 @@
-/*
- (C) Copyright IBM Corp. 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- * Dave Blaschke, IBM, blaschke@us.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 3554738 2012-08-16 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.logging.Level;
-
-/**
- * The interface CIMXMLTraceListener must be implemented if you want to attach
- * your own CIM-XML logging framework to the CIM Client.
- *
- * @see LogAndTraceManager
- */
-public interface CIMXMLTraceListener {
-
- /**
- * Receive a CIM-XML trace message.
- *
- * @param pLevel
- * One of the message level identifiers, e.g. FINE
- * @param pMessage
- * The CIM-XML message text
- * @param pOutgoing
- * true if CIM-XML is outgoing (being sent from
- * client to server), false if CIM-XML is incoming
- * (being sent from server to client)
- */
- public void traceCIMXML(Level pLevel, String pMessage, boolean pOutgoing);
-
-}
+/*
+ (C) Copyright IBM Corp. 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ * Dave Blaschke, IBM, blaschke@us.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 3554738 2012-08-16 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.logging.Level;
+
+/**
+ * The interface CIMXMLTraceListener must be implemented if you want to attach
+ * your own CIM-XML logging framework to the CIM Client.
+ *
+ * @see LogAndTraceManager
+ */
+public interface CIMXMLTraceListener {
+
+ /**
+ * Receive a CIM-XML trace message.
+ *
+ * @param pLevel
+ * One of the message level identifiers, e.g. FINE
+ * @param pMessage
+ * The CIM-XML message text
+ * @param pOutgoing
+ * true if CIM-XML is outgoing (being sent from
+ * client to server), false if CIM-XML is incoming
+ * (being sent from server to client)
+ */
+ public void traceCIMXML(Level pLevel, String pMessage, boolean pOutgoing);
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/GenericExts.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/GenericExts.java
similarity index 75%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/GenericExts.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/GenericExts.java
index a807115..e9689f2 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/GenericExts.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/GenericExts.java
@@ -1,105 +1,103 @@
-/*
- (C) Copyright IBM Corp. 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Ramandeep Arora, arorar@us.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2797696 2009-05-27 raman_arora Input files use unsafe operations
- * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.ArrayList;
-import java.util.Vector;
-
-/**
- * Class GenericExts is responsible for generic initialization
- */
-public class GenericExts {
-
- /**
- * initArrayList : If arrayList is null then it will return the new
- * arrayList of same type if it is not null then it will clear the arrayList
- *
- * @param
- * : Type Parameter
- *
- * @param pAL
- * : ArrayList to be initialized
- * @return ArrayList : initialized ArrayList
- */
- public static ArrayList initClearArrayList(ArrayList pAL) {
- if (pAL == null) return new ArrayList();
- pAL.clear();
- return pAL;
- }
-
- /**
- * initArrayList : If arrayList is null then it will return the new
- * arrayList of same type if it is not null then it will return the same
- * arrayList
- *
- * @param
- * : Type Parameter
- *
- * @param pAL
- * : ArrayList to be initialized
- * @return ArrayList : initialized ArrayList
- */
- public static ArrayList initArrayList(ArrayList pAL) {
- if (pAL == null) return new ArrayList();
- return pAL;
- }
-
- /**
- * cloneVector : Generic deep copy of the vector. If original vector is null
- * then return value will also be null.
- *
- * @param
- * : Type of vector
- *
- * @param oldVec
- * : The original vector.
- *
- * @return Vector<T> : Deep copy of original vector.
- */
- public static synchronized Vector cloneVector(Vector oldVec) {
- if (oldVec == null) return null;
- Vector newVec = new Vector(oldVec.size());
- for (T obj : oldVec)
- newVec.add(obj);
- return newVec;
- }
-}
+/*
+ (C) Copyright IBM Corp. 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Ramandeep Arora, arorar@us.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2797696 2009-05-27 raman_arora Input files use unsafe operations
+ * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.ArrayList;
+import java.util.Vector;
+
+/**
+ * Class GenericExts is responsible for generic initialization
+ */
+public class GenericExts {
+
+ /**
+ * initArrayList : If arrayList is null then it will return the new
+ * arrayList of same type if it is not null then it will clear the arrayList
+ *
+ * @param
+ * : Type Parameter
+ *
+ * @param pAL
+ * : ArrayList to be initialized
+ * @return ArrayList : initialized ArrayList
+ */
+ public static ArrayList initClearArrayList(ArrayList pAL) {
+ if (pAL == null) return new ArrayList();
+ pAL.clear();
+ return pAL;
+ }
+
+ /**
+ * initArrayList : If arrayList is null then it will return the new
+ * arrayList of same type if it is not null then it will return the same
+ * arrayList
+ *
+ * @param
+ * : Type Parameter
+ *
+ * @param pAL
+ * : ArrayList to be initialized
+ * @return ArrayList : initialized ArrayList
+ */
+ public static ArrayList initArrayList(ArrayList pAL) {
+ if (pAL == null) return new ArrayList();
+ return pAL;
+ }
+
+ /**
+ * cloneVector : Generic deep copy of the vector. If original vector is null
+ * then return value will also be null.
+ *
+ * @param
+ * : Type of vector
+ *
+ * @param oldVec
+ * : The original vector.
+ *
+ * @return Vector<T> : Deep copy of original vector.
+ */
+ public static synchronized Vector cloneVector(Vector oldVec) {
+ if (oldVec == null) return null;
+ Vector newVec = new Vector(oldVec.size());
+ for (T obj : oldVec)
+ newVec.add(obj);
+ return newVec;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/IndicationListenerSBLIM.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/IndicationListenerSBLIM.java
similarity index 72%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/IndicationListenerSBLIM.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/IndicationListenerSBLIM.java
index f90f8ef..2f0b230 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/IndicationListenerSBLIM.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/IndicationListenerSBLIM.java
@@ -1,77 +1,75 @@
-/*
- (C) Copyright IBM Corp. 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- * @author : Dave Blaschke, IBM, blaschke@us.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 3477087 2012-01-23 blaschke-oss Need Access to an Indication Sender's IP Address
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.net.InetAddress;
-import java.util.EventListener;
-
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-
-/**
- * This interface is implemented by the code that wants to create a listener for
- * indications. See the WBEMListenerFactory class for an example.
- *
- * The difference between this interface and IndicationListener is
- * that the JSR48 standard (javax.wbem.listener.IndicationListener)
- * does not allow for the listener to receive the IP of the indication sender
- * whereas this internal interface (
- * org.sblim.cimclinet.IndicationListenerSBLIM) does.
- */
-public interface IndicationListenerSBLIM extends EventListener {
-
- /**
- * Called when an indication has been received by the listener
- *
- * @param pIndicationURL
- * The URL to which the indication was posted. For example if the
- * indication was delivered over the https protocol to the
- * destination listener https://hostname:6111/, pIndicationURL
- * would be set to https://hostname:6111/.
- * @param pIndication
- * The indication received.
- * @param pSenderIP
- * The internet address of the indication sender.
- */
- public void indicationOccured(String pIndicationURL, CIMInstance pIndication,
- InetAddress pSenderIP);
-
-}
+/*
+ (C) Copyright IBM Corp. 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ * @author : Dave Blaschke, IBM, blaschke@us.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 3477087 2012-01-23 blaschke-oss Need Access to an Indication Sender's IP Address
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.net.InetAddress;
+import java.util.EventListener;
+
+import org.metricshub.wbem.javax.cim.CIMInstance;
+
+/**
+ * This interface is implemented by the code that wants to create a listener for
+ * indications. See the WBEMListenerFactory class for an example.
+ *
+ * The difference between this interface and IndicationListener is
+ * that the JSR48 standard (javax.wbem.listener.IndicationListener)
+ * does not allow for the listener to receive the IP of the indication sender
+ * whereas this internal interface (
+ * org.sblim.cimclinet.IndicationListenerSBLIM) does.
+ */
+public interface IndicationListenerSBLIM extends EventListener {
+
+ /**
+ * Called when an indication has been received by the listener
+ *
+ * @param pIndicationURL
+ * The URL to which the indication was posted. For example if the
+ * indication was delivered over the https protocol to the
+ * destination listener https://hostname:6111/, pIndicationURL
+ * would be set to https://hostname:6111/.
+ * @param pIndication
+ * The indication received.
+ * @param pSenderIP
+ * The internet address of the indication sender.
+ */
+ public void indicationOccured(String pIndicationURL, CIMInstance pIndication,
+ InetAddress pSenderIP);
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/LogAndTraceManager.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/LogAndTraceManager.java
similarity index 84%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/LogAndTraceManager.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/LogAndTraceManager.java
index 49b51f3..f7aa039 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/LogAndTraceManager.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/LogAndTraceManager.java
@@ -1,220 +1,218 @@
-/*
- (C) Copyright IBM Corp. 2006, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-11-13 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 3554738 2012-08-16 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.OutputStream;
-import java.util.Collections;
-import java.util.List;
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.logging.LogAndTraceBroker;
-
-/**
- * Class LogAndTraceManager provides the means to register/unregister log and
- * trace listeners. It is the entry point for application that want to redirect
- * the CIM Client's log and trace messages into their own logging framework.
- *
- */
-public class LogAndTraceManager {
-
- private static LogAndTraceManager cManager = new LogAndTraceManager();
-
- /**
- * Returns the singleton instance of the manager.
- *
- * @return The manager
- */
- public static LogAndTraceManager getManager() {
- return cManager;
- }
-
- private LogAndTraceManager() {
- super();
- }
-
- /**
- * Adds a listener for log messages. The listener will be notified of any
- * log event.
- *
- * @param pListener
- * The listener
- */
- public void addLogListener(LogListener pListener) {
- LogAndTraceBroker.getBroker().addLogListener(pListener);
- }
-
- /**
- * Remove a listener. This listener will not be notified of log events
- * anymore.
- *
- * @param pListener
- * The listener
- */
- public void removeLogListener(LogListener pListener) {
- LogAndTraceBroker.getBroker().removeLogListener(pListener);
- }
-
- /**
- * Removes all listeners. Caution: This will also remove the internal
- * console and file loggers.
- */
- public void clearLogListeners() {
- LogAndTraceBroker.getBroker().clearLogListeners();
- }
-
- /**
- * Gets the registered log listeners including the internal console and file
- * loggers.
- *
- * @return An unmodifiable list of listeners
- */
- public List getLogListeners() {
- return Collections.unmodifiableList(LogAndTraceBroker.getBroker().getLogListeners());
- }
-
- /**
- * Adds a listener for log messages. The listener will be notified of any
- * trace event.
- *
- * @param pListener
- * The listener
- */
- public void addTraceListener(TraceListener pListener) {
- LogAndTraceBroker.getBroker().addTraceListener(pListener);
- }
-
- /**
- * Removes a listener. This listener will not be notified of trace events
- * anymore.
- *
- * @param pListener
- * The listener
- */
- public void removeTraceListener(TraceListener pListener) {
- LogAndTraceBroker.getBroker().removeTraceListener(pListener);
- }
-
- /**
- * Removes all listeners. Caution this will also remove the internal trace
- * file listener.
- */
- public void clearTraceListeners() {
- LogAndTraceBroker.getBroker().clearTraceListeners();
- }
-
- /**
- * Gets the registered trace listeners including the internal console and
- * file loggers.
- *
- * @return A unmodifiable list of listeners
- */
- public List getTraceListeners() {
- return Collections.unmodifiableList(LogAndTraceBroker.getBroker().getTraceListeners());
- }
-
- /**
- * Adds a listener for CIM-XML trace messages. The listener will be notified
- * of any CIM-XML trace event.
- *
- * @param pListener
- * The listener
- */
- public void addCIMXMLTraceListener(CIMXMLTraceListener pListener) {
- LogAndTraceBroker.getBroker().addCIMXMLTraceListener(pListener);
- }
-
- /**
- * Removes a CIM-XML trace listener. This listener will not be notified of
- * CIM-XML trace events anymore.
- *
- * @param pListener
- * The listener
- */
- public void removeCIMXMLTraceListener(CIMXMLTraceListener pListener) {
- LogAndTraceBroker.getBroker().removeCIMXMLTraceListener(pListener);
- }
-
- /**
- * Removes all CIM-XML trace listeners.
- */
- public void clearCIMXMLTraceListeners() {
- LogAndTraceBroker.getBroker().clearCIMXMLTraceListeners();
- }
-
- /**
- * Gets the registered CIM-XML trace listeners.
- *
- * @return A unmodifiable list of listeners
- */
- public List getCIMXMLTraceListeners() {
- return Collections
- .unmodifiableList(LogAndTraceBroker.getBroker().getCIMXMLTraceListeners());
- }
-
- /**
- * Returns the stream to which the CIM-XML traces are sent. A value of
- * null means that tracing is effectively disabled. Otherwise
- * the CIM-XML tracing can be activated either globally or per-connection
- * via the "sblim.wbem.cimxmlTracing" configuration property.
- *
- * @return The CIM-XML trace stream
- */
- public OutputStream getXmlTraceStream() {
- return LogAndTraceBroker.getBroker().getXmlTraceStream();
- }
-
- /**
- * Sets the stream to which the CIM-XML traces are sent. A value of
- * null means that tracing is effectively disabled. Otherwise
- * the CIM-XML tracing can be activated either globally or per-connection
- * via the "sblim.wbem.cimxmlTracing" configuration property.
- *
- * @param pStream
- * The CIM-XML trace stream
- */
- public void setXmlTraceStream(OutputStream pStream) {
- LogAndTraceBroker.getBroker().setXmlTraceStream(pStream);
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-11-13 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 3554738 2012-08-16 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.List;
+
+import org.metricshub.wbem.sblim.cimclient.internal.logging.LogAndTraceBroker;
+
+/**
+ * Class LogAndTraceManager provides the means to register/unregister log and
+ * trace listeners. It is the entry point for application that want to redirect
+ * the CIM Client's log and trace messages into their own logging framework.
+ *
+ */
+public class LogAndTraceManager {
+
+ private static LogAndTraceManager cManager = new LogAndTraceManager();
+
+ /**
+ * Returns the singleton instance of the manager.
+ *
+ * @return The manager
+ */
+ public static LogAndTraceManager getManager() {
+ return cManager;
+ }
+
+ private LogAndTraceManager() {
+ super();
+ }
+
+ /**
+ * Adds a listener for log messages. The listener will be notified of any
+ * log event.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void addLogListener(LogListener pListener) {
+ LogAndTraceBroker.getBroker().addLogListener(pListener);
+ }
+
+ /**
+ * Remove a listener. This listener will not be notified of log events
+ * anymore.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void removeLogListener(LogListener pListener) {
+ LogAndTraceBroker.getBroker().removeLogListener(pListener);
+ }
+
+ /**
+ * Removes all listeners. Caution: This will also remove the internal
+ * console and file loggers.
+ */
+ public void clearLogListeners() {
+ LogAndTraceBroker.getBroker().clearLogListeners();
+ }
+
+ /**
+ * Gets the registered log listeners including the internal console and file
+ * loggers.
+ *
+ * @return An unmodifiable list of listeners
+ */
+ public List getLogListeners() {
+ return Collections.unmodifiableList(LogAndTraceBroker.getBroker().getLogListeners());
+ }
+
+ /**
+ * Adds a listener for log messages. The listener will be notified of any
+ * trace event.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void addTraceListener(TraceListener pListener) {
+ LogAndTraceBroker.getBroker().addTraceListener(pListener);
+ }
+
+ /**
+ * Removes a listener. This listener will not be notified of trace events
+ * anymore.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void removeTraceListener(TraceListener pListener) {
+ LogAndTraceBroker.getBroker().removeTraceListener(pListener);
+ }
+
+ /**
+ * Removes all listeners. Caution this will also remove the internal trace
+ * file listener.
+ */
+ public void clearTraceListeners() {
+ LogAndTraceBroker.getBroker().clearTraceListeners();
+ }
+
+ /**
+ * Gets the registered trace listeners including the internal console and
+ * file loggers.
+ *
+ * @return A unmodifiable list of listeners
+ */
+ public List getTraceListeners() {
+ return Collections.unmodifiableList(LogAndTraceBroker.getBroker().getTraceListeners());
+ }
+
+ /**
+ * Adds a listener for CIM-XML trace messages. The listener will be notified
+ * of any CIM-XML trace event.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void addCIMXMLTraceListener(CIMXMLTraceListener pListener) {
+ LogAndTraceBroker.getBroker().addCIMXMLTraceListener(pListener);
+ }
+
+ /**
+ * Removes a CIM-XML trace listener. This listener will not be notified of
+ * CIM-XML trace events anymore.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void removeCIMXMLTraceListener(CIMXMLTraceListener pListener) {
+ LogAndTraceBroker.getBroker().removeCIMXMLTraceListener(pListener);
+ }
+
+ /**
+ * Removes all CIM-XML trace listeners.
+ */
+ public void clearCIMXMLTraceListeners() {
+ LogAndTraceBroker.getBroker().clearCIMXMLTraceListeners();
+ }
+
+ /**
+ * Gets the registered CIM-XML trace listeners.
+ *
+ * @return A unmodifiable list of listeners
+ */
+ public List getCIMXMLTraceListeners() {
+ return Collections
+ .unmodifiableList(LogAndTraceBroker.getBroker().getCIMXMLTraceListeners());
+ }
+
+ /**
+ * Returns the stream to which the CIM-XML traces are sent. A value of
+ * null means that tracing is effectively disabled. Otherwise
+ * the CIM-XML tracing can be activated either globally or per-connection
+ * via the "sblim.wbem.cimxmlTracing" configuration property.
+ *
+ * @return The CIM-XML trace stream
+ */
+ public OutputStream getXmlTraceStream() {
+ return LogAndTraceBroker.getBroker().getXmlTraceStream();
+ }
+
+ /**
+ * Sets the stream to which the CIM-XML traces are sent. A value of
+ * null means that tracing is effectively disabled. Otherwise
+ * the CIM-XML tracing can be activated either globally or per-connection
+ * via the "sblim.wbem.cimxmlTracing" configuration property.
+ *
+ * @param pStream
+ * The CIM-XML trace stream
+ */
+ public void setXmlTraceStream(OutputStream pStream) {
+ LogAndTraceBroker.getBroker().setXmlTraceStream(pStream);
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/LogListener.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/LogListener.java
similarity index 67%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/LogListener.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/LogListener.java
index d6bcfe2..6a647ef 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/LogListener.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/LogListener.java
@@ -1,68 +1,66 @@
-/*
- (C) Copyright IBM Corp. 2006, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-11-13 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.logging.Level;
-
-/**
- * The interface LogListener must be implemented if you want to attach your own
- * logging framework to the CIM Client.
- *
- * @see LogAndTraceManager
- */
-public interface LogListener {
-
- /**
- * Receive a message.
- *
- * @param pLevel
- * One of the message level identifiers, e.g. SEVERE
- * @param pMessageKey
- * The identifier of the message
- * @param pMessage
- * The message text
- * @param pParameters
- * The parameters for the message
- */
- public void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters);
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-11-13 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.logging.Level;
+
+/**
+ * The interface LogListener must be implemented if you want to attach your own
+ * logging framework to the CIM Client.
+ *
+ * @see LogAndTraceManager
+ */
+public interface LogListener {
+
+ /**
+ * Receive a message.
+ *
+ * @param pLevel
+ * One of the message level identifiers, e.g. SEVERE
+ * @param pMessageKey
+ * The identifier of the message
+ * @param pMessage
+ * The message text
+ * @param pParameters
+ * The parameters for the message
+ */
+ public void log(Level pLevel, String pMessageKey, String pMessage, Object[] pParameters);
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/TraceListener.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/TraceListener.java
similarity index 73%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/TraceListener.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/TraceListener.java
index f8fc366..04adebc 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/TraceListener.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/TraceListener.java
@@ -1,83 +1,81 @@
-/*
- (C) Copyright IBM Corp. 2006, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-11-14 lupusalex Make SBLIM client JSR48 compliant
- * 1711092 2006-05-02 lupusalex Some fixes/additions of log&trace messages
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.logging.Level;
-
-/**
- * The interface TraceListener must be implemented if you want to attach your
- * own logging framework to the CIM Client.
- *
- * @see LogAndTraceManager
- */
-public interface TraceListener {
-
- /**
- * Receive a trace message.
- *
- * @param pLevel
- * One of the message level identifiers, e.g. FINE
- * @param pOrigin
- * The java class/method/line-of-code sending the message. Might
- * be null if algorithm failed to determine origin.
- * @param pMessage
- * The message text
- */
- public void trace(Level pLevel, StackTraceElement pOrigin, String pMessage);
-
- /**
- * Receive a trace message.
- *
- * @param pLevel
- * One of the message level identifiers, e.g. SEVERE
- * @param pOrigin
- * The java class/method/line-of-code sending the message
- * @param pMessage
- * The message text
- * @param pThrown
- * The throwable associated with the message
- */
- public void trace(Level pLevel, StackTraceElement pOrigin, String pMessage, Throwable pThrown);
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-11-14 lupusalex Make SBLIM client JSR48 compliant
+ * 1711092 2006-05-02 lupusalex Some fixes/additions of log&trace messages
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.logging.Level;
+
+/**
+ * The interface TraceListener must be implemented if you want to attach your
+ * own logging framework to the CIM Client.
+ *
+ * @see LogAndTraceManager
+ */
+public interface TraceListener {
+
+ /**
+ * Receive a trace message.
+ *
+ * @param pLevel
+ * One of the message level identifiers, e.g. FINE
+ * @param pOrigin
+ * The java class/method/line-of-code sending the message. Might
+ * be null if algorithm failed to determine origin.
+ * @param pMessage
+ * The message text
+ */
+ public void trace(Level pLevel, StackTraceElement pOrigin, String pMessage);
+
+ /**
+ * Receive a trace message.
+ *
+ * @param pLevel
+ * One of the message level identifiers, e.g. SEVERE
+ * @param pOrigin
+ * The java class/method/line-of-code sending the message
+ * @param pMessage
+ * The message text
+ * @param pThrown
+ * The throwable associated with the message
+ */
+ public void trace(Level pLevel, StackTraceElement pOrigin, String pMessage, Throwable pThrown);
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMClientSBLIM.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMClientSBLIM.java
similarity index 88%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMClientSBLIM.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMClientSBLIM.java
index 5acae87..056329c 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMClientSBLIM.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMClientSBLIM.java
@@ -1,278 +1,277 @@
-/*
- WBEMClientSBLIM.java
-
- (C) Copyright IBM Corp. 2006, 2013
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 2942520 2010-03-08 blaschke-oss IPv6 link local address with scope_id including a dot not supported
- * 3516848 2012-04-11 blaschke-oss enumerateNamespaces() method to WBEMClient
- * 3522904 2012-05-02 blaschke-oss Add new API WBEMClientSBLIM.isActive()
- * 2616 2013-02-23 blaschke-oss Add new API WBEMClientSBLIM.sendIndication()
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.net.URI;
-import java.util.Locale;
-import java.util.Properties;
-
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-import javax.net.SocketFactory;
-import javax.security.auth.Subject;
-import org.sentrysoftware.wbem.javax.wbem.CloseableIterator;
-import org.sentrysoftware.wbem.javax.wbem.WBEMException;
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClient;
-
-/**
- * Class WBEMClientSBLIM contains the SBLIM CIM Client specific extensions to
- * the WBEMClient interface.
- *
- * @see WBEMClient
- *
- */
-public interface WBEMClientSBLIM extends WBEMClient {
-
- /**
- * Initialize the client connection. This must be called before any
- * operations. This must only be called once.
- *
- * @param pUri
- * The protocol and host to use. Any other fields will be
- * ignored.
- * @param pSubject
- * The principal/credential pairs for this connection.
- * @param pLocales
- * An array of locales in order of priority of preference.
- * @throws IllegalArgumentException
- * If the host or scheme portion of the object path is null, or
- * if the protocol is not supported.
- * @throws WBEMException
- * If the protocol adapter or security cannot be initialized.
- */
- public void initialize(URI pUri, Subject pSubject, Locale[] pLocales)
- throws IllegalArgumentException, WBEMException;
-
- /**
- * Returns the client specific configuration properties. Note that only
- * these properties are returned that override the global settings. The
- * global settings can be accessed via the java.lang.System
- * class.
- * If the no client specific configuration is set, this method returns
- * null
- *
- * @return The configuration properties
- * @see System#getProperties()
- */
- public Properties getProperties();
-
- /**
- * Sets the client specific configuration properties. Any previously set
- * client specific properties are overwritten. The given properties are
- * handled as an overlay on the global settings. That means that properties
- * specified here override the corresponding global properties whereas
- * properties not specified here are taken from the global properties. The
- * global settings can be accessed via the java.lang.System
- * class.
- *
- * @param pProperties
- * The session specific properties. null resets this
- * client to the global settings.
- *
- * @see System#setProperties(Properties)
- */
- public void setProperties(Properties pProperties);
-
- /**
- * Returns the effective value of a given configuration property. The method
- * will return the local value of the current thread if one was set or
- * otherwise client specific value if one was set or otherwise the global
- * value if one was set or otherwise the default value. Valid property names
- * can be found in the WBEMConfigurationProperties interface.
- *
- * @param pKey
- * The name of the configuration property
- *
- * @return The value of the given configuration property
- * @see WBEMConfigurationProperties
- */
- public String getProperty(String pKey);
-
- /**
- * Sets a client specific configuration property. This property will
- * override the corresponding global property for this client instance. The
- * global settings can be accessed via the java.lang.System
- * class. Valid property names can be found in the
- * WBEMConfigurationProperties interface. Unknown properties
- * are ignored.
- *
- * @param pKey
- * The name of the configuration property
- * @param pValue
- * The value of the configuration property. null
- * resets to the global setting.
- * @see WBEMConfigurationProperties
- * @see System#setProperty(String, String)
- */
- public void setProperty(String pKey, String pValue);
-
- /**
- * Returns the configuration properties that are local to the current
- * thread. Note that only these properties are returned that override the
- * global and the client settings. The global settings can be accessed via
- * the java.lang.System class, the client setting via
- * getProperties().
- * If the no client specific configuration is set, this method returns
- * null
- *
- * @return The configuration properties
- * @see System#getProperties()
- * @see #getProperties()
- */
- public Properties getLocalProperties();
-
- /**
- * Sets the configuration properties that are local to the current thread.
- * Any previously set local properties (of the current thread) are
- * overwritten. The given properties are handled as an overlay on the global
- * settings and the client settings. That means that properties specified
- * here override the corresponding properties whereas properties not
- * specified here are taken from the client or global properties. The global
- * settings can be accessed via the java.lang.System class, the
- * client setting via getProperties().
- *
- * @param pProperties
- * The thread specific properties. null remove the
- * local setting of the current thread.
- *
- * @see System#setProperties(Properties)
- * @see #setProperties(Properties)
- */
- public void setLocalProperties(Properties pProperties);
-
- /**
- * Sets a local configuration property for the current thread. This property
- * will override the corresponding global and client property for this
- * client instance. The global settings can be accessed via the
- * java.lang.System class, the client setting via
- * getProperties(). Valid property names can be found in the
- * WBEMConfigurationProperties interface. Unknown properties
- * are ignored.
- *
- * @param pKey
- * The name of the configuration property
- * @param pValue
- * The value of the configuration property. null
- * resets to the global setting.
- * @see WBEMConfigurationProperties
- * @see System#setProperty(String, String)
- * @see #setProperty(String, String)
- */
- public void setLocalProperty(String pKey, String pValue);
-
- /**
- * Gets the custom socket factory if one is set. The client uses this
- * factory for socket creation instead of the default one.
- *
- * @return The custom factory used for socket creation. null
- * indicates set the JRE default factory is used.
- */
- public SocketFactory getCustomSocketFactory();
-
- /**
- * Sets a custom socket factory. The client will use this factory for socket
- * creation instead of the JRE default.
- *
- * @param pFactory
- * The factory to use for socket creation. null
- * resets to the JRE default factory.
- * @throws UnsupportedOperationException
- * Some protocols might not communicate via TCP sockets
- */
- public void setCustomSocketFactory(SocketFactory pFactory) throws UnsupportedOperationException;
-
- /**
- * Enumerate the names of the instances of CIM namespaces.
- *
- * @param pNamespace
- * The Interop Namespace, if known. If null, the default Interop
- * Namespace names defined by DSP1033 are used.
- * @return A CloseableIterator of CIMObjectPaths.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- * CIM_ERR_FAILED (some other unspecified error occurred)
- *
- */
- public CloseableIterator enumerateNamespaces(String pNamespace)
- throws WBEMException;
-
- /**
- * Returns an indication of whether the client is active (initialized and
- * not closed) or inactive (not initialized or closed).
- *
- * @return true if client is active, false
- * otherwise.
- */
- public boolean isActive();
-
- /**
- * Sends the indication to the specified recipient.
- *
- * @param pRecipient
- * URI of indication recipient.
- * @param pIndication
- * Indication.
- * @return true if indication received successfully,
- * false otherwise.
- * @throws WBEMException
- * If unsuccessful, one of the following status codes must be
- * returned. The ORDERED list is:
- *
- *
- */
- public boolean sendIndication(URI pRecipient, CIMInstance pIndication) throws WBEMException;
-}
+/*
+ WBEMClientSBLIM.java
+
+ (C) Copyright IBM Corp. 2006, 2013
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 2942520 2010-03-08 blaschke-oss IPv6 link local address with scope_id including a dot not supported
+ * 3516848 2012-04-11 blaschke-oss enumerateNamespaces() method to WBEMClient
+ * 3522904 2012-05-02 blaschke-oss Add new API WBEMClientSBLIM.isActive()
+ * 2616 2013-02-23 blaschke-oss Add new API WBEMClientSBLIM.sendIndication()
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.net.URI;
+import java.util.Locale;
+import java.util.Properties;
+
+import javax.net.SocketFactory;
+import javax.security.auth.Subject;
+
+import org.metricshub.wbem.javax.cim.CIMInstance;
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.javax.wbem.CloseableIterator;
+import org.metricshub.wbem.javax.wbem.WBEMException;
+import org.metricshub.wbem.javax.wbem.client.WBEMClient;
+
+/**
+ * Class WBEMClientSBLIM contains the SBLIM CIM Client specific extensions to
+ * the WBEMClient interface.
+ *
+ * @see WBEMClient
+ *
+ */
+public interface WBEMClientSBLIM extends WBEMClient {
+
+ /**
+ * Initialize the client connection. This must be called before any
+ * operations. This must only be called once.
+ *
+ * @param pUri
+ * The protocol and host to use. Any other fields will be
+ * ignored.
+ * @param pSubject
+ * The principal/credential pairs for this connection.
+ * @param pLocales
+ * An array of locales in order of priority of preference.
+ * @throws IllegalArgumentException
+ * If the host or scheme portion of the object path is null, or
+ * if the protocol is not supported.
+ * @throws WBEMException
+ * If the protocol adapter or security cannot be initialized.
+ */
+ public void initialize(URI pUri, Subject pSubject, Locale[] pLocales)
+ throws IllegalArgumentException, WBEMException;
+
+ /**
+ * Returns the client specific configuration properties. Note that only
+ * these properties are returned that override the global settings. The
+ * global settings can be accessed via the java.lang.System
+ * class.
+ * If the no client specific configuration is set, this method returns
+ * null
+ *
+ * @return The configuration properties
+ * @see System#getProperties()
+ */
+ public Properties getProperties();
+
+ /**
+ * Sets the client specific configuration properties. Any previously set
+ * client specific properties are overwritten. The given properties are
+ * handled as an overlay on the global settings. That means that properties
+ * specified here override the corresponding global properties whereas
+ * properties not specified here are taken from the global properties. The
+ * global settings can be accessed via the java.lang.System
+ * class.
+ *
+ * @param pProperties
+ * The session specific properties. null resets this
+ * client to the global settings.
+ *
+ * @see System#setProperties(Properties)
+ */
+ public void setProperties(Properties pProperties);
+
+ /**
+ * Returns the effective value of a given configuration property. The method
+ * will return the local value of the current thread if one was set or
+ * otherwise client specific value if one was set or otherwise the global
+ * value if one was set or otherwise the default value. Valid property names
+ * can be found in the WBEMConfigurationProperties interface.
+ *
+ * @param pKey
+ * The name of the configuration property
+ *
+ * @return The value of the given configuration property
+ * @see WBEMConfigurationProperties
+ */
+ public String getProperty(String pKey);
+
+ /**
+ * Sets a client specific configuration property. This property will
+ * override the corresponding global property for this client instance. The
+ * global settings can be accessed via the java.lang.System
+ * class. Valid property names can be found in the
+ * WBEMConfigurationProperties interface. Unknown properties
+ * are ignored.
+ *
+ * @param pKey
+ * The name of the configuration property
+ * @param pValue
+ * The value of the configuration property. null
+ * resets to the global setting.
+ * @see WBEMConfigurationProperties
+ * @see System#setProperty(String, String)
+ */
+ public void setProperty(String pKey, String pValue);
+
+ /**
+ * Returns the configuration properties that are local to the current
+ * thread. Note that only these properties are returned that override the
+ * global and the client settings. The global settings can be accessed via
+ * the java.lang.System class, the client setting via
+ * getProperties().
+ * If the no client specific configuration is set, this method returns
+ * null
+ *
+ * @return The configuration properties
+ * @see System#getProperties()
+ * @see #getProperties()
+ */
+ public Properties getLocalProperties();
+
+ /**
+ * Sets the configuration properties that are local to the current thread.
+ * Any previously set local properties (of the current thread) are
+ * overwritten. The given properties are handled as an overlay on the global
+ * settings and the client settings. That means that properties specified
+ * here override the corresponding properties whereas properties not
+ * specified here are taken from the client or global properties. The global
+ * settings can be accessed via the java.lang.System class, the
+ * client setting via getProperties().
+ *
+ * @param pProperties
+ * The thread specific properties. null remove the
+ * local setting of the current thread.
+ *
+ * @see System#setProperties(Properties)
+ * @see #setProperties(Properties)
+ */
+ public void setLocalProperties(Properties pProperties);
+
+ /**
+ * Sets a local configuration property for the current thread. This property
+ * will override the corresponding global and client property for this
+ * client instance. The global settings can be accessed via the
+ * java.lang.System class, the client setting via
+ * getProperties(). Valid property names can be found in the
+ * WBEMConfigurationProperties interface. Unknown properties
+ * are ignored.
+ *
+ * @param pKey
+ * The name of the configuration property
+ * @param pValue
+ * The value of the configuration property. null
+ * resets to the global setting.
+ * @see WBEMConfigurationProperties
+ * @see System#setProperty(String, String)
+ * @see #setProperty(String, String)
+ */
+ public void setLocalProperty(String pKey, String pValue);
+
+ /**
+ * Gets the custom socket factory if one is set. The client uses this
+ * factory for socket creation instead of the default one.
+ *
+ * @return The custom factory used for socket creation. null
+ * indicates set the JRE default factory is used.
+ */
+ public SocketFactory getCustomSocketFactory();
+
+ /**
+ * Sets a custom socket factory. The client will use this factory for socket
+ * creation instead of the JRE default.
+ *
+ * @param pFactory
+ * The factory to use for socket creation. null
+ * resets to the JRE default factory.
+ * @throws UnsupportedOperationException
+ * Some protocols might not communicate via TCP sockets
+ */
+ public void setCustomSocketFactory(SocketFactory pFactory) throws UnsupportedOperationException;
+
+ /**
+ * Enumerate the names of the instances of CIM namespaces.
+ *
+ * @param pNamespace
+ * The Interop Namespace, if known. If null, the default Interop
+ * Namespace names defined by DSP1033 are used.
+ * @return A CloseableIterator of CIMObjectPaths.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ * CIM_ERR_FAILED (some other unspecified error occurred)
+ *
+ */
+ public CloseableIterator enumerateNamespaces(String pNamespace)
+ throws WBEMException;
+
+ /**
+ * Returns an indication of whether the client is active (initialized and
+ * not closed) or inactive (not initialized or closed).
+ *
+ * @return true if client is active, false
+ * otherwise.
+ */
+ public boolean isActive();
+
+ /**
+ * Sends the indication to the specified recipient.
+ *
+ * @param pRecipient
+ * URI of indication recipient.
+ * @param pIndication
+ * Indication.
+ * @return true if indication received successfully,
+ * false otherwise.
+ * @throws WBEMException
+ * If unsuccessful, one of the following status codes must be
+ * returned. The ORDERED list is:
+ *
+ *
+ */
+ public boolean sendIndication(URI pRecipient, CIMInstance pIndication) throws WBEMException;
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMConfigurationProperties.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMConfigurationProperties.java
similarity index 95%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMConfigurationProperties.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMConfigurationProperties.java
index be80a47..e1a36c4 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMConfigurationProperties.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMConfigurationProperties.java
@@ -1,1154 +1,1152 @@
-/*
- (C) Copyright IBM Corp. 2006, 2013
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, a.wolf-reber@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
- * 1688273 2007-04-19 lupusalex Full support of HTTP trailers
- * 1815707 2007-10-30 ebak TLS support
- * 1827728 2007-11-12 ebak embeddedInstances: attribute EmbeddedObject not set
- * 1848607 2007-12-11 ebak Strict EmbeddedObject types
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2372030 2008-12-01 blaschke-oss Add property to control synchronized SSL handshaking
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 2846231 2009-09-23 rgummada connection failure on CIMOM w/o user/pw
- * 2930341 2010-01-12 blaschke-oss Sync up WBEMClientConstants with JSR48 1.0.0
- * 2957387 2010-03-03 blaschke-oss EmbededObject XML attribute must not be all uppercases
- * 2970881 2010-03-15 blaschke-oss Add property to control EmbeddedObject case
- * 3046073 2010-09-07 blaschke-oss Performance hit due to socket conn. creation with timeout
- * 3111718 2010-11-18 blaschke-oss org.sblim.cimclient SSL Code is using the wrong SSL Property
- * 3185763 2011-02-25 blaschke-oss Reliable indication support - Phase 1
- * 3195069 2011-02-28 blaschke-oss Need support to disable SSL Handshake
- * 3197423 2011-03-02 blaschke-oss Server authentication with PegasusLocalAuthInfo failing
- * 3277928 2011-04-06 blaschke-oss CIM-XML tracing cannot be enabled in the field
- * 3206904 2011-05-03 blaschke-oss Indication listener deadlock causes JVM to run out sockets
- * 3288721 2011-05-20 blaschke-oss Need the function of indication reordering
- * 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs
- * 3485074 2012-02-06 blaschke-oss An Indication trace request
- * 3492246 2012-02-23 blaschke-oss Rename new indication trace property
- * 3492214 2012-02-23 blaschke-oss Add a SenderIPAddress property indications
- * 3492224 2012-02-23 blaschke-oss Need two different timeouts for Socket connections
- * 3521157 2012-05-10 blaschke-oss JSR48 1.0.0: PROP_ENABLE_*_LOGGING is Level, not 0/1
- * 3524050 2012-06-06 blaschke-oss Improve WWW-Authenticate in HTTPClient.java
- * 3536399 2012-08-25 hellerda Add client/listener peer authentication properties
- * 3572993 2012-10-01 blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability
- * 3598613 2013-01-11 blaschke-oss different data type in cim instance and cim object path
- * 2618 2013-02-27 blaschke-oss Need to add property to disable weak cipher suites for the secure indication
- * 2628 2013-03-26 blaschke-oss Limit size of LinkedList of CIMEvents to be dispatched
- * 2635 2013-05-16 blaschke-oss Slowloris DoS attack for CIM indication listener port
- * 2642 2013-05-21 blaschke-oss Seperate properties needed for cim client and listener to filter out ciphers
- * 2647 2013-07-01 blaschke-oss Add two ssl protocol properties for http server and client
- * 2654 2013-07-29 blaschke-oss Check jcc idle time with CIMOM keepalive timeout to avoid EOF
- * 2151 2013-08-20 blaschke-oss gzip compression not supported
- * 2711 2013-11-13 blaschke-oss LOCALNAMESPACEPATH allows 0 NAMESPACE children
- */
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-/**
- * The interface WBEMConfigurationProperties contains the names of all
- * configuration properties that are recognized by the CIM Client.
- *
- */
-public interface WBEMConfigurationProperties {
-
- /**
- * A URL string giving the location of the CIM client config file.
- *
- * By default the SBLIM CIM Client looks for
- *
- *
file:sblim-cim-client2.properties
- *
file:%USER_HOME%/sblim-cim-client2.properties
- *
file:/etc/java/sblim-cim-client2.properties
- *
- * The first file found will be used. The default search list is not applied
- * if this property is set, even if the given URL does not exist.
- */
- public static final String CONFIG_URL = "sblim.wbem.configURL";
-
- /**
- * Sets the minimum level for messages to be written to the log file.
- *
- * Type: Discrete
- * Recognition: Startup
- * Range: OFF, SEVERE, WARNING, INFO, CONFIG, ALL
- * Default: OFF, which disables file logging completely.
- */
- public static final String LOG_FILE_LEVEL = "sblim.wbem.logFileLevel";
-
- /**
- * A string specifying the location of the log file. The string may include
- * the following special components that will be replaced at runtime:
- *
- *
- *
- *
/
- *
the local pathname separator
- *
- *
- *
%t
- *
the system temporary directory
- *
- *
- *
%h
- *
the value of the "user.home" system property
- *
- *
- *
%g
- *
the generation number to distinguish rotated logs
- *
- *
- *
%u
- *
a unique number to resolve conflicts
- *
- *
- *
%%
- *
translates to a single percent sign "%"
- *
- *
- *
- * Thus for example a pattern of %t/java%g.log with a count of
- * 2 would typically cause log files to be written on Unix to
- * /var/tmp/java2.log
- *
- * Type: String
- * Recognition: Startup
- * Default: %t/cimclient_log_%g.txt.
- */
- public static final String LOG_FILE_LOCATION = "sblim.wbem.logFileLocation";
-
- /**
- * Sets the maximum size in bytes of a single log file. When the limit is
- * reached a new file is created. A limit of zero will create a new log file
- * for every log record !
- *
- * Type: Integer
- * Recognition: Startup
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 100.000
- */
- public static final String LOG_FILE_SIZE_LIMIT = "sblim.wbem.logFileSizeLimit";
-
- /**
- * Sets the number of log files to cycle through. When the number is
- * exceeded the oldest file is dropped.
- *
- * Type: Integer
- * Recognition: Startup
- * Range: 1 .. Integer.MAX_VALUE
- * Default: 5
- */
- public static final String LOG_FILE_COUNT = "sblim.wbem.logFileCount";
-
- /**
- * Sets the minimum level for messages to be written to the console logger
- * file.
- *
- * Type: Discrete
- * Recognition: Startup
- * Range: OFF, SEVERE, WARNING, INFO, CONFIG, ALL
- * Default: OFF, which disables console logging completely.
- */
- public static final String LOG_CONSOLE_LEVEL = "sblim.wbem.logConsoleLevel";
-
- /**
- * Sets the type of the console logger. Maybe either message log or trace
- * log.
- *
- * Type: Discrete
- * Recognition: Startup
- * Range: MESSAGE, TRACE
- * Default: MESSAGE.
- */
- public static final String LOG_CONSOLE_TYPE = "sblim.wbem.logConsoleType";
-
- /**
- * Sets the minimum level for messages to be written to the trace file.
- *
- * Type: Discrete
- * Recognition: Startup
- * Range:
- * OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL
- * Default: OFF, which disables file tracing completely
- */
- public static final String TRACE_FILE_LEVEL = "sblim.wbem.traceFileLevel";
-
- /**
- * A string specifying the location of the trace file. The string may
- * include the following special components that will be replaced at
- * runtime:
- *
- *
- *
- *
/
- *
the local pathname separator
- *
- *
- *
%t
- *
the system temporary directory
- *
- *
- *
%h
- *
the value of the "user.home" system property
- *
- *
- *
%g
- *
the generation number to distinguish rotated logs
- *
- *
- *
%u
- *
a unique number to resolve conflicts
- *
- *
- *
%%
- *
translates to a single percent sign "%"
- *
- *
- *
- * Thus for example a pattern of %t/java%g.log with a count of
- * 2 would typically cause log files to be written on Unix to
- * /var/tmp/java2.log
- *
- * Type: String
- * Recognition: Startup
- * Default: %t/cimclient_trace_%g.txt
- */
- public static final String TRACE_FILE_LOCATION = "sblim.wbem.traceFileLocation";
-
- /**
- * Sets the maximum size in bytes of a single log file. When the limit is
- * reached a new file is created. A limit of zero creates a new file for
- * each trace record !
- *
- * Type: Integer
- * Recognition: Startup
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 1.000.000
- */
- public static final String TRACE_FILE_SIZE_LIMIT = "sblim.wbem.traceFileSizeLimit";
-
- /**
- * Sets the number of log files to cycle through. When the number is
- * exceeded the oldest file is dropped.
- *
- * Type: Integer
- * Recognition: Startup
- * Range: 1 .. Integer.MAX_VALUE
- * Default: 5
- */
- public static final String TRACE_FILE_COUNT = "sblim.wbem.traceFileCount";
-
- /**
- * The timeout for http requests. A timeout of zero is interpreted as
- * infinite timeout.
- *
- * Type: Integer
- * Unit: Milliseconds
- * Recognition: Anytime
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 0
- */
- public static final String HTTP_TIMEOUT = "sblim.wbem.httpTimeout";
-
- /**
- * The size of the internal http connection pools. Each
- * WBEMClient instance has it's own http connection pool. A
- * positive value defines the number of connections, zero that no connection
- * will be reused, and -1 all connections will be reused (when it's
- * possible).
- *
- * Type: Integer
- * Recognition: Anytime
- * Range: -1, 0, 1 .. Integer.MAX_VALUE
- * Default: 16
- */
- public static final String HTTP_POOL_SIZE = "sblim.wbem.httpPoolSize";
-
- /**
- * The Java class name of the authentication module to use for http
- * authentication.
- *
- * Type: String
- * Recognition: On next authentication
- * Range:
- *
- * org.sblim.cimclient.internal.http.WwwAuthInfo, org.sblim.cimclient.internal.http.PegasusLocalAuthInfo or any self-written subclass of org.sblim.cimclient.internal.http.AuthorizationInfo
- *
- * Default: org.sblim.cimclient.internal.http.WwwAuthInfo
- */
- public static final String HTTP_AUTHENTICATION_MODULE = "sblim.wbem.httpAuthModule";
-
- /**
- * The WWW-Authenticate information to use when sending the first request to
- * a server.
- *
- * Note: This string must exactly match what the server returns in the
- * WWW-Authenticate field of an HTTP 401 response when authentication
- * fails. The following two strings are examples:
- *
- *
- *
- * Basic realm="Secure Area"
- * Digest realm="testrealm@host.com",qop="auth,auth-int",nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",opaque="5ccc069c403ebaf9f0171e9517f40e41"
- *
- *
- * Type: String
- * Recognition: On next authentication
- * Range: Basic, Digest
- * Default: none
- */
- public static final String HTTP_WWW_AUTHENTICATE_INFO = "sblim.wbem.httpWwwAuthenticateInfo";
-
- /**
- * Specifies if MPOST is used for transmitting http messages. If false, POST
- * is used.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Range: true, false
- * Default: true
- */
- public static final String HTTP_USE_MPOST = "sblim.wbem.httpMPOST";
-
- /**
- * Specifies if chunking is used for transmitting http messages.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Range: true, false
- * Default: true
- */
- public static final String HTTP_USE_CHUNKING = "sblim.wbem.httpChunking";
-
- /**
- * Specifies the http protocol version to use. This option is useful if the
- * protocol negotiation fails.
- *
- * Type: String
- * Recognition: Anytime
- * Range: 1.0, 1.1
- * Default: 1.1
- */
- public static final String HTTP_VERSION = "sblim.wbem.httpVersion";
-
- /**
- * Specifies how often the client will retry to connect to a CIMOM which
- * refused the connection in the first place.
- *
- * Type: Integer
- * Recognition: Anytime
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 0
- */
- public static final String HTTP_CONNECTION_RETRIES = "sblim.wbem.httpConnectionRetries";
-
- /**
- * Specifies if the client will discard and request again http documents
- * with less than a given number of bytes.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Range: true, false
- * Default: false
- */
- public static final String HTTP_ENABLE_CONTENT_LENGTH_RETRY = "sblim.wbem.httpEnableContentLengthRetry";
-
- /**
- * Specifies the threshold above which a http document is regarded as valid
- * by the content length retry algorithm.
- *
- * Type: Integer
- * Recognition: Anytime
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 50
- */
- public static final String HTTP_CONTENT_LENGTH_THRESHOLD = "sblim.wbem.httpContentLengthThreshold";
-
- /**
- * The file path of the SSL keystore.
- *
- * Type: String
- * Recognition: On next SSL connection
- * Default: none
- */
- public static final String KEYSTORE_PATH = "javax.net.ssl.keyStore";
-
- /**
- * The type of the keystore.
- *
- * Type: String
- * Recognition: On next SSL connection
- * Range: PKCS12, JKS, ...
- * Default: JKS
- */
- public static final String KEYSTORE_TYPE = "javax.net.ssl.keyStoreType";
-
- /**
- * The password of the keystore.
- *
- * Type: String
- * Recognition: On next SSL connection
- * Default: none
- */
- public static final String KEYSTORE_PASSWORD = "javax.net.ssl.keyStorePassword";
-
- /**
- * The file path of the SSL truststore.
- *
- * Type: String
- * Recognition: On next SSL connection
- * Default: none
- */
- public static final String TRUSTSTORE_PATH = "javax.net.ssl.trustStore";
-
- /**
- * The type of the truststore.
- *
- * Type: String
- * Recognition: On next SSL connection
- * Range: PKCS12, JKS, ...
- * Default: JKS
- */
- public static final String TRUSTSTORE_TYPE = "javax.net.ssl.trustStoreType";
-
- /**
- * The password of the truststore.
- *
- * Type: String
- * Recognition: On next SSL connection
- * Default: none
- */
- public static final String TRUSTSTORE_PASSWORD = "javax.net.ssl.trustStorePassword";
-
- /**
- * The provider to use for creation of SSL client sockets.
- *
- * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
- *
- *
- * Type: Java class name
- * Recognition: On next SSL connection
- * Default: Security.getProviders("SSLContext.SSL")
- */
- public static final String SSL_SOCKET_PROVIDER = "sblim.wbem.sslSocketProvider";
-
- /**
- * The provider to use for creation of SSL server sockets.
- *
- * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
- *
- *
- * Type: Java class name
- * Recognition: On next SSL connection
- * Default: Security.getProviders("SSLContext.SSL")
- */
- public static final String SSL_SERVER_SOCKET_PROVIDER = "sblim.wbem.sslServerSocketProvider";
-
- /**
- * The protocol used for SSLContext.getInstance(String protocol). For
- * IBMJSSE2 provider it can be "SSL_TLS".
- *
- * Security property: JRE global access via
- * Security.setProperty() and
- * Security.getProperty()
- * Recognition: On next SSL connection
- * Default: "SSL"
- */
- public static final String SSL_PROTOCOL = "ssl.Protocol";
-
- /**
- * The protocol used for SSLContext.getInstance(String protocol) by a
- * client. This property overrides any value set via the ssl.Protocol
- * property.
- *
- * Recognition: On next SSL connection
- * Default: none
- */
- public static final String SSL_CLIENT_PROTOCOL = "sblim.wbem.sslClientProtocol";
-
- /**
- * The protocol used for SSLContext.getInstance(String protocol) by a
- * listener. This property overrides any value set via the ssl.Protocol
- * property.
- *
- * Recognition: On next SSL connection
- * Default: none
- */
- public static final String SSL_LISTENER_PROTOCOL = "sblim.wbem.sslListenerProtocol";
-
- /**
- * The key manager factory algorithm name.
- *
- * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
- *
- *
- * Type: String
- * Recognition: On next SSL connection
- * Range: IbmX509, SunX509, ...
- * Default: JRE specific
- */
- public static final String SSL_KEYMANAGER_ALGORITHM = "ssl.KeyManagerFactory.algorithm";
-
- /**
- * The trust manager factory algorithm name.
- *
- * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
- *
- *
- * Type: String
- * Recognition: On next SSL connection
- * Range: IbmX509, SunX509, ...
- * Default: JRE specific
- */
- public static final String SSL_TRUSTMANAGER_ALGORITHM = "ssl.TrustManagerFactory.algorithm";
-
- /**
- * Determines if a HTTPS client will attempt to authenticate the server
- * (i.e. CIMOM) by verifying the server certificate.
- *
- * If false, do not attempt verification. If true, the client will attempt
- * to verify the server certificate against the contents of the truststore;
- * in this case a valid path must be defined in "javax.net.ssl.trustStore"
- * or no connection will be permitted.
- *
- * Type: Boolean
- * Recognition: On initialization of a new client
- * Default: false
- */
- public static final String SSL_CLIENT_PEER_VERIFICATION = "sblim.wbem.sslClientPeerVerification";
-
- /**
- * Determines how a HTTPS listener will handle authentication of a client
- * (i.e. indication sender):
- *
- *
- *
- *
ignore
- *
do not examine the client certificate
- *
- *
- *
accept
- *
examine client certificate if presented; do not fail if not presented
- *
- *
- *
- *
require
- *
examine client certificate; fail if not presented
- *
- *
- *
- * If set to "ignore", do not attempt verification. If set to "accept" or
- * "require", the listener will attempt to verify the sender against the
- * contents of the truststore; in this case a valid path must be defined in
- * "javax.net.ssl.trustStore" or no connection will be permitted.
- *
- * Type: String
- * Recognition: On next call to addListener()
- * Default: ignore
- */
- public static final String SSL_LISTENER_PEER_VERIFICATION = "sblim.wbem.sslListenerPeerVerification";
-
- /**
- * The comma-separated list of cipher suites that are to be disabled by the
- * client when connecting via an SSL socket. In general, this is the list of
- * cipher suites considered "too weak" for use in a particular environment.
- *
- * Type: String
- * Recognition: On initialization of a new client
- * Default: none
- */
- public static final String SSL_CLIENT_CIPHER_SUITES_TO_DISABLE = "sblim.wbem.sslClientCipherSuitesToDisable";
-
- /**
- * The comma-separated list of cipher suites that are to be disabled by the
- * listener when connecting via an SSL socket. In general, this is the list
- * of cipher suites considered "too weak" for use in a particular
- * environment.
- *
- * Type: String
- * Recognition: On next call to addListener()
- * Default: none
- */
- public static final String SSL_LISTENER_CIPHER_SUITES_TO_DISABLE = "sblim.wbem.sslListenerCipherSuitesToDisable";
-
- /**
- * Specifies the XML parser for parsing CIM-XML responses.
- * The SAX parser is the default choice since it is fast, resource saving
- * and interoperable. The streaming algorithm of the PULL parser uses the
- * fewest possible resources but at the prize to keep the CIMOMs response
- * open for a long time. That works with many but not all CIMOMs. The DOM
- * parser is slow and resource hungry but nice to debug.
- *
- * Type: Discrete
- * Recognition: Anytime
- * Range: DOM, PULL, SAX
- * Default: SAX
- */
- public static final String CIMXML_PARSER = "sblim.wbem.cimxmlParser";
-
- /**
- * Enables or disables tracing of CIM-XML communication. The trace is sent
- * to an output stream the application has to set via the LogAndTraceManager
- * class.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Range: true, false
- * Default: false
- */
- public static final String CIMXML_TRACING = "sblim.wbem.cimxmlTracing";
-
- /**
- * Specifies the stream to use for tracing CIM-XML communication in the
- * event the application does not set one via the LogAndTraceManager class.
- * This stream can either be standard output (System.out), standard error
- * output (System.err) or a filename to be opened by the client.
- *
- * Note: This property has no effect unless sblim.wbem.cimxmlTracing is set
- * to true.
- *
- * Note: This property has no effect if the application already set the
- * stream prior to client initialization. If the application sets the stream
- * after client initialization, the stream specified by this property is
- * overridden.
- *
- * Note: If a filename is specified, it is opened and all CIM-XML
- * communication is written to it - no checks are made for an existing file
- * or for filling up the disk. USE WITH CAUTION.
- *
- * Type: String
- * Recognition: Startup
- * Range: System.out, System.err, filename
- * Default: none
- */
- public static final String CIMXML_TRACE_STREAM = "sblim.wbem.cimxmlTraceStream";
-
- /**
- *
- * Tells the XML builder how to sign embedded objects. This is necessary due to
- * the non-consequent handling of embedded objects on different CIMOMs.
- * "AttribOnly" - only the EmbeddedObject="instance/object" is used
- * (should be good for Pegasus)
- * "EmbObjQuali" - on qualified CIM-XML elements the EmbeddedObject qualifier is used
- * for embedded classes and instances
- * "EmbObjAndEmbInstQuali" -
- * on qualified CIM-XML elements the EmbeddedObject qualifier is used
- * for embedded classes and the EmbeddedInstance="className" qualifier
- * is used for embedded instances
- * Type: String
- * Recognition: Anytime
- * Range: AttribOnly, EmbObjQuali, EmbObjAndEmbInstQuali
- * Default: AttribOnly
- *
- */
- public static final String CIMXML_EMBOBJBUILDER = "sblim.wbem.cimxmlEmbObjBuilder";
-
- /**
- *
- * If set the type of valueless EmbeddedObjects are mapped to CLASS_T. It should work well
- * with OpenPegasus-2.7.0.
- * If unset no type mapping is done for valuless EmbeddedObjects.
- *
- * Type: Boolean
- * Default: true
- *
- */
- public static final String CIMXML_PARSER_STRICT_EMBOBJ_TYPES = "sblim.wbem.cimxmlParser.strictEmbObjTypes";
-
- /**
- *
- * If set to false, the embedded object entity in all requests is in mixed case
- * (EmbeddedObject) per DSP0203. If set to true, the embedded object entity is in
- * upper case (EMBEDDEDOBJECT) - this works with some older CIMOMs, such as OpenPegasus
- * 2.6.1 and 2.7.0.
- *
- * <!ENTITY % EmbeddedObject "EmbeddedObject (object|instance) #IMPLIED">
- *
- * Type: Boolean
- * Recognition: Startup
- * Range: true, false
- * Default: true
- *
- */
- public static final String CIMXML_BUILDER_UPPERCASE_EMBOBJ_ENTITIES = "sblim.wbem.cimxmlBuilder.upperCaseEmbObjEntities";
-
- /**
- *
- * If set to true, SSL handshakes are performed after an SSL socket is created by the
- * socket factory. If set to false, handshakes are not performed, which is useful if
- * if the handshake has already taken place.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Default: true
- *
- */
- public static final String PERFORM_SSL_HANDSHAKE = "sblim.wbem.performSslHandshake";
-
- /**
- *
- * If set to false, SSL handshakes are not synchronized. If set to true, SSL handshakes
- * are synchronized as a workaround for an IBMJSSE1 problem with thread-safe handshakes.
- *
- * Note: This property has no affect unless sblim.wbem.performSslHandshake is set to
- * true.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Default: false
- *
- */
- public static final String SYNCHRONIZED_SSL_HANDSHAKE = "sblim.wbem.synchronizedSslHandshake";
-
- /**
- *
- * If set to true, socket connections are attempted with the timeout value defined by
- * sblim.wbem.socketConnectTimeout. If set to false, socket connections are attempted
- * without a timeout. Using a timeout for socket connections is the preferred method
- * but may introduce intermittent, significant performance impacts during the connection
- * process in Java 5+ (see Sun bug 5092063).
- *
- * Type: Boolean
- * Recognition: Anytime
- * Default: true
- *
- */
- public static final String SOCKET_CONNECT_WITH_TIMEOUT = "sblim.wbem.socketConnectWithTimeout";
-
- /**
- *
- * The timeout for socket connect requests. A timeout of zero is interpreted
- * as infinite timeout.
- *
- * Note: This property has no effect unless socket connection with timeout is
- * enabled (see the sblim.wbem.socketConnectWithTimeout property).
- *
- * Type: Integer
- * Unit: Milliseconds
- * Recognition: Anytime
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 0
- *
- */
- public static final String SOCKET_CONNECT_TIMEOUT = "sblim.wbem.socketConnectTimeout";
-
- /**
- * The idle timeout between socket requests after which the socket is
- * automatically reset (closed, then reopened). A timeout of zero is
- * interpreted as infinite timeout.
- * Type: Integer
- * Unit: Milliseconds
- * Recognition: Anytime
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 0
- */
- public static final String SOCKET_IDLE_TIMEOUT = "sblim.wbem.socketIdleTimeout";
-
- /**
- *
- * Turn on/off usage of the default user/password, which can be used
- * if the CIMOM requires a "garbage" credential. If set to false,
- * user-supplied credentials will be applied. If set to true,
- * default credentials will be applied when both the user-supplied
- * principal and credential are null/empty.
- *
- * Type: Boolean
- * Recognition: Startup
- * Default: false
- *
- */
- public static final String KEY_CREDENTIALS_DEFAULT_ENABLED = "sblim.wbem.default.authorization.enabled";
-
- /**
- *
- * The name of the user for the "garbage" credential.
- *
- * Note: This property has no effect unless default authorization is
- * enabled (see the sblim.wbem.default.authorization.enabled property)
- * AND both the user-supplied principal and credential are null/empty.
- *
- * Type: String
- * Recognition: Startup
- * Default: "default"
- *
- */
- public static final String KEY_DEFAULT_PRINCIPAL = "sblim.wbem.default.principal";
-
- /**
- *
- * The credential of the user for the "garbage" credential.
- *
- * Note: This property has no effect unless default authorization is
- * enabled (see the sblim.wbem.default.authorization.enabled property)
- * AND both the user-supplied principal and credential are null/empty.
- *
- * Type: String
- * Recognition: Startup
- * Default: "default"
- *
- */
- public static final String KEY_DEFAULT_CREDENTIAL = "sblim.wbem.default.credential";
-
- /**
- * The timeout for http connections of an indication listener. A timeout of
- * zero is interpreted as infinite timeout.
- *
- * Type: Integer
- * Unit: Milliseconds
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 10000
- */
- public static final String LISTENER_HTTP_TIMEOUT = "sblim.wbem.listenerHttpTimeout";
-
- /**
- * The header timeout for http connections of an indication listener. The
- * header timeout is defined as the maximum amount of time allowed to read
- * in the entire http header. A timeout of zero is interpreted as infinite
- * timeout.
- *
- * Note: One form of DoS attack sends periodic http header lines in an
- * attempt to keep the socket open indefinitely. This timeout can be used to
- * thwart such an attempt.
- *
- * Type: Integer
- * Unit: Milliseconds
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 30000
- */
- public static final String LISTENER_HTTP_HEADER_TIMEOUT = "sblim.wbem.listenerHttpHeaderTimeout";
-
- /**
- * The maximum allowable timeouts an http connection of an indication
- * listener can have before the client ignores it. In other words, the
- * number of times an IP exceeds sblim.wbem.listenerHttpTimeout and
- * sblim.wbem.listenerHttpHeaderTimeout before it is blocked. A value of
- * zero is interpreted as unlimited timeouts.
- *
- * Type: Integer
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 0
- */
- public static final String LISTENER_HTTP_MAX_ALLOWED_TIMEOUTS = "sblim.wbem.listenerHttpMaxAllowedTimeouts";
-
- /**
- * The size of the thread pool for the connection handlers of the indication
- * for http connections of an indication listener. This is the maximum
- * number of handler threads the pool might create on heavy load.
- * A value of -1 is interpreted as infinity.
- * Type: Integer
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: -1 .. Integer.MAX_VALUE
- * Default: 8
- */
- public static final String LISTENER_MAX_POOL_SIZE = "sblim.wbem.listenerPoolMaxSize";
-
- /**
- * The minimal number of connection handlers of the indication listener that
- * will be kept open by the thread pool regardless of the current load.
- * Type: Integer
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 2
- */
- public static final String LISTENER_MIN_POOL_SIZE = "sblim.wbem.listenerPoolMinSize";
-
- /**
- * The maximum number of queued connections (the fixed capacity of the
- * ArrayBlockingQueue of pending connections incoming to the listener).
- * Whereas increasing this number will result in a correspondingly greater
- * memory usage, making the number too small can result in HTTP 503
- * "Service temporarily overloaded" returned to server if there is no room
- * in queue for an incoming connection.
- * Type: Integer
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: 1 .. Integer.MAX_VALUE
- * Default: 32
- */
- public static final String LISTENER_MAX_QUEUE_SIZE = "sblim.wbem.listenerQueueMaxSize";
-
- /**
- * The number of queued connections that is tolerated before the thread pool
- * creates an additional handler thread. Increasing this value leads to a
- * less "nervous" creation/destruction of handlers. However it
- * makes the listener more vulnerable to frozen connections.
- *
- * Type: Integer
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 2
- */
- public static final String LISTENER_BACKLOG = "sblim.wbem.listenerBacklog";
-
- /**
- * The idle time of a worker that is tolerated before the worker is
- * destroyed by the thread pool. By setting the minimal pool size >0 you can
- * protect a given number of worker from destruction.
- *
- * Type: Long
- * Unit: Milliseconds
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Long.MAX_VALUE
- * Default: 30000
- */
- public static final String LISTENER_HANDLER_MAX_IDLE = "sblim.wbem.listenerHandlerMaxIdle";
-
- /**
- * The maximum number of queued events (the fixed capacity of the LinkedList
- * of indications awaiting delivery to the listener). When the maximum is
- * reached, the oldest indications are discarded to make room for the newest
- * ones. A value of 0 is interpreted as infinity.
- * Type: Integer
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. Integer.MAX_VALUE
- * Default: 0
- */
- public static final String LISTENER_MAX_QUEUED_EVENTS = "sblim.wbem.listenerMaxQueuedEvents";
-
- /**
- *
- * If set to true, reliable indication support is enabled and indications
- * are processed accordingly. If set to false, reliable indication
- * support is disabled and indications are passed directly to listener.
- *
- * If reliable indication support is enabled, incoming indications are
- * handled as documented in DSP1054 which includes queuing unexpected
- * indications, caching all indications for the duration of their sequence
- * identifier lifetime, and logging missing, duplicate and out-of-order
- * indications.
- *
- * The sequence identifier lifetime is defined as:
- * DeliveryRetryAttempts * DeliveryRetryInterval * 10
- * These values can be set by the sblim.wbem.listenerDeliveryRetryAttempts
- * and sblim.wbem.listenerDeliveryRetryInterval properties below.
- *
- * Unexpected indications are queued in either a linked list or a hash
- * table based on the sblim.wbem.listenerReliableIndicationHashtableCapacity
- * property below. The linked list is better suited for a small number of
- * listener destinations per WBEMListener while the hash table is better
- * suited for a large number.
- *
- * Type: Boolean
- * Recognition: On next creation of a WBEMListener
- * Default: false
- *
- */
- public static final String LISTENER_ENABLE_RELIABLE_INDICATIONS = "sblim.wbem.listenerEnableReliableIndications";
-
- /**
- *
- * The default value to use for the CIM_IndicationService DeliveryRetryAttempts
- * property. See DSP1054 for details on reliable indications.
- *
- * Note: This property has no effect unless reliable indication support is
- * enabled. See the sblim.wbem.listenerEnableReliableIndications property.
- *
- * Type: Long
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: 1 .. 1000
- * Default: 3
- *
- */
- public static final String LISTENER_DELIVERY_RETRY_ATTEMPTS = "sblim.wbem.listenerDeliveryRetryAttempts";
-
- /**
- *
- * The default value to use for the CIM_IndicationService DeliveryRetryInterval
- * property. See DSP1054 for details on reliable indications.
- *
- * Note: This property has no effect unless reliable indication support is
- * enabled. See the sblim.wbem.listenerEnableReliableIndications property.
- *
- * Type: Long
- * Unit: Seconds
- * Recognition: On next creation of a WBEMListener
- * Range: 1 .. 86400
- * Default: 20
- *
- */
- public static final String LISTENER_DELIVERY_RETRY_INTERVAL = "sblim.wbem.listenerDeliveryRetryInterval";
-
- /**
- *
- * The default value to use for the reliable indication handler's initial
- * hash table capacity. A value of 0 indicates use a linked list instead.
- * Linked lists are better suited for a small number of listener destinations
- * per WBEMListener while hash tables are better suited for a large number.
- *
- * Note: This property has no effect unless reliable indication support is
- * enabled. See the sblim.wbem.listenerEnableReliableIndications property.
- *
- * Type: Integer
- * Unit: Count
- * Recognition: On next creation of a WBEMListener
- * Range: 0 .. 25000
- * Default: 0
- *
- */
- public static final String LISTENER_RELIABLE_INDICATION_HASHTABLE_CAPACITY = "sblim.wbem.listenerReliableIndicationHashtableCapacity";
-
- /**
- *
- * The filter to use for tracing of incoming indications at the FINE level.
- *
- * If string is empty, no tracing of incoming indications will occur. If
- * string is not empty, it identifies one or more properties to be included
- * in the trace of all incoming indications. An optional class can be used
- * to filter the output to include only those indications that contain the
- * substring. For example, to trace the SequenceContext and SequenceNumber
- * properties of all alerts, use the following:
- *
- * alert:sequencecontext,sequencenumber
- *
- * To trace the IndicationTime of all indications, use the following:
- *
- * indicationtime
- *
- * Note: This property has no effect unless tracing is enabled. See the
- * sblim.wbem.traceFileLevel property.
- *
- * Type: String
- * Recognition: On next creation of WBEMListener
- * Format: [class:]property[,property]*
- *
- */
- public static final String LISTENER_INDICATION_TRACE_FILTER = "sblim.wbem.listenerIndicationTraceFilter";
-
- /**
- *
- * If set to true, a property will be added to all indications that identifies
- * the sender's IP address. If set to false, the property will not be added.
- *
- * The property is a CIMProperty with:
- * name = "SBLIMJCC_SenderIPAddress"
- * data type = CIMDataType.STRING_T
- * value = String returned by InetAddress.getHostAddress() (i.e. 1.2.3.4)
- *
- * Type: Boolean
- * Recognition: On next creation of a WBEMListener
- * Default: false
- *
- */
- public static final String LISTENER_ADD_SENDER_IP_ADDRESS = "sblim.wbem.listenerAddSenderIPAddress";
-
- /**
- *
- * If set to true, numeric string values passed to the java.lang.Double
- * constructor or its parseDouble method will be checked to make sure they
- * are not in the range that hangs Java 6- (see Sun bug 4421494). If
- * set to false, the string values will not be checked.
- *
- * Note: This property should only be set to true if running on Java 5 or
- * Java 6 prior to update 24.
- *
- * Type: Boolean
- * Recognition: Startup
- * Default: true
- *
- */
- public static final String VERIFY_JAVA_LANG_DOUBLE_STRINGS = "sblim.wbem.verifyJavaLangDoubleStrings";
-
- /**
- *
- * If set to true, numeric key data types in a CIMInstance's CIMObjectPath
- * will be synchronized to match those of the corresponding keys within
- * the CIMInstance's CIMProperty[]. If set to false, the numeric key data
- * types will not be synchronized.
- *
- * Note: Only numeric key data types in CIMInstances from CIMOM responses
- * are synchronized, application calls to the CIMInstance constructor are
- * not affected.
- *
- * Type: Boolean
- * Recognition: Startup
- * Default: false
- *
- */
- public static final String SYNCHRONIZE_NUMERIC_KEY_DATA_TYPES = "sblim.wbem.synchronizeNumericKeyDataTypes";
-
- /**
- *
- * If set to true, gzip encoding is enabled. If set to false, gzip encoding
- * is not enabled. When enabled, outgoing requests include the HTTP header
- * "Accept-Encoding: gzip" to indicate to the CIMOM that the client handles
- * message bodies compressed with gzip. If the incoming response includes
- * "Content-Encoding: gzip" the message body will be decompressed with gzip
- * before being processed.
- *
- * Note: This property does not affect indications or outgoing requests.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Default: false
- *
- */
- public static final String ENABLE_GZIP_ENCODING = "sblim.wbem.enableGzipEncoding";
-
- /**
- *
- * If set to true, the CIM-XML parser will allow empty LOCALNAMESPACEPATH
- * elements in incoming responses. If set to false, the parser will not
- * allow empty LOCALNAMESPACEPATH elements.
- *
- * Note: Some older CIMOMs sent empty LOCALNAMESPACEPATHs, relying on the
- * client to provide the local namespace path. This is a violation of
- * DSP0201, which dictates that LOCALNAMESPACEPATH must contain at least
- * one NAMESPACE child. By default, this property is set to false so the
- * client can adhere to the CIM-XML specifications. Set this property to
- * true if "LOCALNAMESPACEPATH requires NAMESPACE" exceptions occur while
- * interacting with one of these older CIMOMs.
- *
- * Type: Boolean
- * Recognition: Anytime
- * Default: false
- *
- */
- public static final String CIMXML_PARSER_ALLOW_EMPTY_LOCALNAMESPACEPATH = "sblim.wbem.cimxmlParser.allowEmptyLocalNameSpacePath";
-
- /**
- * AMMO-863
- *
- * New configuration property to force the use of a strict mode for the
- * HTTP header Connection=Keep-alive (that may not be used for HTTP/1.1).
- */
- public static final String HTTP_KEEP_ALIVE_STRICT_MODE = "sblim.wbem.httpKeepAliveStrictMode";
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2013
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, a.wolf-reber@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-11-08 lupusalex Make SBLIM client JSR48 compliant
+ * 1688273 2007-04-19 lupusalex Full support of HTTP trailers
+ * 1815707 2007-10-30 ebak TLS support
+ * 1827728 2007-11-12 ebak embeddedInstances: attribute EmbeddedObject not set
+ * 1848607 2007-12-11 ebak Strict EmbeddedObject types
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2372030 2008-12-01 blaschke-oss Add property to control synchronized SSL handshaking
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 2846231 2009-09-23 rgummada connection failure on CIMOM w/o user/pw
+ * 2930341 2010-01-12 blaschke-oss Sync up WBEMClientConstants with JSR48 1.0.0
+ * 2957387 2010-03-03 blaschke-oss EmbededObject XML attribute must not be all uppercases
+ * 2970881 2010-03-15 blaschke-oss Add property to control EmbeddedObject case
+ * 3046073 2010-09-07 blaschke-oss Performance hit due to socket conn. creation with timeout
+ * 3111718 2010-11-18 blaschke-oss org.sblim.cimclient SSL Code is using the wrong SSL Property
+ * 3185763 2011-02-25 blaschke-oss Reliable indication support - Phase 1
+ * 3195069 2011-02-28 blaschke-oss Need support to disable SSL Handshake
+ * 3197423 2011-03-02 blaschke-oss Server authentication with PegasusLocalAuthInfo failing
+ * 3277928 2011-04-06 blaschke-oss CIM-XML tracing cannot be enabled in the field
+ * 3206904 2011-05-03 blaschke-oss Indication listener deadlock causes JVM to run out sockets
+ * 3288721 2011-05-20 blaschke-oss Need the function of indication reordering
+ * 3459036 2011-12-13 blaschke-oss Linked list for RI queue not efficient for many LDs
+ * 3485074 2012-02-06 blaschke-oss An Indication trace request
+ * 3492246 2012-02-23 blaschke-oss Rename new indication trace property
+ * 3492214 2012-02-23 blaschke-oss Add a SenderIPAddress property indications
+ * 3492224 2012-02-23 blaschke-oss Need two different timeouts for Socket connections
+ * 3521157 2012-05-10 blaschke-oss JSR48 1.0.0: PROP_ENABLE_*_LOGGING is Level, not 0/1
+ * 3524050 2012-06-06 blaschke-oss Improve WWW-Authenticate in HTTPClient.java
+ * 3536399 2012-08-25 hellerda Add client/listener peer authentication properties
+ * 3572993 2012-10-01 blaschke-oss parseDouble("2.2250738585072012e-308") DoS vulnerability
+ * 3598613 2013-01-11 blaschke-oss different data type in cim instance and cim object path
+ * 2618 2013-02-27 blaschke-oss Need to add property to disable weak cipher suites for the secure indication
+ * 2628 2013-03-26 blaschke-oss Limit size of LinkedList of CIMEvents to be dispatched
+ * 2635 2013-05-16 blaschke-oss Slowloris DoS attack for CIM indication listener port
+ * 2642 2013-05-21 blaschke-oss Seperate properties needed for cim client and listener to filter out ciphers
+ * 2647 2013-07-01 blaschke-oss Add two ssl protocol properties for http server and client
+ * 2654 2013-07-29 blaschke-oss Check jcc idle time with CIMOM keepalive timeout to avoid EOF
+ * 2151 2013-08-20 blaschke-oss gzip compression not supported
+ * 2711 2013-11-13 blaschke-oss LOCALNAMESPACEPATH allows 0 NAMESPACE children
+ */
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+/**
+ * The interface WBEMConfigurationProperties contains the names of all
+ * configuration properties that are recognized by the CIM Client.
+ *
+ */
+public interface WBEMConfigurationProperties {
+
+ /**
+ * A URL string giving the location of the CIM client config file.
+ *
+ * By default the SBLIM CIM Client looks for
+ *
+ *
file:sblim-cim-client2.properties
+ *
file:%USER_HOME%/sblim-cim-client2.properties
+ *
file:/etc/java/sblim-cim-client2.properties
+ *
+ * The first file found will be used. The default search list is not applied
+ * if this property is set, even if the given URL does not exist.
+ */
+ public static final String CONFIG_URL = "sblim.wbem.configURL";
+
+ /**
+ * Sets the minimum level for messages to be written to the log file.
+ *
+ * Type: Discrete
+ * Recognition: Startup
+ * Range: OFF, SEVERE, WARNING, INFO, CONFIG, ALL
+ * Default: OFF, which disables file logging completely.
+ */
+ public static final String LOG_FILE_LEVEL = "sblim.wbem.logFileLevel";
+
+ /**
+ * A string specifying the location of the log file. The string may include
+ * the following special components that will be replaced at runtime:
+ *
+ *
+ *
+ *
/
+ *
the local pathname separator
+ *
+ *
+ *
%t
+ *
the system temporary directory
+ *
+ *
+ *
%h
+ *
the value of the "user.home" system property
+ *
+ *
+ *
%g
+ *
the generation number to distinguish rotated logs
+ *
+ *
+ *
%u
+ *
a unique number to resolve conflicts
+ *
+ *
+ *
%%
+ *
translates to a single percent sign "%"
+ *
+ *
+ *
+ * Thus for example a pattern of %t/java%g.log with a count of
+ * 2 would typically cause log files to be written on Unix to
+ * /var/tmp/java2.log
+ *
+ * Type: String
+ * Recognition: Startup
+ * Default: %t/cimclient_log_%g.txt.
+ */
+ public static final String LOG_FILE_LOCATION = "sblim.wbem.logFileLocation";
+
+ /**
+ * Sets the maximum size in bytes of a single log file. When the limit is
+ * reached a new file is created. A limit of zero will create a new log file
+ * for every log record !
+ *
+ * Type: Integer
+ * Recognition: Startup
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 100.000
+ */
+ public static final String LOG_FILE_SIZE_LIMIT = "sblim.wbem.logFileSizeLimit";
+
+ /**
+ * Sets the number of log files to cycle through. When the number is
+ * exceeded the oldest file is dropped.
+ *
+ * Type: Integer
+ * Recognition: Startup
+ * Range: 1 .. Integer.MAX_VALUE
+ * Default: 5
+ */
+ public static final String LOG_FILE_COUNT = "sblim.wbem.logFileCount";
+
+ /**
+ * Sets the minimum level for messages to be written to the console logger
+ * file.
+ *
+ * Type: Discrete
+ * Recognition: Startup
+ * Range: OFF, SEVERE, WARNING, INFO, CONFIG, ALL
+ * Default: OFF, which disables console logging completely.
+ */
+ public static final String LOG_CONSOLE_LEVEL = "sblim.wbem.logConsoleLevel";
+
+ /**
+ * Sets the type of the console logger. Maybe either message log or trace
+ * log.
+ *
+ * Type: Discrete
+ * Recognition: Startup
+ * Range: MESSAGE, TRACE
+ * Default: MESSAGE.
+ */
+ public static final String LOG_CONSOLE_TYPE = "sblim.wbem.logConsoleType";
+
+ /**
+ * Sets the minimum level for messages to be written to the trace file.
+ *
+ * Type: Discrete
+ * Recognition: Startup
+ * Range:
+ * OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL
+ * Default: OFF, which disables file tracing completely
+ */
+ public static final String TRACE_FILE_LEVEL = "sblim.wbem.traceFileLevel";
+
+ /**
+ * A string specifying the location of the trace file. The string may
+ * include the following special components that will be replaced at
+ * runtime:
+ *
+ *
+ *
+ *
/
+ *
the local pathname separator
+ *
+ *
+ *
%t
+ *
the system temporary directory
+ *
+ *
+ *
%h
+ *
the value of the "user.home" system property
+ *
+ *
+ *
%g
+ *
the generation number to distinguish rotated logs
+ *
+ *
+ *
%u
+ *
a unique number to resolve conflicts
+ *
+ *
+ *
%%
+ *
translates to a single percent sign "%"
+ *
+ *
+ *
+ * Thus for example a pattern of %t/java%g.log with a count of
+ * 2 would typically cause log files to be written on Unix to
+ * /var/tmp/java2.log
+ *
+ * Type: String
+ * Recognition: Startup
+ * Default: %t/cimclient_trace_%g.txt
+ */
+ public static final String TRACE_FILE_LOCATION = "sblim.wbem.traceFileLocation";
+
+ /**
+ * Sets the maximum size in bytes of a single log file. When the limit is
+ * reached a new file is created. A limit of zero creates a new file for
+ * each trace record !
+ *
+ * Type: Integer
+ * Recognition: Startup
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 1.000.000
+ */
+ public static final String TRACE_FILE_SIZE_LIMIT = "sblim.wbem.traceFileSizeLimit";
+
+ /**
+ * Sets the number of log files to cycle through. When the number is
+ * exceeded the oldest file is dropped.
+ *
+ * Type: Integer
+ * Recognition: Startup
+ * Range: 1 .. Integer.MAX_VALUE
+ * Default: 5
+ */
+ public static final String TRACE_FILE_COUNT = "sblim.wbem.traceFileCount";
+
+ /**
+ * The timeout for http requests. A timeout of zero is interpreted as
+ * infinite timeout.
+ *
+ * Type: Integer
+ * Unit: Milliseconds
+ * Recognition: Anytime
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 0
+ */
+ public static final String HTTP_TIMEOUT = "sblim.wbem.httpTimeout";
+
+ /**
+ * The size of the internal http connection pools. Each
+ * WBEMClient instance has it's own http connection pool. A
+ * positive value defines the number of connections, zero that no connection
+ * will be reused, and -1 all connections will be reused (when it's
+ * possible).
+ *
+ * Type: Integer
+ * Recognition: Anytime
+ * Range: -1, 0, 1 .. Integer.MAX_VALUE
+ * Default: 16
+ */
+ public static final String HTTP_POOL_SIZE = "sblim.wbem.httpPoolSize";
+
+ /**
+ * The Java class name of the authentication module to use for http
+ * authentication.
+ *
+ * Type: String
+ * Recognition: On next authentication
+ * Range:
+ *
+ * org.sblim.cimclient.internal.http.WwwAuthInfo, org.sblim.cimclient.internal.http.PegasusLocalAuthInfo or any self-written subclass of org.sblim.cimclient.internal.http.AuthorizationInfo
+ *
+ * Default: org.sblim.cimclient.internal.http.WwwAuthInfo
+ */
+ public static final String HTTP_AUTHENTICATION_MODULE = "sblim.wbem.httpAuthModule";
+
+ /**
+ * The WWW-Authenticate information to use when sending the first request to
+ * a server.
+ *
+ * Note: This string must exactly match what the server returns in the
+ * WWW-Authenticate field of an HTTP 401 response when authentication
+ * fails. The following two strings are examples:
+ *
+ *
+ *
+ * Basic realm="Secure Area"
+ * Digest realm="testrealm@host.com",qop="auth,auth-int",nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",opaque="5ccc069c403ebaf9f0171e9517f40e41"
+ *
+ *
+ * Type: String
+ * Recognition: On next authentication
+ * Range: Basic, Digest
+ * Default: none
+ */
+ public static final String HTTP_WWW_AUTHENTICATE_INFO = "sblim.wbem.httpWwwAuthenticateInfo";
+
+ /**
+ * Specifies if MPOST is used for transmitting http messages. If false, POST
+ * is used.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Range: true, false
+ * Default: true
+ */
+ public static final String HTTP_USE_MPOST = "sblim.wbem.httpMPOST";
+
+ /**
+ * Specifies if chunking is used for transmitting http messages.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Range: true, false
+ * Default: true
+ */
+ public static final String HTTP_USE_CHUNKING = "sblim.wbem.httpChunking";
+
+ /**
+ * Specifies the http protocol version to use. This option is useful if the
+ * protocol negotiation fails.
+ *
+ * Type: String
+ * Recognition: Anytime
+ * Range: 1.0, 1.1
+ * Default: 1.1
+ */
+ public static final String HTTP_VERSION = "sblim.wbem.httpVersion";
+
+ /**
+ * Specifies how often the client will retry to connect to a CIMOM which
+ * refused the connection in the first place.
+ *
+ * Type: Integer
+ * Recognition: Anytime
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 0
+ */
+ public static final String HTTP_CONNECTION_RETRIES = "sblim.wbem.httpConnectionRetries";
+
+ /**
+ * Specifies if the client will discard and request again http documents
+ * with less than a given number of bytes.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Range: true, false
+ * Default: false
+ */
+ public static final String HTTP_ENABLE_CONTENT_LENGTH_RETRY = "sblim.wbem.httpEnableContentLengthRetry";
+
+ /**
+ * Specifies the threshold above which a http document is regarded as valid
+ * by the content length retry algorithm.
+ *
+ * Type: Integer
+ * Recognition: Anytime
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 50
+ */
+ public static final String HTTP_CONTENT_LENGTH_THRESHOLD = "sblim.wbem.httpContentLengthThreshold";
+
+ /**
+ * The file path of the SSL keystore.
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Default: none
+ */
+ public static final String KEYSTORE_PATH = "javax.net.ssl.keyStore";
+
+ /**
+ * The type of the keystore.
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Range: PKCS12, JKS, ...
+ * Default: JKS
+ */
+ public static final String KEYSTORE_TYPE = "javax.net.ssl.keyStoreType";
+
+ /**
+ * The password of the keystore.
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Default: none
+ */
+ public static final String KEYSTORE_PASSWORD = "javax.net.ssl.keyStorePassword";
+
+ /**
+ * The file path of the SSL truststore.
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Default: none
+ */
+ public static final String TRUSTSTORE_PATH = "javax.net.ssl.trustStore";
+
+ /**
+ * The type of the truststore.
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Range: PKCS12, JKS, ...
+ * Default: JKS
+ */
+ public static final String TRUSTSTORE_TYPE = "javax.net.ssl.trustStoreType";
+
+ /**
+ * The password of the truststore.
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Default: none
+ */
+ public static final String TRUSTSTORE_PASSWORD = "javax.net.ssl.trustStorePassword";
+
+ /**
+ * The provider to use for creation of SSL client sockets.
+ *
+ * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
+ *
+ *
+ * Type: Java class name
+ * Recognition: On next SSL connection
+ * Default: Security.getProviders("SSLContext.SSL")
+ */
+ public static final String SSL_SOCKET_PROVIDER = "sblim.wbem.sslSocketProvider";
+
+ /**
+ * The provider to use for creation of SSL server sockets.
+ *
+ * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
+ *
+ *
+ * Type: Java class name
+ * Recognition: On next SSL connection
+ * Default: Security.getProviders("SSLContext.SSL")
+ */
+ public static final String SSL_SERVER_SOCKET_PROVIDER = "sblim.wbem.sslServerSocketProvider";
+
+ /**
+ * The protocol used for SSLContext.getInstance(String protocol). For
+ * IBMJSSE2 provider it can be "SSL_TLS".
+ *
+ * Security property: JRE global access via
+ * Security.setProperty() and
+ * Security.getProperty()
+ * Recognition: On next SSL connection
+ * Default: "SSL"
+ */
+ public static final String SSL_PROTOCOL = "ssl.Protocol";
+
+ /**
+ * The protocol used for SSLContext.getInstance(String protocol) by a
+ * client. This property overrides any value set via the ssl.Protocol
+ * property.
+ *
+ * Recognition: On next SSL connection
+ * Default: none
+ */
+ public static final String SSL_CLIENT_PROTOCOL = "sblim.wbem.sslClientProtocol";
+
+ /**
+ * The protocol used for SSLContext.getInstance(String protocol) by a
+ * listener. This property overrides any value set via the ssl.Protocol
+ * property.
+ *
+ * Recognition: On next SSL connection
+ * Default: none
+ */
+ public static final String SSL_LISTENER_PROTOCOL = "sblim.wbem.sslListenerProtocol";
+
+ /**
+ * The key manager factory algorithm name.
+ *
+ * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
+ *
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Range: IbmX509, SunX509, ...
+ * Default: JRE specific
+ */
+ public static final String SSL_KEYMANAGER_ALGORITHM = "ssl.KeyManagerFactory.algorithm";
+
+ /**
+ * The trust manager factory algorithm name.
+ *
+ * Security property: JRE global access via Security.setProperty() and Security.getProperty() !
+ *
+ *
+ * Type: String
+ * Recognition: On next SSL connection
+ * Range: IbmX509, SunX509, ...
+ * Default: JRE specific
+ */
+ public static final String SSL_TRUSTMANAGER_ALGORITHM = "ssl.TrustManagerFactory.algorithm";
+
+ /**
+ * Determines if a HTTPS client will attempt to authenticate the server
+ * (i.e. CIMOM) by verifying the server certificate.
+ *
+ * If false, do not attempt verification. If true, the client will attempt
+ * to verify the server certificate against the contents of the truststore;
+ * in this case a valid path must be defined in "javax.net.ssl.trustStore"
+ * or no connection will be permitted.
+ *
+ * Type: Boolean
+ * Recognition: On initialization of a new client
+ * Default: false
+ */
+ public static final String SSL_CLIENT_PEER_VERIFICATION = "sblim.wbem.sslClientPeerVerification";
+
+ /**
+ * Determines how a HTTPS listener will handle authentication of a client
+ * (i.e. indication sender):
+ *
+ *
+ *
+ *
ignore
+ *
do not examine the client certificate
+ *
+ *
+ *
accept
+ *
examine client certificate if presented; do not fail if not presented
+ *
+ *
+ *
+ *
require
+ *
examine client certificate; fail if not presented
+ *
+ *
+ *
+ * If set to "ignore", do not attempt verification. If set to "accept" or
+ * "require", the listener will attempt to verify the sender against the
+ * contents of the truststore; in this case a valid path must be defined in
+ * "javax.net.ssl.trustStore" or no connection will be permitted.
+ *
+ * Type: String
+ * Recognition: On next call to addListener()
+ * Default: ignore
+ */
+ public static final String SSL_LISTENER_PEER_VERIFICATION = "sblim.wbem.sslListenerPeerVerification";
+
+ /**
+ * The comma-separated list of cipher suites that are to be disabled by the
+ * client when connecting via an SSL socket. In general, this is the list of
+ * cipher suites considered "too weak" for use in a particular environment.
+ *
+ * Type: String
+ * Recognition: On initialization of a new client
+ * Default: none
+ */
+ public static final String SSL_CLIENT_CIPHER_SUITES_TO_DISABLE = "sblim.wbem.sslClientCipherSuitesToDisable";
+
+ /**
+ * The comma-separated list of cipher suites that are to be disabled by the
+ * listener when connecting via an SSL socket. In general, this is the list
+ * of cipher suites considered "too weak" for use in a particular
+ * environment.
+ *
+ * Type: String
+ * Recognition: On next call to addListener()
+ * Default: none
+ */
+ public static final String SSL_LISTENER_CIPHER_SUITES_TO_DISABLE = "sblim.wbem.sslListenerCipherSuitesToDisable";
+
+ /**
+ * Specifies the XML parser for parsing CIM-XML responses.
+ * The SAX parser is the default choice since it is fast, resource saving
+ * and interoperable. The streaming algorithm of the PULL parser uses the
+ * fewest possible resources but at the prize to keep the CIMOMs response
+ * open for a long time. That works with many but not all CIMOMs. The DOM
+ * parser is slow and resource hungry but nice to debug.
+ *
+ * Type: Discrete
+ * Recognition: Anytime
+ * Range: DOM, PULL, SAX
+ * Default: SAX
+ */
+ public static final String CIMXML_PARSER = "sblim.wbem.cimxmlParser";
+
+ /**
+ * Enables or disables tracing of CIM-XML communication. The trace is sent
+ * to an output stream the application has to set via the LogAndTraceManager
+ * class.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Range: true, false
+ * Default: false
+ */
+ public static final String CIMXML_TRACING = "sblim.wbem.cimxmlTracing";
+
+ /**
+ * Specifies the stream to use for tracing CIM-XML communication in the
+ * event the application does not set one via the LogAndTraceManager class.
+ * This stream can either be standard output (System.out), standard error
+ * output (System.err) or a filename to be opened by the client.
+ *
+ * Note: This property has no effect unless sblim.wbem.cimxmlTracing is set
+ * to true.
+ *
+ * Note: This property has no effect if the application already set the
+ * stream prior to client initialization. If the application sets the stream
+ * after client initialization, the stream specified by this property is
+ * overridden.
+ *
+ * Note: If a filename is specified, it is opened and all CIM-XML
+ * communication is written to it - no checks are made for an existing file
+ * or for filling up the disk. USE WITH CAUTION.
+ *
+ * Type: String
+ * Recognition: Startup
+ * Range: System.out, System.err, filename
+ * Default: none
+ */
+ public static final String CIMXML_TRACE_STREAM = "sblim.wbem.cimxmlTraceStream";
+
+ /**
+ *
+ * Tells the XML builder how to sign embedded objects. This is necessary due to
+ * the non-consequent handling of embedded objects on different CIMOMs.
+ * "AttribOnly" - only the EmbeddedObject="instance/object" is used
+ * (should be good for Pegasus)
+ * "EmbObjQuali" - on qualified CIM-XML elements the EmbeddedObject qualifier is used
+ * for embedded classes and instances
+ * "EmbObjAndEmbInstQuali" -
+ * on qualified CIM-XML elements the EmbeddedObject qualifier is used
+ * for embedded classes and the EmbeddedInstance="className" qualifier
+ * is used for embedded instances
+ * Type: String
+ * Recognition: Anytime
+ * Range: AttribOnly, EmbObjQuali, EmbObjAndEmbInstQuali
+ * Default: AttribOnly
+ *
+ */
+ public static final String CIMXML_EMBOBJBUILDER = "sblim.wbem.cimxmlEmbObjBuilder";
+
+ /**
+ *
+ * If set the type of valueless EmbeddedObjects are mapped to CLASS_T. It should work well
+ * with OpenPegasus-2.7.0.
+ * If unset no type mapping is done for valuless EmbeddedObjects.
+ *
+ * Type: Boolean
+ * Default: true
+ *
+ */
+ public static final String CIMXML_PARSER_STRICT_EMBOBJ_TYPES = "sblim.wbem.cimxmlParser.strictEmbObjTypes";
+
+ /**
+ *
+ * If set to false, the embedded object entity in all requests is in mixed case
+ * (EmbeddedObject) per DSP0203. If set to true, the embedded object entity is in
+ * upper case (EMBEDDEDOBJECT) - this works with some older CIMOMs, such as OpenPegasus
+ * 2.6.1 and 2.7.0.
+ *
+ * <!ENTITY % EmbeddedObject "EmbeddedObject (object|instance) #IMPLIED">
+ *
+ * Type: Boolean
+ * Recognition: Startup
+ * Range: true, false
+ * Default: true
+ *
+ */
+ public static final String CIMXML_BUILDER_UPPERCASE_EMBOBJ_ENTITIES = "sblim.wbem.cimxmlBuilder.upperCaseEmbObjEntities";
+
+ /**
+ *
+ * If set to true, SSL handshakes are performed after an SSL socket is created by the
+ * socket factory. If set to false, handshakes are not performed, which is useful if
+ * if the handshake has already taken place.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Default: true
+ *
+ */
+ public static final String PERFORM_SSL_HANDSHAKE = "sblim.wbem.performSslHandshake";
+
+ /**
+ *
+ * If set to false, SSL handshakes are not synchronized. If set to true, SSL handshakes
+ * are synchronized as a workaround for an IBMJSSE1 problem with thread-safe handshakes.
+ *
+ * Note: This property has no affect unless sblim.wbem.performSslHandshake is set to
+ * true.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Default: false
+ *
+ */
+ public static final String SYNCHRONIZED_SSL_HANDSHAKE = "sblim.wbem.synchronizedSslHandshake";
+
+ /**
+ *
+ * If set to true, socket connections are attempted with the timeout value defined by
+ * sblim.wbem.socketConnectTimeout. If set to false, socket connections are attempted
+ * without a timeout. Using a timeout for socket connections is the preferred method
+ * but may introduce intermittent, significant performance impacts during the connection
+ * process in Java 5+ (see Sun bug 5092063).
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Default: true
+ *
+ */
+ public static final String SOCKET_CONNECT_WITH_TIMEOUT = "sblim.wbem.socketConnectWithTimeout";
+
+ /**
+ *
+ * The timeout for socket connect requests. A timeout of zero is interpreted
+ * as infinite timeout.
+ *
+ * Note: This property has no effect unless socket connection with timeout is
+ * enabled (see the sblim.wbem.socketConnectWithTimeout property).
+ *
+ * Type: Integer
+ * Unit: Milliseconds
+ * Recognition: Anytime
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 0
+ *
+ */
+ public static final String SOCKET_CONNECT_TIMEOUT = "sblim.wbem.socketConnectTimeout";
+
+ /**
+ * The idle timeout between socket requests after which the socket is
+ * automatically reset (closed, then reopened). A timeout of zero is
+ * interpreted as infinite timeout.
+ * Type: Integer
+ * Unit: Milliseconds
+ * Recognition: Anytime
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 0
+ */
+ public static final String SOCKET_IDLE_TIMEOUT = "sblim.wbem.socketIdleTimeout";
+
+ /**
+ *
+ * Turn on/off usage of the default user/password, which can be used
+ * if the CIMOM requires a "garbage" credential. If set to false,
+ * user-supplied credentials will be applied. If set to true,
+ * default credentials will be applied when both the user-supplied
+ * principal and credential are null/empty.
+ *
+ * Type: Boolean
+ * Recognition: Startup
+ * Default: false
+ *
+ */
+ public static final String KEY_CREDENTIALS_DEFAULT_ENABLED = "sblim.wbem.default.authorization.enabled";
+
+ /**
+ *
+ * The name of the user for the "garbage" credential.
+ *
+ * Note: This property has no effect unless default authorization is
+ * enabled (see the sblim.wbem.default.authorization.enabled property)
+ * AND both the user-supplied principal and credential are null/empty.
+ *
+ * Type: String
+ * Recognition: Startup
+ * Default: "default"
+ *
+ */
+ public static final String KEY_DEFAULT_PRINCIPAL = "sblim.wbem.default.principal";
+
+ /**
+ *
+ * The credential of the user for the "garbage" credential.
+ *
+ * Note: This property has no effect unless default authorization is
+ * enabled (see the sblim.wbem.default.authorization.enabled property)
+ * AND both the user-supplied principal and credential are null/empty.
+ *
+ * Type: String
+ * Recognition: Startup
+ * Default: "default"
+ *
+ */
+ public static final String KEY_DEFAULT_CREDENTIAL = "sblim.wbem.default.credential";
+
+ /**
+ * The timeout for http connections of an indication listener. A timeout of
+ * zero is interpreted as infinite timeout.
+ *
+ * Type: Integer
+ * Unit: Milliseconds
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 10000
+ */
+ public static final String LISTENER_HTTP_TIMEOUT = "sblim.wbem.listenerHttpTimeout";
+
+ /**
+ * The header timeout for http connections of an indication listener. The
+ * header timeout is defined as the maximum amount of time allowed to read
+ * in the entire http header. A timeout of zero is interpreted as infinite
+ * timeout.
+ *
+ * Note: One form of DoS attack sends periodic http header lines in an
+ * attempt to keep the socket open indefinitely. This timeout can be used to
+ * thwart such an attempt.
+ *
+ * Type: Integer
+ * Unit: Milliseconds
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 30000
+ */
+ public static final String LISTENER_HTTP_HEADER_TIMEOUT = "sblim.wbem.listenerHttpHeaderTimeout";
+
+ /**
+ * The maximum allowable timeouts an http connection of an indication
+ * listener can have before the client ignores it. In other words, the
+ * number of times an IP exceeds sblim.wbem.listenerHttpTimeout and
+ * sblim.wbem.listenerHttpHeaderTimeout before it is blocked. A value of
+ * zero is interpreted as unlimited timeouts.
+ *
+ * Type: Integer
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 0
+ */
+ public static final String LISTENER_HTTP_MAX_ALLOWED_TIMEOUTS = "sblim.wbem.listenerHttpMaxAllowedTimeouts";
+
+ /**
+ * The size of the thread pool for the connection handlers of the indication
+ * for http connections of an indication listener. This is the maximum
+ * number of handler threads the pool might create on heavy load.
+ * A value of -1 is interpreted as infinity.
+ * Type: Integer
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: -1 .. Integer.MAX_VALUE
+ * Default: 8
+ */
+ public static final String LISTENER_MAX_POOL_SIZE = "sblim.wbem.listenerPoolMaxSize";
+
+ /**
+ * The minimal number of connection handlers of the indication listener that
+ * will be kept open by the thread pool regardless of the current load.
+ * Type: Integer
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 2
+ */
+ public static final String LISTENER_MIN_POOL_SIZE = "sblim.wbem.listenerPoolMinSize";
+
+ /**
+ * The maximum number of queued connections (the fixed capacity of the
+ * ArrayBlockingQueue of pending connections incoming to the listener).
+ * Whereas increasing this number will result in a correspondingly greater
+ * memory usage, making the number too small can result in HTTP 503
+ * "Service temporarily overloaded" returned to server if there is no room
+ * in queue for an incoming connection.
+ * Type: Integer
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: 1 .. Integer.MAX_VALUE
+ * Default: 32
+ */
+ public static final String LISTENER_MAX_QUEUE_SIZE = "sblim.wbem.listenerQueueMaxSize";
+
+ /**
+ * The number of queued connections that is tolerated before the thread pool
+ * creates an additional handler thread. Increasing this value leads to a
+ * less "nervous" creation/destruction of handlers. However it
+ * makes the listener more vulnerable to frozen connections.
+ *
+ * Type: Integer
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 2
+ */
+ public static final String LISTENER_BACKLOG = "sblim.wbem.listenerBacklog";
+
+ /**
+ * The idle time of a worker that is tolerated before the worker is
+ * destroyed by the thread pool. By setting the minimal pool size >0 you can
+ * protect a given number of worker from destruction.
+ *
+ * Type: Long
+ * Unit: Milliseconds
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Long.MAX_VALUE
+ * Default: 30000
+ */
+ public static final String LISTENER_HANDLER_MAX_IDLE = "sblim.wbem.listenerHandlerMaxIdle";
+
+ /**
+ * The maximum number of queued events (the fixed capacity of the LinkedList
+ * of indications awaiting delivery to the listener). When the maximum is
+ * reached, the oldest indications are discarded to make room for the newest
+ * ones. A value of 0 is interpreted as infinity.
+ * Type: Integer
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. Integer.MAX_VALUE
+ * Default: 0
+ */
+ public static final String LISTENER_MAX_QUEUED_EVENTS = "sblim.wbem.listenerMaxQueuedEvents";
+
+ /**
+ *
+ * If set to true, reliable indication support is enabled and indications
+ * are processed accordingly. If set to false, reliable indication
+ * support is disabled and indications are passed directly to listener.
+ *
+ * If reliable indication support is enabled, incoming indications are
+ * handled as documented in DSP1054 which includes queuing unexpected
+ * indications, caching all indications for the duration of their sequence
+ * identifier lifetime, and logging missing, duplicate and out-of-order
+ * indications.
+ *
+ * The sequence identifier lifetime is defined as:
+ * DeliveryRetryAttempts * DeliveryRetryInterval * 10
+ * These values can be set by the sblim.wbem.listenerDeliveryRetryAttempts
+ * and sblim.wbem.listenerDeliveryRetryInterval properties below.
+ *
+ * Unexpected indications are queued in either a linked list or a hash
+ * table based on the sblim.wbem.listenerReliableIndicationHashtableCapacity
+ * property below. The linked list is better suited for a small number of
+ * listener destinations per WBEMListener while the hash table is better
+ * suited for a large number.
+ *
+ * Type: Boolean
+ * Recognition: On next creation of a WBEMListener
+ * Default: false
+ *
+ */
+ public static final String LISTENER_ENABLE_RELIABLE_INDICATIONS = "sblim.wbem.listenerEnableReliableIndications";
+
+ /**
+ *
+ * The default value to use for the CIM_IndicationService DeliveryRetryAttempts
+ * property. See DSP1054 for details on reliable indications.
+ *
+ * Note: This property has no effect unless reliable indication support is
+ * enabled. See the sblim.wbem.listenerEnableReliableIndications property.
+ *
+ * Type: Long
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: 1 .. 1000
+ * Default: 3
+ *
+ */
+ public static final String LISTENER_DELIVERY_RETRY_ATTEMPTS = "sblim.wbem.listenerDeliveryRetryAttempts";
+
+ /**
+ *
+ * The default value to use for the CIM_IndicationService DeliveryRetryInterval
+ * property. See DSP1054 for details on reliable indications.
+ *
+ * Note: This property has no effect unless reliable indication support is
+ * enabled. See the sblim.wbem.listenerEnableReliableIndications property.
+ *
+ * Type: Long
+ * Unit: Seconds
+ * Recognition: On next creation of a WBEMListener
+ * Range: 1 .. 86400
+ * Default: 20
+ *
+ */
+ public static final String LISTENER_DELIVERY_RETRY_INTERVAL = "sblim.wbem.listenerDeliveryRetryInterval";
+
+ /**
+ *
+ * The default value to use for the reliable indication handler's initial
+ * hash table capacity. A value of 0 indicates use a linked list instead.
+ * Linked lists are better suited for a small number of listener destinations
+ * per WBEMListener while hash tables are better suited for a large number.
+ *
+ * Note: This property has no effect unless reliable indication support is
+ * enabled. See the sblim.wbem.listenerEnableReliableIndications property.
+ *
+ * Type: Integer
+ * Unit: Count
+ * Recognition: On next creation of a WBEMListener
+ * Range: 0 .. 25000
+ * Default: 0
+ *
+ */
+ public static final String LISTENER_RELIABLE_INDICATION_HASHTABLE_CAPACITY = "sblim.wbem.listenerReliableIndicationHashtableCapacity";
+
+ /**
+ *
+ * The filter to use for tracing of incoming indications at the FINE level.
+ *
+ * If string is empty, no tracing of incoming indications will occur. If
+ * string is not empty, it identifies one or more properties to be included
+ * in the trace of all incoming indications. An optional class can be used
+ * to filter the output to include only those indications that contain the
+ * substring. For example, to trace the SequenceContext and SequenceNumber
+ * properties of all alerts, use the following:
+ *
+ * alert:sequencecontext,sequencenumber
+ *
+ * To trace the IndicationTime of all indications, use the following:
+ *
+ * indicationtime
+ *
+ * Note: This property has no effect unless tracing is enabled. See the
+ * sblim.wbem.traceFileLevel property.
+ *
+ * Type: String
+ * Recognition: On next creation of WBEMListener
+ * Format: [class:]property[,property]*
+ *
+ */
+ public static final String LISTENER_INDICATION_TRACE_FILTER = "sblim.wbem.listenerIndicationTraceFilter";
+
+ /**
+ *
+ * If set to true, a property will be added to all indications that identifies
+ * the sender's IP address. If set to false, the property will not be added.
+ *
+ * The property is a CIMProperty with:
+ * name = "SBLIMJCC_SenderIPAddress"
+ * data type = CIMDataType.STRING_T
+ * value = String returned by InetAddress.getHostAddress() (i.e. 1.2.3.4)
+ *
+ * Type: Boolean
+ * Recognition: On next creation of a WBEMListener
+ * Default: false
+ *
+ */
+ public static final String LISTENER_ADD_SENDER_IP_ADDRESS = "sblim.wbem.listenerAddSenderIPAddress";
+
+ /**
+ *
+ * If set to true, numeric string values passed to the java.lang.Double
+ * constructor or its parseDouble method will be checked to make sure they
+ * are not in the range that hangs Java 6- (see Sun bug 4421494). If
+ * set to false, the string values will not be checked.
+ *
+ * Note: This property should only be set to true if running on Java 5 or
+ * Java 6 prior to update 24.
+ *
+ * Type: Boolean
+ * Recognition: Startup
+ * Default: true
+ *
+ */
+ public static final String VERIFY_JAVA_LANG_DOUBLE_STRINGS = "sblim.wbem.verifyJavaLangDoubleStrings";
+
+ /**
+ *
+ * If set to true, numeric key data types in a CIMInstance's CIMObjectPath
+ * will be synchronized to match those of the corresponding keys within
+ * the CIMInstance's CIMProperty[]. If set to false, the numeric key data
+ * types will not be synchronized.
+ *
+ * Note: Only numeric key data types in CIMInstances from CIMOM responses
+ * are synchronized, application calls to the CIMInstance constructor are
+ * not affected.
+ *
+ * Type: Boolean
+ * Recognition: Startup
+ * Default: false
+ *
+ */
+ public static final String SYNCHRONIZE_NUMERIC_KEY_DATA_TYPES = "sblim.wbem.synchronizeNumericKeyDataTypes";
+
+ /**
+ *
+ * If set to true, gzip encoding is enabled. If set to false, gzip encoding
+ * is not enabled. When enabled, outgoing requests include the HTTP header
+ * "Accept-Encoding: gzip" to indicate to the CIMOM that the client handles
+ * message bodies compressed with gzip. If the incoming response includes
+ * "Content-Encoding: gzip" the message body will be decompressed with gzip
+ * before being processed.
+ *
+ * Note: This property does not affect indications or outgoing requests.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Default: false
+ *
+ */
+ public static final String ENABLE_GZIP_ENCODING = "sblim.wbem.enableGzipEncoding";
+
+ /**
+ *
+ * If set to true, the CIM-XML parser will allow empty LOCALNAMESPACEPATH
+ * elements in incoming responses. If set to false, the parser will not
+ * allow empty LOCALNAMESPACEPATH elements.
+ *
+ * Note: Some older CIMOMs sent empty LOCALNAMESPACEPATHs, relying on the
+ * client to provide the local namespace path. This is a violation of
+ * DSP0201, which dictates that LOCALNAMESPACEPATH must contain at least
+ * one NAMESPACE child. By default, this property is set to false so the
+ * client can adhere to the CIM-XML specifications. Set this property to
+ * true if "LOCALNAMESPACEPATH requires NAMESPACE" exceptions occur while
+ * interacting with one of these older CIMOMs.
+ *
+ * Type: Boolean
+ * Recognition: Anytime
+ * Default: false
+ *
+ */
+ public static final String CIMXML_PARSER_ALLOW_EMPTY_LOCALNAMESPACEPATH = "sblim.wbem.cimxmlParser.allowEmptyLocalNameSpacePath";
+
+ /**
+ * AMMO-863
+ *
+ * New configuration property to force the use of a strict mode for the
+ * HTTP header Connection=Keep-alive (that may not be used for HTTP/1.1).
+ */
+ public static final String HTTP_KEEP_ALIVE_STRICT_MODE = "sblim.wbem.httpKeepAliveStrictMode";
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMListenerSBLIM.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMListenerSBLIM.java
similarity index 88%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMListenerSBLIM.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMListenerSBLIM.java
index b1be5ee..66ae31a 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/WBEMListenerSBLIM.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/WBEMListenerSBLIM.java
@@ -1,465 +1,462 @@
-/*
- (C) Copyright IBM Corp. 2006, 2013
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, IBM, ebak@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2007-01-08 ebak Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 3023348 2010-07-02 blaschke-oss Listener uses # constructor instead of valueOf
- * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues
- * 3469018 2012-01-03 blaschke-oss Properties not passed to CIMIndicationHandler
- * 3477087 2012-01-23 blaschke-oss Need Access to an Indication Sender's IP Address
- * 3496385 2012-03-02 blaschke-oss JSR48 1.0.0: add WBEMListener get/setProperty
- * 3513228 2012-04-23 blaschke-oss Reliable Indications support can create lots of threads
- * 3529062 2012-05-23 blaschke-oss WBEMListenerFactory should return new instance
- * 3529065 2012-05-31 hellerda Enable WBEMListener get/setProperty
- * 2628 2013-03-26 blaschke-oss Limit size of LinkedList of CIMEvents to be dispatched
- * 2635 2013-05-16 blaschke-oss Slowloris DoS attack for CIM indication listener port
- * 2657 2013-08-20 blaschke-oss Potential null pointer exception in handleConnection
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.IOException;
-import java.net.BindException;
-import java.util.Enumeration;
-import java.util.EventListener;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.sentrysoftware.wbem.javax.wbem.listener.IndicationListener;
-import org.sentrysoftware.wbem.javax.wbem.listener.WBEMListener;
-import org.sentrysoftware.wbem.javax.wbem.listener.WBEMListenerConstants;
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.http.HttpConnectionHandler;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.http.HttpServerConnection;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.util.WBEMConfiguration;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.util.WBEMConstants;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.indications.CIMEventDispatcher;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.indications.CIMIndicationHandler;
-
-/**
- * Class WBEMListenerSBLIM is the SBLIM implementation of the WBEMListener
- * interface.
- *
- */
-public class WBEMListenerSBLIM implements WBEMListener {
-
- /**
- * The real implementation of a listener that starts a HTTP server and
- * processes incoming indications
- *
- */
- public class WBEMListenerImpl {
-
- private EventListener iIndicationListener;
-
- private HttpServerConnection iConnection;
-
- private CIMIndicationHandler iIndicationHandler;
-
- private HttpConnectionHandler iConnectionHandler;
-
- /**
- * Ctor.
- *
- * @param pLocalAddress
- * The local address to bind the port to. If null the port is
- * bound to all local addresses. For use on multi-homed
- * systems.
- * @param pPort
- * The port to listen on. If zero any free port will be
- * chosen.
- * @param pSSL
- * SSL secured connection?
- * @param pIndicationListener
- * The indication listener to forward the incoming
- * indications to (an instance of IndicationListener or
- * IndicationListenerSBLIM).
- * @param pProperties
- * The configuration.
- * @throws IOException
- */
- public WBEMListenerImpl(String pLocalAddress, int pPort, boolean pSSL,
- EventListener pIndicationListener, Properties pProperties) throws IOException {
-
- // Merge any properties passed via addListener
- if (pProperties != null) {
- for (Enumeration e = pProperties.keys(); e.hasMoreElements();) {
- String key = (String) e.nextElement();
- String value = pProperties.getProperty(key);
- setProperty(key, value);
- }
- }
- WBEMConfiguration config = WBEMListenerSBLIM.this.iConfiguration;
- if (!(pIndicationListener instanceof IndicationListener)
- && !(pIndicationListener instanceof IndicationListenerSBLIM)) throw new IllegalArgumentException(
- "Listener must be instance of IndicationListener or IndicationListenerSBLIM");
- this.iIndicationListener = pIndicationListener;
- CIMEventDispatcher eventDispatcher = new CIMEventDispatcher(this.iIndicationListener,
- config.getListenerMaxQueuedEvents());
- this.iIndicationHandler = new CIMIndicationHandler(eventDispatcher, config);
- this.iConnectionHandler = new HttpConnectionHandler(this.iIndicationHandler, config);
- this.iConnection = new HttpServerConnection(this.iConnectionHandler, pLocalAddress,
- pPort, pSSL, config);
- }
-
- @Override
- protected void finalize() throws Throwable {
- try {
- stop();
- } finally {
- super.finalize();
- }
- }
-
- /**
- * Starts the HTTP server connection receiving the indications.
- */
- public void start() {
- this.iConnection.start();
- }
-
- /**
- * Stops the HTTP server connection receiving the indications and the
- * indication handler.
- */
- public void stop() {
- this.iConnection.close();
- this.iIndicationHandler.close();
- }
-
- /**
- * Returns the listener we forward the indications to.
- *
- * @return The listener.
- */
- public IndicationListener getIndicationListener() {
- return (this.iIndicationListener instanceof IndicationListener) ? (IndicationListener) this.iIndicationListener
- : null;
- }
-
- /**
- * Returns the listener we forward the indications to.
- *
- * @return The listener.
- */
- public IndicationListenerSBLIM getIndicationListenerSBLIM() {
- return (this.iIndicationListener instanceof IndicationListenerSBLIM) ? (IndicationListenerSBLIM) this.iIndicationListener
- : null;
- }
-
- /**
- * Returns the listener port.
- *
- * @return The listener port.
- */
- public int getListenerPort() {
- return this.iConnection.getPort();
- }
-
- /**
- * Get the IPs blocked by the listener.
- *
- * @return The comma-separated list of blocked IPs.
- */
- public String getBlockedIPs() {
- return this.iConnectionHandler.getBlockedIPs();
- }
-
- /**
- * Set the IPs to be blocked by the listener.
- *
- * @param pIPs
- * The comma-separated list of blocked IPs.
- */
- public void setBlockedIPs(String pIPs) {
- this.iConnectionHandler.setBlockedIPs(pIPs);
- }
- }
-
- protected final WBEMConfiguration iConfiguration = new WBEMConfiguration(new Properties());
-
- private Map iPortMap = new HashMap();
-
- /**
- * Ctor.
- */
- public WBEMListenerSBLIM() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.sentrysoftware.wbem.javax.wbem.listener.WBEMListener#addListener(javax.wbem.listener.
- * IndicationListener, int, java.lang.String)
- */
- public int addListener(IndicationListener pListener, int pPort, String pTransport)
- throws IOException {
- return addListener((EventListener) pListener, pPort, pTransport, null, null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.sentrysoftware.wbem.javax.wbem.listener.WBEMListener#addListener(javax.wbem.listener.
- * IndicationListener, int, java.lang.String, java.lang.String)
- */
- public int addListener(IndicationListener pListener, int pPort, String pTransport,
- String pLocalAddr) throws IOException {
- return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr, null);
- }
-
- /**
- * Add a new listener using the specified port.
- *
- * @param pListener
- * The Indication Listener that will be called when an indication
- * is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @param pLocalAddr
- * The local IP address to bind to. This is only needed in
- * multi-homed systems. A value of null will bind to
- * all IP addresses.
- * @param pConfigurationProperties
- * The individual configuration properties for this listener.
- * @return The port that was used.
- * @throws IOException
- * This exception is thrown when binding to pPort fails.
- */
- public int addListener(IndicationListener pListener, int pPort, String pTransport,
- String pLocalAddr, Properties pConfigurationProperties) throws IOException {
-
- return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr,
- pConfigurationProperties);
- }
-
- /**
- * Add a new listener using the specified port.
- *
- * @param pListener
- * The SBLIM Indication Listener that will be called when an
- * indication is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @return The port that was used.
- * @throws IOException
- * This exception is thrown when binding to pPort fails.
- */
- public int addListener(IndicationListenerSBLIM pListener, int pPort, String pTransport)
- throws IOException {
- return addListener((EventListener) pListener, pPort, pTransport, null, null);
- }
-
- /**
- * Add a new listener using the specified port and local address.
- *
- * @param pListener
- * The SBLIM Indication Listener that will be called when an
- * indication is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @param pLocalAddr
- * The local IP address to bind to. This is only needed in
- * multi-homed systems. A value of null will bind to
- * all IP addresses.
- * @return The port that was used.
- * @throws IOException
- * This exception is thrown when binding to pPort fails.
- */
- public int addListener(IndicationListenerSBLIM pListener, int pPort, String pTransport,
- String pLocalAddr) throws IOException {
- return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr, null);
- }
-
- /**
- * Add a new listener using the specified port, local address and
- * properties.
- *
- * @param pListener
- * The SBLIM Indication Listener that will be called when an
- * indication is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @param pLocalAddr
- * The local IP address to bind to. This is only needed in
- * multi-homed systems. A value of null will bind to
- * all IP addresses.
- * @param pConfigurationProperties
- * The individual configuration properties for this listener.
- * @return The port that was used.
- * @throws IOException
- * This exception is thrown when binding to pPort fails.
- */
- public int addListener(IndicationListenerSBLIM pListener, int pPort, String pTransport,
- String pLocalAddr, Properties pConfigurationProperties) throws IOException {
-
- return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr,
- pConfigurationProperties);
- }
-
- /**
- * Add a new listener using the specified port, local address and
- * properties. This is the worker routine for all public addListener
- * methods.
- *
- * @param pListener
- * The indication listener (IndicationListener or
- * IndicationListenerSBLIM) that will be called when
- * an indication is received.
- * @param pPort
- * The port to listen on. Use 0 to specify any available port.
- * @param pTransport
- * The transport to use (e.g. HTTP or HTTPS).
- * @param pLocalAddr
- * The local IP address to bind to. This is only needed in
- * multi-homed systems. A value of null will bind to
- * all IP addresses.
- * @param pConfigurationProperties
- * The individual configuration properties for this listener.
- * @return The port that was used.
- * @throws IOException
- * This exception is thrown when binding to pPort fails.
- */
- private synchronized int addListener(EventListener pListener, int pPort, String pTransport,
- String pLocalAddr, Properties pConfigurationProperties) throws IOException {
-
- if (pPort > 0 && this.iPortMap.containsKey(Integer.valueOf(pPort))) { throw new BindException(
- "Port already in use."); }
- boolean ssl;
- if (pTransport.equalsIgnoreCase(WBEMConstants.HTTP)) ssl = false;
- else if (pTransport.equalsIgnoreCase(WBEMConstants.HTTPS)) ssl = true;
- else throw new IllegalArgumentException("Unknown transport: " + pTransport
- + "! Valid values are http and https.");
-
- WBEMListenerImpl listener = new WBEMListenerImpl(pLocalAddr, pPort, ssl, pListener,
- pConfigurationProperties);
- listener.start();
-
- this.iPortMap.put(Integer.valueOf(listener.getListenerPort()), listener);
-
- return listener.getListenerPort();
- }
-
- /**
- * Get the IPs blocked by the listener associated with the specified port.
- *
- * @param pPort
- * The port.
- * @return The comma-separated list of blocked IPs.
- */
- public String getBlockedIPs(int pPort) {
- if (pPort <= 0 || !this.iPortMap.containsKey(Integer.valueOf(pPort))) { throw new IllegalArgumentException(
- "Port not in use."); }
- WBEMListenerImpl listener = this.iPortMap.get(Integer.valueOf(pPort));
- return listener != null ? listener.getBlockedIPs() : null;
- }
-
- public String getProperty(String pName) {
- if (pName.startsWith("javax.wbem.")) {
- // Process JSR48 properties
- if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE)) {
- return this.iConfiguration.getSslKeyStorePath();
- } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE_PASSWORD)) {
- return this.iConfiguration.getSslKeyStorePassword();
- } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_TRUSTSTORE)) {
- return this.iConfiguration.getSslTrustStorePath();
- } else {
- return null;
- }
- }
- return this.iConfiguration.getDomainProperty(pName);
- }
-
- public synchronized void removeListener(int pPort) {
- WBEMListenerImpl listener = this.iPortMap.remove(Integer.valueOf(pPort));
- if (listener != null) {
- listener.stop();
- }
- }
-
- /**
- * Set the IPs to be blocked by the listener associated with the specified
- * port.
- *
- * @param pPort
- * The port.
- * @param pIPs
- * The comma-separated list of blocked IPs.
- */
- public void setBlockedIPs(int pPort, String pIPs) {
- if (pPort <= 0 || !this.iPortMap.containsKey(Integer.valueOf(pPort))) { throw new IllegalArgumentException(
- "Port not in use."); }
- WBEMListenerImpl listener = this.iPortMap.get(Integer.valueOf(pPort));
- if (listener != null) {
- listener.setBlockedIPs(pIPs);
- }
- }
-
- public void setProperty(String pName, String pValue) {
- if (pName.startsWith("javax.wbem.")) {
- // Process JSR48 properties
- if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE)) {
- this.iConfiguration.setDomainProperty(WBEMConfigurationProperties.KEYSTORE_PATH,
- pValue);
- } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE_PASSWORD)) {
- this.iConfiguration.setDomainProperty(
- WBEMConfigurationProperties.KEYSTORE_PASSWORD, pValue);
- } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_TRUSTSTORE)) {
- this.iConfiguration.setDomainProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH,
- pValue);
- } else {
- throw new IllegalArgumentException(pName);
- }
- } else {
- this.iConfiguration.setDomainProperty(pName, pValue);
- }
- }
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2013
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, IBM, ebak@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2007-01-08 ebak Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 3023348 2010-07-02 blaschke-oss Listener uses # constructor instead of valueOf
+ * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues
+ * 3469018 2012-01-03 blaschke-oss Properties not passed to CIMIndicationHandler
+ * 3477087 2012-01-23 blaschke-oss Need Access to an Indication Sender's IP Address
+ * 3496385 2012-03-02 blaschke-oss JSR48 1.0.0: add WBEMListener get/setProperty
+ * 3513228 2012-04-23 blaschke-oss Reliable Indications support can create lots of threads
+ * 3529062 2012-05-23 blaschke-oss WBEMListenerFactory should return new instance
+ * 3529065 2012-05-31 hellerda Enable WBEMListener get/setProperty
+ * 2628 2013-03-26 blaschke-oss Limit size of LinkedList of CIMEvents to be dispatched
+ * 2635 2013-05-16 blaschke-oss Slowloris DoS attack for CIM indication listener port
+ * 2657 2013-08-20 blaschke-oss Potential null pointer exception in handleConnection
+ */
+
+package org.metricshub.wbem.sblim.cimclient;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.IOException;
+import java.net.BindException;
+import java.util.Enumeration;
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.metricshub.wbem.javax.wbem.listener.IndicationListener;
+import org.metricshub.wbem.javax.wbem.listener.WBEMListenerConstants;
+import org.metricshub.wbem.sblim.cimclient.internal.http.HttpConnectionHandler;
+import org.metricshub.wbem.sblim.cimclient.internal.http.HttpServerConnection;
+import org.metricshub.wbem.sblim.cimclient.internal.util.WBEMConfiguration;
+import org.metricshub.wbem.sblim.cimclient.internal.util.WBEMConstants;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.indications.CIMEventDispatcher;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.indications.CIMIndicationHandler;
+import org.metricshub.wbem.javax.wbem.listener.WBEMListener;
+
+/**
+ * Class WBEMListenerSBLIM is the SBLIM implementation of the WBEMListener
+ * interface.
+ *
+ */
+public class WBEMListenerSBLIM implements WBEMListener {
+
+ /**
+ * The real implementation of a listener that starts a HTTP server and
+ * processes incoming indications
+ *
+ */
+ public class WBEMListenerImpl {
+
+ private EventListener iIndicationListener;
+
+ private HttpServerConnection iConnection;
+
+ private CIMIndicationHandler iIndicationHandler;
+
+ private HttpConnectionHandler iConnectionHandler;
+
+ /**
+ * Ctor.
+ *
+ * @param pLocalAddress
+ * The local address to bind the port to. If null the port is
+ * bound to all local addresses. For use on multi-homed
+ * systems.
+ * @param pPort
+ * The port to listen on. If zero any free port will be
+ * chosen.
+ * @param pSSL
+ * SSL secured connection?
+ * @param pIndicationListener
+ * The indication listener to forward the incoming
+ * indications to (an instance of IndicationListener or
+ * IndicationListenerSBLIM).
+ * @param pProperties
+ * The configuration.
+ * @throws IOException
+ */
+ public WBEMListenerImpl(String pLocalAddress, int pPort, boolean pSSL,
+ EventListener pIndicationListener, Properties pProperties) throws IOException {
+
+ // Merge any properties passed via addListener
+ if (pProperties != null) {
+ for (Enumeration e = pProperties.keys(); e.hasMoreElements();) {
+ String key = (String) e.nextElement();
+ String value = pProperties.getProperty(key);
+ setProperty(key, value);
+ }
+ }
+ WBEMConfiguration config = WBEMListenerSBLIM.this.iConfiguration;
+ if (!(pIndicationListener instanceof IndicationListener)
+ && !(pIndicationListener instanceof IndicationListenerSBLIM)) throw new IllegalArgumentException(
+ "Listener must be instance of IndicationListener or IndicationListenerSBLIM");
+ this.iIndicationListener = pIndicationListener;
+ CIMEventDispatcher eventDispatcher = new CIMEventDispatcher(this.iIndicationListener,
+ config.getListenerMaxQueuedEvents());
+ this.iIndicationHandler = new CIMIndicationHandler(eventDispatcher, config);
+ this.iConnectionHandler = new HttpConnectionHandler(this.iIndicationHandler, config);
+ this.iConnection = new HttpServerConnection(this.iConnectionHandler, pLocalAddress,
+ pPort, pSSL, config);
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ try {
+ stop();
+ } finally {
+ super.finalize();
+ }
+ }
+
+ /**
+ * Starts the HTTP server connection receiving the indications.
+ */
+ public void start() {
+ this.iConnection.start();
+ }
+
+ /**
+ * Stops the HTTP server connection receiving the indications and the
+ * indication handler.
+ */
+ public void stop() {
+ this.iConnection.close();
+ this.iIndicationHandler.close();
+ }
+
+ /**
+ * Returns the listener we forward the indications to.
+ *
+ * @return The listener.
+ */
+ public IndicationListener getIndicationListener() {
+ return (this.iIndicationListener instanceof IndicationListener) ? (IndicationListener) this.iIndicationListener
+ : null;
+ }
+
+ /**
+ * Returns the listener we forward the indications to.
+ *
+ * @return The listener.
+ */
+ public IndicationListenerSBLIM getIndicationListenerSBLIM() {
+ return (this.iIndicationListener instanceof IndicationListenerSBLIM) ? (IndicationListenerSBLIM) this.iIndicationListener
+ : null;
+ }
+
+ /**
+ * Returns the listener port.
+ *
+ * @return The listener port.
+ */
+ public int getListenerPort() {
+ return this.iConnection.getPort();
+ }
+
+ /**
+ * Get the IPs blocked by the listener.
+ *
+ * @return The comma-separated list of blocked IPs.
+ */
+ public String getBlockedIPs() {
+ return this.iConnectionHandler.getBlockedIPs();
+ }
+
+ /**
+ * Set the IPs to be blocked by the listener.
+ *
+ * @param pIPs
+ * The comma-separated list of blocked IPs.
+ */
+ public void setBlockedIPs(String pIPs) {
+ this.iConnectionHandler.setBlockedIPs(pIPs);
+ }
+ }
+
+ protected final WBEMConfiguration iConfiguration = new WBEMConfiguration(new Properties());
+
+ private Map iPortMap = new HashMap();
+
+ /**
+ * Ctor.
+ */
+ public WBEMListenerSBLIM() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.metricshub.wbem.javax.wbem.listener.WBEMListener#addListener(javax.wbem.listener.
+ * IndicationListener, int, java.lang.String)
+ */
+ public int addListener(IndicationListener pListener, int pPort, String pTransport)
+ throws IOException {
+ return addListener((EventListener) pListener, pPort, pTransport, null, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.metricshub.wbem.javax.wbem.listener.WBEMListener#addListener(javax.wbem.listener.
+ * IndicationListener, int, java.lang.String, java.lang.String)
+ */
+ public int addListener(IndicationListener pListener, int pPort, String pTransport,
+ String pLocalAddr) throws IOException {
+ return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr, null);
+ }
+
+ /**
+ * Add a new listener using the specified port.
+ *
+ * @param pListener
+ * The Indication Listener that will be called when an indication
+ * is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @param pLocalAddr
+ * The local IP address to bind to. This is only needed in
+ * multi-homed systems. A value of null will bind to
+ * all IP addresses.
+ * @param pConfigurationProperties
+ * The individual configuration properties for this listener.
+ * @return The port that was used.
+ * @throws IOException
+ * This exception is thrown when binding to pPort fails.
+ */
+ public int addListener(IndicationListener pListener, int pPort, String pTransport,
+ String pLocalAddr, Properties pConfigurationProperties) throws IOException {
+
+ return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr,
+ pConfigurationProperties);
+ }
+
+ /**
+ * Add a new listener using the specified port.
+ *
+ * @param pListener
+ * The SBLIM Indication Listener that will be called when an
+ * indication is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @return The port that was used.
+ * @throws IOException
+ * This exception is thrown when binding to pPort fails.
+ */
+ public int addListener(IndicationListenerSBLIM pListener, int pPort, String pTransport)
+ throws IOException {
+ return addListener((EventListener) pListener, pPort, pTransport, null, null);
+ }
+
+ /**
+ * Add a new listener using the specified port and local address.
+ *
+ * @param pListener
+ * The SBLIM Indication Listener that will be called when an
+ * indication is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @param pLocalAddr
+ * The local IP address to bind to. This is only needed in
+ * multi-homed systems. A value of null will bind to
+ * all IP addresses.
+ * @return The port that was used.
+ * @throws IOException
+ * This exception is thrown when binding to pPort fails.
+ */
+ public int addListener(IndicationListenerSBLIM pListener, int pPort, String pTransport,
+ String pLocalAddr) throws IOException {
+ return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr, null);
+ }
+
+ /**
+ * Add a new listener using the specified port, local address and
+ * properties.
+ *
+ * @param pListener
+ * The SBLIM Indication Listener that will be called when an
+ * indication is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @param pLocalAddr
+ * The local IP address to bind to. This is only needed in
+ * multi-homed systems. A value of null will bind to
+ * all IP addresses.
+ * @param pConfigurationProperties
+ * The individual configuration properties for this listener.
+ * @return The port that was used.
+ * @throws IOException
+ * This exception is thrown when binding to pPort fails.
+ */
+ public int addListener(IndicationListenerSBLIM pListener, int pPort, String pTransport,
+ String pLocalAddr, Properties pConfigurationProperties) throws IOException {
+
+ return addListener((EventListener) pListener, pPort, pTransport, pLocalAddr,
+ pConfigurationProperties);
+ }
+
+ /**
+ * Add a new listener using the specified port, local address and
+ * properties. This is the worker routine for all public addListener
+ * methods.
+ *
+ * @param pListener
+ * The indication listener (IndicationListener or
+ * IndicationListenerSBLIM) that will be called when
+ * an indication is received.
+ * @param pPort
+ * The port to listen on. Use 0 to specify any available port.
+ * @param pTransport
+ * The transport to use (e.g. HTTP or HTTPS).
+ * @param pLocalAddr
+ * The local IP address to bind to. This is only needed in
+ * multi-homed systems. A value of null will bind to
+ * all IP addresses.
+ * @param pConfigurationProperties
+ * The individual configuration properties for this listener.
+ * @return The port that was used.
+ * @throws IOException
+ * This exception is thrown when binding to pPort fails.
+ */
+ private synchronized int addListener(EventListener pListener, int pPort, String pTransport,
+ String pLocalAddr, Properties pConfigurationProperties) throws IOException {
+
+ if (pPort > 0 && this.iPortMap.containsKey(Integer.valueOf(pPort))) { throw new BindException(
+ "Port already in use."); }
+ boolean ssl;
+ if (pTransport.equalsIgnoreCase(WBEMConstants.HTTP)) ssl = false;
+ else if (pTransport.equalsIgnoreCase(WBEMConstants.HTTPS)) ssl = true;
+ else throw new IllegalArgumentException("Unknown transport: " + pTransport
+ + "! Valid values are http and https.");
+
+ WBEMListenerImpl listener = new WBEMListenerImpl(pLocalAddr, pPort, ssl, pListener,
+ pConfigurationProperties);
+ listener.start();
+
+ this.iPortMap.put(Integer.valueOf(listener.getListenerPort()), listener);
+
+ return listener.getListenerPort();
+ }
+
+ /**
+ * Get the IPs blocked by the listener associated with the specified port.
+ *
+ * @param pPort
+ * The port.
+ * @return The comma-separated list of blocked IPs.
+ */
+ public String getBlockedIPs(int pPort) {
+ if (pPort <= 0 || !this.iPortMap.containsKey(Integer.valueOf(pPort))) { throw new IllegalArgumentException(
+ "Port not in use."); }
+ WBEMListenerImpl listener = this.iPortMap.get(Integer.valueOf(pPort));
+ return listener != null ? listener.getBlockedIPs() : null;
+ }
+
+ public String getProperty(String pName) {
+ if (pName.startsWith("javax.wbem.")) {
+ // Process JSR48 properties
+ if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE)) {
+ return this.iConfiguration.getSslKeyStorePath();
+ } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE_PASSWORD)) {
+ return this.iConfiguration.getSslKeyStorePassword();
+ } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_TRUSTSTORE)) {
+ return this.iConfiguration.getSslTrustStorePath();
+ } else {
+ return null;
+ }
+ }
+ return this.iConfiguration.getDomainProperty(pName);
+ }
+
+ public synchronized void removeListener(int pPort) {
+ WBEMListenerImpl listener = this.iPortMap.remove(Integer.valueOf(pPort));
+ if (listener != null) {
+ listener.stop();
+ }
+ }
+
+ /**
+ * Set the IPs to be blocked by the listener associated with the specified
+ * port.
+ *
+ * @param pPort
+ * The port.
+ * @param pIPs
+ * The comma-separated list of blocked IPs.
+ */
+ public void setBlockedIPs(int pPort, String pIPs) {
+ if (pPort <= 0 || !this.iPortMap.containsKey(Integer.valueOf(pPort))) { throw new IllegalArgumentException(
+ "Port not in use."); }
+ WBEMListenerImpl listener = this.iPortMap.get(Integer.valueOf(pPort));
+ if (listener != null) {
+ listener.setBlockedIPs(pIPs);
+ }
+ }
+
+ public void setProperty(String pName, String pValue) {
+ if (pName.startsWith("javax.wbem.")) {
+ // Process JSR48 properties
+ if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE)) {
+ this.iConfiguration.setDomainProperty(WBEMConfigurationProperties.KEYSTORE_PATH,
+ pValue);
+ } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_KEYSTORE_PASSWORD)) {
+ this.iConfiguration.setDomainProperty(
+ WBEMConfigurationProperties.KEYSTORE_PASSWORD, pValue);
+ } else if (pName.equals(WBEMListenerConstants.PROP_LISTENER_TRUSTSTORE)) {
+ this.iConfiguration.setDomainProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH,
+ pValue);
+ } else {
+ throw new IllegalArgumentException(pName);
+ }
+ } else {
+ this.iConfiguration.setDomainProperty(pName, pValue);
+ }
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/AdvertisementCatalog.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/AdvertisementCatalog.java
similarity index 91%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/AdvertisementCatalog.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/AdvertisementCatalog.java
index 15c2234..b1100e1 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/AdvertisementCatalog.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/AdvertisementCatalog.java
@@ -1,560 +1,559 @@
-/*
- (C) Copyright IBM Corp. 2007, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
- * 1729361 2007-06-04 lupusalex Multicast discovery is broken in DiscovererSLP
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.discovery;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.logging.LogAndTraceBroker;
-
-import javax.security.auth.Subject;
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClient;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.logging.Level;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Class AdvertisementCatalog implements a catalog for WBEM service
- * advertisements. In practice we usually have multiple advertisements for a
- * single service, because the DMTF mandates an advertisement per remote service
- * access point (e.g. http, https, rmi). This class tries to ease the management
- * of this by indexing services by the unique service id and therefore surfacing
- * which advertisements belong to the same service. The application might then
- * choose it's preferred communication mechanism.
- *
- * No thread synchronization provided, this is the responsibility of
- * the caller.
- * @since 2.0.2
- */
-public class AdvertisementCatalog {
-
- /**
- * Interface EventListener specifies listener that are called when an
- * advertisement is added to or removed from the catalog, expires or is
- * renewed.
- *
- */
- public static interface EventListener {
-
- /**
- * Called when an advertisement is added to the catalog that has not
- * been a member of the catalog before.
- *
- * @param pEvent
- * The type of the event. One of the constants
- * EVENT_ADD, EVENT_REMOVE, EVENT_EXPIRE, EVENT_RENEW
- * in AdvertisementCatalog.
- *
- * @param pAdvertisment
- * The added advertisement
- */
- public void advertisementEvent(int pEvent, WBEMServiceAdvertisement pAdvertisment);
- }
-
- /**
- * Class AdvertisementDecorator decorates a WBEMAdvertisement with state
- * information required by the AdvertisementCatalog class
- *
- * @pattern Decorator
- * iAvertisement!=null
- */
- private static class AdvertisementDecorator implements WBEMServiceAdvertisement {
-
- private WBEMServiceAdvertisement iAdvertisement;
-
- private boolean iRefresh = false;
-
- /**
- * Ctor.
- *
- * @param pAdvertisement
- * The advertisement to decorate
- */
- protected AdvertisementDecorator(WBEMServiceAdvertisement pAdvertisement) {
- if (pAdvertisement == null) throw new IllegalArgumentException("Advertisement is null");
- this.iAdvertisement = pAdvertisement;
- }
-
- /**
- * Returns advertisement
- *
- * @return The value of advertisement.
- */
- protected WBEMServiceAdvertisement getAdvertisementXXX() {
- return this.iAdvertisement;
- }
-
- /**
- * Returns refresh
- *
- * @return The value of refresh.
- */
- protected boolean isRefresh() {
- return this.iRefresh;
- }
-
- /**
- * Sets advertisement
- *
- * @param pAdvertisement
- * The new value of advertisement.
- */
- protected void setAdvertisement(WBEMServiceAdvertisement pAdvertisement) {
- this.iAdvertisement = pAdvertisement;
- }
-
- /**
- * Sets refresh
- *
- * @param pRefresh
- * The new value of refresh.
- */
- protected void setRefresh(boolean pRefresh) {
- this.iRefresh = pRefresh;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object pObj) {
- return this.iAdvertisement.equals(pObj);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return this.iAdvertisement.hashCode();
- }
-
- /**
- * @see WBEMServiceAdvertisement#createClient(javax.security.auth.Subject, java.util.Locale[])
- */
- public WBEMClient createClient(Subject pSubject, Locale[] pLocales) throws Exception {
- return this.iAdvertisement.createClient(pSubject, pLocales);
- }
-
- /**
- * @see WBEMServiceAdvertisement#getAttribute(java.lang.String)
- */
- public String getAttribute(String pAttributeName) {
- return this.iAdvertisement.getAttribute(pAttributeName);
- }
-
- /**
- * @see WBEMServiceAdvertisement#getAttributes()
- */
- public Set> getAttributes() {
- return this.iAdvertisement.getAttributes();
- }
-
- /**
- * @see WBEMServiceAdvertisement#getConcreteServiceType()
- */
- public String getConcreteServiceType() {
- return this.iAdvertisement.getConcreteServiceType();
- }
-
- /**
- * @see WBEMServiceAdvertisement#getDirectory()
- */
- public String getDirectory() {
- return this.iAdvertisement.getDirectory();
- }
-
- /**
- * @see WBEMServiceAdvertisement#getInteropNamespaces()
- */
- public String[] getInteropNamespaces() {
- return this.iAdvertisement.getInteropNamespaces();
- }
-
- /**
- * @see WBEMServiceAdvertisement#getServiceId()
- */
- public String getServiceId() {
- return this.iAdvertisement.getServiceId();
- }
-
- /**
- * @see WBEMServiceAdvertisement#getServiceUrl()
- */
- public String getServiceUrl() {
- return this.iAdvertisement.getServiceUrl();
- }
-
- /**
- * @see WBEMServiceAdvertisement#isExpired()
- */
- public boolean isExpired() {
- return this.iAdvertisement.isExpired();
- }
-
- /**
- * @see WBEMServiceAdvertisement#setExpired(boolean)
- */
- public void setExpired(boolean pExpired) {
- this.iAdvertisement.setExpired(pExpired);
- }
- }
-
- /**
- * Event code when advertisement is added
- */
- public static int EVENT_ADD = 1;
-
- /**
- * Event code when advertisement is removed
- */
- public static int EVENT_REMOVE = 2;
-
- /**
- * Event code when advertisement expires
- */
- public static int EVENT_EXPIRE = 4;
-
- /**
- * Event code when advertisement is renewed
- */
- public static int EVENT_RENEW = 8;
-
- private List iListeners = new LinkedList();
-
- private HashMap> iCatalogByDirectory = new HashMap>();
-
- private Map> iCatalogById = new HashMap>();
-
- /**
- * Ctor.
- */
- public AdvertisementCatalog() {
- /**/
- }
-
- /**
- * Adds a listener for "add" events. The listener will be called whenever a
- * advertisement is added to the catalog.
- *
- * @param pListener
- * The listener
- */
- public void addEventListener(EventListener pListener) {
- this.iListeners.add(pListener);
- }
-
- /**
- * Adds new advertisements to the catalog. Existing advertisements sharing
- * concrete type, url and directory are replaced.
- *
- * @param pAdvertisements
- * The new advertisements
- */
- public void addAdvertisements(WBEMServiceAdvertisement[] pAdvertisements) {
- for (int i = 0; i < pAdvertisements.length; ++i) {
- String url = "";
- try {
- WBEMServiceAdvertisement advertisement = pAdvertisements[i];
- url = advertisement.getServiceUrl();
- WBEMProtocol protocol = makeProtocol(advertisement);
- String serviceId = advertisement.getAttribute(WBEMServiceAdvertisement.SERVICE_ID);
- {
- List innerList = this.iCatalogByDirectory
- .get(advertisement.getDirectory());
- if (innerList == null) {
- innerList = new ArrayList();
- this.iCatalogByDirectory.put(advertisement.getDirectory(), innerList);
- }
- AdvertisementDecorator entry = findAdvertisement(innerList, advertisement);
- if (entry != null) {
- boolean wasExpired = entry.isExpired();
- entry.setAdvertisement(advertisement);
- entry.setRefresh(false);
- entry.setExpired(false);
- if (wasExpired) {
- notifyEventListeners(EVENT_RENEW, advertisement);
- }
- } else {
- innerList.add(new AdvertisementDecorator(advertisement));
- notifyEventListeners(EVENT_ADD, advertisement);
- }
- }
- {
- Map innerMap = this.iCatalogById
- .get(serviceId);
- if (innerMap == null) {
- innerMap = new HashMap();
- this.iCatalogById.put(serviceId, innerMap);
- }
- innerMap.put(protocol, advertisement);
- }
- } catch (Exception e) {
- LogAndTraceBroker.getBroker().trace(Level.FINE,
- "Incomplete advertisement for" + url, e);
- }
- }
- }
-
- /**
- * Returns the advertisement from the catalog corresponding to a given id
- * and with the protocol preferred most.
- *
- * @param pId
- * The service id
- * @param pProtocols
- * An array containing the desired protocols in order of
- * preference. If a service doesn't advertise any of the given
- * protocols this service returns null.
- * @return The corresponding advertisement
- */
- public WBEMServiceAdvertisement getAdvertisement(final String pId,
- final WBEMProtocol[] pProtocols) {
- Map innerMap = this.iCatalogById.get(pId);
- if (innerMap == null) { return null; }
- for (int i = 0; i < pProtocols.length; ++i) {
- WBEMServiceAdvertisement advertisement = innerMap.get(pProtocols[i]);
- if (advertisement != null) { return advertisement; }
- }
- return null;
- }
-
- /**
- * Returns the advertisements from the catalog corresponding to a given
- * directory
- *
- * @param pDirectory
- * The directory service
- * @return The corresponding advertisements
- */
- public WBEMServiceAdvertisement[] getAdvertisementsByDirectory(String pDirectory) {
- List result = this.iCatalogByDirectory.get(pDirectory);
- return (result != null ? (WBEMServiceAdvertisement[]) result
- .toArray(new WBEMServiceAdvertisement[result.size()])
- : new WBEMServiceAdvertisement[] {});
- }
-
- /**
- * Returns the advertisements from the catalog corresponding to a given id
- *
- * @param pId
- * The service id
- * @return The corresponding advertisements
- */
- public WBEMServiceAdvertisement[] getAdvertisementsById(String pId) {
- Map innerMap = this.iCatalogById.get(pId);
- if (innerMap == null) { return null; }
- Collection advertisements = innerMap.values();
- return advertisements.toArray(new WBEMServiceAdvertisement[advertisements.size()]);
- }
-
- /**
- * Returns an array of service ids known by this catalog
- *
- * @return The service ids
- */
- public String[] getKnownIds() {
- Set ids = this.iCatalogById.keySet();
- return ids.toArray(new String[ids.size()]);
- }
-
- /**
- * Refreshes the advertisements from a given directory. All existing
- * advertisements from this directory are deleted first before the new ones
- * are added.
- *
- * @param pDirectory
- * The directory services we got the advertisements from
- * @param pAdvertisements
- * The advertisements
- */
- public void refreshAdvertisements(final String[] pDirectory,
- WBEMServiceAdvertisement[] pAdvertisements) {
- for (int i = 0; i < pDirectory.length; ++i) {
- markRefresh(pDirectory[i]);
- }
- addAdvertisements(pAdvertisements);
- for (int i = 0; i < pDirectory.length; ++i) {
- expire(pDirectory[i]);
- }
- }
-
- /**
- * Removes a listener
- *
- * @param pListener
- * The listener to remove
- */
- public void removeEventListener(EventListener pListener) {
- this.iListeners.remove(pListener);
- }
-
- /**
- * Removes the expired advertisements from the catalog.
- *
- * @param pDirectory
- * When not null only the expired advertisements of
- * the given directory are removed. Otherwise all expired
- * advertisements are removed.
- */
- public void removeExpired(String pDirectory) {
-
- if (pDirectory == null) {
- Iterator iter = this.iCatalogByDirectory.keySet().iterator();
- while (iter.hasNext()) {
- removeExpired(iter.next());
- }
- return;
- }
-
- List advertisementList = this.iCatalogByDirectory.get(pDirectory);
- Iterator iter = advertisementList.iterator();
- while (iter.hasNext()) {
- AdvertisementDecorator decorator = iter.next();
- if (decorator.isExpired()) {
- iter.remove();
- notifyEventListeners(EVENT_REMOVE, decorator);
- Map innerMap = this.iCatalogById
- .get(decorator.getServiceId());
- innerMap.remove(makeProtocol(decorator));
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append("AdvertisementCatalog:");
- Iterator>> outer = this.iCatalogById
- .entrySet().iterator();
- while (outer.hasNext()) {
- Map.Entry> entry = outer.next();
- if (entry.getValue() == null) {
- continue;
- }
- result.append("[service-id:\"");
- result.append(entry.getKey());
- result.append("\"");
- Map innerMap = entry.getValue();
- Iterator> inner = innerMap.entrySet()
- .iterator();
- while (inner.hasNext()) {
- Map.Entry innerEntry = inner.next();
- result.append("[");
- result.append(innerEntry.getKey().toString());
- result.append("]");
- }
- result.append("]");
- }
- return result.toString();
- }
-
- private void expire(String pDirectory) {
- List advertisementList = this.iCatalogByDirectory.get(pDirectory);
- if (advertisementList == null) { return; }
- Iterator iter = advertisementList.iterator();
- while (iter.hasNext()) {
- AdvertisementDecorator advertisement = iter.next();
- if (advertisement.isRefresh()) {
- advertisement.setRefresh(false);
- advertisement.setExpired(true);
- notifyEventListeners(EVENT_EXPIRE, advertisement);
- }
- }
- }
-
- private AdvertisementDecorator findAdvertisement(List pList,
- WBEMServiceAdvertisement pAdvertisement) {
- Iterator iter = pList.iterator();
- while (iter.hasNext()) {
- AdvertisementDecorator entry = iter.next();
- if (entry.getServiceUrl().equals(pAdvertisement.getServiceUrl())) { return entry; }
- }
- return null;
- }
-
- private WBEMProtocol makeProtocol(WBEMServiceAdvertisement advertisement) {
- String presentation = advertisement.getAttribute(WBEMServiceAdvertisement.COMM_MECHANISM);
- if ("OTHER".equalsIgnoreCase(presentation)) {
- presentation = advertisement
- .getAttribute(WBEMServiceAdvertisement.OTHER_COMM_MECHN_DESC);
- }
- String transport = advertisement.getServiceUrl().split(":", 2)[0];
- WBEMProtocol protocol = new WBEMProtocol(transport, presentation);
- return protocol;
- }
-
- private void markRefresh(String pDirectory) {
- List advertisementList = this.iCatalogByDirectory.get(pDirectory);
- if (advertisementList == null) { return; }
- Iterator iter = advertisementList.iterator();
- while (iter.hasNext()) {
- AdvertisementDecorator advertisement = iter.next();
- advertisement.setRefresh(true);
- }
- }
-
- private void notifyEventListeners(int pEvent, WBEMServiceAdvertisement pAdvertisement) {
- Iterator iter = this.iListeners.iterator();
- while (iter.hasNext()) {
- iter.next().advertisementEvent(pEvent, pAdvertisement);
- }
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2007, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
+ * 1729361 2007-06-04 lupusalex Multicast discovery is broken in DiscovererSLP
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ */
+
+package org.metricshub.wbem.sblim.cimclient.discovery;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import javax.security.auth.Subject;
+
+import org.metricshub.wbem.javax.wbem.client.WBEMClient;
+import org.metricshub.wbem.sblim.cimclient.internal.logging.LogAndTraceBroker;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.logging.Level;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Class AdvertisementCatalog implements a catalog for WBEM service
+ * advertisements. In practice we usually have multiple advertisements for a
+ * single service, because the DMTF mandates an advertisement per remote service
+ * access point (e.g. http, https, rmi). This class tries to ease the management
+ * of this by indexing services by the unique service id and therefore surfacing
+ * which advertisements belong to the same service. The application might then
+ * choose it's preferred communication mechanism.
+ *
+ * No thread synchronization provided, this is the responsibility of
+ * the caller.
+ * @since 2.0.2
+ */
+public class AdvertisementCatalog {
+
+ /**
+ * Interface EventListener specifies listener that are called when an
+ * advertisement is added to or removed from the catalog, expires or is
+ * renewed.
+ *
+ */
+ public static interface EventListener {
+
+ /**
+ * Called when an advertisement is added to the catalog that has not
+ * been a member of the catalog before.
+ *
+ * @param pEvent
+ * The type of the event. One of the constants
+ * EVENT_ADD, EVENT_REMOVE, EVENT_EXPIRE, EVENT_RENEW
+ * in AdvertisementCatalog.
+ *
+ * @param pAdvertisment
+ * The added advertisement
+ */
+ public void advertisementEvent(int pEvent, WBEMServiceAdvertisement pAdvertisment);
+ }
+
+ /**
+ * Class AdvertisementDecorator decorates a WBEMAdvertisement with state
+ * information required by the AdvertisementCatalog class
+ *
+ * @pattern Decorator
+ * iAvertisement!=null
+ */
+ private static class AdvertisementDecorator implements WBEMServiceAdvertisement {
+
+ private WBEMServiceAdvertisement iAdvertisement;
+
+ private boolean iRefresh = false;
+
+ /**
+ * Ctor.
+ *
+ * @param pAdvertisement
+ * The advertisement to decorate
+ */
+ protected AdvertisementDecorator(WBEMServiceAdvertisement pAdvertisement) {
+ if (pAdvertisement == null) throw new IllegalArgumentException("Advertisement is null");
+ this.iAdvertisement = pAdvertisement;
+ }
+
+ /**
+ * Returns advertisement
+ *
+ * @return The value of advertisement.
+ */
+ protected WBEMServiceAdvertisement getAdvertisementXXX() {
+ return this.iAdvertisement;
+ }
+
+ /**
+ * Returns refresh
+ *
+ * @return The value of refresh.
+ */
+ protected boolean isRefresh() {
+ return this.iRefresh;
+ }
+
+ /**
+ * Sets advertisement
+ *
+ * @param pAdvertisement
+ * The new value of advertisement.
+ */
+ protected void setAdvertisement(WBEMServiceAdvertisement pAdvertisement) {
+ this.iAdvertisement = pAdvertisement;
+ }
+
+ /**
+ * Sets refresh
+ *
+ * @param pRefresh
+ * The new value of refresh.
+ */
+ protected void setRefresh(boolean pRefresh) {
+ this.iRefresh = pRefresh;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object pObj) {
+ return this.iAdvertisement.equals(pObj);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return this.iAdvertisement.hashCode();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#createClient(javax.security.auth.Subject, java.util.Locale[])
+ */
+ public WBEMClient createClient(Subject pSubject, Locale[] pLocales) throws Exception {
+ return this.iAdvertisement.createClient(pSubject, pLocales);
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getAttribute(java.lang.String)
+ */
+ public String getAttribute(String pAttributeName) {
+ return this.iAdvertisement.getAttribute(pAttributeName);
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getAttributes()
+ */
+ public Set> getAttributes() {
+ return this.iAdvertisement.getAttributes();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getConcreteServiceType()
+ */
+ public String getConcreteServiceType() {
+ return this.iAdvertisement.getConcreteServiceType();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getDirectory()
+ */
+ public String getDirectory() {
+ return this.iAdvertisement.getDirectory();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getInteropNamespaces()
+ */
+ public String[] getInteropNamespaces() {
+ return this.iAdvertisement.getInteropNamespaces();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getServiceId()
+ */
+ public String getServiceId() {
+ return this.iAdvertisement.getServiceId();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#getServiceUrl()
+ */
+ public String getServiceUrl() {
+ return this.iAdvertisement.getServiceUrl();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#isExpired()
+ */
+ public boolean isExpired() {
+ return this.iAdvertisement.isExpired();
+ }
+
+ /**
+ * @see WBEMServiceAdvertisement#setExpired(boolean)
+ */
+ public void setExpired(boolean pExpired) {
+ this.iAdvertisement.setExpired(pExpired);
+ }
+ }
+
+ /**
+ * Event code when advertisement is added
+ */
+ public static int EVENT_ADD = 1;
+
+ /**
+ * Event code when advertisement is removed
+ */
+ public static int EVENT_REMOVE = 2;
+
+ /**
+ * Event code when advertisement expires
+ */
+ public static int EVENT_EXPIRE = 4;
+
+ /**
+ * Event code when advertisement is renewed
+ */
+ public static int EVENT_RENEW = 8;
+
+ private List iListeners = new LinkedList();
+
+ private HashMap> iCatalogByDirectory = new HashMap>();
+
+ private Map> iCatalogById = new HashMap>();
+
+ /**
+ * Ctor.
+ */
+ public AdvertisementCatalog() {
+ /**/
+ }
+
+ /**
+ * Adds a listener for "add" events. The listener will be called whenever a
+ * advertisement is added to the catalog.
+ *
+ * @param pListener
+ * The listener
+ */
+ public void addEventListener(EventListener pListener) {
+ this.iListeners.add(pListener);
+ }
+
+ /**
+ * Adds new advertisements to the catalog. Existing advertisements sharing
+ * concrete type, url and directory are replaced.
+ *
+ * @param pAdvertisements
+ * The new advertisements
+ */
+ public void addAdvertisements(WBEMServiceAdvertisement[] pAdvertisements) {
+ for (int i = 0; i < pAdvertisements.length; ++i) {
+ String url = "";
+ try {
+ WBEMServiceAdvertisement advertisement = pAdvertisements[i];
+ url = advertisement.getServiceUrl();
+ WBEMProtocol protocol = makeProtocol(advertisement);
+ String serviceId = advertisement.getAttribute(WBEMServiceAdvertisement.SERVICE_ID);
+ {
+ List innerList = this.iCatalogByDirectory
+ .get(advertisement.getDirectory());
+ if (innerList == null) {
+ innerList = new ArrayList();
+ this.iCatalogByDirectory.put(advertisement.getDirectory(), innerList);
+ }
+ AdvertisementDecorator entry = findAdvertisement(innerList, advertisement);
+ if (entry != null) {
+ boolean wasExpired = entry.isExpired();
+ entry.setAdvertisement(advertisement);
+ entry.setRefresh(false);
+ entry.setExpired(false);
+ if (wasExpired) {
+ notifyEventListeners(EVENT_RENEW, advertisement);
+ }
+ } else {
+ innerList.add(new AdvertisementDecorator(advertisement));
+ notifyEventListeners(EVENT_ADD, advertisement);
+ }
+ }
+ {
+ Map innerMap = this.iCatalogById
+ .get(serviceId);
+ if (innerMap == null) {
+ innerMap = new HashMap();
+ this.iCatalogById.put(serviceId, innerMap);
+ }
+ innerMap.put(protocol, advertisement);
+ }
+ } catch (Exception e) {
+ LogAndTraceBroker.getBroker().trace(Level.FINE,
+ "Incomplete advertisement for" + url, e);
+ }
+ }
+ }
+
+ /**
+ * Returns the advertisement from the catalog corresponding to a given id
+ * and with the protocol preferred most.
+ *
+ * @param pId
+ * The service id
+ * @param pProtocols
+ * An array containing the desired protocols in order of
+ * preference. If a service doesn't advertise any of the given
+ * protocols this service returns null.
+ * @return The corresponding advertisement
+ */
+ public WBEMServiceAdvertisement getAdvertisement(final String pId,
+ final WBEMProtocol[] pProtocols) {
+ Map innerMap = this.iCatalogById.get(pId);
+ if (innerMap == null) { return null; }
+ for (int i = 0; i < pProtocols.length; ++i) {
+ WBEMServiceAdvertisement advertisement = innerMap.get(pProtocols[i]);
+ if (advertisement != null) { return advertisement; }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the advertisements from the catalog corresponding to a given
+ * directory
+ *
+ * @param pDirectory
+ * The directory service
+ * @return The corresponding advertisements
+ */
+ public WBEMServiceAdvertisement[] getAdvertisementsByDirectory(String pDirectory) {
+ List result = this.iCatalogByDirectory.get(pDirectory);
+ return (result != null ? (WBEMServiceAdvertisement[]) result
+ .toArray(new WBEMServiceAdvertisement[result.size()])
+ : new WBEMServiceAdvertisement[] {});
+ }
+
+ /**
+ * Returns the advertisements from the catalog corresponding to a given id
+ *
+ * @param pId
+ * The service id
+ * @return The corresponding advertisements
+ */
+ public WBEMServiceAdvertisement[] getAdvertisementsById(String pId) {
+ Map innerMap = this.iCatalogById.get(pId);
+ if (innerMap == null) { return null; }
+ Collection advertisements = innerMap.values();
+ return advertisements.toArray(new WBEMServiceAdvertisement[advertisements.size()]);
+ }
+
+ /**
+ * Returns an array of service ids known by this catalog
+ *
+ * @return The service ids
+ */
+ public String[] getKnownIds() {
+ Set ids = this.iCatalogById.keySet();
+ return ids.toArray(new String[ids.size()]);
+ }
+
+ /**
+ * Refreshes the advertisements from a given directory. All existing
+ * advertisements from this directory are deleted first before the new ones
+ * are added.
+ *
+ * @param pDirectory
+ * The directory services we got the advertisements from
+ * @param pAdvertisements
+ * The advertisements
+ */
+ public void refreshAdvertisements(final String[] pDirectory,
+ WBEMServiceAdvertisement[] pAdvertisements) {
+ for (int i = 0; i < pDirectory.length; ++i) {
+ markRefresh(pDirectory[i]);
+ }
+ addAdvertisements(pAdvertisements);
+ for (int i = 0; i < pDirectory.length; ++i) {
+ expire(pDirectory[i]);
+ }
+ }
+
+ /**
+ * Removes a listener
+ *
+ * @param pListener
+ * The listener to remove
+ */
+ public void removeEventListener(EventListener pListener) {
+ this.iListeners.remove(pListener);
+ }
+
+ /**
+ * Removes the expired advertisements from the catalog.
+ *
+ * @param pDirectory
+ * When not null only the expired advertisements of
+ * the given directory are removed. Otherwise all expired
+ * advertisements are removed.
+ */
+ public void removeExpired(String pDirectory) {
+
+ if (pDirectory == null) {
+ Iterator iter = this.iCatalogByDirectory.keySet().iterator();
+ while (iter.hasNext()) {
+ removeExpired(iter.next());
+ }
+ return;
+ }
+
+ List advertisementList = this.iCatalogByDirectory.get(pDirectory);
+ Iterator iter = advertisementList.iterator();
+ while (iter.hasNext()) {
+ AdvertisementDecorator decorator = iter.next();
+ if (decorator.isExpired()) {
+ iter.remove();
+ notifyEventListeners(EVENT_REMOVE, decorator);
+ Map innerMap = this.iCatalogById
+ .get(decorator.getServiceId());
+ innerMap.remove(makeProtocol(decorator));
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ result.append("AdvertisementCatalog:");
+ Iterator>> outer = this.iCatalogById
+ .entrySet().iterator();
+ while (outer.hasNext()) {
+ Map.Entry> entry = outer.next();
+ if (entry.getValue() == null) {
+ continue;
+ }
+ result.append("[service-id:\"");
+ result.append(entry.getKey());
+ result.append("\"");
+ Map innerMap = entry.getValue();
+ Iterator> inner = innerMap.entrySet()
+ .iterator();
+ while (inner.hasNext()) {
+ Map.Entry innerEntry = inner.next();
+ result.append("[");
+ result.append(innerEntry.getKey().toString());
+ result.append("]");
+ }
+ result.append("]");
+ }
+ return result.toString();
+ }
+
+ private void expire(String pDirectory) {
+ List advertisementList = this.iCatalogByDirectory.get(pDirectory);
+ if (advertisementList == null) { return; }
+ Iterator iter = advertisementList.iterator();
+ while (iter.hasNext()) {
+ AdvertisementDecorator advertisement = iter.next();
+ if (advertisement.isRefresh()) {
+ advertisement.setRefresh(false);
+ advertisement.setExpired(true);
+ notifyEventListeners(EVENT_EXPIRE, advertisement);
+ }
+ }
+ }
+
+ private AdvertisementDecorator findAdvertisement(List pList,
+ WBEMServiceAdvertisement pAdvertisement) {
+ Iterator iter = pList.iterator();
+ while (iter.hasNext()) {
+ AdvertisementDecorator entry = iter.next();
+ if (entry.getServiceUrl().equals(pAdvertisement.getServiceUrl())) { return entry; }
+ }
+ return null;
+ }
+
+ private WBEMProtocol makeProtocol(WBEMServiceAdvertisement advertisement) {
+ String presentation = advertisement.getAttribute(WBEMServiceAdvertisement.COMM_MECHANISM);
+ if ("OTHER".equalsIgnoreCase(presentation)) {
+ presentation = advertisement
+ .getAttribute(WBEMServiceAdvertisement.OTHER_COMM_MECHN_DESC);
+ }
+ String transport = advertisement.getServiceUrl().split(":", 2)[0];
+ WBEMProtocol protocol = new WBEMProtocol(transport, presentation);
+ return protocol;
+ }
+
+ private void markRefresh(String pDirectory) {
+ List advertisementList = this.iCatalogByDirectory.get(pDirectory);
+ if (advertisementList == null) { return; }
+ Iterator iter = advertisementList.iterator();
+ while (iter.hasNext()) {
+ AdvertisementDecorator advertisement = iter.next();
+ advertisement.setRefresh(true);
+ }
+ }
+
+ private void notifyEventListeners(int pEvent, WBEMServiceAdvertisement pAdvertisement) {
+ Iterator iter = this.iListeners.iterator();
+ while (iter.hasNext()) {
+ iter.next().advertisementEvent(pEvent, pAdvertisement);
+ }
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/Discoverer.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/Discoverer.java
similarity index 71%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/Discoverer.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/Discoverer.java
index dd700c1..92f333f 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/Discoverer.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/Discoverer.java
@@ -1,73 +1,71 @@
-/*
- (C) Copyright IBM Corp. 2007, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
- * 1729361 2007-06-04 lupusalex Multicast discovery is broken in DiscovererSLP
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.discovery;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-/**
- * Interface Discoverer offers methodology for discovering WBEM services.
- *
- * Implementations SHALL ensure thread-safety
- * @since 2.0.2
- */
-public interface Discoverer {
-
- /**
- * Finds WBEM services using a given list of directory servers
- *
- * @param pDirectoryUrls
- * An array of directory servers. For SLP this would be a list of
- * DA URLs.
- * @return The array of WBEM service advertisements found
- */
- public WBEMServiceAdvertisement[] findWbemServices(String[] pDirectoryUrls);
-
- /**
- * Finds directory services. The semantics of this method might be protocol
- * specific. E.g. for SLP this sends a multicast into the local subnet
- * looking first for directory agent, second for service agents.
- *
- * @return A String[] containing the URLs of the directories
- * @since 2.0.3
- */
- public String[] findDirectoryServices();
-}
+/*
+ (C) Copyright IBM Corp. 2007, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
+ * 1729361 2007-06-04 lupusalex Multicast discovery is broken in DiscovererSLP
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ */
+
+package org.metricshub.wbem.sblim.cimclient.discovery;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+/**
+ * Interface Discoverer offers methodology for discovering WBEM services.
+ *
+ * Implementations SHALL ensure thread-safety
+ * @since 2.0.2
+ */
+public interface Discoverer {
+
+ /**
+ * Finds WBEM services using a given list of directory servers
+ *
+ * @param pDirectoryUrls
+ * An array of directory servers. For SLP this would be a list of
+ * DA URLs.
+ * @return The array of WBEM service advertisements found
+ */
+ public WBEMServiceAdvertisement[] findWbemServices(String[] pDirectoryUrls);
+
+ /**
+ * Finds directory services. The semantics of this method might be protocol
+ * specific. E.g. for SLP this sends a multicast into the local subnet
+ * looking first for directory agent, second for service agents.
+ *
+ * @return A String[] containing the URLs of the directories
+ * @since 2.0.3
+ */
+ public String[] findDirectoryServices();
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/DiscovererFactory.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/DiscovererFactory.java
similarity index 69%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/DiscovererFactory.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/DiscovererFactory.java
index 3a0a8cd..47b40bc 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/DiscovererFactory.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/DiscovererFactory.java
@@ -1,93 +1,91 @@
-/*
- (C) Copyright IBM Corp. 2007, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.discovery;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Locale;
-
-import org.sentrysoftware.wbem.sblim.cimclient.discovery.Discoverer;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.discovery.slp.DiscovererSLP;
-
-/**
- * Class DiscovererFactory is responsible for creating concrete instances of the
- * Discoverer interface.
- *
- * This class is thread-safe.
- *
- * @since 2.0.2
- */
-public class DiscovererFactory {
-
- /**
- * The Service Location Protocol (SLP)
- */
- public static final String SLP = "SLP";
-
- private static final String[] cProtocols = new String[] { SLP };
-
- /**
- * Returns the concrete Discoverer for a given discovery protocol.
- *
- * @param pProtocol The discovery protocol, e.g. "SLP"
- * @return The corresponding discoverer
- * @throws IllegalArgumentException On unsupported protocols
- * Factory Method
- */
- public static Discoverer getDiscoverer(String pProtocol) throws IllegalArgumentException {
- if (SLP.equalsIgnoreCase(pProtocol)) {
- return new DiscovererSLP(Locale.US);
- }
- throw new IllegalArgumentException("Protocol " + pProtocol + " not supported.");
- }
-
- /**
- * Return an array of all supported discovery protocols
- *
- * @return The supported protocols
- */
- public static String[] getSupportedProtocols() {
- return cProtocols;
- }
-
- private DiscovererFactory() {
- /**/}
-}
+/*
+ (C) Copyright IBM Corp. 2007, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ */
+
+package org.metricshub.wbem.sblim.cimclient.discovery;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Locale;
+
+import org.metricshub.wbem.sblim.cimclient.internal.discovery.slp.DiscovererSLP;
+import org.metricshub.wbem.sblim.cimclient.discovery.Discoverer;
+
+/**
+ * Class DiscovererFactory is responsible for creating concrete instances of the
+ * Discoverer interface.
+ *
+ * This class is thread-safe.
+ *
+ * @since 2.0.2
+ */
+public class DiscovererFactory {
+
+ /**
+ * The Service Location Protocol (SLP)
+ */
+ public static final String SLP = "SLP";
+
+ private static final String[] cProtocols = new String[] { SLP };
+
+ /**
+ * Returns the concrete Discoverer for a given discovery protocol.
+ *
+ * @param pProtocol The discovery protocol, e.g. "SLP"
+ * @return The corresponding discoverer
+ * @throws IllegalArgumentException On unsupported protocols
+ * Factory Method
+ */
+ public static Discoverer getDiscoverer(String pProtocol) throws IllegalArgumentException {
+ if (SLP.equalsIgnoreCase(pProtocol)) {
+ return new DiscovererSLP(Locale.US);
+ }
+ throw new IllegalArgumentException("Protocol " + pProtocol + " not supported.");
+ }
+
+ /**
+ * Return an array of all supported discovery protocols
+ *
+ * @return The supported protocols
+ */
+ public static String[] getSupportedProtocols() {
+ return cProtocols;
+ }
+
+ private DiscovererFactory() {
+ /**/}
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/WBEMProtocol.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/WBEMProtocol.java
similarity index 78%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/WBEMProtocol.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/WBEMProtocol.java
index d8c8f97..a1f31c7 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/WBEMProtocol.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/WBEMProtocol.java
@@ -1,144 +1,142 @@
-/*
- (C) Copyright IBM Corp. 2007, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1678915 2007-03-29 lupusalex Integrated WBEM service discovery via SLP
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.discovery;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-/**
- * Class WBEMProtocol encapsulates a transport/presentation protocol pair. E.g.
- * "HTTPS/CIM-XML"
- *
- * iTransport != null iPresentation != null
- * @since 2.0.2
- */
-public class WBEMProtocol {
-
- private String iTransport;
-
- private String iPresentation;
-
- /**
- * Ctor.
- *
- * @param pTransport
- * The transport protocol (e.g. HTTP, HTTPS, RMI)
- * @param pPresentation
- * The presentation protocol (e.g. CIM-XML)
- */
- public WBEMProtocol(String pTransport, String pPresentation) {
- this.iTransport = pTransport != null ? pTransport.toUpperCase() : "";
- this.iPresentation = pPresentation != null ? pPresentation.toUpperCase() : "";
- }
-
- /**
- * Returns the presentation protocol (e.g. CIM-XML)
- *
- * @return The value.
- */
- public String getPresentation() {
- return this.iPresentation;
- }
-
- /**
- * Sets the presentation protocol
- *
- * @param pPresentation
- * The new value (e.g. CIM-XML)
- */
- public void setPresentation(String pPresentation) {
- this.iPresentation = pPresentation != null ? pPresentation : "";
- }
-
- /**
- * Returns transport protocol (e.g. HTTP)
- *
- * @return The value.
- */
- public String getTransport() {
- return this.iTransport;
- }
-
- /**
- * Sets the transport protocol
- *
- * @param pTransport
- * The new value (e.g. HTTP).
- */
- public void setTransport(String pTransport) {
- this.iTransport = pTransport != null ? pTransport : "";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object pObj) {
- if (pObj instanceof WBEMProtocol) {
- WBEMProtocol that = (WBEMProtocol) pObj;
- return (this.iTransport.equals(that.iTransport))
- && (this.iPresentation.equals(that.iPresentation));
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return this.iTransport.hashCode() + this.iPresentation.hashCode();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return this.iTransport + "/" + this.iPresentation;
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2007, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1678915 2007-03-29 lupusalex Integrated WBEM service discovery via SLP
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ */
+
+package org.metricshub.wbem.sblim.cimclient.discovery;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+/**
+ * Class WBEMProtocol encapsulates a transport/presentation protocol pair. E.g.
+ * "HTTPS/CIM-XML"
+ *
+ * iTransport != null iPresentation != null
+ * @since 2.0.2
+ */
+public class WBEMProtocol {
+
+ private String iTransport;
+
+ private String iPresentation;
+
+ /**
+ * Ctor.
+ *
+ * @param pTransport
+ * The transport protocol (e.g. HTTP, HTTPS, RMI)
+ * @param pPresentation
+ * The presentation protocol (e.g. CIM-XML)
+ */
+ public WBEMProtocol(String pTransport, String pPresentation) {
+ this.iTransport = pTransport != null ? pTransport.toUpperCase() : "";
+ this.iPresentation = pPresentation != null ? pPresentation.toUpperCase() : "";
+ }
+
+ /**
+ * Returns the presentation protocol (e.g. CIM-XML)
+ *
+ * @return The value.
+ */
+ public String getPresentation() {
+ return this.iPresentation;
+ }
+
+ /**
+ * Sets the presentation protocol
+ *
+ * @param pPresentation
+ * The new value (e.g. CIM-XML)
+ */
+ public void setPresentation(String pPresentation) {
+ this.iPresentation = pPresentation != null ? pPresentation : "";
+ }
+
+ /**
+ * Returns transport protocol (e.g. HTTP)
+ *
+ * @return The value.
+ */
+ public String getTransport() {
+ return this.iTransport;
+ }
+
+ /**
+ * Sets the transport protocol
+ *
+ * @param pTransport
+ * The new value (e.g. HTTP).
+ */
+ public void setTransport(String pTransport) {
+ this.iTransport = pTransport != null ? pTransport : "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object pObj) {
+ if (pObj instanceof WBEMProtocol) {
+ WBEMProtocol that = (WBEMProtocol) pObj;
+ return (this.iTransport.equals(that.iTransport))
+ && (this.iPresentation.equals(that.iPresentation));
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return this.iTransport.hashCode() + this.iPresentation.hashCode();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return this.iTransport + "/" + this.iPresentation;
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/WBEMServiceAdvertisement.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/WBEMServiceAdvertisement.java
similarity index 91%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/WBEMServiceAdvertisement.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/WBEMServiceAdvertisement.java
index 7e0b8f7..803a842 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/WBEMServiceAdvertisement.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/WBEMServiceAdvertisement.java
@@ -1,344 +1,343 @@
-/*
- (C) Copyright IBM Corp. 2007, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 3469427 2012-01-04 blaschke-oss Fix broken HTML links
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.discovery;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Locale;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.security.auth.Subject;
-import org.sentrysoftware.wbem.javax.wbem.client.WBEMClient;
-
-/**
- * Interface WBEMServiceAdvertisement is encapsulates the information collected
- * about a service during discovery. The DMTF specifies a set a attributes that
- * each service must advertise. These attributes are found as string constants
- * in this interface and the method getAttribute() is offered to get an
- * attribute by name. This design was chosen because the set of attributes might
- * be extended by DMTF and vendor implementations. It's also unclear if upcoming
- * new discovery protocols will have the same set of attributes as SLP.
- *
- * Immutable
- * This class is thread-safe
- * @since 2.0.2
- */
-public interface WBEMServiceAdvertisement {
-
- /**
- * template-type (string): The scheme name of the service scheme. The scheme
- * name consists of the service type name and an optional naming authority
- * name, separated from the service type name by a period. See RFC 2609
- * section 3.2.2 for the conventions governing service type names.
- */
- public static final String TEMPLATE_TYPE = "template-type";
-
- /**
- * template-version (string): The version number of the service type
- * specification.
- */
- public static final String TEMPLATE_VERSION = "template-version";
-
- /**
- * template-description (string): A description of the service suitable for
- * inclusion in text read by people.
- */
- public static final String TEMPLATE_DESCRIPTION = "template-description";
-
- /**
- * template-url-syntax (string): The template-url-syntax MUST be the WBEM
- * URI Mapping of the location of one service access point offered by the
- * WBEM Server over TCP transport. This attribute must provide sufficient
- * addressing information so that the WBEM Server can be addressed directly
- * using the URL. The WBEM URI Mapping is defined in the WBEM URI Mapping
- * Specification 1.0.0 (DSP0207).
- *
- * Example: (template-url-syntax=https://localhost:5989)
- */
- public static final String TEMPLATE_URL_SYNTAX = "template-url-syntax";
-
- /**
- * service-hi-name (string, optional): This string is used as a name of the
- * CIM service for human interfaces. This attribute MUST be the
- * CIM_ObjectManager.ElementName property value.
- */
- public static final String SERVICE_HI_NAME = "service-hi-name";
-
- /**
- * service-hi-description (string, optional): This string is used as a
- * description of the CIM service for human interfaces.This attribute MUST
- * be the CIM_ObjectManager.Description property value.
- */
- public static final String SERVICE_HI_DESC = "service-hi-description";
-
- /**
- * service-id (string, literal): The ID of this WBEM Server. The value MUST
- * be the CIM_ObjectManager.Name property value.
- */
- public static final String SERVICE_ID = "service-id";
-
- /**
- * CommunicationMechanism (string, literal): The communication mechanism
- * (protocol) used by the CIM Object Manager for this service-location-tcp
- * defined in this advertisement. This information MUST be the
- * CIM_ObjectManagerCommunicationMechanism.CommunicationMechanism property
- * value. CIM-XML is defined in the CIM Operations over HTTP specification
- * which can be found at http://www.dmtf.org/
- *
- * Values: "Unknown", "Other", "cim-xml"
- */
- public static final String COMM_MECHANISM = "CommunicationMechanism";
-
- /**
- * OtherCommunicationMechanismDescription (string, literal, optional): The
- * other communication mechanism defined for the CIM Server in the case the
- * "Other" value is set in the CommunicationMechanism string. This attribute
- * MUST be the
- * CIM_ObjectManagerCommunicationMechanism.OtherCommunicationMechanism
- * property value. This attribute is optional because it is only required if
- * the "other" value is set in CommunicationMechansim. The value returned is
- * a free-form string.
- */
- public static final String OTHER_COMM_MECHN_DESC = "OtherCommunicationMechanismDescription";
-
- /**
- * InteropSchemaNamespace (string, literal, multiple): Namespace within the
- * target WBEM Server where the CIM Interop Schema can be accessed. Multiple
- * namespaces may be provided. Each namespace provided MUST contain the same
- * information.
- */
- public static final String INTEROP_NS = "InteropSchemaNamespace";
-
- /**
- * ProtocolVersion (string, literal, optional): The version of the protocol.
- * It MUST be the CIM_ObjectManagerCommunicationMechanism.Version property
- * value.
- */
- public static final String PROTOCOL_VERSION = "ProtocolVersion";
-
- /**
- * FunctionalProfilesSupported (string, literal, multiple):
- * ProfilesSupported defines the CIM Operation profiles supported by the CIM
- * Object Manager. This attribute MUST be the
- * CIM_ObjectManagerCommunicationMechansim.FunctionalProfilesSupported
- * property value.
- *
- * Values:
- "Unknown", "Other", "Basic Read", "Basic Write",
- "Schema Manipulation", "Instance Manipulation",
- "Association Traversal", "Query Execution",
- "Qualifier Declaration", "Indications"
- */
- public static final String FUNCTIONAL_PROF_SUPP = "FunctionalProfilesSupported";
-
- /**
- * FunctionalProfileDescriptions (string, literal, multiple, optional):
- * Other profile description if the "other" value is set in the
- * ProfilesSupported attribute. This attribute is optional because it is
- * returned only if the "other" value is set in the ProfilesSupported
- * attribute. If provided it MUST be equal to the
- * CIM_ObjectManagerCommunicationMechanism.FunctionalProfileDescriptions
- * property value.
- */
- public static final String FUNCTIONAL_PROF_DESC = "FunctionalProfileDescriptions";
-
- /**
- * MultipleOperationsSupported (boolean): Defines whether the CIM Object
- * Manager supports batch operations. This attribute MUST be the
- * CIM_ObjectManagerCommunicationMechanism.MultipleOperationsSupported
- * property value.
- */
- public static final String MULT_OPERATIONS_SUPP = "MultipleOperationsSupported";
-
- /**
- * AuthenticationMechanismsSupported (string, literal, multiple): Defines
- * the authentication mechanism supported by the CIM Object Manager. This
- * attributed MUST be the CIM_ObjectManagerCommunicationMechanism.
- * AuthenticationMechanismsSupported property value.
- *
- * Values: "Unknown", "None", "Other", "Basic", "Digest"
- */
- public static final String AUTH_MECH_SUPP = "AuthenticationMechanismsSupported";
-
- /**
- * AuthenticationMechansimDescriptions (string, literal, multiple,
- * optional): Defines other Authentication mechanisms supported by the CIM
- * Object Manager in the case where the "Other" value is set in any of the
- * AuthenticationMechanismSupported attribute values. If provided, this
- * attribute MUST be the CIM_ObjectManagerCommunicationMechanism.
- * AuthenticationMechansimDescriptions property value.
- */
- public static final String AUTH_MECH_DESC = "AuthenticationMechansimDescriptions";
-
- /**
- * Namespace (string, literal, multiple, optional): Namespace(s) supported
- * on the CIM Object Manager. This attribute MUST be the CIM_Namespace.name
- * property value for each instance of CIM_Namespace that exists. This
- * attribute is optional. NOTE: This value is literal (L) because the
- * namespace names MUST not be translated into other languages.
- */
- public static final String NAMESPACE = "Namespace";
-
- /**
- * Classinfo (string, multiple, optional): This attributes is optional but
- * if used, the values MUST be the CIM_Namespace.Classinfo property value.
- * The values represent the classinfo (CIM Schema version, etc.) for the
- * namespaces defined in the corresponding namespace listed in the Namespace
- * attribute. Each entry in this attribute MUST correspond to the namespace
- * defined in the same position of the namespace attribute. There must be
- * one entry in this attribute for each entry in the namespace attribute.
- */
- public static final String CLASSINFO = "Classinfo";
-
- /**
- * RegisteredProfilesSupported (string, literal, multiple):
- * RegisteredProfilesSupported defines the Profiles that this WBEM Server
- * has support for. Each entry in this attribute MUST be in the form of
- * Organization:Profile Name{:Subprofile Name}
- *
- * Examples:
- *
- *
- * DMTF:CIM Server
- * DMTF:CIM Server:Protocol Adapter
- * DMTF:CIM Server:Provider Registration
- *
- * The Organization MUST be the CIM_RegisteredProfile.RegisteredOrganization
- * property value. The Profile Name MUST be the
- * CIM_RegisteredProfile.RegisteredName property value. The subprofile Name
- * MUST be the CIM_RegisteredProfile.RegisteredName property value when it
- * is used as a Dependent in the CIM_SubProfileRequiresProfile association
- * for the specified Profile Name (used as the antecedent).
- *
- */
- public static final String REG_PROF_SUPP = "RegisteredProfilesSupported";
-
- /**
- * Gets the URL of the directory from which this advertisement was received
- *
- * @return The directory URL
- */
- public abstract String getDirectory();
-
- /**
- * Returns the concrete service type. E.g. for the SLP advertised service
- * service:wbem:https this method would return
- * https.
- *
- * @return The concrete service type
- */
- public abstract String getConcreteServiceType();
-
- /**
- * Returns the interop namespaces
- *
- * @return The interop namespaces
- */
- public abstract String[] getInteropNamespaces();
-
- /**
- * Returns the service url, e.g. http://9.155.62.79:5988
- *
- * @return The service url
- */
- public abstract String getServiceUrl();
-
- /**
- * Return the attribute value for a given attribute name
- *
- * @param pAttributeName
- * The attribute name
- * @return The value
- */
- public abstract String getAttribute(String pAttributeName);
-
- /**
- * Return the set of attributes of this advertisement
- *
- * @return A Set<Map.Entry<String, String>> containing the name
- * value pairs of the attributes.
- */
- public abstract Set> getAttributes();
-
- /**
- * Returns the service id
- *
- * @return The service id
- */
- public abstract String getServiceId();
-
- /**
- * Returns the expiration state of the advertisement.
- *
- * @return true when advertisement is expired.
- */
- public abstract boolean isExpired();
-
- /**
- * Sets the expirations state of the advertisement. Might be used by the
- * application to mark an advertisement as expired, e.g. when it's no longer
- * reported by the corresponding directory. Used for this purpose by
- * AdvertisementCatalog.
- *
- * @param pExpired
- * The new value
- */
- public abstract void setExpired(boolean pExpired);
-
- /**
- * Creates a fully-initialized WBEMClient instance connected to the service
- * that is subject of this advertisement. On every call to this method a new
- * client will be created. The client is not stored or cached anywhere in
- * this class.
- *
- * @param pSubject
- * The credential for authenticating with the service
- * @param pLocales
- * An array of locales ordered by preference
- * @return The WBEM client
- * @throws Exception
- * @pattern Factory Methods
- */
- public abstract WBEMClient createClient(Subject pSubject, Locale[] pLocales) throws Exception;
-}
+/*
+ (C) Copyright IBM Corp. 2007, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1678915 2007-03-12 lupusalex Integrated WBEM service discovery via SLP
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 3469427 2012-01-04 blaschke-oss Fix broken HTML links
+ */
+
+package org.metricshub.wbem.sblim.cimclient.discovery;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Locale;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.security.auth.Subject;
+
+import org.metricshub.wbem.javax.wbem.client.WBEMClient;
+
+/**
+ * Interface WBEMServiceAdvertisement is encapsulates the information collected
+ * about a service during discovery. The DMTF specifies a set a attributes that
+ * each service must advertise. These attributes are found as string constants
+ * in this interface and the method getAttribute() is offered to get an
+ * attribute by name. This design was chosen because the set of attributes might
+ * be extended by DMTF and vendor implementations. It's also unclear if upcoming
+ * new discovery protocols will have the same set of attributes as SLP.
+ *
+ * Immutable
+ * This class is thread-safe
+ * @since 2.0.2
+ */
+public interface WBEMServiceAdvertisement {
+
+ /**
+ * template-type (string): The scheme name of the service scheme. The scheme
+ * name consists of the service type name and an optional naming authority
+ * name, separated from the service type name by a period. See RFC 2609
+ * section 3.2.2 for the conventions governing service type names.
+ */
+ public static final String TEMPLATE_TYPE = "template-type";
+
+ /**
+ * template-version (string): The version number of the service type
+ * specification.
+ */
+ public static final String TEMPLATE_VERSION = "template-version";
+
+ /**
+ * template-description (string): A description of the service suitable for
+ * inclusion in text read by people.
+ */
+ public static final String TEMPLATE_DESCRIPTION = "template-description";
+
+ /**
+ * template-url-syntax (string): The template-url-syntax MUST be the WBEM
+ * URI Mapping of the location of one service access point offered by the
+ * WBEM Server over TCP transport. This attribute must provide sufficient
+ * addressing information so that the WBEM Server can be addressed directly
+ * using the URL. The WBEM URI Mapping is defined in the WBEM URI Mapping
+ * Specification 1.0.0 (DSP0207).
+ *
+ * Example: (template-url-syntax=https://localhost:5989)
+ */
+ public static final String TEMPLATE_URL_SYNTAX = "template-url-syntax";
+
+ /**
+ * service-hi-name (string, optional): This string is used as a name of the
+ * CIM service for human interfaces. This attribute MUST be the
+ * CIM_ObjectManager.ElementName property value.
+ */
+ public static final String SERVICE_HI_NAME = "service-hi-name";
+
+ /**
+ * service-hi-description (string, optional): This string is used as a
+ * description of the CIM service for human interfaces.This attribute MUST
+ * be the CIM_ObjectManager.Description property value.
+ */
+ public static final String SERVICE_HI_DESC = "service-hi-description";
+
+ /**
+ * service-id (string, literal): The ID of this WBEM Server. The value MUST
+ * be the CIM_ObjectManager.Name property value.
+ */
+ public static final String SERVICE_ID = "service-id";
+
+ /**
+ * CommunicationMechanism (string, literal): The communication mechanism
+ * (protocol) used by the CIM Object Manager for this service-location-tcp
+ * defined in this advertisement. This information MUST be the
+ * CIM_ObjectManagerCommunicationMechanism.CommunicationMechanism property
+ * value. CIM-XML is defined in the CIM Operations over HTTP specification
+ * which can be found at http://www.dmtf.org/
+ *
+ * Values: "Unknown", "Other", "cim-xml"
+ */
+ public static final String COMM_MECHANISM = "CommunicationMechanism";
+
+ /**
+ * OtherCommunicationMechanismDescription (string, literal, optional): The
+ * other communication mechanism defined for the CIM Server in the case the
+ * "Other" value is set in the CommunicationMechanism string. This attribute
+ * MUST be the
+ * CIM_ObjectManagerCommunicationMechanism.OtherCommunicationMechanism
+ * property value. This attribute is optional because it is only required if
+ * the "other" value is set in CommunicationMechansim. The value returned is
+ * a free-form string.
+ */
+ public static final String OTHER_COMM_MECHN_DESC = "OtherCommunicationMechanismDescription";
+
+ /**
+ * InteropSchemaNamespace (string, literal, multiple): Namespace within the
+ * target WBEM Server where the CIM Interop Schema can be accessed. Multiple
+ * namespaces may be provided. Each namespace provided MUST contain the same
+ * information.
+ */
+ public static final String INTEROP_NS = "InteropSchemaNamespace";
+
+ /**
+ * ProtocolVersion (string, literal, optional): The version of the protocol.
+ * It MUST be the CIM_ObjectManagerCommunicationMechanism.Version property
+ * value.
+ */
+ public static final String PROTOCOL_VERSION = "ProtocolVersion";
+
+ /**
+ * FunctionalProfilesSupported (string, literal, multiple):
+ * ProfilesSupported defines the CIM Operation profiles supported by the CIM
+ * Object Manager. This attribute MUST be the
+ * CIM_ObjectManagerCommunicationMechansim.FunctionalProfilesSupported
+ * property value.
+ *
+ * Values:
+ "Unknown", "Other", "Basic Read", "Basic Write",
+ "Schema Manipulation", "Instance Manipulation",
+ "Association Traversal", "Query Execution",
+ "Qualifier Declaration", "Indications"
+ */
+ public static final String FUNCTIONAL_PROF_SUPP = "FunctionalProfilesSupported";
+
+ /**
+ * FunctionalProfileDescriptions (string, literal, multiple, optional):
+ * Other profile description if the "other" value is set in the
+ * ProfilesSupported attribute. This attribute is optional because it is
+ * returned only if the "other" value is set in the ProfilesSupported
+ * attribute. If provided it MUST be equal to the
+ * CIM_ObjectManagerCommunicationMechanism.FunctionalProfileDescriptions
+ * property value.
+ */
+ public static final String FUNCTIONAL_PROF_DESC = "FunctionalProfileDescriptions";
+
+ /**
+ * MultipleOperationsSupported (boolean): Defines whether the CIM Object
+ * Manager supports batch operations. This attribute MUST be the
+ * CIM_ObjectManagerCommunicationMechanism.MultipleOperationsSupported
+ * property value.
+ */
+ public static final String MULT_OPERATIONS_SUPP = "MultipleOperationsSupported";
+
+ /**
+ * AuthenticationMechanismsSupported (string, literal, multiple): Defines
+ * the authentication mechanism supported by the CIM Object Manager. This
+ * attributed MUST be the CIM_ObjectManagerCommunicationMechanism.
+ * AuthenticationMechanismsSupported property value.
+ *
+ * Values: "Unknown", "None", "Other", "Basic", "Digest"
+ */
+ public static final String AUTH_MECH_SUPP = "AuthenticationMechanismsSupported";
+
+ /**
+ * AuthenticationMechansimDescriptions (string, literal, multiple,
+ * optional): Defines other Authentication mechanisms supported by the CIM
+ * Object Manager in the case where the "Other" value is set in any of the
+ * AuthenticationMechanismSupported attribute values. If provided, this
+ * attribute MUST be the CIM_ObjectManagerCommunicationMechanism.
+ * AuthenticationMechansimDescriptions property value.
+ */
+ public static final String AUTH_MECH_DESC = "AuthenticationMechansimDescriptions";
+
+ /**
+ * Namespace (string, literal, multiple, optional): Namespace(s) supported
+ * on the CIM Object Manager. This attribute MUST be the CIM_Namespace.name
+ * property value for each instance of CIM_Namespace that exists. This
+ * attribute is optional. NOTE: This value is literal (L) because the
+ * namespace names MUST not be translated into other languages.
+ */
+ public static final String NAMESPACE = "Namespace";
+
+ /**
+ * Classinfo (string, multiple, optional): This attributes is optional but
+ * if used, the values MUST be the CIM_Namespace.Classinfo property value.
+ * The values represent the classinfo (CIM Schema version, etc.) for the
+ * namespaces defined in the corresponding namespace listed in the Namespace
+ * attribute. Each entry in this attribute MUST correspond to the namespace
+ * defined in the same position of the namespace attribute. There must be
+ * one entry in this attribute for each entry in the namespace attribute.
+ */
+ public static final String CLASSINFO = "Classinfo";
+
+ /**
+ * RegisteredProfilesSupported (string, literal, multiple):
+ * RegisteredProfilesSupported defines the Profiles that this WBEM Server
+ * has support for. Each entry in this attribute MUST be in the form of
+ * Organization:Profile Name{:Subprofile Name}
+ *
+ * Examples:
+ *
+ *
+ * DMTF:CIM Server
+ * DMTF:CIM Server:Protocol Adapter
+ * DMTF:CIM Server:Provider Registration
+ *
+ * The Organization MUST be the CIM_RegisteredProfile.RegisteredOrganization
+ * property value. The Profile Name MUST be the
+ * CIM_RegisteredProfile.RegisteredName property value. The subprofile Name
+ * MUST be the CIM_RegisteredProfile.RegisteredName property value when it
+ * is used as a Dependent in the CIM_SubProfileRequiresProfile association
+ * for the specified Profile Name (used as the antecedent).
+ *
+ */
+ public static final String REG_PROF_SUPP = "RegisteredProfilesSupported";
+
+ /**
+ * Gets the URL of the directory from which this advertisement was received
+ *
+ * @return The directory URL
+ */
+ public abstract String getDirectory();
+
+ /**
+ * Returns the concrete service type. E.g. for the SLP advertised service
+ * service:wbem:https this method would return
+ * https.
+ *
+ * @return The concrete service type
+ */
+ public abstract String getConcreteServiceType();
+
+ /**
+ * Returns the interop namespaces
+ *
+ * @return The interop namespaces
+ */
+ public abstract String[] getInteropNamespaces();
+
+ /**
+ * Returns the service url, e.g. http://9.155.62.79:5988
+ *
+ * @return The service url
+ */
+ public abstract String getServiceUrl();
+
+ /**
+ * Return the attribute value for a given attribute name
+ *
+ * @param pAttributeName
+ * The attribute name
+ * @return The value
+ */
+ public abstract String getAttribute(String pAttributeName);
+
+ /**
+ * Return the set of attributes of this advertisement
+ *
+ * @return A Set<Map.Entry<String, String>> containing the name
+ * value pairs of the attributes.
+ */
+ public abstract Set> getAttributes();
+
+ /**
+ * Returns the service id
+ *
+ * @return The service id
+ */
+ public abstract String getServiceId();
+
+ /**
+ * Returns the expiration state of the advertisement.
+ *
+ * @return true when advertisement is expired.
+ */
+ public abstract boolean isExpired();
+
+ /**
+ * Sets the expirations state of the advertisement. Might be used by the
+ * application to mark an advertisement as expired, e.g. when it's no longer
+ * reported by the corresponding directory. Used for this purpose by
+ * AdvertisementCatalog.
+ *
+ * @param pExpired
+ * The new value
+ */
+ public abstract void setExpired(boolean pExpired);
+
+ /**
+ * Creates a fully-initialized WBEMClient instance connected to the service
+ * that is subject of this advertisement. On every call to this method a new
+ * client will be created. The client is not stored or cached anywhere in
+ * this class.
+ *
+ * @param pSubject
+ * The credential for authenticating with the service
+ * @param pLocales
+ * An array of locales ordered by preference
+ * @return The WBEM client
+ * @throws Exception
+ * @pattern Factory Methods
+ */
+ public abstract WBEMClient createClient(Subject pSubject, Locale[] pLocales) throws Exception;
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/package.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/package.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/discovery/package.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/discovery/package.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/bestpractise.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/bestpractise.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/bestpractise.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/bestpractise.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/configuration.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/configuration.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/configuration.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/configuration.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/development.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/development.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/development.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/development.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/discovery.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/discovery.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/discovery.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/discovery.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/embedded.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/embedded.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/embedded.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/embedded.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/firststeps.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/firststeps.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/firststeps.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/firststeps.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/history.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/history.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/history.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/history.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/indication_threading.png b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/indication_threading.png
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/indication_threading.png
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/indication_threading.png
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/indications.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/indications.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/indications.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/indications.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/logging.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/logging.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/logging.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/logging.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/secure.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/secure.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/secure.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/secure.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/secure_indications.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/secure_indications.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/secure_indications.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/secure_indications.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/terminology.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/terminology.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/terminology.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/terminology.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/unittest.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/unittest.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/doc-files/unittest.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/doc-files/unittest.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMElementSorter.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMElementSorter.java
similarity index 78%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMElementSorter.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMElementSorter.java
index 8a2882d..29a43e9 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMElementSorter.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMElementSorter.java
@@ -1,123 +1,121 @@
-/*
- (C) Copyright IBM Corp. 2006, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-10-10 ebak Make SBLIM client JSR48 compliant
- * 1660756 2007-02-22 ebak Embedded object support
- * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.sentrysoftware.wbem.javax.cim.CIMElement;
-
-/**
- * Class CIMElementSorter can sort CIMElement arrays and can do binary search by
- * name in them.
- */
-public class CIMElementSorter implements Comparator {
-
- private static final Comparator COMPARATOR = new CIMElementSorter();
-
- /**
- * Sorts the passed CIMElement array, the passed array is not copied.
- *
- * @param pArray
- * the array which will be sorted if it's not null
- * @return pArray
- */
- public static CIMElement[] sort(CIMElement[] pArray) {
- if (pArray == null || pArray.length == 0) return null;
- synchronized (pArray) {
- Arrays.sort(pArray /* , COMPARATOR */);
- }
- return pArray;
- }
-
- /**
- * Finds CIMElement, named pName, in pArray which must be a sorted array of
- * CIMElements.
- *
- * @param pArray
- * @param pName
- * @return the CIMElement if found, otherwise null
- */
- public static CIMElement find(CIMElement[] pArray, String pName) {
- if (pArray == null) return null;
- int idx;
- synchronized (pArray) {
- idx = Arrays.binarySearch(pArray, pName, COMPARATOR);
- }
- if (idx < 0) return null;
- return pArray[idx];
- }
-
- /**
- * Finds the index of CIMElement, named pName, in pArray which must be a
- * sorted array of CIMElements.
- *
- * @param pArray
- * @param pName
- * @return the index, just like in case of Arrays.binarySearch()
- * @see java.util.Arrays#binarySearch(Object[], Object, Comparator)
- */
- public static int findIdx(CIMElement[] pArray, String pName) {
- if (pArray == null) return -1;
- synchronized (pArray) {
- return Arrays.binarySearch(pArray, pName, COMPARATOR);
- }
- }
-
- /**
- * @see java.util.Comparator#compare(Object, Object)
- */
- public int compare(Object pObj0, Object pObj1) {
- // ebak: handling null objects
- if (pObj0 == null) return pObj1 == null ? 0 : 1;
- if (pObj1 == null) return -1;
- String name0 = pObj0 instanceof CIMElement ? ((CIMElement) pObj0).getName()
- : (String) pObj0;
- String name1 = pObj1 instanceof CIMElement ? ((CIMElement) pObj1).getName()
- : (String) pObj1;
- return name0.compareToIgnoreCase(name1);
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, ebak@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-10-10 ebak Make SBLIM client JSR48 compliant
+ * 1660756 2007-02-22 ebak Embedded object support
+ * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+import org.metricshub.wbem.javax.cim.CIMElement;
+
+/**
+ * Class CIMElementSorter can sort CIMElement arrays and can do binary search by
+ * name in them.
+ */
+public class CIMElementSorter implements Comparator {
+
+ private static final Comparator COMPARATOR = new CIMElementSorter();
+
+ /**
+ * Sorts the passed CIMElement array, the passed array is not copied.
+ *
+ * @param pArray
+ * the array which will be sorted if it's not null
+ * @return pArray
+ */
+ public static CIMElement[] sort(CIMElement[] pArray) {
+ if (pArray == null || pArray.length == 0) return null;
+ synchronized (pArray) {
+ Arrays.sort(pArray /* , COMPARATOR */);
+ }
+ return pArray;
+ }
+
+ /**
+ * Finds CIMElement, named pName, in pArray which must be a sorted array of
+ * CIMElements.
+ *
+ * @param pArray
+ * @param pName
+ * @return the CIMElement if found, otherwise null
+ */
+ public static CIMElement find(CIMElement[] pArray, String pName) {
+ if (pArray == null) return null;
+ int idx;
+ synchronized (pArray) {
+ idx = Arrays.binarySearch(pArray, pName, COMPARATOR);
+ }
+ if (idx < 0) return null;
+ return pArray[idx];
+ }
+
+ /**
+ * Finds the index of CIMElement, named pName, in pArray which must be a
+ * sorted array of CIMElements.
+ *
+ * @param pArray
+ * @param pName
+ * @return the index, just like in case of Arrays.binarySearch()
+ * @see java.util.Arrays#binarySearch(Object[], Object, Comparator)
+ */
+ public static int findIdx(CIMElement[] pArray, String pName) {
+ if (pArray == null) return -1;
+ synchronized (pArray) {
+ return Arrays.binarySearch(pArray, pName, COMPARATOR);
+ }
+ }
+
+ /**
+ * @see java.util.Comparator#compare(Object, Object)
+ */
+ public int compare(Object pObj0, Object pObj1) {
+ // ebak: handling null objects
+ if (pObj0 == null) return pObj1 == null ? 0 : 1;
+ if (pObj1 == null) return -1;
+ String name0 = pObj0 instanceof CIMElement ? ((CIMElement) pObj0).getName()
+ : (String) pObj0;
+ String name1 = pObj1 instanceof CIMElement ? ((CIMElement) pObj1).getName()
+ : (String) pObj1;
+ return name0.compareToIgnoreCase(name1);
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMHelper.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMHelper.java
similarity index 86%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMHelper.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMHelper.java
index 1ce9442..e048802 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMHelper.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMHelper.java
@@ -1,349 +1,346 @@
-/*
- (C) Copyright IBM Corp. 2006, 2013
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1565892 2006-12-06 lupusalex Make SBLIM client JSR48 compliant
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2964463 2010-03-08 blaschke-oss WBEMClient.initialize() throws wrong exception
- * 2942520 2010-03-08 blaschke-oss IPv6 link local address with scope_id including a dot not supported
- * 3513353 2012-03-30 blaschke-oss TCK: CIMDataType arrays must have length >= 1
- * 3513349 2012-03-31 blaschke-oss TCK: CIMDataType must not accept null string
- * 3598613 2013-01-11 blaschke-oss different data type in cim instance and cim object path
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.math.BigInteger;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.sentrysoftware.wbem.javax.cim.CIMDataType;
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-import org.sentrysoftware.wbem.javax.cim.CIMProperty;
-import org.sentrysoftware.wbem.javax.cim.UnsignedInteger16;
-import org.sentrysoftware.wbem.javax.cim.UnsignedInteger32;
-import org.sentrysoftware.wbem.javax.cim.UnsignedInteger64;
-import org.sentrysoftware.wbem.javax.cim.UnsignedInteger8;
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.util.WBEMConstants;
-
-/**
- * Class CIMHelper provides convenience methods that are missing from the
- * official JSR48 API
- *
- */
-public abstract class CIMHelper {
-
- private CIMHelper() {
- // no instances
- }
-
- /**
- * Creates a URI of a CIMOM from a given CIM object path, adding default
- * port if port not parsable.
- *
- * @param pPath
- * The CIM object path.
- * @return The URI.
- * @throws URISyntaxException
- */
- public static URI createCimomUri(CIMObjectPath pPath) throws URISyntaxException {
- String scheme = pPath.getScheme();
- String host = pPath.getHost();
- int port = WBEMConstants.DEFAULT_WBEM_PORT;
- try {
- port = Integer.parseInt(pPath.getPort());
- } catch (NumberFormatException e) {
- // stuck with default port
- }
- return new URI(scheme, null, host, port, WBEMConstants.CIMOM_PATH, null, null);
- }
-
- /**
- * Creates a URI of a CIMOM from a given URI, adding default port if port
- * not specified.
- *
- * @param pUri
- * The URI.
- * @return The URI.
- * @throws URISyntaxException
- */
- public static URI createCimomUri(URI pUri) throws URISyntaxException {
- String scheme = pUri.getScheme();
- String host = pUri.getHost();
- int port = pUri.getPort();
- if (port == -1) {
- // stuck with default port
- port = WBEMConstants.DEFAULT_WBEM_PORT;
- }
- return new URI(scheme, null, host, port, WBEMConstants.CIMOM_PATH, null, null);
- }
-
- private static CIMDataType CIMScalarDataTypes[] = {
- /* 00 */CIMDataType.UINT8_T,
- /* 01 */CIMDataType.SINT8_T,
- /* 02 */CIMDataType.UINT16_T,
- /* 03 */CIMDataType.SINT16_T,
- /* 04 */CIMDataType.UINT32_T,
- /* 05 */CIMDataType.SINT32_T,
- /* 06 */CIMDataType.UINT64_T,
- /* 07 */CIMDataType.SINT64_T,
- /* 08 */CIMDataType.STRING_T,
- /* 09 */CIMDataType.BOOLEAN_T,
- /* 10 */CIMDataType.REAL32_T,
- /* 11 */CIMDataType.REAL64_T,
- /* 12 */CIMDataType.DATETIME_T,
- /* 13 */CIMDataType.CHAR16_T,
- /* 14 */new CIMDataType(""),
- /* 15 */CIMDataType.OBJECT_T,
- /* 16 */null,
- /* 17 */CIMDataType.CLASS_T };
-
- /**
- * Returns the CIMDataType of a scalar of the specified data type. This
- * should be used in lieu of "new CIMDataType(pType)" which is not supported
- * by the JSR48 standard.
- *
- * @param pType
- * Data type.
- * @return CIMDataType corresponding to data type.
- */
- public static CIMDataType ScalarDataType(int pType) {
- if (pType < 0 || pType >= CIMScalarDataTypes.length) return null;
- return CIMScalarDataTypes[pType];
- }
-
- private static CIMDataType CIMArrayDataTypes[] = {
- /* 00 */CIMDataType.UINT8_ARRAY_T,
- /* 01 */CIMDataType.SINT8_ARRAY_T,
- /* 02 */CIMDataType.UINT16_ARRAY_T,
- /* 03 */CIMDataType.SINT16_ARRAY_T,
- /* 04 */CIMDataType.UINT32_ARRAY_T,
- /* 05 */CIMDataType.SINT32_ARRAY_T,
- /* 06 */CIMDataType.UINT64_ARRAY_T,
- /* 07 */CIMDataType.SINT64_ARRAY_T,
- /* 08 */CIMDataType.STRING_ARRAY_T,
- /* 09 */CIMDataType.BOOLEAN_ARRAY_T,
- /* 10 */CIMDataType.REAL32_ARRAY_T,
- /* 11 */CIMDataType.REAL64_ARRAY_T,
- /* 12 */CIMDataType.DATETIME_ARRAY_T,
- /* 13 */CIMDataType.CHAR16_ARRAY_T,
- /* 14 */new CIMDataType("", 0),
- /* 15 */CIMDataType.OBJECT_ARRAY_T,
- /* 16 */null,
- /* 17 */CIMDataType.CLASS_ARRAY_T };
-
- /**
- * Returns the CIMDataType of an unbounded array of the specified data type.
- * This should be used in lieu of "new CIMDataType(pType,0)" which is not
- * supported by the JSR48 standard.
- *
- * @param pType
- * Data type.
- * @return CIMDataType corresponding to data type.
- */
- public static CIMDataType UnboundedArrayDataType(int pType) {
- if (pType < 0 || pType >= CIMArrayDataTypes.length) return null;
- return CIMArrayDataTypes[pType];
- }
-
- /**
- * CIMInstanceWithSynchonizedNumericKeyDataTypes returns a
- * CIMInstance where the data types of all numeric keys in the
- * CIMObjectPath match those of the corresponding keys within
- * the CIMProperty[].
- *
- * The need for this conversion mechanism arises from a deficiency in the
- * CIM-XML specs, where the TYPE (sint8, uint8, etc.) is required for
- * PROPERTY but not for KEYVALUE. If a CIMOM sends a KEYVALUE of
- * VALUETYPE="numeric" without TYPE, the Java CIM Client assumes a type of
- * sint64, uint64 or real64. This can cause problems (i.e.
- * ClassCastException) down the line if the TYPE of the corresponding
- * PROPERTY is different.
- *
- * @param pObjectPath
- * Instance object path.
- * @param pProps
- * Instance properties.
- * @return CIMInstance with numeric key data types synchronized.
- */
- public static CIMInstance CIMInstanceWithSynchonizedNumericKeyDataTypes(
- CIMObjectPath pObjectPath, CIMProperty>[] pProps) {
- CIMInstance inst = new CIMInstance(pObjectPath, pProps);
- CIMProperty>[] oldKeys = inst.getKeys();
- CIMProperty>[] newKeys = new CIMProperty>[oldKeys.length];
- boolean update = false;
-
- for (int i = 0; i < oldKeys.length; i++) {
- CIMDataType oldType = oldKeys[i].getDataType();
- CIMProperty> prop = inst.getProperty(oldKeys[i].getName());
- if (oldType != null && prop != null && prop.getDataType() != null
- && !prop.getDataType().equals(oldType) && isNumericObject(oldType)
- && isNumericObject(prop.getDataType())) {
- update = true;
- newKeys[i] = new CIMProperty(oldKeys[i].getName(), prop.getDataType(),
- translateNumericObject(oldKeys[i].getValue(), oldType, prop.getDataType()),
- oldKeys[i].isKey(), oldKeys[i].isPropagated(), oldKeys[i].getOriginClass());
- } else {
- newKeys[i] = oldKeys[i];
- }
- }
-
- return (update ? inst.deriveInstance(new CIMObjectPath(pObjectPath.getScheme(), pObjectPath
- .getHost(), pObjectPath.getPort(), pObjectPath.getNamespace(), pObjectPath
- .getObjectName(), newKeys)) : inst);
- }
-
- private static boolean isNumericObject(CIMDataType type) {
- switch (type.getType()) {
- case CIMDataType.SINT8:
- case CIMDataType.SINT16:
- case CIMDataType.SINT32:
- case CIMDataType.SINT64:
- case CIMDataType.UINT8:
- case CIMDataType.UINT16:
- case CIMDataType.UINT32:
- case CIMDataType.UINT64:
- case CIMDataType.REAL32:
- case CIMDataType.REAL64:
- return true;
- }
- return false;
- }
-
- private static Object translateNumericObject(Object oldValue, CIMDataType oldType,
- CIMDataType newType) {
- if (oldValue == null) return null;
-
- int from = oldType.getType(), to = newType.getType();
- long newInt = 0;
- double newDec = 0;
- Object o = null;
- boolean useInt = true;
-
- switch (from) {
- case CIMDataType.SINT8:
- Byte b = (Byte) oldValue;
- newInt = b.longValue();
- break;
- case CIMDataType.SINT16:
- Short s = (Short) oldValue;
- newInt = s.longValue();
- break;
- case CIMDataType.SINT32:
- Integer i = (Integer) oldValue;
- newInt = i.longValue();
- break;
- case CIMDataType.SINT64:
- Long l = (Long) oldValue;
- newInt = l.longValue();
- break;
- case CIMDataType.UINT8:
- UnsignedInteger8 u8 = (UnsignedInteger8) oldValue;
- newInt = u8.longValue();
- break;
- case CIMDataType.UINT16:
- UnsignedInteger16 u16 = (UnsignedInteger16) oldValue;
- newInt = u16.longValue();
- break;
- case CIMDataType.UINT32:
- UnsignedInteger32 u32 = (UnsignedInteger32) oldValue;
- newInt = u32.longValue();
- break;
- case CIMDataType.UINT64:
- UnsignedInteger64 u64 = (UnsignedInteger64) oldValue;
- newInt = u64.longValue();
- break;
- case CIMDataType.REAL32:
- Float f = (Float) oldValue;
- newDec = f.doubleValue();
- useInt = false;
- break;
- case CIMDataType.REAL64:
- Double d = (Double) oldValue;
- newDec = d.doubleValue();
- useInt = false;
- break;
- }
-
- switch (to) {
- case CIMDataType.SINT8:
- byte b = (byte) (useInt ? newInt : newDec);
- o = new Byte(b);
- break;
- case CIMDataType.SINT16:
- short s = (short) (useInt ? newInt : newDec);
- o = new Short(s);
- break;
- case CIMDataType.SINT32:
- int i = (int) (useInt ? newInt : newDec);
- o = new Integer(i);
- break;
- case CIMDataType.SINT64:
- long l = (long) (useInt ? newInt : newDec);
- o = new Long(l);
- break;
- case CIMDataType.UINT8:
- byte u8 = (byte) (useInt ? newInt : newDec);
- o = new UnsignedInteger8(u8);
- break;
- case CIMDataType.UINT16:
- short u16 = (short) (useInt ? newInt : newDec);
- o = new UnsignedInteger16(u16);
- break;
- case CIMDataType.UINT32:
- int u32 = (int) (useInt ? newInt : newDec);
- o = new UnsignedInteger32(u32);
- break;
- case CIMDataType.UINT64:
- long u64 = (long) (useInt ? newInt : newDec);
- o = new UnsignedInteger64(BigInteger.valueOf(u64));
- break;
- case CIMDataType.REAL32:
- float f = (float) (useInt ? newInt : newDec);
- o = new Float(f);
- break;
- case CIMDataType.REAL64:
- double d = useInt ? (double) newInt : newDec;
- o = new Double(d);
- break;
- }
-
- return o;
- }
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2013
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Alexander Wolf-Reber, IBM, a.wolf-reber@de.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1565892 2006-12-06 lupusalex Make SBLIM client JSR48 compliant
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2964463 2010-03-08 blaschke-oss WBEMClient.initialize() throws wrong exception
+ * 2942520 2010-03-08 blaschke-oss IPv6 link local address with scope_id including a dot not supported
+ * 3513353 2012-03-30 blaschke-oss TCK: CIMDataType arrays must have length >= 1
+ * 3513349 2012-03-31 blaschke-oss TCK: CIMDataType must not accept null string
+ * 3598613 2013-01-11 blaschke-oss different data type in cim instance and cim object path
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.math.BigInteger;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.metricshub.wbem.javax.cim.CIMDataType;
+import org.metricshub.wbem.javax.cim.CIMInstance;
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.sblim.cimclient.internal.util.WBEMConstants;
+import org.metricshub.wbem.javax.cim.CIMProperty;
+import org.metricshub.wbem.javax.cim.UnsignedInteger16;
+import org.metricshub.wbem.javax.cim.UnsignedInteger32;
+import org.metricshub.wbem.javax.cim.UnsignedInteger64;
+import org.metricshub.wbem.javax.cim.UnsignedInteger8;
+
+/**
+ * Class CIMHelper provides convenience methods that are missing from the
+ * official JSR48 API
+ *
+ */
+public abstract class CIMHelper {
+
+ private CIMHelper() {
+ // no instances
+ }
+
+ /**
+ * Creates a URI of a CIMOM from a given CIM object path, adding default
+ * port if port not parsable.
+ *
+ * @param pPath
+ * The CIM object path.
+ * @return The URI.
+ * @throws URISyntaxException
+ */
+ public static URI createCimomUri(CIMObjectPath pPath) throws URISyntaxException {
+ String scheme = pPath.getScheme();
+ String host = pPath.getHost();
+ int port = WBEMConstants.DEFAULT_WBEM_PORT;
+ try {
+ port = Integer.parseInt(pPath.getPort());
+ } catch (NumberFormatException e) {
+ // stuck with default port
+ }
+ return new URI(scheme, null, host, port, WBEMConstants.CIMOM_PATH, null, null);
+ }
+
+ /**
+ * Creates a URI of a CIMOM from a given URI, adding default port if port
+ * not specified.
+ *
+ * @param pUri
+ * The URI.
+ * @return The URI.
+ * @throws URISyntaxException
+ */
+ public static URI createCimomUri(URI pUri) throws URISyntaxException {
+ String scheme = pUri.getScheme();
+ String host = pUri.getHost();
+ int port = pUri.getPort();
+ if (port == -1) {
+ // stuck with default port
+ port = WBEMConstants.DEFAULT_WBEM_PORT;
+ }
+ return new URI(scheme, null, host, port, WBEMConstants.CIMOM_PATH, null, null);
+ }
+
+ private static CIMDataType CIMScalarDataTypes[] = {
+ /* 00 */CIMDataType.UINT8_T,
+ /* 01 */CIMDataType.SINT8_T,
+ /* 02 */CIMDataType.UINT16_T,
+ /* 03 */CIMDataType.SINT16_T,
+ /* 04 */CIMDataType.UINT32_T,
+ /* 05 */CIMDataType.SINT32_T,
+ /* 06 */CIMDataType.UINT64_T,
+ /* 07 */CIMDataType.SINT64_T,
+ /* 08 */CIMDataType.STRING_T,
+ /* 09 */CIMDataType.BOOLEAN_T,
+ /* 10 */CIMDataType.REAL32_T,
+ /* 11 */CIMDataType.REAL64_T,
+ /* 12 */CIMDataType.DATETIME_T,
+ /* 13 */CIMDataType.CHAR16_T,
+ /* 14 */new CIMDataType(""),
+ /* 15 */CIMDataType.OBJECT_T,
+ /* 16 */null,
+ /* 17 */CIMDataType.CLASS_T };
+
+ /**
+ * Returns the CIMDataType of a scalar of the specified data type. This
+ * should be used in lieu of "new CIMDataType(pType)" which is not supported
+ * by the JSR48 standard.
+ *
+ * @param pType
+ * Data type.
+ * @return CIMDataType corresponding to data type.
+ */
+ public static CIMDataType ScalarDataType(int pType) {
+ if (pType < 0 || pType >= CIMScalarDataTypes.length) return null;
+ return CIMScalarDataTypes[pType];
+ }
+
+ private static CIMDataType CIMArrayDataTypes[] = {
+ /* 00 */CIMDataType.UINT8_ARRAY_T,
+ /* 01 */CIMDataType.SINT8_ARRAY_T,
+ /* 02 */CIMDataType.UINT16_ARRAY_T,
+ /* 03 */CIMDataType.SINT16_ARRAY_T,
+ /* 04 */CIMDataType.UINT32_ARRAY_T,
+ /* 05 */CIMDataType.SINT32_ARRAY_T,
+ /* 06 */CIMDataType.UINT64_ARRAY_T,
+ /* 07 */CIMDataType.SINT64_ARRAY_T,
+ /* 08 */CIMDataType.STRING_ARRAY_T,
+ /* 09 */CIMDataType.BOOLEAN_ARRAY_T,
+ /* 10 */CIMDataType.REAL32_ARRAY_T,
+ /* 11 */CIMDataType.REAL64_ARRAY_T,
+ /* 12 */CIMDataType.DATETIME_ARRAY_T,
+ /* 13 */CIMDataType.CHAR16_ARRAY_T,
+ /* 14 */new CIMDataType("", 0),
+ /* 15 */CIMDataType.OBJECT_ARRAY_T,
+ /* 16 */null,
+ /* 17 */CIMDataType.CLASS_ARRAY_T };
+
+ /**
+ * Returns the CIMDataType of an unbounded array of the specified data type.
+ * This should be used in lieu of "new CIMDataType(pType,0)" which is not
+ * supported by the JSR48 standard.
+ *
+ * @param pType
+ * Data type.
+ * @return CIMDataType corresponding to data type.
+ */
+ public static CIMDataType UnboundedArrayDataType(int pType) {
+ if (pType < 0 || pType >= CIMArrayDataTypes.length) return null;
+ return CIMArrayDataTypes[pType];
+ }
+
+ /**
+ * CIMInstanceWithSynchonizedNumericKeyDataTypes returns a
+ * CIMInstance where the data types of all numeric keys in the
+ * CIMObjectPath match those of the corresponding keys within
+ * the CIMProperty[].
+ *
+ * The need for this conversion mechanism arises from a deficiency in the
+ * CIM-XML specs, where the TYPE (sint8, uint8, etc.) is required for
+ * PROPERTY but not for KEYVALUE. If a CIMOM sends a KEYVALUE of
+ * VALUETYPE="numeric" without TYPE, the Java CIM Client assumes a type of
+ * sint64, uint64 or real64. This can cause problems (i.e.
+ * ClassCastException) down the line if the TYPE of the corresponding
+ * PROPERTY is different.
+ *
+ * @param pObjectPath
+ * Instance object path.
+ * @param pProps
+ * Instance properties.
+ * @return CIMInstance with numeric key data types synchronized.
+ */
+ public static CIMInstance CIMInstanceWithSynchonizedNumericKeyDataTypes(
+ CIMObjectPath pObjectPath, CIMProperty>[] pProps) {
+ CIMInstance inst = new CIMInstance(pObjectPath, pProps);
+ CIMProperty>[] oldKeys = inst.getKeys();
+ CIMProperty>[] newKeys = new CIMProperty>[oldKeys.length];
+ boolean update = false;
+
+ for (int i = 0; i < oldKeys.length; i++) {
+ CIMDataType oldType = oldKeys[i].getDataType();
+ CIMProperty> prop = inst.getProperty(oldKeys[i].getName());
+ if (oldType != null && prop != null && prop.getDataType() != null
+ && !prop.getDataType().equals(oldType) && isNumericObject(oldType)
+ && isNumericObject(prop.getDataType())) {
+ update = true;
+ newKeys[i] = new CIMProperty(oldKeys[i].getName(), prop.getDataType(),
+ translateNumericObject(oldKeys[i].getValue(), oldType, prop.getDataType()),
+ oldKeys[i].isKey(), oldKeys[i].isPropagated(), oldKeys[i].getOriginClass());
+ } else {
+ newKeys[i] = oldKeys[i];
+ }
+ }
+
+ return (update ? inst.deriveInstance(new CIMObjectPath(pObjectPath.getScheme(), pObjectPath
+ .getHost(), pObjectPath.getPort(), pObjectPath.getNamespace(), pObjectPath
+ .getObjectName(), newKeys)) : inst);
+ }
+
+ private static boolean isNumericObject(CIMDataType type) {
+ switch (type.getType()) {
+ case CIMDataType.SINT8:
+ case CIMDataType.SINT16:
+ case CIMDataType.SINT32:
+ case CIMDataType.SINT64:
+ case CIMDataType.UINT8:
+ case CIMDataType.UINT16:
+ case CIMDataType.UINT32:
+ case CIMDataType.UINT64:
+ case CIMDataType.REAL32:
+ case CIMDataType.REAL64:
+ return true;
+ }
+ return false;
+ }
+
+ private static Object translateNumericObject(Object oldValue, CIMDataType oldType,
+ CIMDataType newType) {
+ if (oldValue == null) return null;
+
+ int from = oldType.getType(), to = newType.getType();
+ long newInt = 0;
+ double newDec = 0;
+ Object o = null;
+ boolean useInt = true;
+
+ switch (from) {
+ case CIMDataType.SINT8:
+ Byte b = (Byte) oldValue;
+ newInt = b.longValue();
+ break;
+ case CIMDataType.SINT16:
+ Short s = (Short) oldValue;
+ newInt = s.longValue();
+ break;
+ case CIMDataType.SINT32:
+ Integer i = (Integer) oldValue;
+ newInt = i.longValue();
+ break;
+ case CIMDataType.SINT64:
+ Long l = (Long) oldValue;
+ newInt = l.longValue();
+ break;
+ case CIMDataType.UINT8:
+ UnsignedInteger8 u8 = (UnsignedInteger8) oldValue;
+ newInt = u8.longValue();
+ break;
+ case CIMDataType.UINT16:
+ UnsignedInteger16 u16 = (UnsignedInteger16) oldValue;
+ newInt = u16.longValue();
+ break;
+ case CIMDataType.UINT32:
+ UnsignedInteger32 u32 = (UnsignedInteger32) oldValue;
+ newInt = u32.longValue();
+ break;
+ case CIMDataType.UINT64:
+ UnsignedInteger64 u64 = (UnsignedInteger64) oldValue;
+ newInt = u64.longValue();
+ break;
+ case CIMDataType.REAL32:
+ Float f = (Float) oldValue;
+ newDec = f.doubleValue();
+ useInt = false;
+ break;
+ case CIMDataType.REAL64:
+ Double d = (Double) oldValue;
+ newDec = d.doubleValue();
+ useInt = false;
+ break;
+ }
+
+ switch (to) {
+ case CIMDataType.SINT8:
+ byte b = (byte) (useInt ? newInt : newDec);
+ o = new Byte(b);
+ break;
+ case CIMDataType.SINT16:
+ short s = (short) (useInt ? newInt : newDec);
+ o = new Short(s);
+ break;
+ case CIMDataType.SINT32:
+ int i = (int) (useInt ? newInt : newDec);
+ o = new Integer(i);
+ break;
+ case CIMDataType.SINT64:
+ long l = (long) (useInt ? newInt : newDec);
+ o = new Long(l);
+ break;
+ case CIMDataType.UINT8:
+ byte u8 = (byte) (useInt ? newInt : newDec);
+ o = new UnsignedInteger8(u8);
+ break;
+ case CIMDataType.UINT16:
+ short u16 = (short) (useInt ? newInt : newDec);
+ o = new UnsignedInteger16(u16);
+ break;
+ case CIMDataType.UINT32:
+ int u32 = (int) (useInt ? newInt : newDec);
+ o = new UnsignedInteger32(u32);
+ break;
+ case CIMDataType.UINT64:
+ long u64 = (long) (useInt ? newInt : newDec);
+ o = new UnsignedInteger64(BigInteger.valueOf(u64));
+ break;
+ case CIMDataType.REAL32:
+ float f = (float) (useInt ? newInt : newDec);
+ o = new Float(f);
+ break;
+ case CIMDataType.REAL64:
+ double d = useInt ? (double) newInt : newDec;
+ o = new Double(d);
+ break;
+ }
+
+ return o;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMInstanceBuilder.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMInstanceBuilder.java
similarity index 83%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMInstanceBuilder.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMInstanceBuilder.java
index 5885655..4413836 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMInstanceBuilder.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMInstanceBuilder.java
@@ -1,156 +1,154 @@
-/*
- (C) Copyright IBM Corp. 2006, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-11-30 ebak Make SBLIM client JSR48 compliant
- * 1669961 2006-04-16 lupusalex CIMTypedElement.getType() =>getDataType()
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-import org.sentrysoftware.wbem.javax.cim.CIMProperty;
-
-/**
- * Class CIMInstanceBuilder provides help for CIMInstance(CIMObjectPath,
- * CIMProperty[]) constructor.
- *
- * CIMObjectPath param has to contain the key properties only.
- * ( VALUE.NAMEDINSTANCE->INSTANCENAME->KEYBINDING )
- * CIMProperty[] param has to contain all properties, including key properties.
- * ( VALUE.NAMEDINSTANCE->INSTANCE->PROPERTY* )
- * The implementation merges the properties from both params.
- * From CIMObjectPath's keys only the type and value information is considered.
- *
- */
-public class CIMInstanceBuilder {
-
- private CIMProperty>[] iProperties;
-
- private static final Object[] EMPTY_RPOP_A = new CIMProperty[0];
-
- /**
- * Ctor.
- *
- * @param pPath
- * @param pProps
- * @throws IllegalArgumentException
- */
- public CIMInstanceBuilder(CIMObjectPath pPath, CIMProperty>[] pProps)
- throws IllegalArgumentException {
- this.iProperties = pProps != null ? pProps : new CIMProperty[0];
- CIMElementSorter.sort(this.iProperties);
- addPathKeys(pPath);
- }
-
- /**
- * Extends the keys of the passed CIMObjectPath.
- *
- * @param pPath
- * @return the new CIMObjectPath
- */
- public CIMObjectPath setKeys(CIMObjectPath pPath) {
- List> keys = new ArrayList>();
- for (int i = 0; i < this.iProperties.length; ++i) {
- CIMProperty> prop = this.iProperties[i];
- if (prop.isKey()) keys.add(prop);
- }
-
- /*
- * CIMObjectPath( String scheme, String host, String port, String
- * namespace, String objectName, CIMProperty[] keys )
- */
- return new CIMObjectPath(pPath.getScheme(), pPath.getHost(), pPath.getPort(), pPath
- .getNamespace(), pPath.getObjectName(), (CIMProperty[]) keys.toArray(EMPTY_RPOP_A));
- }
-
- /**
- * getAllPropertis
- *
- * @return all properties in an ordered way
- */
- public CIMProperty>[] getAllPropertis() {
- return this.iProperties;
- }
-
- private void addPathKeys(CIMObjectPath pPath) throws IllegalArgumentException {
- CIMProperty>[] keys = pPath.getKeys();
- for (int i = 0; i < keys.length; i++) {
- CIMProperty> key = keys[i];
- int pos = CIMElementSorter.findIdx(this.iProperties, key.getName());
- if (pos < 0) {
- pos = -pos - 1;
- CIMProperty>[] newArray = new CIMProperty[this.iProperties.length + 1];
- System.arraycopy(this.iProperties, 0, newArray, 0, pos);
- newArray[pos] = key;
- System.arraycopy(this.iProperties, pos, newArray, pos + 1, this.iProperties.length
- - pos);
- this.iProperties = newArray;
- } else {
- CIMProperty> prop = this.iProperties[pos];
- // typeAndValueCheck(key, prop);
- if (!prop.isKey()) this.iProperties[pos] = mkKey(prop);
- }
- }
- }
-
- private static CIMProperty mkKey(CIMProperty> pProp) {
- return new CIMProperty(pProp.getName(), pProp.getDataType(), pProp.getValue(),
- true, pProp.isPropagated(), pProp.getOriginClass());
- }
-
- /*
- * private static void typeAndValueCheck(CIMProperty pPathProp, CIMProperty
- * pArrayProp) throws IllegalArgumentException { CIMDataType pType =
- * pPathProp.getDataType(), aType = pArrayProp.getDataType(); if (pType ==
- * null ? aType != null : pType.getType() != aType.getType()) throw new
- * IllegalArgumentException( pPathProp.getName() + " property presents in
- * CIMObjectPath param and CIMProperty[] param " + "with different types!");
- * Object pValue = pPathProp.getValue(), aValue = pArrayProp.getValue(); if
- * (pValue == null ? aValue != null : !pValue.equals(aValue)) throw new
- * IllegalArgumentException( pPathProp.getName() + " property conatins
- * different values in CIMObjectPath and " + "CIMProperty params!"); }
- */
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, ebak@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-11-30 ebak Make SBLIM client JSR48 compliant
+ * 1669961 2006-04-16 lupusalex CIMTypedElement.getType() =>getDataType()
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.javax.cim.CIMProperty;
+
+/**
+ * Class CIMInstanceBuilder provides help for CIMInstance(CIMObjectPath,
+ * CIMProperty[]) constructor.
+ *
+ * CIMObjectPath param has to contain the key properties only.
+ * ( VALUE.NAMEDINSTANCE->INSTANCENAME->KEYBINDING )
+ * CIMProperty[] param has to contain all properties, including key properties.
+ * ( VALUE.NAMEDINSTANCE->INSTANCE->PROPERTY* )
+ * The implementation merges the properties from both params.
+ * From CIMObjectPath's keys only the type and value information is considered.
+ *
+ */
+public class CIMInstanceBuilder {
+
+ private CIMProperty>[] iProperties;
+
+ private static final Object[] EMPTY_RPOP_A = new CIMProperty[0];
+
+ /**
+ * Ctor.
+ *
+ * @param pPath
+ * @param pProps
+ * @throws IllegalArgumentException
+ */
+ public CIMInstanceBuilder(CIMObjectPath pPath, CIMProperty>[] pProps)
+ throws IllegalArgumentException {
+ this.iProperties = pProps != null ? pProps : new CIMProperty[0];
+ CIMElementSorter.sort(this.iProperties);
+ addPathKeys(pPath);
+ }
+
+ /**
+ * Extends the keys of the passed CIMObjectPath.
+ *
+ * @param pPath
+ * @return the new CIMObjectPath
+ */
+ public CIMObjectPath setKeys(CIMObjectPath pPath) {
+ List> keys = new ArrayList>();
+ for (int i = 0; i < this.iProperties.length; ++i) {
+ CIMProperty> prop = this.iProperties[i];
+ if (prop.isKey()) keys.add(prop);
+ }
+
+ /*
+ * CIMObjectPath( String scheme, String host, String port, String
+ * namespace, String objectName, CIMProperty[] keys )
+ */
+ return new CIMObjectPath(pPath.getScheme(), pPath.getHost(), pPath.getPort(), pPath
+ .getNamespace(), pPath.getObjectName(), (CIMProperty[]) keys.toArray(EMPTY_RPOP_A));
+ }
+
+ /**
+ * getAllPropertis
+ *
+ * @return all properties in an ordered way
+ */
+ public CIMProperty>[] getAllPropertis() {
+ return this.iProperties;
+ }
+
+ private void addPathKeys(CIMObjectPath pPath) throws IllegalArgumentException {
+ CIMProperty>[] keys = pPath.getKeys();
+ for (int i = 0; i < keys.length; i++) {
+ CIMProperty> key = keys[i];
+ int pos = CIMElementSorter.findIdx(this.iProperties, key.getName());
+ if (pos < 0) {
+ pos = -pos - 1;
+ CIMProperty>[] newArray = new CIMProperty[this.iProperties.length + 1];
+ System.arraycopy(this.iProperties, 0, newArray, 0, pos);
+ newArray[pos] = key;
+ System.arraycopy(this.iProperties, pos, newArray, pos + 1, this.iProperties.length
+ - pos);
+ this.iProperties = newArray;
+ } else {
+ CIMProperty> prop = this.iProperties[pos];
+ // typeAndValueCheck(key, prop);
+ if (!prop.isKey()) this.iProperties[pos] = mkKey(prop);
+ }
+ }
+ }
+
+ private static CIMProperty mkKey(CIMProperty> pProp) {
+ return new CIMProperty(pProp.getName(), pProp.getDataType(), pProp.getValue(),
+ true, pProp.isPropagated(), pProp.getOriginClass());
+ }
+
+ /*
+ * private static void typeAndValueCheck(CIMProperty pPathProp, CIMProperty
+ * pArrayProp) throws IllegalArgumentException { CIMDataType pType =
+ * pPathProp.getDataType(), aType = pArrayProp.getDataType(); if (pType ==
+ * null ? aType != null : pType.getType() != aType.getType()) throw new
+ * IllegalArgumentException( pPathProp.getName() + " property presents in
+ * CIMObjectPath param and CIMProperty[] param " + "with different types!");
+ * Object pValue = pPathProp.getValue(), aValue = pArrayProp.getValue(); if
+ * (pValue == null ? aValue != null : !pValue.equals(aValue)) throw new
+ * IllegalArgumentException( pPathProp.getName() + " property conatins
+ * different values in CIMObjectPath and " + "CIMProperty params!"); }
+ */
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMOctetString.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMOctetString.java
similarity index 91%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMOctetString.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMOctetString.java
index 0cca4a0..f75d9a3 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMOctetString.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMOctetString.java
@@ -1,484 +1,482 @@
-/*
- (C) Copyright IBM Corp. 2011
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Dave Blaschke, IBM, blaschke@us.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 3397922 2011-08-30 blaschke-oss support OctetString
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import org.sentrysoftware.wbem.javax.cim.UnsignedInteger8;
-
-/**
- * This class represents a CIM octet string, or length-prefixed string, where
- * the length is four octets (32 bits) AND includes the four octets it occupies.
- * In other words, the length of the octet string is the number of characters in
- * the string plus four. There are three possible representations:
- *
- * 1) Byte array - This is an array of UnsignedInteger8 (unit8) objects. The
- * first four bytes contain the length, so the ASCII string "DEB" would be
- * represented as { 0x00, 0x00, 0x00, 0x07, 0x44, 0x45, 0x42 }
- *
- * 2) Hexadecimal string - This is a string of hexadecimal digits. The four
- * bytes after the initial "0x" contain the length, so the ASCII string "DEB"
- * would be represented as "0x00000007444542".
- *
- * 3) ASCII string
- *
- * One of these representations is passed into a constructor. The other
- * representations are created on demand when a get() method is invoked or when
- * the equals() method is invoked and the two octet strings have no
- * representations in common.
- */
-public class CIMOctetString {
-
- private UnsignedInteger8 iBytes[];
-
- private String iASCIIString;
-
- private char iReplacementChar; // 0xFF indicates ASCII constructor used
-
- private String iHexString;
-
- private int iLength;
-
- /**
- * Constructs a CIMOctetString from the given byte array.
- *
- * @param pBytes
- * Byte array representation of octet string.
- * @throws IllegalArgumentException
- */
- public CIMOctetString(UnsignedInteger8 pBytes[]) throws IllegalArgumentException {
- // Minimum (empty) byte array is { 0x00 0x00 0x00 0x04 }
- if (pBytes == null || pBytes.length < 4) throw new IllegalArgumentException(
- "Array of bytes must contain at least four bytes");
-
- // Verify there are no null entries in byte array
- for (int i = pBytes.length - 1; i >= 0; i--)
- if (pBytes[i] == null) throw new IllegalArgumentException(
- "Array of bytes must not contain any null bytes");
-
- // Calculate length
- this.iLength = pBytes[3].byteValue() + (pBytes[2].byteValue() * 0x100)
- + (pBytes[1].byteValue() * 0x10000) + (pBytes[0].byteValue() * 0x1000000);
-
- // Verify calculated length matches actual length
- if (this.iLength != pBytes.length) throw new IllegalArgumentException(
- "Array of bytes contains invalid length: found " + this.iLength + ", expected "
- + pBytes.length);
-
- // Save byte array in new object
- this.iBytes = new UnsignedInteger8[this.iLength];
- for (int i = this.iLength - 1; i >= 0; i--)
- this.iBytes[i] = pBytes[i];
- }
-
- /**
- * Constructs a CIMOctetString from the given string.
- *
- * @param pString
- * String representation of octet string.
- * @param pIsHex
- * true if string is hexadecimal string,
- * false if string is ASCII string.
- *
- * @throws IllegalArgumentException
- */
- public CIMOctetString(String pString, boolean pIsHex) throws IllegalArgumentException {
- if (pString == null) throw new IllegalArgumentException("String cannot be null");
-
- if (pIsHex) {
- // Minimum (empty) hexadecimal string is "0x00000004"
- if (pString.length() < 10) throw new IllegalArgumentException(
- "Hexadecimal string must contain \"0x\" and at least four pairs of hex digits");
-
- // Verify hexadecimal string starts with "0x"
- if (pString.charAt(0) != '0' || pString.charAt(1) != 'x') throw new IllegalArgumentException(
- "Hexadecimal string must begin with \"0x\"");
-
- // Calculate length
- try {
- this.iLength = Integer.parseInt(pString.substring(2, 10), 16);
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException(
- "Hexadecimal string length could not be parsed: " + e.toString());
- }
-
- // Verify calculated length matches actual length
- if ((this.iLength * 2) + 2 != pString.length()) throw new IllegalArgumentException(
- "Hexadecimal string contains invalid length: found " + this.iLength
- + ", expected " + ((pString.length() - 2 / 2)));
-
- // Verify remainder of hexadecimal string contains only hexadecimal
- // digits
- for (int i = pString.length() - 1; i >= 10; i--) {
- char ch = pString.charAt(i);
- if (!((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'))) throw new IllegalArgumentException(
- "Hexadecimal string could not be parsed, invalid character \'" + ch
- + "\' at index " + i);
- }
-
- // Save hexadecimal string in new object
- this.iHexString = new String(pString);
- } else {
- // Calculate length
- this.iLength = pString.length() + 4;
-
- // Save ASCII string in new object and indicate constructor used
- this.iASCIIString = new String(pString);
- this.iReplacementChar = 0xFF;
- }
- }
-
- /**
- * Takes a CIM octet string and returns true if it is equal to
- * this CIM octet string. Otherwise, it returns false. Two
- * octet strings are considered equal if all of their common representations
- * are equal. If the octet strings have no representations in common, this
- * method will build the missing one, starting with byte array and then
- * hexadecmial string.
- *
- * NOTE: The ASCII string representation is only considered if both octet
- * strings were constructed with an ASCII string.
- *
- * @param pObj
- * The object to be compared a CIM element.
- * @return true if the specified CIM octet string equals this
- * CIM octet string, false otherwise.
- */
- @Override
- public synchronized boolean equals(Object pObj) {
- // Verify parameter is CIMOctetString instance
- if (!(pObj instanceof CIMOctetString)) return false;
-
- CIMOctetString that = (CIMOctetString) pObj;
- int numCompares = 0;
-
- // Verify lengths are same
- if (this.iLength != that.iLength) return false;
-
- // Verify byte arrays match if both non-null
- if (this.iBytes != null && that.iBytes != null) {
- for (int i = this.iLength - 1; i >= 0; i--)
- if (this.iBytes[i].byteValue() != that.iBytes[i].byteValue()) return false;
- numCompares++;
- }
-
- // Verify hexadecimal strings match if both non-null
- if (this.iHexString != null && that.iHexString != null) {
- if (!this.iHexString.equalsIgnoreCase(that.iHexString)) return false;
- numCompares++;
- }
-
- // Verify ASCII strings match if both non-null
- if (this.iASCIIString != null && that.iASCIIString != null
- && this.iReplacementChar == that.iReplacementChar) {
- if (!this.iASCIIString.equalsIgnoreCase(that.iASCIIString)) return false;
- numCompares++;
- }
-
- // Octet strings equal if at least one representation equal
- if (numCompares > 0) return true;
-
- // At this point, the two CIMOctetString instances have no
- // representations in common - time to make one
-
- if (this.iBytes != null && that.iBytes == null) {
- that.getBytes();
- if (this.iBytes != null && that.iBytes != null) {
- for (int i = this.iLength - 1; i >= 0; i--)
- if (this.iBytes[i].byteValue() != that.iBytes[i].byteValue()) return false;
- numCompares++;
- }
- }
-
- // Octet strings equal if byte arrays equal
- if (numCompares > 0) return true;
-
- if (this.iBytes == null && that.iBytes != null) {
- getBytes();
- if (this.iBytes != null && that.iBytes != null) {
- for (int i = this.iLength - 1; i >= 0; i--)
- if (this.iBytes[i].byteValue() != that.iBytes[i].byteValue()) return false;
- numCompares++;
- }
- }
-
- // Octet strings equal if byte arrays equal
- if (numCompares > 0) return true;
-
- if (this.iHexString != null && that.iHexString == null) {
- that.getHexString();
- if (this.iHexString != null && that.iHexString != null) {
- if (!this.iHexString.equalsIgnoreCase(that.iHexString)) return false;
- numCompares++;
- }
- }
-
- // Octet strings equal if byte arrays equal
- if (numCompares > 0) return true;
-
- if (this.iHexString == null && that.iHexString != null) {
- getHexString();
- if (this.iHexString != null && that.iHexString != null) {
- if (!this.iHexString.equalsIgnoreCase(that.iHexString)) return false;
- numCompares++;
- }
- }
-
- // Octet strings equal if byte arrays equal
- if (numCompares > 0) return true;
-
- return false;
- }
-
- /**
- * Returns ASCII string representation of octet string with non-printable
- * characters replaced by pReplacementChar. If the ASCII string
- * has not yet been created, it is created from the byte array or
- * hexadecimal string.
- *
- * @param pReplacementChar
- * Replacement character for non-printable characters which must
- * be between 0x20 and 0x7E, inclusive.
- * @return ASCII string representation of octet string.
- */
- public synchronized String getASCIIString(char pReplacementChar) {
- // If ASCII string constructor used, return original string
- if (this.iASCIIString != null && this.iReplacementChar == 0xFF) return this.iASCIIString;
-
- // Verify replacement character is printable
- if (pReplacementChar <= 0x1F || pReplacementChar >= 0x7F) throw new IllegalArgumentException(
- "Replacement character not printable");
-
- // If we already did this once, return previous string
- if (this.iASCIIString != null && this.iReplacementChar == pReplacementChar) return this.iASCIIString;
-
- // Construct new ASCII string
- StringBuilder str = new StringBuilder("");
- if (this.iBytes != null) {
- for (int i = 4; i < this.iBytes.length; i++) {
- char ch = (char) this.iBytes[i].byteValue();
- if (ch <= 0x1F || ch >= 0x7F) str.append(pReplacementChar);
- else str.append(ch);
- }
- } else /* (this.iHexString != null) */{
- for (int i = 10; i < this.iHexString.length(); i += 2) {
- char ch = (char) Integer.parseInt(this.iHexString.substring(i, i + 2), 16);
- if (ch <= 0x1F || ch >= 0x7F) str.append(pReplacementChar);
- else str.append(ch);
- }
- }
-
- // Save ASCII string in new object and indicate which replacement
- // character used
- this.iASCIIString = new String(str);
- this.iReplacementChar = pReplacementChar;
-
- return this.iASCIIString;
- }
-
- /**
- * Returns byte array representation of octet string. If the byte array has
- * not yet been created, it is created from the hexadecimal string or ASCII
- * string.
- *
- * @return Byte array representation of octet string.
- */
- public synchronized UnsignedInteger8[] getBytes() {
- if (this.iBytes != null) return this.iBytes;
-
- if (this.iHexString != null) {
- convertHexStringToBytes();
- } else /* if (this.iASCIIString != null) */{
- convertASCIIStringToBytes();
- }
-
- return this.iBytes;
- }
-
- /**
- * Returns hexadecimal string representation of octet string. If the
- * hexadecimal string has not yet been created, it is created from the byte
- * array or ASCII string.
- *
- * @return Hexadecimal string representation of octet string.
- */
- public synchronized String getHexString() {
- if (this.iHexString != null) return this.iHexString;
-
- if (this.iBytes != null) {
- convertBytesToHexString();
- } else /* if (this.iASCIIString != null) */{
- convertASCIIStringToHexString();
- }
-
- return this.iHexString;
- }
-
- /**
- * Returns hash code value for octet string.
- *
- * @return Hash code value for octet string.
- */
- @Override
- public int hashCode() {
- return toString().toLowerCase().hashCode();
- }
-
- /**
- * Returns length of octet string, where length is number of octets plus
- * four.
- *
- * @return Length of octet string.
- */
- public int length() {
- return this.iLength;
- }
-
- /**
- * Returns string representation of octet string.
- *
- * @return String representation of octet string.
- */
- @Override
- public String toString() {
- return getHexString();
- }
-
- private void convertBytesToHexString() {
- // Start with "0x"
- StringBuilder str = new StringBuilder("0x");
-
- // Append length
- String len = Integer.toHexString(this.iLength);
- for (int i = 8 - len.length(); i > 0; i--)
- str.append('0');
- str.append(len);
-
- // Append string
- for (int i = 4; i < this.iLength; i++) {
- String octet = Integer.toHexString(this.iBytes[i].intValue());
- if (octet.length() == 1) str.append('0');
- str.append(octet);
- }
-
- // Save hexadecimal string in new object
- this.iHexString = new String(str);
-
- // debug("convertBytesToHexString: from {" + toBytesString() + "} to \""
- // + this.iHexString + "\"");
- }
-
- private void convertHexStringToBytes() {
- // Save byte array in new object
- this.iBytes = new UnsignedInteger8[this.iLength];
-
- // Convert each octet in hexadecimal string to byte
- for (int idxByte = 0, idxStr = 2, len = this.iHexString.length(); idxStr < len; idxByte++, idxStr += 2) {
- short s;
- try {
- s = Short.parseShort(this.iHexString.substring(idxStr, idxStr + 2), 16);
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("Hex string length could not be parsed: "
- + e.toString());
- }
- this.iBytes[idxByte] = new UnsignedInteger8(s);
- }
-
- // debug("convertHexStringToBytes: from \"" + this.iHexString +
- // "\" to {" + toBytesString() + "}");
- }
-
- private void convertASCIIStringToBytes() {
- // Save byte array in new object
- this.iBytes = new UnsignedInteger8[this.iLength];
-
- // Convert length
- this.iBytes[0] = new UnsignedInteger8((short) ((this.iLength >> 24) & 0xFF));
- this.iBytes[1] = new UnsignedInteger8((short) ((this.iLength >> 16) & 0xFF));
- this.iBytes[2] = new UnsignedInteger8((short) ((this.iLength >> 8) & 0xFF));
- this.iBytes[3] = new UnsignedInteger8((short) (this.iLength & 0xFF));
-
- // Convert each character in ASCII string to byte
- for (int idxStr = 0, idxByte = 4; idxStr < this.iASCIIString.length(); idxStr++, idxByte++)
- this.iBytes[idxByte] = new UnsignedInteger8((short) (this.iASCIIString.charAt(idxStr)));
-
- // debug("convertASCIIStringToBytes: from \"" + this.iASCIIString +
- // "\" to {" + toBytesString() + "}");
- }
-
- private void convertASCIIStringToHexString() {
- // Start with "0x"
- StringBuilder str = new StringBuilder("0x");
-
- // Append length
- String len = Integer.toHexString(this.iLength);
- for (int i = 8 - len.length(); i > 0; i--)
- str.append('0');
- str.append(len);
-
- // Append string
- for (int idxAsc = 0, idxHex = 10; idxAsc < this.iASCIIString.length(); idxAsc++, idxHex++) {
- String octet = Integer.toHexString((this.iASCIIString.charAt(idxAsc)));
- if (octet.length() == 1) str.append('0');
- str.append(octet);
- }
-
- // Save hexadecimal string in new object
- this.iHexString = new String(str);
-
- // debug("convertASCIIStringToHexString: from \"" + this.iASCIIString +
- // "\" to \"" + this.iHexString + "\"");
- }
-
- // private String toBytesString() {
- // StringBuilder str = new StringBuilder();
- //
- // for (int i = 0; i < this.iLength; i++) {
- // String octet = Integer.toHexString((this.iBytes[i].intValue()));
- // if (i > 0) str.append(' ');
- // if (octet.length() == 1) str.append('0');
- // str.append(octet);
- // }
- // return new String(str);
- // }
-
- // private void debug(String str) {
- // System.out.println(str);
- // }
-}
+/*
+ (C) Copyright IBM Corp. 2011
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Dave Blaschke, IBM, blaschke@us.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 3397922 2011-08-30 blaschke-oss support OctetString
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import org.metricshub.wbem.javax.cim.UnsignedInteger8;
+
+/**
+ * This class represents a CIM octet string, or length-prefixed string, where
+ * the length is four octets (32 bits) AND includes the four octets it occupies.
+ * In other words, the length of the octet string is the number of characters in
+ * the string plus four. There are three possible representations:
+ *
+ * 1) Byte array - This is an array of UnsignedInteger8 (unit8) objects. The
+ * first four bytes contain the length, so the ASCII string "DEB" would be
+ * represented as { 0x00, 0x00, 0x00, 0x07, 0x44, 0x45, 0x42 }
+ *
+ * 2) Hexadecimal string - This is a string of hexadecimal digits. The four
+ * bytes after the initial "0x" contain the length, so the ASCII string "DEB"
+ * would be represented as "0x00000007444542".
+ *
+ * 3) ASCII string
+ *
+ * One of these representations is passed into a constructor. The other
+ * representations are created on demand when a get() method is invoked or when
+ * the equals() method is invoked and the two octet strings have no
+ * representations in common.
+ */
+public class CIMOctetString {
+
+ private UnsignedInteger8 iBytes[];
+
+ private String iASCIIString;
+
+ private char iReplacementChar; // 0xFF indicates ASCII constructor used
+
+ private String iHexString;
+
+ private int iLength;
+
+ /**
+ * Constructs a CIMOctetString from the given byte array.
+ *
+ * @param pBytes
+ * Byte array representation of octet string.
+ * @throws IllegalArgumentException
+ */
+ public CIMOctetString(UnsignedInteger8 pBytes[]) throws IllegalArgumentException {
+ // Minimum (empty) byte array is { 0x00 0x00 0x00 0x04 }
+ if (pBytes == null || pBytes.length < 4) throw new IllegalArgumentException(
+ "Array of bytes must contain at least four bytes");
+
+ // Verify there are no null entries in byte array
+ for (int i = pBytes.length - 1; i >= 0; i--)
+ if (pBytes[i] == null) throw new IllegalArgumentException(
+ "Array of bytes must not contain any null bytes");
+
+ // Calculate length
+ this.iLength = pBytes[3].byteValue() + (pBytes[2].byteValue() * 0x100)
+ + (pBytes[1].byteValue() * 0x10000) + (pBytes[0].byteValue() * 0x1000000);
+
+ // Verify calculated length matches actual length
+ if (this.iLength != pBytes.length) throw new IllegalArgumentException(
+ "Array of bytes contains invalid length: found " + this.iLength + ", expected "
+ + pBytes.length);
+
+ // Save byte array in new object
+ this.iBytes = new UnsignedInteger8[this.iLength];
+ for (int i = this.iLength - 1; i >= 0; i--)
+ this.iBytes[i] = pBytes[i];
+ }
+
+ /**
+ * Constructs a CIMOctetString from the given string.
+ *
+ * @param pString
+ * String representation of octet string.
+ * @param pIsHex
+ * true if string is hexadecimal string,
+ * false if string is ASCII string.
+ *
+ * @throws IllegalArgumentException
+ */
+ public CIMOctetString(String pString, boolean pIsHex) throws IllegalArgumentException {
+ if (pString == null) throw new IllegalArgumentException("String cannot be null");
+
+ if (pIsHex) {
+ // Minimum (empty) hexadecimal string is "0x00000004"
+ if (pString.length() < 10) throw new IllegalArgumentException(
+ "Hexadecimal string must contain \"0x\" and at least four pairs of hex digits");
+
+ // Verify hexadecimal string starts with "0x"
+ if (pString.charAt(0) != '0' || pString.charAt(1) != 'x') throw new IllegalArgumentException(
+ "Hexadecimal string must begin with \"0x\"");
+
+ // Calculate length
+ try {
+ this.iLength = Integer.parseInt(pString.substring(2, 10), 16);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException(
+ "Hexadecimal string length could not be parsed: " + e.toString());
+ }
+
+ // Verify calculated length matches actual length
+ if ((this.iLength * 2) + 2 != pString.length()) throw new IllegalArgumentException(
+ "Hexadecimal string contains invalid length: found " + this.iLength
+ + ", expected " + ((pString.length() - 2 / 2)));
+
+ // Verify remainder of hexadecimal string contains only hexadecimal
+ // digits
+ for (int i = pString.length() - 1; i >= 10; i--) {
+ char ch = pString.charAt(i);
+ if (!((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'))) throw new IllegalArgumentException(
+ "Hexadecimal string could not be parsed, invalid character \'" + ch
+ + "\' at index " + i);
+ }
+
+ // Save hexadecimal string in new object
+ this.iHexString = new String(pString);
+ } else {
+ // Calculate length
+ this.iLength = pString.length() + 4;
+
+ // Save ASCII string in new object and indicate constructor used
+ this.iASCIIString = new String(pString);
+ this.iReplacementChar = 0xFF;
+ }
+ }
+
+ /**
+ * Takes a CIM octet string and returns true if it is equal to
+ * this CIM octet string. Otherwise, it returns false. Two
+ * octet strings are considered equal if all of their common representations
+ * are equal. If the octet strings have no representations in common, this
+ * method will build the missing one, starting with byte array and then
+ * hexadecmial string.
+ *
+ * NOTE: The ASCII string representation is only considered if both octet
+ * strings were constructed with an ASCII string.
+ *
+ * @param pObj
+ * The object to be compared a CIM element.
+ * @return true if the specified CIM octet string equals this
+ * CIM octet string, false otherwise.
+ */
+ @Override
+ public synchronized boolean equals(Object pObj) {
+ // Verify parameter is CIMOctetString instance
+ if (!(pObj instanceof CIMOctetString)) return false;
+
+ CIMOctetString that = (CIMOctetString) pObj;
+ int numCompares = 0;
+
+ // Verify lengths are same
+ if (this.iLength != that.iLength) return false;
+
+ // Verify byte arrays match if both non-null
+ if (this.iBytes != null && that.iBytes != null) {
+ for (int i = this.iLength - 1; i >= 0; i--)
+ if (this.iBytes[i].byteValue() != that.iBytes[i].byteValue()) return false;
+ numCompares++;
+ }
+
+ // Verify hexadecimal strings match if both non-null
+ if (this.iHexString != null && that.iHexString != null) {
+ if (!this.iHexString.equalsIgnoreCase(that.iHexString)) return false;
+ numCompares++;
+ }
+
+ // Verify ASCII strings match if both non-null
+ if (this.iASCIIString != null && that.iASCIIString != null
+ && this.iReplacementChar == that.iReplacementChar) {
+ if (!this.iASCIIString.equalsIgnoreCase(that.iASCIIString)) return false;
+ numCompares++;
+ }
+
+ // Octet strings equal if at least one representation equal
+ if (numCompares > 0) return true;
+
+ // At this point, the two CIMOctetString instances have no
+ // representations in common - time to make one
+
+ if (this.iBytes != null && that.iBytes == null) {
+ that.getBytes();
+ if (this.iBytes != null && that.iBytes != null) {
+ for (int i = this.iLength - 1; i >= 0; i--)
+ if (this.iBytes[i].byteValue() != that.iBytes[i].byteValue()) return false;
+ numCompares++;
+ }
+ }
+
+ // Octet strings equal if byte arrays equal
+ if (numCompares > 0) return true;
+
+ if (this.iBytes == null && that.iBytes != null) {
+ getBytes();
+ if (this.iBytes != null && that.iBytes != null) {
+ for (int i = this.iLength - 1; i >= 0; i--)
+ if (this.iBytes[i].byteValue() != that.iBytes[i].byteValue()) return false;
+ numCompares++;
+ }
+ }
+
+ // Octet strings equal if byte arrays equal
+ if (numCompares > 0) return true;
+
+ if (this.iHexString != null && that.iHexString == null) {
+ that.getHexString();
+ if (this.iHexString != null && that.iHexString != null) {
+ if (!this.iHexString.equalsIgnoreCase(that.iHexString)) return false;
+ numCompares++;
+ }
+ }
+
+ // Octet strings equal if byte arrays equal
+ if (numCompares > 0) return true;
+
+ if (this.iHexString == null && that.iHexString != null) {
+ getHexString();
+ if (this.iHexString != null && that.iHexString != null) {
+ if (!this.iHexString.equalsIgnoreCase(that.iHexString)) return false;
+ numCompares++;
+ }
+ }
+
+ // Octet strings equal if byte arrays equal
+ if (numCompares > 0) return true;
+
+ return false;
+ }
+
+ /**
+ * Returns ASCII string representation of octet string with non-printable
+ * characters replaced by pReplacementChar. If the ASCII string
+ * has not yet been created, it is created from the byte array or
+ * hexadecimal string.
+ *
+ * @param pReplacementChar
+ * Replacement character for non-printable characters which must
+ * be between 0x20 and 0x7E, inclusive.
+ * @return ASCII string representation of octet string.
+ */
+ public synchronized String getASCIIString(char pReplacementChar) {
+ // If ASCII string constructor used, return original string
+ if (this.iASCIIString != null && this.iReplacementChar == 0xFF) return this.iASCIIString;
+
+ // Verify replacement character is printable
+ if (pReplacementChar <= 0x1F || pReplacementChar >= 0x7F) throw new IllegalArgumentException(
+ "Replacement character not printable");
+
+ // If we already did this once, return previous string
+ if (this.iASCIIString != null && this.iReplacementChar == pReplacementChar) return this.iASCIIString;
+
+ // Construct new ASCII string
+ StringBuilder str = new StringBuilder("");
+ if (this.iBytes != null) {
+ for (int i = 4; i < this.iBytes.length; i++) {
+ char ch = (char) this.iBytes[i].byteValue();
+ if (ch <= 0x1F || ch >= 0x7F) str.append(pReplacementChar);
+ else str.append(ch);
+ }
+ } else /* (this.iHexString != null) */{
+ for (int i = 10; i < this.iHexString.length(); i += 2) {
+ char ch = (char) Integer.parseInt(this.iHexString.substring(i, i + 2), 16);
+ if (ch <= 0x1F || ch >= 0x7F) str.append(pReplacementChar);
+ else str.append(ch);
+ }
+ }
+
+ // Save ASCII string in new object and indicate which replacement
+ // character used
+ this.iASCIIString = new String(str);
+ this.iReplacementChar = pReplacementChar;
+
+ return this.iASCIIString;
+ }
+
+ /**
+ * Returns byte array representation of octet string. If the byte array has
+ * not yet been created, it is created from the hexadecimal string or ASCII
+ * string.
+ *
+ * @return Byte array representation of octet string.
+ */
+ public synchronized UnsignedInteger8[] getBytes() {
+ if (this.iBytes != null) return this.iBytes;
+
+ if (this.iHexString != null) {
+ convertHexStringToBytes();
+ } else /* if (this.iASCIIString != null) */{
+ convertASCIIStringToBytes();
+ }
+
+ return this.iBytes;
+ }
+
+ /**
+ * Returns hexadecimal string representation of octet string. If the
+ * hexadecimal string has not yet been created, it is created from the byte
+ * array or ASCII string.
+ *
+ * @return Hexadecimal string representation of octet string.
+ */
+ public synchronized String getHexString() {
+ if (this.iHexString != null) return this.iHexString;
+
+ if (this.iBytes != null) {
+ convertBytesToHexString();
+ } else /* if (this.iASCIIString != null) */{
+ convertASCIIStringToHexString();
+ }
+
+ return this.iHexString;
+ }
+
+ /**
+ * Returns hash code value for octet string.
+ *
+ * @return Hash code value for octet string.
+ */
+ @Override
+ public int hashCode() {
+ return toString().toLowerCase().hashCode();
+ }
+
+ /**
+ * Returns length of octet string, where length is number of octets plus
+ * four.
+ *
+ * @return Length of octet string.
+ */
+ public int length() {
+ return this.iLength;
+ }
+
+ /**
+ * Returns string representation of octet string.
+ *
+ * @return String representation of octet string.
+ */
+ @Override
+ public String toString() {
+ return getHexString();
+ }
+
+ private void convertBytesToHexString() {
+ // Start with "0x"
+ StringBuilder str = new StringBuilder("0x");
+
+ // Append length
+ String len = Integer.toHexString(this.iLength);
+ for (int i = 8 - len.length(); i > 0; i--)
+ str.append('0');
+ str.append(len);
+
+ // Append string
+ for (int i = 4; i < this.iLength; i++) {
+ String octet = Integer.toHexString(this.iBytes[i].intValue());
+ if (octet.length() == 1) str.append('0');
+ str.append(octet);
+ }
+
+ // Save hexadecimal string in new object
+ this.iHexString = new String(str);
+
+ // debug("convertBytesToHexString: from {" + toBytesString() + "} to \""
+ // + this.iHexString + "\"");
+ }
+
+ private void convertHexStringToBytes() {
+ // Save byte array in new object
+ this.iBytes = new UnsignedInteger8[this.iLength];
+
+ // Convert each octet in hexadecimal string to byte
+ for (int idxByte = 0, idxStr = 2, len = this.iHexString.length(); idxStr < len; idxByte++, idxStr += 2) {
+ short s;
+ try {
+ s = Short.parseShort(this.iHexString.substring(idxStr, idxStr + 2), 16);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Hex string length could not be parsed: "
+ + e.toString());
+ }
+ this.iBytes[idxByte] = new UnsignedInteger8(s);
+ }
+
+ // debug("convertHexStringToBytes: from \"" + this.iHexString +
+ // "\" to {" + toBytesString() + "}");
+ }
+
+ private void convertASCIIStringToBytes() {
+ // Save byte array in new object
+ this.iBytes = new UnsignedInteger8[this.iLength];
+
+ // Convert length
+ this.iBytes[0] = new UnsignedInteger8((short) ((this.iLength >> 24) & 0xFF));
+ this.iBytes[1] = new UnsignedInteger8((short) ((this.iLength >> 16) & 0xFF));
+ this.iBytes[2] = new UnsignedInteger8((short) ((this.iLength >> 8) & 0xFF));
+ this.iBytes[3] = new UnsignedInteger8((short) (this.iLength & 0xFF));
+
+ // Convert each character in ASCII string to byte
+ for (int idxStr = 0, idxByte = 4; idxStr < this.iASCIIString.length(); idxStr++, idxByte++)
+ this.iBytes[idxByte] = new UnsignedInteger8((short) (this.iASCIIString.charAt(idxStr)));
+
+ // debug("convertASCIIStringToBytes: from \"" + this.iASCIIString +
+ // "\" to {" + toBytesString() + "}");
+ }
+
+ private void convertASCIIStringToHexString() {
+ // Start with "0x"
+ StringBuilder str = new StringBuilder("0x");
+
+ // Append length
+ String len = Integer.toHexString(this.iLength);
+ for (int i = 8 - len.length(); i > 0; i--)
+ str.append('0');
+ str.append(len);
+
+ // Append string
+ for (int idxAsc = 0; idxAsc < this.iASCIIString.length(); idxAsc++) {
+ String octet = Integer.toHexString((this.iASCIIString.charAt(idxAsc)));
+ if (octet.length() == 1) str.append('0');
+ str.append(octet);
+ }
+
+ // Save hexadecimal string in new object
+ this.iHexString = new String(str);
+
+ // debug("convertASCIIStringToHexString: from \"" + this.iASCIIString +
+ // "\" to \"" + this.iHexString + "\"");
+ }
+
+ // private String toBytesString() {
+ // StringBuilder str = new StringBuilder();
+ //
+ // for (int i = 0; i < this.iLength; i++) {
+ // String octet = Integer.toHexString((this.iBytes[i].intValue()));
+ // if (i > 0) str.append(' ');
+ // if (octet.length() == 1) str.append('0');
+ // str.append(octet);
+ // }
+ // return new String(str);
+ // }
+
+ // private void debug(String str) {
+ // System.out.println(str);
+ // }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMQualifiedElementInterfaceImpl.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMQualifiedElementInterfaceImpl.java
similarity index 82%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMQualifiedElementInterfaceImpl.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMQualifiedElementInterfaceImpl.java
index 399fd23..eefe45c 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMQualifiedElementInterfaceImpl.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMQualifiedElementInterfaceImpl.java
@@ -1,329 +1,327 @@
-/*
- (C) Copyright IBM Corp. 2006, 2011
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-10-09 ebak Make SBLIM client JSR48 compliant
- * 1660756 2007-02-22 ebak Embedded object support
- * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
- * 1783288 2007-09-10 ebak CIMClass.isAssociation() not working for retrieved classes.
- * 1796339 2007-10-01 ebak Serializable interface missing from internal componentry
- * 1963102 2008-06-26 rgummada NullPointerException when getting qualifiers
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2620505 2009-02-24 rgummada EmbeddedObject qualifier is missing from CIMClass
- * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
- * 2823494 2009-08-03 rgummada Change Boolean constructor to static
- * 2975885 2010-03-24 blaschke-oss TCK: CIMXXX.hasQualifierValue(null,null) returns true
- * 3001680 2010-05-18 blaschke-oss CIMQualifierElementInterfaceImpl changes qualifiers
- * 3023095 2010-07-01 blaschke-oss CIMQualifiedElementInterfaceImpl equals/hashCode issue
- * 3154232 2011-01-13 blaschke-oss EmbeddedObject misspelled in javadoc
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.sentrysoftware.wbem.javax.cim.CIMDataType;
-import org.sentrysoftware.wbem.javax.cim.CIMFlavor;
-import org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface;
-import org.sentrysoftware.wbem.javax.cim.CIMQualifier;
-
-/**
- * Class CIMQualifiedElementInterfaceImpl is responsible for implementing the
- * functionality of javax.cim.CIMQualifiedElementInterface
- */
-public class CIMQualifiedElementInterfaceImpl implements CIMQualifiedElementInterface, Serializable {
-
- /**
- * serialVersionUID
- */
- private static final long serialVersionUID = 4533301297060752510L;
-
- private CIMQualifier>[] iQualis;
-
- private CIMQualifier>[] iLocalOnlyQualis;
-
- private boolean iEmbeddedObject;
-
- private static final CIMQualifier KEY = new CIMQualifier("Key",
- CIMDataType.BOOLEAN_T, Boolean.TRUE, CIMFlavor.DISABLEOVERRIDE);
-
- private static final CIMQualifier ASSOCIATION = new CIMQualifier(
- "Association", CIMDataType.BOOLEAN_T, Boolean.TRUE, CIMFlavor.DISABLEOVERRIDE);
-
- private static final CIMQualifier>[] EMPTY_QA = new CIMQualifier[0];
-
- /**
- * Ctor. This constructor doesn't modify the passed qualifier list.
- *
- * @param pQualifiers
- */
- public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers) {
- setQualis(pQualifiers);
- }
-
- /**
- * Ctor. This constructor modifies the qualifier list according to the
- * pIsKeyed flag.
- *
- * @param pQualifiers
- * @param pIsKeyed
- */
- public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers, boolean pIsKeyed) {
- this(pQualifiers, pIsKeyed, false);
- }
-
- /**
- * Ctor. This constructor is able to not remove the EmbeddedObject
- * qualifier. It is useful for the XML parser to parse EmbeddedObject
- * qualified elements without values.
- *
- * @param pQualifiers
- * @param pIsKeyed
- * @param pKeepEmbObj
- */
- public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers, boolean pIsKeyed,
- boolean pKeepEmbObj) {
- this(pQualifiers, pIsKeyed, pKeepEmbObj, false);
- }
-
- /**
- * Ctor. This constructor is able to not remove the EmbeddedObject
- * qualifier. It is useful for the XML parser to parse EmbeddedObject
- * qualified elements without values. It also adds or removes the
- * Association qualifier depending on the value of pIsAssociation.
- *
- * @param pQualifiers
- * @param pIsKeyed
- * @param pKeepEmbObj
- * @param pIsAssociation
- */
- public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers, boolean pIsKeyed,
- boolean pKeepEmbObj, boolean pIsAssociation) {
- if (pKeepEmbObj) {
- this.iQualis = (CIMQualifier[]) CIMElementSorter.sort(pQualifiers);
- this.iEmbeddedObject = CIMElementSorter.findIdx(this.iQualis, "EmbeddedObject") >= 0;
- } else {
- setQualis(pQualifiers);
- }
- setBoolQualifier(KEY, pIsKeyed);
- setBoolQualifier(ASSOCIATION, pIsAssociation);
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object pObj) {
- if (!(pObj instanceof CIMQualifiedElementInterfaceImpl)) return false;
- CIMQualifiedElementInterfaceImpl that = (CIMQualifiedElementInterfaceImpl) pObj;
- return Arrays.equals(getQualifiers(), that.getQualifiers());
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return Arrays.hashCode(getQualifiers());
- }
-
- /**
- * Sets the Qualifiers. If there is an EmbeddedObject qualifier,
- * corresponding flag is set.
- *
- * @param pQualiA
- */
- private void setQualis(CIMQualifier>[] pQualiA) {
- pQualiA = (CIMQualifier[]) CIMElementSorter.sort(pQualiA);
- int rmIdx = CIMElementSorter.findIdx(pQualiA, "EmbeddedObject");
- if (rmIdx < 0) {
- this.iQualis = pQualiA;
- return;
- }
- this.iEmbeddedObject = true;
- this.iQualis = pQualiA;
- }
-
- /**
- * if pValue is false and boolean qualifier exists it is removed.
- * if pValue is true and boolean qualifier exists, it's value is changed to
- * true, if boolean qualifier doesn't exist it is added.
- *
- * @param pQuali
- * @param pValue
- */
- private void setBoolQualifier(CIMQualifier pQuali, boolean pValue) {
- int idx = CIMElementSorter.findIdx(this.iQualis, pQuali.getName());
- if (pValue) {
- if (idx < 0) {
- // insert the qualifier
- // idx=-insertIdx-1
- // insertIdx=-idx-1;
- insertQuali(pQuali, -idx - 1);
- } else if (!pQuali.getValue().equals(this.iQualis[idx].getValue())) {
- // change the qualifier if value different
- this.iQualis[idx] = pQuali;
- }
- } else {
- if (idx > 0) {
- // remove the existing qualifier
- removeQuali(idx);
- }
- }
- }
-
- private void insertQuali(CIMQualifier pQuali, int idx) {
- int origLength = this.iQualis == null ? 0 : this.iQualis.length;
- CIMQualifier>[] qualis = new CIMQualifier[origLength + 1];
- int srcIdx = 0, dstIdx = 0;
- while (srcIdx < idx)
- qualis[dstIdx++] = this.iQualis[srcIdx++];
- qualis[dstIdx++] = pQuali;
- while (srcIdx < origLength)
- qualis[dstIdx++] = this.iQualis[srcIdx++];
- this.iQualis = qualis;
- }
-
- private void removeQuali(int idx) {
- CIMQualifier>[] qualis = new CIMQualifier[this.iQualis.length - 1];
- int srcIdx = 0, dstIdx = 0;
- while (srcIdx < idx)
- qualis[dstIdx++] = this.iQualis[srcIdx++];
- ++srcIdx;
- while (srcIdx < this.iQualis.length)
- qualis[dstIdx++] = this.iQualis[srcIdx++];
- this.iQualis = qualis;
- }
-
- /*
- * CIMQualifier( "Key", CIMDataType.BOOLEAN_T, new Boolean(true),
- * CIMFlavor.DISABLEOVERRIDE );
- */
-
- /**
- * Returns true if the "key" Qualifier with true value presents.
- *
- * @return true/false
- */
- public boolean isKeyed() {
- return hasQualifierValue("key", Boolean.TRUE);
- }
-
- /**
- * Returns true if the "EmbeddedObject" qualifier with true value presents.
- *
- * @return true/false
- */
- public boolean isEmbeddedObject() {
- return this.iEmbeddedObject;
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#getQualifier(int)
- */
- public CIMQualifier> getQualifier(int pIndex) {
- return this.iQualis[pIndex];
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#getQualifier(java.lang.String)
- */
- public CIMQualifier> getQualifier(String pName) {
- return (CIMQualifier>) CIMElementSorter.find(this.iQualis, pName);
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#getQualifierCount()
- */
- public int getQualifierCount() {
- return this.iQualis == null ? 0 : this.iQualis.length;
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#getQualifierValue(java.lang.String)
- */
- public Object getQualifierValue(String pName) {
- CIMQualifier> quali = getQualifier(pName);
- if (quali == null) return null;
- return quali.getValue();
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#getQualifiers()
- */
- public CIMQualifier>[] getQualifiers() {
- return getQualifiers(false);
- }
-
- /**
- * getQualifiers - helps filtering based on the propagated flag.
- *
- * @param pLocalOnly
- * @return CIMQualifier[]
- */
- public CIMQualifier>[] getQualifiers(boolean pLocalOnly) {
- if (this.iQualis == null) return EMPTY_QA;
- if (!pLocalOnly) return this.iQualis;
- if (this.iLocalOnlyQualis == null) {
- ArrayList> qualiL = new ArrayList>(this.iQualis.length);
- for (int i = 0; i < this.iQualis.length; i++)
- if (!this.iQualis[i].isPropagated()) qualiL.add(this.iQualis[i]);
- this.iLocalOnlyQualis = qualiL.toArray(new CIMQualifier[qualiL.size()]);
- }
- return this.iLocalOnlyQualis;
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#hasQualifier(java.lang.String)
- */
- public boolean hasQualifier(String pName) {
- return getQualifier(pName) != null;
- }
-
- /**
- * @see org.sentrysoftware.wbem.javax.cim.CIMQualifiedElementInterface#hasQualifierValue(java.lang.String,
- * java.lang.Object)
- */
- public boolean hasQualifierValue(String pName, Object pValue) {
- if (!hasQualifier(pName)) return false;
- Object value = getQualifierValue(pName);
- return value == null ? pValue == null : value.equals(pValue);
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2011
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, ebak@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-10-09 ebak Make SBLIM client JSR48 compliant
+ * 1660756 2007-02-22 ebak Embedded object support
+ * 1737141 2007-06-18 ebak Sync up with JSR48 evolution
+ * 1783288 2007-09-10 ebak CIMClass.isAssociation() not working for retrieved classes.
+ * 1796339 2007-10-01 ebak Serializable interface missing from internal componentry
+ * 1963102 2008-06-26 rgummada NullPointerException when getting qualifiers
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2620505 2009-02-24 rgummada EmbeddedObject qualifier is missing from CIMClass
+ * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
+ * 2823494 2009-08-03 rgummada Change Boolean constructor to static
+ * 2975885 2010-03-24 blaschke-oss TCK: CIMXXX.hasQualifierValue(null,null) returns true
+ * 3001680 2010-05-18 blaschke-oss CIMQualifierElementInterfaceImpl changes qualifiers
+ * 3023095 2010-07-01 blaschke-oss CIMQualifiedElementInterfaceImpl equals/hashCode issue
+ * 3154232 2011-01-13 blaschke-oss EmbeddedObject misspelled in javadoc
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.metricshub.wbem.javax.cim.CIMDataType;
+import org.metricshub.wbem.javax.cim.CIMQualifier;
+import org.metricshub.wbem.javax.cim.CIMFlavor;
+import org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface;
+
+/**
+ * Class CIMQualifiedElementInterfaceImpl is responsible for implementing the
+ * functionality of javax.cim.CIMQualifiedElementInterface
+ */
+public class CIMQualifiedElementInterfaceImpl implements CIMQualifiedElementInterface, Serializable {
+
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 4533301297060752510L;
+
+ private CIMQualifier>[] iQualis;
+
+ private CIMQualifier>[] iLocalOnlyQualis;
+
+ private boolean iEmbeddedObject;
+
+ private static final CIMQualifier KEY = new CIMQualifier("Key",
+ CIMDataType.BOOLEAN_T, Boolean.TRUE, CIMFlavor.DISABLEOVERRIDE);
+
+ private static final CIMQualifier ASSOCIATION = new CIMQualifier(
+ "Association", CIMDataType.BOOLEAN_T, Boolean.TRUE, CIMFlavor.DISABLEOVERRIDE);
+
+ private static final CIMQualifier>[] EMPTY_QA = new CIMQualifier[0];
+
+ /**
+ * Ctor. This constructor doesn't modify the passed qualifier list.
+ *
+ * @param pQualifiers
+ */
+ public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers) {
+ setQualis(pQualifiers);
+ }
+
+ /**
+ * Ctor. This constructor modifies the qualifier list according to the
+ * pIsKeyed flag.
+ *
+ * @param pQualifiers
+ * @param pIsKeyed
+ */
+ public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers, boolean pIsKeyed) {
+ this(pQualifiers, pIsKeyed, false);
+ }
+
+ /**
+ * Ctor. This constructor is able to not remove the EmbeddedObject
+ * qualifier. It is useful for the XML parser to parse EmbeddedObject
+ * qualified elements without values.
+ *
+ * @param pQualifiers
+ * @param pIsKeyed
+ * @param pKeepEmbObj
+ */
+ public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers, boolean pIsKeyed,
+ boolean pKeepEmbObj) {
+ this(pQualifiers, pIsKeyed, pKeepEmbObj, false);
+ }
+
+ /**
+ * Ctor. This constructor is able to not remove the EmbeddedObject
+ * qualifier. It is useful for the XML parser to parse EmbeddedObject
+ * qualified elements without values. It also adds or removes the
+ * Association qualifier depending on the value of pIsAssociation.
+ *
+ * @param pQualifiers
+ * @param pIsKeyed
+ * @param pKeepEmbObj
+ * @param pIsAssociation
+ */
+ public CIMQualifiedElementInterfaceImpl(CIMQualifier>[] pQualifiers, boolean pIsKeyed,
+ boolean pKeepEmbObj, boolean pIsAssociation) {
+ if (pKeepEmbObj) {
+ this.iQualis = (CIMQualifier[]) CIMElementSorter.sort(pQualifiers);
+ this.iEmbeddedObject = CIMElementSorter.findIdx(this.iQualis, "EmbeddedObject") >= 0;
+ } else {
+ setQualis(pQualifiers);
+ }
+ setBoolQualifier(KEY, pIsKeyed);
+ setBoolQualifier(ASSOCIATION, pIsAssociation);
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object pObj) {
+ if (!(pObj instanceof CIMQualifiedElementInterfaceImpl)) return false;
+ CIMQualifiedElementInterfaceImpl that = (CIMQualifiedElementInterfaceImpl) pObj;
+ return Arrays.equals(getQualifiers(), that.getQualifiers());
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(getQualifiers());
+ }
+
+ /**
+ * Sets the Qualifiers. If there is an EmbeddedObject qualifier,
+ * corresponding flag is set.
+ *
+ * @param pQualiA
+ */
+ private void setQualis(CIMQualifier>[] pQualiA) {
+ pQualiA = (CIMQualifier[]) CIMElementSorter.sort(pQualiA);
+ int rmIdx = CIMElementSorter.findIdx(pQualiA, "EmbeddedObject");
+ if (rmIdx < 0) {
+ this.iQualis = pQualiA;
+ return;
+ }
+ this.iEmbeddedObject = true;
+ this.iQualis = pQualiA;
+ }
+
+ /**
+ * if pValue is false and boolean qualifier exists it is removed.
+ * if pValue is true and boolean qualifier exists, it's value is changed to
+ * true, if boolean qualifier doesn't exist it is added.
+ *
+ * @param pQuali
+ * @param pValue
+ */
+ private void setBoolQualifier(CIMQualifier pQuali, boolean pValue) {
+ int idx = CIMElementSorter.findIdx(this.iQualis, pQuali.getName());
+ if (pValue) {
+ if (idx < 0) {
+ // insert the qualifier
+ // idx=-insertIdx-1
+ // insertIdx=-idx-1;
+ insertQuali(pQuali, -idx - 1);
+ } else if (!pQuali.getValue().equals(this.iQualis[idx].getValue())) {
+ // change the qualifier if value different
+ this.iQualis[idx] = pQuali;
+ }
+ } else {
+ if (idx > 0) {
+ // remove the existing qualifier
+ removeQuali(idx);
+ }
+ }
+ }
+
+ private void insertQuali(CIMQualifier pQuali, int idx) {
+ int origLength = this.iQualis == null ? 0 : this.iQualis.length;
+ CIMQualifier>[] qualis = new CIMQualifier[origLength + 1];
+ int srcIdx = 0, dstIdx = 0;
+ while (srcIdx < idx)
+ qualis[dstIdx++] = this.iQualis[srcIdx++];
+ qualis[dstIdx++] = pQuali;
+ while (srcIdx < origLength)
+ qualis[dstIdx++] = this.iQualis[srcIdx++];
+ this.iQualis = qualis;
+ }
+
+ private void removeQuali(int idx) {
+ CIMQualifier>[] qualis = new CIMQualifier[this.iQualis.length - 1];
+ int srcIdx = 0, dstIdx = 0;
+ while (srcIdx < idx)
+ qualis[dstIdx++] = this.iQualis[srcIdx++];
+ ++srcIdx;
+ while (srcIdx < this.iQualis.length)
+ qualis[dstIdx++] = this.iQualis[srcIdx++];
+ this.iQualis = qualis;
+ }
+
+ /*
+ * CIMQualifier( "Key", CIMDataType.BOOLEAN_T, new Boolean(true),
+ * CIMFlavor.DISABLEOVERRIDE );
+ */
+
+ /**
+ * Returns true if the "key" Qualifier with true value presents.
+ *
+ * @return true/false
+ */
+ public boolean isKeyed() {
+ return hasQualifierValue("key", Boolean.TRUE);
+ }
+
+ /**
+ * Returns true if the "EmbeddedObject" qualifier with true value presents.
+ *
+ * @return true/false
+ */
+ public boolean isEmbeddedObject() {
+ return this.iEmbeddedObject;
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#getQualifier(int)
+ */
+ public CIMQualifier> getQualifier(int pIndex) {
+ return this.iQualis[pIndex];
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#getQualifier(java.lang.String)
+ */
+ public CIMQualifier> getQualifier(String pName) {
+ return (CIMQualifier>) CIMElementSorter.find(this.iQualis, pName);
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#getQualifierCount()
+ */
+ public int getQualifierCount() {
+ return this.iQualis == null ? 0 : this.iQualis.length;
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#getQualifierValue(java.lang.String)
+ */
+ public Object getQualifierValue(String pName) {
+ CIMQualifier> quali = getQualifier(pName);
+ if (quali == null) return null;
+ return quali.getValue();
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#getQualifiers()
+ */
+ public CIMQualifier>[] getQualifiers() {
+ return getQualifiers(false);
+ }
+
+ /**
+ * getQualifiers - helps filtering based on the propagated flag.
+ *
+ * @param pLocalOnly
+ * @return CIMQualifier[]
+ */
+ public CIMQualifier>[] getQualifiers(boolean pLocalOnly) {
+ if (this.iQualis == null) return EMPTY_QA;
+ if (!pLocalOnly) return this.iQualis;
+ if (this.iLocalOnlyQualis == null) {
+ ArrayList> qualiL = new ArrayList>(this.iQualis.length);
+ for (int i = 0; i < this.iQualis.length; i++)
+ if (!this.iQualis[i].isPropagated()) qualiL.add(this.iQualis[i]);
+ this.iLocalOnlyQualis = qualiL.toArray(new CIMQualifier[qualiL.size()]);
+ }
+ return this.iLocalOnlyQualis;
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#hasQualifier(java.lang.String)
+ */
+ public boolean hasQualifier(String pName) {
+ return getQualifier(pName) != null;
+ }
+
+ /**
+ * @see org.metricshub.wbem.javax.cim.CIMQualifiedElementInterface#hasQualifierValue(java.lang.String,
+ * java.lang.Object)
+ */
+ public boolean hasQualifierValue(String pName, Object pValue) {
+ if (!hasQualifier(pName)) return false;
+ Object value = getQualifierValue(pName);
+ return value == null ? pValue == null : value.equals(pValue);
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMVersion.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMVersion.java
similarity index 77%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMVersion.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMVersion.java
index f8acb6a..bbd8836 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/CIMVersion.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/CIMVersion.java
@@ -1,158 +1,156 @@
-/*
- CIMVersion.java
-
- (C) Copyright IBM Corp. 2005, 2010
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
- * @author : Chung-hao Tan, IBM ,chungtan@us.ibm.com
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 2807325 2009-06-22 blaschke-oss Change licensing from CPL to EPL
- * 2834838 2009-08-11 blaschke-oss Add interface to retrieve version number and product name
- * 3027618 2010-07-14 blaschke-oss Close files/readers in finally blocks
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * Class CIMVersion is responsible for providing the exact version number,
- * product name, etc. of the Java CIM Client
- */
-public class CIMVersion {
-
- private static String PRODUCT_NAME = "n/a";
-
- private static String VERSION = "n/a";
-
- private static String COPYRIGHT = "n/a";
-
- private static String BUILDDATE = "n/a";
-
- private static String BUILDTIME = "n/a";
-
- static {
- Properties properties = new Properties();
- InputStream versionIS = null;
- try {
- versionIS = CIMVersion.class.getClassLoader().getResourceAsStream("com/sentrysoftware/sblim/cimclient/version.txt");
- properties.load(versionIS);
- PRODUCT_NAME = properties.getProperty("PRODUCTNAME");
- VERSION = properties.getProperty("VERSION");
- COPYRIGHT = properties.getProperty("COPYRIGHT");
- BUILDDATE = properties.getProperty("BUILDDATE");
- BUILDTIME = properties.getProperty("BUILDTIME");
- } catch (FileNotFoundException e) {
- System.out.println("Error: Could not open version.txt");
- } catch (IOException e) {
- System.out.println("Error while reading version.txt");
- } finally {
- if (versionIS != null) {
- try {
- versionIS.close();
- } catch (IOException e) {
- /* Ignore exception on close */
- }
- }
- }
- }
-
- /**
- * Gets the build date
- *
- * @return The build date
- */
- public static String getBuildDate() {
- return BUILDDATE;
- }
-
- /**
- * Gets the build time
- *
- * @return The build time
- */
- public static String getBuildTime() {
- return BUILDTIME;
- }
-
- /**
- * Gets the copyright statement
- *
- * @return THe copyright
- */
- public static String getCopyright() {
- return COPYRIGHT;
- }
-
- /**
- * Gets the product name
- *
- * @return The product name
- */
- public static String getProductName() {
- return PRODUCT_NAME;
- }
-
- /**
- * Gets the version
- *
- * @return The version
- */
- public static String getVersion() {
- return VERSION;
- }
-
- /**
- * toString
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return (PRODUCT_NAME + "\n" + VERSION + "\n" + COPYRIGHT + "\n" + BUILDDATE + "\n" + BUILDTIME);
- }
-
- /**
- * main
- *
- * @param args
- */
- public static void main(String[] args) {
- System.out.println(new CIMVersion());
- }
-}
+/*
+ CIMVersion.java
+
+ (C) Copyright IBM Corp. 2005, 2010
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
+ * @author : Chung-hao Tan, IBM ,chungtan@us.ibm.com
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 2807325 2009-06-22 blaschke-oss Change licensing from CPL to EPL
+ * 2834838 2009-08-11 blaschke-oss Add interface to retrieve version number and product name
+ * 3027618 2010-07-14 blaschke-oss Close files/readers in finally blocks
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Class CIMVersion is responsible for providing the exact version number,
+ * product name, etc. of the Java CIM Client
+ */
+public class CIMVersion {
+
+ private static String PRODUCT_NAME = "n/a";
+
+ private static String VERSION = "n/a";
+
+ private static String COPYRIGHT = "n/a";
+
+ private static String BUILDDATE = "n/a";
+
+ private static String BUILDTIME = "n/a";
+
+ static {
+ Properties properties = new Properties();
+ InputStream versionIS = null;
+ try {
+ versionIS = CIMVersion.class.getClassLoader().getResourceAsStream("org/sblim/cimclient/version.txt");
+ properties.load(versionIS);
+ PRODUCT_NAME = properties.getProperty("PRODUCTNAME");
+ VERSION = properties.getProperty("VERSION");
+ COPYRIGHT = properties.getProperty("COPYRIGHT");
+ BUILDDATE = properties.getProperty("BUILDDATE");
+ BUILDTIME = properties.getProperty("BUILDTIME");
+ } catch (FileNotFoundException e) {
+ System.out.println("Error: Could not open version.txt");
+ } catch (IOException e) {
+ System.out.println("Error while reading version.txt");
+ } finally {
+ if (versionIS != null) {
+ try {
+ versionIS.close();
+ } catch (IOException e) {
+ /* Ignore exception on close */
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets the build date
+ *
+ * @return The build date
+ */
+ public static String getBuildDate() {
+ return BUILDDATE;
+ }
+
+ /**
+ * Gets the build time
+ *
+ * @return The build time
+ */
+ public static String getBuildTime() {
+ return BUILDTIME;
+ }
+
+ /**
+ * Gets the copyright statement
+ *
+ * @return THe copyright
+ */
+ public static String getCopyright() {
+ return COPYRIGHT;
+ }
+
+ /**
+ * Gets the product name
+ *
+ * @return The product name
+ */
+ public static String getProductName() {
+ return PRODUCT_NAME;
+ }
+
+ /**
+ * Gets the version
+ *
+ * @return The version
+ */
+ public static String getVersion() {
+ return VERSION;
+ }
+
+ /**
+ * toString
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return (PRODUCT_NAME + "\n" + VERSION + "\n" + COPYRIGHT + "\n" + BUILDDATE + "\n" + BUILDTIME);
+ }
+
+ /**
+ * main
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println(new CIMVersion());
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/DTStringReader.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/DTStringReader.java
similarity index 84%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/DTStringReader.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/DTStringReader.java
index 4fc3f3e..bd669b0 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/DTStringReader.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/DTStringReader.java
@@ -1,208 +1,206 @@
-/*
- (C) Copyright IBM Corp. 2006, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-10-12 ebak Make SBLIM client JSR48 compliant
- * 1678807 2007-03-12 ebak Minor CIMDateTime suggestions
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 3526675 2012-05-14 blaschke-oss Unit test fails on Java 7
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.IOException;
-import java.io.StringReader;
-
-/**
- * Class DTString helps parsing CIMDateTime Strings.
- *
- */
-public class DTStringReader {
-
- private String iDateTimeStr;
-
- private StringReader iReader;
-
- private int iPos = 0;
-
- private boolean iUnsignificant;
-
- /**
- * Ctor.
- *
- * @param pDateTimeStr
- */
- public DTStringReader(String pDateTimeStr) {
- this.iDateTimeStr = pDateTimeStr;
- this.iReader = new StringReader(pDateTimeStr);
- }
-
- /**
- * read
- *
- * @param pLen
- * - number of characters to be read from the string
- * @param pFieldName
- * - the name of the field which is to be read (e.g. year, month,
- * day ...)
- * @param pAllowUnsignificant
- * @return int
- * @throws IllegalArgumentException
- */
- public int read(int pLen, String pFieldName, boolean pAllowUnsignificant)
- throws IllegalArgumentException {
- char[] buf = new char[pLen];
- int read;
- try {
- read = this.iReader.read(buf);
- this.iPos += pLen;
- } catch (IOException e) {
- String msg = "Failed to read " + pFieldName + " field from " + this.iDateTimeStr + '!';
- throw new IllegalArgumentException(msg);
- }
- if (read != pLen) {
- String msg = "Length of " + pFieldName + " field should be " + pLen + " but only"
- + read + " characters could be read!";
- throw new IllegalArgumentException(msg);
- }
- // Not significant check
- if (pAllowUnsignificant) {
- int cnt = 0;
- for (int i = 0; i < buf.length; i++)
- if (buf[i] == '*') ++cnt;
- if (cnt == buf.length) {
- this.iUnsignificant = true;
- return -1;
- }
- }
- this.iUnsignificant = false;
- String field = new String(buf);
- int res;
- try {
- res = Integer.parseInt(field);
- } catch (NumberFormatException e) {
- String msg = "Illegal " + pFieldName + " field \"" + field + "\" in \""
- + this.iDateTimeStr + "\"!";
- throw new IllegalArgumentException(msg);
- }
- if (res < 0) throw new IllegalArgumentException("Negative value is not allowed for "
- + pFieldName + " in " + this.iDateTimeStr + "!");
- // Java 7 parseInt began allowing plus sign
- if (field.indexOf('+') != -1) throw new IllegalArgumentException(
- "Plus sign is not allowed for " + pFieldName + " in " + this.iDateTimeStr + "!");
- return res;
- }
-
- /**
- * readAndCheck
- *
- * @param pLen
- * - number of digits to read
- * @param pFieldName
- * - the name of the field which is to be read (e.g. year, month,
- * day...)
- * @param pMin
- * - the allowed minimum value (-1 is always allowed as not
- * significant)
- * @param pMax
- * - the allowed maximum value
- * @param pAllowUnsignificant
- * @return int
- * @throws IllegalArgumentException
- */
- public int readAndCheck(int pLen, String pFieldName, int pMin, int pMax,
- boolean pAllowUnsignificant) throws IllegalArgumentException {
- int val = read(pLen, pFieldName, pAllowUnsignificant);
- if (pAllowUnsignificant && val == -1) return val;
- if (val < pMin || val > pMax) throw new IllegalArgumentException(pFieldName
- + " must be between " + pMin + " and " + pMax + ", but " + val + " was read from "
- + this.iDateTimeStr + " !");
- return val;
- }
-
- /**
- * read
- *
- * @return a char, 0 if failed
- */
- public char read() {
- try {
- int i = this.iReader.read();
- if (i > 0) {
- ++this.iPos;
- return (char) i;
- }
- return 0;
- } catch (IOException e) {
- return 0;
- }
- }
-
- /**
- * read - Throws an IllegalArgumentException if the read character is not c.
- *
- * @param c
- * - contains the character which should be read from the String.
- * @throws IllegalArgumentException
- */
- public void read(char c) throws IllegalArgumentException {
- if (read() != c) {
- String msg = "'" + c + "' expected at position " + getPos() + " in "
- + this.iDateTimeStr + "!";
- throw new IllegalArgumentException(msg);
- }
- }
-
- /**
- * getPos
- *
- * @return the position in the reader
- */
- public int getPos() {
- return this.iPos;
- }
-
- /**
- * isUnsignificant
- *
- * @return boolean
- */
- public boolean isUnsignificant() {
- return this.iUnsignificant;
- }
-
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, ebak@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-10-12 ebak Make SBLIM client JSR48 compliant
+ * 1678807 2007-03-12 ebak Minor CIMDateTime suggestions
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 3526675 2012-05-14 blaschke-oss Unit test fails on Java 7
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.IOException;
+import java.io.StringReader;
+
+/**
+ * Class DTString helps parsing CIMDateTime Strings.
+ *
+ */
+public class DTStringReader {
+
+ private String iDateTimeStr;
+
+ private StringReader iReader;
+
+ private int iPos = 0;
+
+ private boolean iUnsignificant;
+
+ /**
+ * Ctor.
+ *
+ * @param pDateTimeStr
+ */
+ public DTStringReader(String pDateTimeStr) {
+ this.iDateTimeStr = pDateTimeStr;
+ this.iReader = new StringReader(pDateTimeStr);
+ }
+
+ /**
+ * read
+ *
+ * @param pLen
+ * - number of characters to be read from the string
+ * @param pFieldName
+ * - the name of the field which is to be read (e.g. year, month,
+ * day ...)
+ * @param pAllowUnsignificant
+ * @return int
+ * @throws IllegalArgumentException
+ */
+ public int read(int pLen, String pFieldName, boolean pAllowUnsignificant)
+ throws IllegalArgumentException {
+ char[] buf = new char[pLen];
+ int read;
+ try {
+ read = this.iReader.read(buf);
+ this.iPos += pLen;
+ } catch (IOException e) {
+ String msg = "Failed to read " + pFieldName + " field from " + this.iDateTimeStr + '!';
+ throw new IllegalArgumentException(msg);
+ }
+ if (read != pLen) {
+ String msg = "Length of " + pFieldName + " field should be " + pLen + " but only"
+ + read + " characters could be read!";
+ throw new IllegalArgumentException(msg);
+ }
+ // Not significant check
+ if (pAllowUnsignificant) {
+ int cnt = 0;
+ for (int i = 0; i < buf.length; i++)
+ if (buf[i] == '*') ++cnt;
+ if (cnt == buf.length) {
+ this.iUnsignificant = true;
+ return -1;
+ }
+ }
+ this.iUnsignificant = false;
+ String field = new String(buf);
+ int res;
+ try {
+ res = Integer.parseInt(field);
+ } catch (NumberFormatException e) {
+ String msg = "Illegal " + pFieldName + " field \"" + field + "\" in \""
+ + this.iDateTimeStr + "\"!";
+ throw new IllegalArgumentException(msg);
+ }
+ if (res < 0) throw new IllegalArgumentException("Negative value is not allowed for "
+ + pFieldName + " in " + this.iDateTimeStr + "!");
+ // Java 7 parseInt began allowing plus sign
+ if (field.indexOf('+') != -1) throw new IllegalArgumentException(
+ "Plus sign is not allowed for " + pFieldName + " in " + this.iDateTimeStr + "!");
+ return res;
+ }
+
+ /**
+ * readAndCheck
+ *
+ * @param pLen
+ * - number of digits to read
+ * @param pFieldName
+ * - the name of the field which is to be read (e.g. year, month,
+ * day...)
+ * @param pMin
+ * - the allowed minimum value (-1 is always allowed as not
+ * significant)
+ * @param pMax
+ * - the allowed maximum value
+ * @param pAllowUnsignificant
+ * @return int
+ * @throws IllegalArgumentException
+ */
+ public int readAndCheck(int pLen, String pFieldName, int pMin, int pMax,
+ boolean pAllowUnsignificant) throws IllegalArgumentException {
+ int val = read(pLen, pFieldName, pAllowUnsignificant);
+ if (pAllowUnsignificant && val == -1) return val;
+ if (val < pMin || val > pMax) throw new IllegalArgumentException(pFieldName
+ + " must be between " + pMin + " and " + pMax + ", but " + val + " was read from "
+ + this.iDateTimeStr + " !");
+ return val;
+ }
+
+ /**
+ * read
+ *
+ * @return a char, 0 if failed
+ */
+ public char read() {
+ try {
+ int i = this.iReader.read();
+ if (i > 0) {
+ ++this.iPos;
+ return (char) i;
+ }
+ return 0;
+ } catch (IOException e) {
+ return 0;
+ }
+ }
+
+ /**
+ * read - Throws an IllegalArgumentException if the read character is not c.
+ *
+ * @param c
+ * - contains the character which should be read from the String.
+ * @throws IllegalArgumentException
+ */
+ public void read(char c) throws IllegalArgumentException {
+ if (read() != c) {
+ String msg = "'" + c + "' expected at position " + getPos() + " in "
+ + this.iDateTimeStr + "!";
+ throw new IllegalArgumentException(msg);
+ }
+ }
+
+ /**
+ * getPos
+ *
+ * @return the position in the reader
+ */
+ public int getPos() {
+ return this.iPos;
+ }
+
+ /**
+ * isUnsignificant
+ *
+ * @return boolean
+ */
+ public boolean isUnsignificant() {
+ return this.iUnsignificant;
+ }
+
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/DTStringWriter.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/DTStringWriter.java
similarity index 76%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/DTStringWriter.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/DTStringWriter.java
index 1bb1dfe..095d3bc 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/DTStringWriter.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/DTStringWriter.java
@@ -1,134 +1,132 @@
-/*
- (C) Copyright IBM Corp. 2006, 2010
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Endre Bak, ebak@de.ibm.com
- *
- * Flag Date Prog Description
- * -------------------------------------------------------------------------------
- * 1565892 2006-10-12 ebak Make SBLIM client JSR48 compliant
- * 1678807 2007-03-12 ebak Minor CIMDateTime suggestions
- * 1849235 2008-02-11 blaschke-oss DTStringWriter.writeSigned parameter pDigits is not used
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2989367 2010-04-29 blaschke-oss CIMDateTimeInterval(long) constructor range wrong
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cim;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Arrays;
-
-/**
- * Class DTStringWriter helps making CIMDateTime Strings.
- */
-public class DTStringWriter {
-
- private StringBuffer iBuf = new StringBuffer();
-
- /**
- * writeInt - writes an integer, the upper digits are filled with zeros
- *
- * @param pNum
- * -1 means that asterisks have to be printed
- * @param pDigits
- */
- public void write(int pDigits, int pNum) {
- if (pDigits <= 0) return;
- if (pNum == -1) {
- char[] cA = new char[pDigits];
- Arrays.fill(cA, '*');
- this.iBuf.append(cA);
- return;
- }
- String str = Integer.toString(pNum);
- int paddingDigits = pDigits - str.length();
- if (paddingDigits > 0) {
- char[] cA = new char[paddingDigits];
- Arrays.fill(cA, '0');
- this.iBuf.append(cA).append(str);
- } else this.iBuf.append(str);
- }
-
- /**
- * writeSignedInt - used for utc writing
- *
- * @param pNum
- * @param pDigits
- */
- public void writeSigned(int pDigits, int pNum) {
- char sign;
- if (pNum < 0) {
- sign = '-';
- pNum = -pNum;
- } else sign = '+';
- write(sign);
- write(pDigits, pNum);
- }
-
- /**
- * writeUSec
- *
- * @param pUSec
- * @param pUnsignificantDigits
- */
- public void writeUSec(int pUSec, int pUnsignificantDigits) {
- int digits = 6 - pUnsignificantDigits;
- write(digits, pUSec);
- for (int i = 0; i < pUnsignificantDigits; i++)
- write('*');
- }
-
- /**
- * writeChar
- *
- * @param pChar
- */
- public void write(char pChar) {
- this.iBuf.append(pChar);
- }
-
- /**
- * write
- *
- * @param pStr
- */
- public void write(String pStr) {
- this.iBuf.append(pStr);
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return this.iBuf.toString();
- }
-}
+/*
+ (C) Copyright IBM Corp. 2006, 2010
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Endre Bak, ebak@de.ibm.com
+ *
+ * Flag Date Prog Description
+ * -------------------------------------------------------------------------------
+ * 1565892 2006-10-12 ebak Make SBLIM client JSR48 compliant
+ * 1678807 2007-03-12 ebak Minor CIMDateTime suggestions
+ * 1849235 2008-02-11 blaschke-oss DTStringWriter.writeSigned parameter pDigits is not used
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2989367 2010-04-29 blaschke-oss CIMDateTimeInterval(long) constructor range wrong
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cim;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Arrays;
+
+/**
+ * Class DTStringWriter helps making CIMDateTime Strings.
+ */
+public class DTStringWriter {
+
+ private StringBuffer iBuf = new StringBuffer();
+
+ /**
+ * writeInt - writes an integer, the upper digits are filled with zeros
+ *
+ * @param pNum
+ * -1 means that asterisks have to be printed
+ * @param pDigits
+ */
+ public void write(int pDigits, int pNum) {
+ if (pDigits <= 0) return;
+ if (pNum == -1) {
+ char[] cA = new char[pDigits];
+ Arrays.fill(cA, '*');
+ this.iBuf.append(cA);
+ return;
+ }
+ String str = Integer.toString(pNum);
+ int paddingDigits = pDigits - str.length();
+ if (paddingDigits > 0) {
+ char[] cA = new char[paddingDigits];
+ Arrays.fill(cA, '0');
+ this.iBuf.append(cA).append(str);
+ } else this.iBuf.append(str);
+ }
+
+ /**
+ * writeSignedInt - used for utc writing
+ *
+ * @param pNum
+ * @param pDigits
+ */
+ public void writeSigned(int pDigits, int pNum) {
+ char sign;
+ if (pNum < 0) {
+ sign = '-';
+ pNum = -pNum;
+ } else sign = '+';
+ write(sign);
+ write(pDigits, pNum);
+ }
+
+ /**
+ * writeUSec
+ *
+ * @param pUSec
+ * @param pUnsignificantDigits
+ */
+ public void writeUSec(int pUSec, int pUnsignificantDigits) {
+ int digits = 6 - pUnsignificantDigits;
+ write(digits, pUSec);
+ for (int i = 0; i < pUnsignificantDigits; i++)
+ write('*');
+ }
+
+ /**
+ * writeChar
+ *
+ * @param pChar
+ */
+ public void write(char pChar) {
+ this.iBuf.append(pChar);
+ }
+
+ /**
+ * write
+ *
+ * @param pStr
+ */
+ public void write(String pStr) {
+ this.iBuf.append(pStr);
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return this.iBuf.toString();
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/package.html b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/package.html
similarity index 100%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cim/package.html
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cim/package.html
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java
similarity index 93%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java
index 326bd35..d9ea7ad 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java
@@ -1,2635 +1,2634 @@
-/*
- (C) Copyright IBM Corp. 2005, 2013
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
- * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
- *
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 13521 2004-11-26 thschaef XML Request Composition for static method call is wrong
- * 18075 2005-08-11 pineiro5 Can not use method CIMClient.invokeMethod
- * 1535756 2006-08-07 lupusalex Make code warning free
- * 1365086 2006-10-25 ebak Possible bug in createQualifier
- * 1565892 2006-11-16 lupusalex Make SBLIM client JSR48 compliant
- * 1610046 2006-12-18 lupusalex Does not escape trailing spaces
- * 1610046 2007-01-10 lupusalex Rework: Does not escape trailing spaces
- * 1649611 2007-01-31 lupusalex Interop issue: Quotes not escaped by client
- * 1671502 2007-02-28 lupusalex Remove dependency from Xerces
- * 1660756 2007-03-02 ebak Embedded object support
- * 1689085 2007-04-10 ebak Embedded object enhancements for Pegasus
- * 1669961 2006-04-16 lupusalex CIMTypedElement.getType() =>getDataType()
- * 1715027 2007-05-08 lupusalex Make message id random
- * 1719991 2007-05-16 ebak FVT: regression ClassCastException in EmbObjHandler
- * 1734888 2007-06-11 ebak Wrong reference building in METHODCALL request
- * 1827728 2007-11-12 ebak embeddedInstances: attribute EmbeddedObject not set
- * 1827728 2007-11-20 ebak rework: embeddedInstances: attribute EmbeddedObject not set
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
- * 2845211 2009-08-27 raman_arora Pull Enumeration Feature (SAX Parser)
- * 2865222 2009-09-29 raman_arora enumerateQualifierTypes shouldn't require a class name
- * 2858933 2009-10-12 raman_arora JSR48 new APIs: associatorClasses & associatorInstances
- * 2886829 2009-11-18 raman_arora JSR48 new APIs: referenceClasses & referenceInstances
- * 2944219 2010-02-05 blaschke-oss Problem with pull operations using client against EMC CIMOM
- * 3027479 2010-07-09 blaschke-oss Dead store to local variable
- * 3062747 2010-09-21 blaschke-oss SblimCIMClient does not log all CIM-XML responces.
- * 3514537 2012-04-03 blaschke-oss TCK: execQueryInstances requires boolean, not Boolean
- * 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors
- * 3527580 2012-05-17 blaschke-oss WBEMClient should not throw IllegalArgumentException
- * 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing
- * 2616 2013-02-23 blaschke-oss Add new API WBEMClientSBLIM.sendIndication()
- * 2689 2013-10-10 blaschke-oss createMETHODCALL should not add PARAMTYPE attribute
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cimxml;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.Random;
-import java.util.Vector;
-
-import org.sentrysoftware.wbem.javax.cim.CIMArgument;
-import org.sentrysoftware.wbem.javax.cim.CIMClass;
-import org.sentrysoftware.wbem.javax.cim.CIMDataType;
-import org.sentrysoftware.wbem.javax.cim.CIMInstance;
-import org.sentrysoftware.wbem.javax.cim.CIMNamedElementInterface;
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-import org.sentrysoftware.wbem.javax.cim.CIMProperty;
-import org.sentrysoftware.wbem.javax.cim.CIMQualifierType;
-import org.sentrysoftware.wbem.javax.cim.CIMValuedElement;
-import org.sentrysoftware.wbem.javax.cim.UnsignedInteger32;
-import org.sentrysoftware.wbem.javax.wbem.WBEMException;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.sentrysoftware.wbem.sblim.cimclient.internal.logging.TimeStamp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.util.MOF;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.CIMError;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMAssociatorNamesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMAssociatorsOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateClassOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateInstanceOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateNameSpaceOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateQualifierTypeOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteClassOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteInstanceOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteQualifierTypeOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumClassNamesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumClassesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumInstanceNamesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumInstancesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumNameSpaceOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumQualifierTypesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMExecQueryOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMGetClassOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMGetInstanceOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMGetPropertyOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMGetQualifierTypeOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMInvokeMethodOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMOperation;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMReferenceNamesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMReferencesOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMSetClassOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMSetInstanceOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMSetPropertyOp;
-import org.sentrysoftware.wbem.sblim.cimclient.internal.wbem.operations.CIMSetQualifierTypeOp;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Class CIMClientXML_HelperImpl is responsible for building CIM-XML requests
- * and responses.
- */
-public class CIMClientXML_HelperImpl {
-
- private static class Counter {
-
- private int iCounter;
-
- protected Counter(int pCounter) {
- this.iCounter = pCounter;
- }
-
- protected int incrementAndGet() {
- return ++this.iCounter;
- }
- }
-
- private static final String VERSION = "1.0";
-
- private static final String ASSOCIATOR_NAMES = "AssociatorNames";
-
- // Pull Enumeration variables
- private static final String ASSOC_CLASS = "AssocClass";
-
- private static final String CLASS_NAME = "ClassName";
-
- private static final String CONTINUE_ON_ERROR = "ContinueOnError";
-
- private static final String DEEP_INHERITANCE = "DeepInheritance";
-
- private static final String ENUMERATION_CONTEXT = "EnumerationContext";
-
- private static final String FILTER_QUERY_LANGUAGE = "FilterQueryLanguage";
-
- private static final String FILTER_QUERY = "FilterQuery";
-
- private static final String INCLUDE_CLASS_ORIGIN = "IncludeClassOrigin";
-
- private static final String INSTANCE_NAME = "InstanceName";
-
- private static final String MAX_OBJECT_COUNT = "MaxObjectCount";
-
- private static final String PROPERTY_LIST = "PropertyList";
-
- private static final String OPERATION_TIMEOUT = "OperationTimeout";
-
- private static final String RESULT_CLASS = "ResultClass";
-
- private static final String RETURN_QUERY_RESULT_CLASS = "ReturnQueryResultClass";
-
- private static final String QUERY_RESULT_CLASS = "QueryResultClass";
-
- private static final String ROLE = "Role";
-
- private static final String RESULT_ROLE = "ResultRole";
-
- private static final Random RANDOM = new Random();
-
- private static final int MAX_ID = 1 << 20;
-
- private final ThreadLocal iCurrentId = new ThreadLocal();
-
- private final DocumentBuilder iBuilder;
-
- private static String valueStr(CIMValuedElement> pE) {
- Object o = pE.getValue();
- return o == null ? MOF.NULL : o.toString();
- }
-
- /**
- * Ctor.
- *
- * @throws ParserConfigurationException
- */
- public CIMClientXML_HelperImpl() throws ParserConfigurationException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- this.iBuilder = factory.newDocumentBuilder();
- }
-
- /**
- * getDocumentBuilder
- *
- * @return DocumentBuilder
- */
- public DocumentBuilder getDocumentBuilder() {
- return this.iBuilder;
- }
-
- /**
- * newDocument
- *
- * @return Document
- */
- public Document newDocument() {
- return this.iBuilder.newDocument();
- }
-
- /**
- * parse
- *
- * @param pIS
- * @return Document
- * @throws IOException
- * @throws SAXException
- */
- public Document parse(InputSource pIS) throws IOException, SAXException {
- if (pIS == null) throw new IllegalArgumentException("null input stream argument");
- return this.iBuilder.parse(pIS);
- }
-
- /**
- * Serializes a given DOM document as (CIM-)XML to a given output stream
- *
- * @param pOS
- * The output stream
- * @param pDoc
- * The documents
- * @throws IOException
- * Whenever something goes wrong
- */
- public static void serialize(OutputStream pOS, Document pDoc) throws IOException {
- CimXmlSerializer.serialize(pOS, pDoc, false);
- }
-
- /**
- * Serializes a given DOM document as (CIM-)XML to a given output stream.
- * The document is pretty wrapped and indented and surrounded with markers
- * for the begin and end.
- *
- * @param pOS
- * The output stream
- * @param pDoc
- * The documents
- * @throws IOException
- */
- public static void dumpDocument(OutputStream pOS, Document pDoc) throws IOException {
- dumpDocument(pOS, pDoc, null);
- }
-
- /**
- * Serializes a given DOM document as (CIM-)XML to a given output stream.
- * The document is pretty wrapped and indented and surrounded with markers
- * for the begin and end.
- *
- * @param pOS
- * The output stream
- * @param pDoc
- * The documents
- * @param pOrigin
- * The origin of the output stream (request, indication response,
- * etc.)
- * @throws IOException
- */
- public static void dumpDocument(OutputStream pOS, Document pDoc, String pOrigin)
- throws IOException {
- // debug
- if (pOS == null) { return; }
- if (pOrigin == null) pOrigin = "unknown";
- pOS.write("<--- ".getBytes());
- pOS.write(pOrigin.getBytes());
- pOS.write(" begin ".getBytes());
- pOS.write(TimeStamp.formatWithMillis(System.currentTimeMillis()).getBytes());
- pOS.write(" -----\n".getBytes());
- CimXmlSerializer.serialize(pOS, pDoc, true);
- pOS.write("\n---- ".getBytes());
- pOS.write(pOrigin.getBytes());
- pOS.write(" end ------>\n".getBytes());
- }
-
- /**
- * createCIMMessage
- *
- * @param pDoc
- * @param pRequestE
- * @return Element
- */
- public Element createCIMMessage(Document pDoc, Element pRequestE) {
- Element cimE = CIMXMLBuilderImpl.createCIM(pDoc);
- Element messageE = CIMXMLBuilderImpl.createMESSAGE(pDoc, cimE, String.valueOf(getNextId()),
- VERSION);
- if (pRequestE != null) {
- messageE.appendChild(pRequestE);
- }
- return messageE;
- }
-
- /**
- * createMultiReq
- *
- * @param pDoc
- * @return Element
- */
- public Element createMultiReq(Document pDoc) {
- Element multireqE = CIMXMLBuilderImpl.createMULTIREQ(pDoc);
- return multireqE;
- }
-
- /**
- * associatorNames_request
- *
- * @param pDoc
- * @param pObjectName
- * @param pAssocClass
- * @param pResultClass
- * @param pRole
- * @param pResultRole
- * @return Element
- * @throws WBEMException
- */
- public Element associatorNames_request(Document pDoc, CIMObjectPath pObjectName,
- String pAssocClass, String pResultClass, String pRole, String pResultRole)
- throws WBEMException {
-
- // obtain data
- String className = pObjectName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
- CIMProperty>[] keysA = pObjectName.getKeys();
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- ASSOCIATOR_NAMES);
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
-
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
- for (int i = 0; i < keysA.length; i++) {
- CIMProperty> prop = keysA[i];
- String propName = prop.getName();
- // TODO: check that CIMDataType.toString() satisfies this
- String propTypeStr = prop.getDataType().toString();
- String propValueStr = valueStr(prop);
- Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
- CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
- }
- if (pAssocClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
- }
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pResultRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
- }
-
- return simplereqE;
- }
-
- /**
- * associatorNames_response
- *
- * @param pDoc
- * @param pPathA
- * @return Element
- */
- public static Element associatorNames_response(Document pDoc, CIMObjectPath[] pPathA) {
- Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
- Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
- "associatorNames");
- Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
- try {
- for (int i = 0; i < pPathA.length; i++) {
- CIMXMLBuilderImpl.createOBJECTPATH(pDoc, iRetValE, pPathA[i]);
- }
- } catch (WBEMException e) {
- throw new RuntimeException(e);
- }
- return simpRspE;
- }
-
- /**
- * associatorInstances_request
- *
- * @param pDoc
- * @param pObjectName
- * @param pAssocClass
- * @param pResultClass
- * @param pRole
- * @param pResultRole
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element associatorInstances_request(Document pDoc, CIMObjectPath pObjectName,
- String pAssocClass, String pResultClass, String pRole, String pResultRole,
- boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
-
- String className = pObjectName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
- CIMProperty>[] keysA = pObjectName.getKeys();
-
- // Make sure keys are populated
- if (keysA.length == 0) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "associatorInstances requires keys for the instance to be populated");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
- for (int i = 0; i < keysA.length; i++) {
- CIMProperty> prop = keysA[i];
- String propName = prop.getName();
- String propTypeStr = prop.getDataType().toString();
- String propValueStr = valueStr(prop);
-
- Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
- CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
- }
- if (pAssocClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
- }
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pResultRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
- }
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * associatorClasses_request
- *
- * @param pDoc
- * @param pObjectName
- * @param pAssocClass
- * @param pResultClass
- * @param pRole
- * @param pResultRole
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element associatorClasses_request(Document pDoc, CIMObjectPath pObjectName,
- String pAssocClass, String pResultClass, String pRole, String pResultRole,
- boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
- throws WBEMException {
-
- String className = pObjectName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- // Make sure keys are not populated
- if (pObjectName.getKeys().length != 0) throw new WBEMException(
- WBEMException.CIM_ERR_INVALID_PARAMETER,
- "Keys should not be populated for associatorClasses");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
-
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
-
- if (pAssocClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
- }
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pResultRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
- }
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * associators_request
- *
- * @param pDoc
- * @param pObjectName
- * @param pAssocClass
- * @param pResultClass
- * @param pRole
- * @param pResultRole
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element associators_request(Document pDoc, CIMObjectPath pObjectName,
- String pAssocClass, String pResultClass, String pRole, String pResultRole,
- boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
- throws WBEMException {
-
- // obtain data
- String className = pObjectName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
- CIMProperty>[] keysA = pObjectName.getKeys();
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
- for (int i = 0; i < keysA.length; i++) {
- CIMProperty> prop = keysA[i];
- String propName = prop.getName();
- // TODO: check that CIMDataType.toString() satisfies this
- String propTypeStr = prop.getDataType().toString();
- // CIMXMLBuilderImpl.getTypeStr(pValue.getType());
- String propValueStr = valueStr(prop);
-
- Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
- CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
- }
- if (pAssocClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
- }
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pResultRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
- }
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList"); // BB
- // fixed
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * associators_response
- *
- * @param pDoc
- * @param pNamedElementA
- * @return Element
- */
- public static Element associators_response(Document pDoc,
- CIMNamedElementInterface[] pNamedElementA) {
- Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
- Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "associators");
- Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
- try {
- for (int i = 0; i < pNamedElementA.length; i++) {
- CIMNamedElementInterface namedElement = pNamedElementA[i];
- CIMObjectPath op = namedElement.getObjectPath();
- String nameSpace = op == null ? null : op.getNamespace();
- CIMXMLBuilderImpl
- .createVALUEOBJECTWITHPATH(pDoc, iRetValE, namedElement, nameSpace);
- /*
- * CIMXMLBuilderImpl.createCLASSPATH( pDoc, iRetValE,
- * pClassA[i].getObjectPath() );
- * CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClassA[i]);
- */
-
- }
- } catch (WBEMException e) {
- throw new RuntimeException(e);
- }
- return simpRspE;
- }
-
- /**
- * enumerateInstanceNames_request
- *
- * @param pDoc
- * @param pPath
- * @return Element
- * @throws WBEMException
- */
- public Element enumerateInstanceNames_request(Document pDoc, CIMObjectPath pPath)
- throws WBEMException {
- // obtain data
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "EnumerateInstanceNames");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
-
- return simplereqE;
- }
-
- /**
- * enumerateInstances_request
- *
- * @param pDoc
- * @param pPath
- * @param pDeepInheritance
- * @param pLocalOnly
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element enumerateInstances_request(Document pDoc, CIMObjectPath pPath,
- boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
- boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
-
- // obtain data
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "EnumerateInstances");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
- return simplereqE;
- }
-
- /**
- * getInstance_request
- *
- * @param pDoc
- * @param pName
- * @param pLocalOnly
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element getInstance_request(Document pDoc, CIMObjectPath pName, boolean pLocalOnly,
- boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
- throws WBEMException {
- // obtain data
- String className = pName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetInstance");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "InstanceName");
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * deleteInstance_request
- *
- * @param pDoc
- * @param pName
- * @return Element
- * @throws WBEMException
- */
- public Element deleteInstance_request(Document pDoc, CIMObjectPath pName) throws WBEMException {
-
- // obtain data
- String className = pName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "DeleteInstance");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "InstanceName");
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
-
- return simplereqE;
- }
-
- /**
- * getClass_request
- *
- * @param pDoc
- * @param pName
- * @param pLocalOnly
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element getClass_request(Document pDoc, CIMObjectPath pName, boolean pLocalOnly,
- boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
- throws WBEMException {
-
- // obtain data
- String className = pName.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetClass");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * createInstance_request
- *
- * @param pDoc
- * @param pName
- * @param pInstance
- * @return Element
- * @throws WBEMException
- */
- public Element createInstance_request(Document pDoc, CIMObjectPath pName, CIMInstance pInstance)
- throws WBEMException {
-
- String className = pInstance.getObjectPath().getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "CreateInstance");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "NewInstance");
-
- CIMXMLBuilderImpl.createINSTANCE(pDoc, iparamvalueE, pInstance);
-
- return simplereqE;
- }
-
- /**
- * invokeMethod_request
- *
- * @param pDoc
- * @param pLocalPath
- * @param pMethodName
- * @param pInArgs
- * @return Element
- * @throws WBEMException
- */
- public Element invokeMethod_request(Document pDoc, CIMObjectPath pLocalPath,
- String pMethodName, CIMArgument>[] pInArgs) throws WBEMException {
-
- // obtain data
- String className = pLocalPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
- CIMProperty>[] keysA = pLocalPath.getKeys();
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element methodcallE = CIMXMLBuilderImpl.createMETHODCALL(pDoc, simplereqE, pMethodName);
-
- // 13521
- if (keysA.length > 0) {
- Element localpathE = CIMXMLBuilderImpl.createLOCALINSTANCEPATH(pDoc, methodcallE);
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, localpathE, pLocalPath); // 13521
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, localpathE, pLocalPath); // 13521
- } else {
- CIMXMLBuilderImpl.createLOCALCLASSPATH(pDoc, methodcallE, pLocalPath);
- }
-
- buildParamValues(pDoc, methodcallE, pLocalPath, pInArgs);
-
- return simplereqE;
- }
-
- /**
- * invokeMethod_response
- *
- * @param pDoc
- * @param pMethodName
- * @param pLocalPath
- * @param pRetVal
- * @param pOutArgA
- * @return Element
- * @throws WBEMException
- */
- public static Element invokeMethod_response(Document pDoc, String pMethodName,
- CIMObjectPath pLocalPath, Object pRetVal, CIMArgument>[] pOutArgA)
- throws WBEMException {
- if (pMethodName == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null method name");
- Element simpleRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
- Element methodRspE = CIMXMLBuilderImpl.createMETHODRESPONSE(pDoc, simpleRspE, pMethodName);
-
- CIMXMLBuilderImpl.createRETURNVALUE(pDoc, methodRspE, pRetVal);
-
- buildParamValues(pDoc, methodRspE, pLocalPath, pOutArgA);
- return simpleRspE;
- }
-
- /**
- * @param pLocalPath
- */
- private static void buildParamValues(Document pDoc, Element pParentE, CIMObjectPath pLocalPath,
- CIMArgument>[] pArgA) throws WBEMException {
- if (pArgA == null) return;
- for (int i = 0; i < pArgA.length; i++) {
- CIMArgument> arg = pArgA[i];
- if (arg == null) continue;
- CIMXMLBuilderImpl.createPARAMVALUE(pDoc, pParentE, arg);
- }
- }
-
- // public CIMResponse createIndication_request(Document doc) throws
- // CIMXMLParseException, CIMException {
- // Element rootE = doc.getDocumentElement();
- // CIMResponse response = (CIMResponse)xmlParser.parseCIM(rootE);
- // response.checkError();
- // return response;
- // // Vector v = (Vector)response.getFirstReturnValue();
- // //
- // // //TODO: Should we return the whole list of instances or just the first
- // instance?
- // // //TODO: return the whole vector of indications
- // // if (v.size() > 0)
- // // return (CIMInstance)v.elementAt(0);
- // // else
- // // return null;
- // }
-
- /**
- * createIndication_response
- *
- * @param error
- * @return Document
- */
- public Document createIndication_response(CIMError error) {
-
- // CIMXMLBuilderImpl.create XML
- Document doc = this.iBuilder.newDocument();
- Element cimE = CIMXMLBuilderImpl.createCIM(doc);
- Element messageE = CIMXMLBuilderImpl.createMESSAGE(doc, cimE, String.valueOf(getNextId()),
- "1.0");
- Element simpleexprspE = CIMXMLBuilderImpl.createSIMPLEEXPRSP(doc, messageE);
- Element expmethodresponseE = CIMXMLBuilderImpl.createEXPMETHODRESPONSE(doc, simpleexprspE,
- "ExportIndication");
- if (error == null) {
- CIMXMLBuilderImpl.createIRETURNVALUE(doc, expmethodresponseE);
- } else {
- CIMXMLBuilderImpl.createERROR(doc, expmethodresponseE, error);
- }
- // Element
- return doc;
- }
-
- /**
- * createClass_request
- *
- * @param pDoc
- * @param pPath
- * @param pClass
- * @return Element
- * @throws WBEMException
- */
- public Element createClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass)
- throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "CreateClass");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewClass");
-
- CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
-
- return simplereqE;
- }
-
- /**
- * getQualifier_request
- *
- * @param pDoc
- * @param pPath
- * @param pQt
- * @return Element
- * @throws WBEMException
- */
- public Element getQualifier_request(Document pDoc, CIMObjectPath pPath, String pQt)
- throws WBEMException {
- // obtain data
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl
- .createIMETHODCALL(pDoc, simplereqE, "GetQualifier");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "QualifierName");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
-
- return simplereqE;
- }
-
- /**
- * createQualifierType_request : This has been replaced by
- * setQualifierType_request
- *
- * @param pDoc
- * @param pPath
- * @param pQt
- * @return Element
- * @throws WBEMException
- */
- public Element createQualifierType_request(Document pDoc, CIMObjectPath pPath,
- CIMQualifierType> pQt) throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl
- .createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "QualifierDeclaration");
- CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
-
- return simplereqE;
- }
-
- /**
- * deleteClass_request
- *
- * @param pDoc
- * @param pPath
- * @return Element
- * @throws WBEMException
- */
- public Element deleteClass_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "DeleteClass");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
-
- CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
-
- return simplereqE;
- }
-
- /**
- * deleteQualifierType_request
- *
- * @param pDoc
- * @param pPath
- * @return Element
- * @throws WBEMException
- */
- public Element deleteQualifierType_request(Document pDoc, CIMObjectPath pPath)
- throws WBEMException {
- // obtain data
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "DeleteQualifier");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "QualifierName");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
- return simplereqE;
- }
-
- /**
- * enumerateClasses_request
- *
- * @param pDoc
- * @param pPath
- * @param pDeepInheritance
- * @param pLocalOnly
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @return Element
- */
- public Element enumerateClasses_request(Document pDoc, CIMObjectPath pPath,
- boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
- boolean pIncludeClassOrigin) {
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "EnumerateClasses");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
- if (pPath != null && pPath.getObjectName() != null
- && pPath.getObjectName().trim().length() != 0) {
- String className = pPath.getObjectName();
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
- }
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
- return simplereqE;
- }
-
- /**
- * enumerateClasses_response
- *
- * @param pDoc
- * @param pClA
- * @return Element
- */
- public static Element enumerateClasses_response(Document pDoc, CIMClass[] pClA) {
- Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
- Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
- "enumerateClasses");
- Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
- try {
- for (int i = 0; i < pClA.length; i++) {
- CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClA[i]);
- }
- } catch (WBEMException e) {
- throw new RuntimeException(e);
- }
- return simpRspE;
- }
-
- /**
- * enumerateInstances_response
- *
- * @param pDoc
- * @param pInstA
- * @return Element
- */
- public static Element enumerateInstances_response(Document pDoc, CIMInstance[] pInstA) {
- Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
- Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
- "enumerateInstances");
- Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
- try {
- for (int i = 0; i < pInstA.length; i++) {
- CIMXMLBuilderImpl.createINSTANCE(pDoc, iRetValE, pInstA[i]);
- }
- } catch (WBEMException e) {
- throw new RuntimeException(e);
- }
- return simpRspE;
- }
-
- /**
- * enumerateClassNames_request
- *
- * @param pDoc
- * @param pPath
- * @param pDeepInheritance
- * @return Element
- */
- public Element enumerateClassNames_request(Document pDoc, CIMObjectPath pPath,
- boolean pDeepInheritance) {
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "EnumerateClassNames");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
-
- if (pPath != null && pPath.getObjectName() != null
- && pPath.getObjectName().trim().length() != 0) {
- String className = pPath.getObjectName();
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
-
- return simplereqE;
- }
-
- /**
- * getProperty_request
- *
- * @param pDoc
- * @param pPath
- * @param pPropertyName
- * @return Element
- * @throws WBEMException
- */
- public Element getProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName)
- throws WBEMException {
- // obtain data
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetProperty");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "InstanceName");
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
-
- if (pPropertyName != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
- }
-
- return simplereqE;
- }
-
- /**
- * referenceNames_request
- *
- * @param pDoc
- * @param pPath
- * @param pResultClass
- * @param pRole
- * @return Element
- * @throws WBEMException
- */
- public Element referenceNames_request(Document pDoc, CIMObjectPath pPath, String pResultClass,
- String pRole) throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "ReferenceNames");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
-
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
-
- return simplereqE;
- }
-
- /**
- * referenceClasses_request
- *
- * @param pDoc
- * @param pPath
- * @param pResultClass
- * @param pRole
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element referenceClasses_request(Document pDoc, CIMObjectPath pPath,
- String pResultClass, String pRole, boolean pIncludeQualifiers,
- boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- // Make sure keys are not populated
- if (pPath.getKeys().length != 0) throw new WBEMException(
- WBEMException.CIM_ERR_INVALID_PARAMETER,
- "Keys should not be populated for referenceClasses");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- // createOBJECTNAME will internally call createINSTANCENAME but as there
- // are no keys Element containing keys will not be populated
- CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
-
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
- return simplereqE;
- }
-
- /**
- * referenceInstances_request
- *
- * @param pDoc
- * @param pPath
- * @param pResultClass
- * @param pRole
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element referenceInstances_request(Document pDoc, CIMObjectPath pPath,
- String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList)
- throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- // keys are required for CIMInstance
- if (pPath.getKeys().length == 0) throw new WBEMException(
- WBEMException.CIM_ERR_INVALID_PARAMETER,
- "refrenceInstances requires keys for the instance to be populated");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- // createOBJECTNAME will internally call createINSTANCENAME to populate
- // Element containing keys
- CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
-
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
- return simplereqE;
- }
-
- /**
- * references_request
- *
- * @param pDoc
- * @param pPath
- * @param pResultClass
- * @param pRole
- * @param pIncludeQualifiers
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element references_request(Document pDoc, CIMObjectPath pPath, String pResultClass,
- String pRole, boolean pIncludeQualifiers, boolean pIncludeClassOrigin,
- String[] pPropertyList) throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
- CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
-
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * setClass_request
- *
- * @param pDoc
- * @param pPath
- * @param pClass
- * @return Element
- * @throws WBEMException
- */
- public Element setClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass)
- throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ModifyClass");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "ModifiedClass");
- CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
-
- return simplereqE;
- }
-
- /**
- * setInstance_request
- *
- * @param pDoc
- * @param pPath
- * @param pInstance
- * @param pIncludeQualifiers
- * @param pPropertyList
- * @return Element
- * @throws WBEMException
- */
- public Element setInstance_request(Document pDoc, CIMObjectPath pPath, CIMInstance pInstance,
- boolean pIncludeQualifiers, String[] pPropertyList) throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "ModifyInstance");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "ModifiedInstance");
- CIMXMLBuilderImpl.createVALUENAMEDINSTANCE(pDoc, iparamvalueE, pPath, pInstance);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++) {
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- }
-
- return simplereqE;
- }
-
- /**
- * setProperty_request
- *
- * @param pDoc
- * @param pPath
- * @param pPropertyName
- * @param pNewValue
- * @return Element
- * @throws WBEMException
- */
- public Element setProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName,
- Object pNewValue) throws WBEMException {
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "SetProperty");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "InstanceName");
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
-
- if (pPropertyName != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
- }
-
- if (pNewValue != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewValue");
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pNewValue);
- }
-
- return simplereqE;
- }
-
- /**
- * setQualifierType_request
- *
- * @param pDoc
- * @param pPath
- * @param pQt
- * @return Element
- * @throws WBEMException
- */
- public Element setQualifierType_request(Document pDoc, CIMObjectPath pPath,
- CIMQualifierType> pQt) throws WBEMException {
- // Make sure class name exists, it is required to uniquely identify
- // qualifier in namespace
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl
- .createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "QualifierDeclaration");
- CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
-
- return simplereqE;
- }
-
- /**
- * enumQualifierTypes_request
- *
- * @param pDoc
- * @param pPath
- * @return Element
- * @throws WBEMException
- */
- public Element enumQualifierTypes_request(Document pDoc, CIMObjectPath pPath)
- throws WBEMException {
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "EnumerateQualifiers");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- return simplereqE;
- }
-
- /**
- * enumQualifierTypes_response
- *
- * @param pDoc
- * @param pQualiTypeA
- * @return Element
- * @throws WBEMException
- */
- public static Element enumQualifierTypes_response(Document pDoc,
- CIMQualifierType>[] pQualiTypeA) throws WBEMException {
- Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
- Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
- "associatorNames");
- Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
- for (int i = 0; i < pQualiTypeA.length; i++) {
- CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iRetValE, pQualiTypeA[i]);
- }
- return simpRspE;
- }
-
- /**
- * execQuery_request
- *
- * @param pDoc
- * @param pPath
- * @param pQuery
- * @param pQueryLanguage
- * @return Element
- */
- public Element execQuery_request(Document pDoc, CIMObjectPath pPath, String pQuery,
- String pQueryLanguage) {
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ExecQuery");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element querylanguageE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- "QueryLanguage");
- CIMXMLBuilderImpl.createVALUE(pDoc, querylanguageE, pQueryLanguage);
-
- Element queryE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Query");
- CIMXMLBuilderImpl.createVALUE(pDoc, queryE, pQuery);
-
- return simplereqE;
- }
-
- /**
- * performBatchOperation_request
- *
- * @param pDoc
- * @param pOperations
- * @return Element
- * @throws WBEMException
- */
- public Element performBatchOperation_request(Document pDoc, Vector pOperations)
- throws WBEMException {
-
- Element messageE = createCIMMessage(pDoc, null);
- if (pOperations.size() > 1) {
- Element multireqE = createMultiReq(pDoc);
- messageE.appendChild(multireqE);
- messageE = multireqE;
- }
- int i = 0;
- Iterator iter = pOperations.iterator();
- while (iter.hasNext()) {
- CIMOperation op = iter.next();
- try {
- Element requestE = null;
-
- if (op instanceof CIMAssociatorsOp) {
- CIMAssociatorsOp associatorsOp = (CIMAssociatorsOp) op;
- requestE = associators_request(pDoc, associatorsOp.getObjectName(),
- associatorsOp.getAssocClass(), associatorsOp.getResultClass(),
- associatorsOp.getRole(), associatorsOp.getResultRole(), associatorsOp
- .isIncludeQualifiers(), associatorsOp.isIncludeClassOrigin(),
- associatorsOp.getPropertyList());
- } else if (op instanceof CIMAssociatorNamesOp) {
- CIMAssociatorNamesOp associatorNamesOp = (CIMAssociatorNamesOp) op;
- requestE = associatorNames_request(pDoc, associatorNamesOp.getObjectName(),
- associatorNamesOp.getAssocClass(), associatorNamesOp.getResultClass(),
- associatorNamesOp.getRole(), associatorNamesOp.getResultRole());
- } else if (op instanceof CIMCreateClassOp) {
- CIMCreateClassOp createClassOp = (CIMCreateClassOp) op;
- requestE = createClass_request(pDoc, createClassOp.getObjectName(),
- createClassOp.getCimClass());
- } else if (op instanceof CIMCreateInstanceOp) {
- CIMCreateInstanceOp createInstanceOp = (CIMCreateInstanceOp) op;
- requestE = createInstance_request(pDoc, createInstanceOp.getObjectName(),
- createInstanceOp.getInstance());
- } else if (op instanceof CIMCreateNameSpaceOp) {
- CIMCreateNameSpaceOp createNameSpaceOp = (CIMCreateNameSpaceOp) op;
-
- String namespace = createNameSpaceOp.getNameSpace();
- int j = namespace.lastIndexOf('/');
-
- if (j < 0) throw new WBEMException(WBEMException.CIM_ERR_NOT_FOUND,
- "Invalid namespace. Must contain at least /");
- String parentNs = namespace.substring(0, j);
- namespace = namespace.substring(j + 1);
-
- /*
- * CIMInstance inst = new CIMInstance();
- * inst.setClassName("CIM_NameSpace"); CIMProperty prop =
- * new CIMProperty("NameSpace"); prop.setValue(new
- * CIMValue(namespace, CIMDataType
- * .getPredefinedType(CIMDataType.STRING))); Vector v = new
- * Vector(); v.add(prop); inst.setProperties(v);
- */
-
- CIMInstance inst = new CIMInstance(new CIMObjectPath(null, null, null, null,
- "CIM_NameSpace", null), new CIMProperty[] { new CIMProperty(
- "NameSpace", CIMDataType.STRING_T, namespace, true, false, null) });
- CIMObjectPath object = new CIMObjectPath(null, null, null, parentNs, null, null);
-
- requestE = createInstance_request(pDoc, object, inst);
- } else if (op instanceof CIMCreateQualifierTypeOp) {
- CIMCreateQualifierTypeOp createQualifierTypeOp = (CIMCreateQualifierTypeOp) op;
- requestE = createQualifierType_request(pDoc, createQualifierTypeOp
- .getObjectName(), createQualifierTypeOp.getQualifierType());
- } else if (op instanceof CIMDeleteClassOp) {
- CIMDeleteClassOp deleteClassOp = (CIMDeleteClassOp) op;
- requestE = deleteClass_request(pDoc, deleteClassOp.getObjectName());
- } else if (op instanceof CIMDeleteInstanceOp) {
- CIMDeleteInstanceOp deleteInstanceOp = (CIMDeleteInstanceOp) op;
- requestE = deleteClass_request(pDoc, deleteInstanceOp.getObjectName());
- } else if (op instanceof CIMDeleteQualifierTypeOp) {
- CIMDeleteQualifierTypeOp deleteQualifierTypeOp = (CIMDeleteQualifierTypeOp) op;
- requestE = deleteClass_request(pDoc, deleteQualifierTypeOp.getObjectName());
- } else if (op instanceof CIMEnumClassesOp) {
- CIMEnumClassesOp enumClassesOp = (CIMEnumClassesOp) op;
- requestE = enumerateClasses_request(pDoc, enumClassesOp.getObjectName(),
- enumClassesOp.isDeep(), enumClassesOp.isLocalOnly(), enumClassesOp
- .isIncludeQualifiers(), enumClassesOp.isIncludeClassOrigin());
- } else if (op instanceof CIMEnumClassNamesOp) {
- CIMEnumClassNamesOp enumClassNamesOp = (CIMEnumClassNamesOp) op;
- requestE = enumerateClassNames_request(pDoc, enumClassNamesOp.getObjectName(),
- enumClassNamesOp.isDeep());
- } else if (op instanceof CIMEnumInstanceNamesOp) {
- CIMEnumInstanceNamesOp enumInstanceNamesOp = (CIMEnumInstanceNamesOp) op;
- requestE = enumerateInstanceNames_request(pDoc, enumInstanceNamesOp
- .getObjectName());
- } else if (op instanceof CIMEnumInstancesOp) {
- CIMEnumInstancesOp enumInstancesOp = (CIMEnumInstancesOp) op;
- requestE = enumerateInstances_request(pDoc, enumInstancesOp.getObjectName(),
- enumInstancesOp.isDeep(), enumInstancesOp.isLocalOnly(),
- enumInstancesOp.isIncludeQualifiers(), enumInstancesOp
- .isIncludeClassOrigin(), enumInstancesOp.getPropertyList());
- } else if (op instanceof CIMEnumNameSpaceOp) {
- CIMEnumNameSpaceOp enumNameSpaceOp = (CIMEnumNameSpaceOp) op;
- // ebak: here we have to set CIMObjectPath's objectname
- // enumNameSpaceOp.getObjectName().setObjectName("CIM_NameSpace");
- CIMObjectPath objPath = enumNameSpaceOp.getObjectName();
- objPath = new CIMObjectPath(objPath.getScheme(), objPath.getHost(), objPath
- .getPort(), objPath.getNamespace(), "CIM_NameSpace", objPath.getKeys());
- requestE = enumerateInstanceNames_request(pDoc, enumNameSpaceOp.getObjectName());
- } else if (op instanceof CIMEnumQualifierTypesOp) {
- CIMEnumQualifierTypesOp enumQualifierTypesOp = (CIMEnumQualifierTypesOp) op;
- requestE = enumQualifierTypes_request(pDoc, enumQualifierTypesOp
- .getObjectName());
- } else if (op instanceof CIMExecQueryOp) {
- CIMExecQueryOp execQueryOp = (CIMExecQueryOp) op;
- requestE = execQuery_request(pDoc, execQueryOp.getObjectName(), execQueryOp
- .getQuery(), execQueryOp.getQueryLanguage());
- } else if (op instanceof CIMGetPropertyOp) {
- CIMGetPropertyOp getPropertyOp = (CIMGetPropertyOp) op;
- requestE = getInstance_request(pDoc, getPropertyOp.getObjectName(), false,
- false, false, new String[] { getPropertyOp.getPropertyName() });
-
- } else if (op instanceof CIMGetClassOp) {
- CIMGetClassOp getClassOp = (CIMGetClassOp) op;
- requestE = getClass_request(pDoc, getClassOp.getObjectName(), getClassOp
- .isLocalOnly(), getClassOp.isIncludeQualifiers(), getClassOp
- .isIncludeClassOrigin(), getClassOp.getPropertyList());
- } else if (op instanceof CIMGetInstanceOp) {
- CIMGetInstanceOp getInstanceOp = (CIMGetInstanceOp) op;
- requestE = getInstance_request(pDoc, getInstanceOp.getObjectName(),
- getInstanceOp.isLocalOnly(), getInstanceOp.isIncludeQualifiers(),
- getInstanceOp.isIncludeClassOrigin(), getInstanceOp.getPropertyList());
- } else if (op instanceof CIMGetQualifierTypeOp) {
- CIMGetQualifierTypeOp getQualifierTypeOp = (CIMGetQualifierTypeOp) op;
- requestE = getQualifier_request(pDoc, getQualifierTypeOp.getObjectName(),
- getQualifierTypeOp.getQualifierType());
- } else if (op instanceof CIMInvokeMethodOp) {
- CIMInvokeMethodOp invokeMethodOp = (CIMInvokeMethodOp) op;
- requestE = invokeMethod_request(pDoc, invokeMethodOp.getObjectName(),
- invokeMethodOp.getMethodCall(), invokeMethodOp.getInParams());
- } else if (op instanceof CIMReferenceNamesOp) {
- CIMReferenceNamesOp referenceNamesOp = (CIMReferenceNamesOp) op;
- requestE = referenceNames_request(pDoc, referenceNamesOp.getObjectName(),
- referenceNamesOp.getResultClass(), referenceNamesOp.getResultRole());
- } else if (op instanceof CIMReferencesOp) {
- CIMReferencesOp referencesOp = (CIMReferencesOp) op;
- requestE = references_request(pDoc, referencesOp.getObjectName(), referencesOp
- .getResultClass(), referencesOp.getRole(), referencesOp
- .isIncludeQualifiers(), referencesOp.isIncludeClassOrigin(),
- referencesOp.getPropertyList());
- } else if (op instanceof CIMSetClassOp) {
- CIMSetClassOp setClassOp = (CIMSetClassOp) op;
- requestE = setClass_request(pDoc, setClassOp.getObjectName(), setClassOp
- .getCimClass());
- } else if (op instanceof CIMSetInstanceOp) {
- CIMSetInstanceOp setInstanceOp = (CIMSetInstanceOp) op;
- requestE = setInstance_request(pDoc, setInstanceOp.getObjectName(),
- setInstanceOp.getInstance(), setInstanceOp.isIncludeQualifiers(),
- setInstanceOp.getPropertyList());
- } else if (op instanceof CIMSetPropertyOp) {
- CIMSetPropertyOp setPropertyOp = (CIMSetPropertyOp) op;
- requestE = setProperty_request(pDoc, setPropertyOp.getObjectName(),
- setPropertyOp.getPropertyName(), setPropertyOp.getCimValue());
- } else if (op instanceof CIMSetQualifierTypeOp) {
- CIMSetQualifierTypeOp setQualifierTypeOp = (CIMSetQualifierTypeOp) op;
- requestE = setQualifierType_request(pDoc, setQualifierTypeOp.getObjectName(),
- setQualifierTypeOp.getQualifierType());
- }
- if (requestE == null) throw new WBEMException(
- WBEMException.CIM_ERR_INVALID_PARAMETER, "Illegal batch operation number ("
- + i + ") " + op.getClass());
- messageE.appendChild(requestE);
- } catch (WBEMException e) {
- throw e;
- } catch (Exception e) {
- throw new WBEMException(WBEMException.CIM_ERR_FAILED, "At batch operation (" + i
- + ')', null, e);
- }
- i++;
- }
- return messageE;
- }
-
- /**
- * Sets the message id counter to a given value. For use in units tests
- * only.
- *
- * @param pId
- * The new value
- */
- public void setId(int pId) {
- this.iCurrentId.set(new Counter(pId - 1));
- }
-
- /**
- * Get the next message id. If this method is called for the first time by
- * the current thread it will choose a start value randomly. Afterwards the
- * id is incremented by 1. Be aware that different threads will have
- * distinct id counters.
- *
- * @return The next message id
- */
- private int getNextId() {
- if (this.iCurrentId.get() == null) {
- this.iCurrentId.set(new Counter(RANDOM.nextInt(MAX_ID)));
- }
- return this.iCurrentId.get().incrementAndGet();
- }
-
- /**
- * pAssociatorPaths_request
- *
- * @param pDoc
- * @param pPath
- * @param pAssocClass
- * @param pResultClass
- * @param pRole
- * @param pResultRole
- * @param pFilterQueryLanguage
- * @param pFilterQuery
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @return Element
- * @throws WBEMException
- */
- public Element OpenAssociatorInstancePaths_request(Document pDoc, CIMObjectPath pPath,
- String pAssocClass, String pResultClass, String pRole, String pResultRole,
- String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
- boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenAssociatorInstancePaths");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- INSTANCE_NAME);
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
-
- if (pAssocClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
- }
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pResultRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
- }
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * OpenAssociatorInstances_request
- *
- * @param pDoc
- * @param pPath
- * @param pAssocClass
- * @param pResultClass
- * @param pRole
- * @param pResultRole
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @param pFilterQueryLanguage
- * @param pFilterQuery
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @return Element OpenAssociatorInstances_request
- * @throws WBEMException
- */
- public Element OpenAssociatorInstances_request(Document pDoc, CIMObjectPath pPath,
- String pAssocClass, String pResultClass, String pRole, String pResultRole,
- boolean pIncludeClassOrigin, String[] pPropertyList, String pFilterQueryLanguage,
- String pFilterQuery, UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
- UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
-
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenAssociatorInstances");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- INSTANCE_NAME);
- // createINSTANCENAME will take care of keyBindings
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
-
- if (pAssocClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
- }
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pResultRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
- }
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++)
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * OpenEnumerateInstancePaths_request
- *
- * @param pDoc
- * @param pPath
- * @param pFilterQueryLanguage
- * @param pFilterQuery
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @return Element
- * @throws WBEMException
- */
- public Element OpenEnumerateInstancePaths_request(Document pDoc, CIMObjectPath pPath,
- String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
- boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenEnumerateInstancePaths");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
-
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * OpenEnumerateInstances_request
- *
- * @param pDoc
- * @param pPath
- * @param pPropertyList
- * @param pIncludeClassOrigin
- * @param pDeepInheritance
- * @param pFilterQueryLanguage
- * @param pFilterQuery
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @return Element
- * @throws WBEMException
- */
- public Element OpenEnumerateInstances_request(Document pDoc, CIMObjectPath pPath,
- boolean pDeepInheritance, boolean pIncludeClassOrigin, String[] pPropertyList,
- String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
- boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenEnumerateInstances");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, DEEP_INHERITANCE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++)
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
-
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * EnumerationCount_request
- *
- * @param pDoc
- * @param pPath
- * @param pEnumerationContext
- * @return Element
- * @throws WBEMException
- */
- public Element EnumerationCount_request(Document pDoc, CIMObjectPath pPath,
- String pEnumerationContext) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "EnumerationCount");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- if (pEnumerationContext != null) {
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- ENUMERATION_CONTEXT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
- }
-
- return simplereqE;
-
- }
-
- /**
- * CloseEnumeration_request
- *
- * @param pDoc
- * @param pPath
- * @param pEnumerationContext
- * @return Element
- * @throws WBEMException
- */
- public Element CloseEnumeration_request(Document pDoc, CIMObjectPath pPath,
- String pEnumerationContext) throws WBEMException {
-
- String className = pPath.getObjectName();
-
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "CloseEnumeration");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- if (pEnumerationContext != null) {
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- ENUMERATION_CONTEXT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
- }
- return simplereqE;
- }
-
- /**
- * referencePaths_request
- *
- * @param pDoc
- * @param pPath
- * @param pResultClass
- * @param pRole
- * @param pFilterQueryLanguage
- * @param pFilterQuery
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @return Element referencePaths_request
- * @throws WBEMException
- */
- public Element OpenReferenceInstancePaths_request(Document pDoc, CIMObjectPath pPath,
- String pResultClass, String pRole, String pFilterQueryLanguage, String pFilterQuery,
- UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
- UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenReferenceInstancePaths");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- INSTANCE_NAME);
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
-
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
-
- }
-
- /**
- * references_request
- *
- * @param pDoc
- * @param pPath
- * @param pResultClass
- * @param pRole
- * @param pIncludeClassOrigin
- * @param pPropertyList
- * @param pFilterQueryLanguage
- * @param pFilterQuery
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @return Element references_request
- * @throws WBEMException
- */
- public Element OpenReferenceInstances_request(Document pDoc, CIMObjectPath pPath,
- String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList,
- String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
- boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenReferenceInstances");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- INSTANCE_NAME);
- CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
-
- if (pResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
- CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
- }
- if (pRole != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
- }
-
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
-
- if (pPropertyList != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
- Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
- for (int i = 0; i < pPropertyList.length; i++)
- CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
- }
-
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * OpenQueryInstances_request
- *
- * @param pDoc
- * @param pPath
- * @param pFilterQuery
- * @param pFilterQueryLanguage
- * @param pReturnQueryResultClass
- * @param pOperationTimeout
- * @param pContinueOnError
- * @param pMaxObjectCount
- * @param pQueryResultClass
- * @return Element OpenQueryInstances_request
- * @throws WBEMException
- */
- public Element OpenQueryInstances_request(Document pDoc, CIMObjectPath pPath,
- String pFilterQuery, String pFilterQueryLanguage, boolean pReturnQueryResultClass,
- UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
- UnsignedInteger32 pMaxObjectCount, CIMClass pQueryResultClass) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "OpenQueryInstances");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
-
- if (pFilterQuery != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
- }
- if (pFilterQueryLanguage != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- FILTER_QUERY_LANGUAGE);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
- }
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- RETURN_QUERY_RESULT_CLASS);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pReturnQueryResultClass);
-
- if (pOperationTimeout != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- OPERATION_TIMEOUT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
- }
-
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
- if (pQueryResultClass != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- QUERY_RESULT_CLASS);
- CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pQueryResultClass);
- }
- return simplereqE;
- }
-
- /**
- * PullInstancesWithPath_request
- *
- * @param pDoc
- * @param pPath
- * @param pContext
- * @param pMaxObjectCount
- * @return Element PullInstancesWithPath_request
- * @throws WBEMException
- */
- public Element PullInstancesWithPath_request(Document pDoc, CIMObjectPath pPath,
- String pContext, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "PullInstancesWithPath");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
-
- if (pContext != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- ENUMERATION_CONTEXT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
- }
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * PullInstancePaths_request
- *
- * @param pDoc
- * @param pPath
- * @param pContext
- * @param pMaxObjectCount
- * @return Element PullInstancePaths
- * @throws WBEMException
- */
- public Element PullInstancePaths_request(Document pDoc, CIMObjectPath pPath, String pContext,
- UnsignedInteger32 pMaxObjectCount) throws WBEMException {
-
- String className = pPath.getObjectName();
-
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "PullInstancePaths");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
-
- if (pContext != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- ENUMERATION_CONTEXT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
- }
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * PullInstances_request
- *
- * @param pDoc
- * @param pPath
- * @param pContext
- * @param pMaxObjectCount
- * @return Element PullInstances_request
- * @throws WBEMException
- */
- public Element PullInstances_request(Document pDoc, CIMObjectPath pPath, String pContext,
- UnsignedInteger32 pMaxObjectCount) throws WBEMException {
- String className = pPath.getObjectName();
-
- if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
- "null class name");
-
- Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
- Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
- "PullInstances");
- CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
-
- Element iparamvalueE;
-
- if (pContext != null) {
- iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
- ENUMERATION_CONTEXT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
- }
-
- if (pMaxObjectCount != null) {
- iparamvalueE = CIMXMLBuilderImpl
- .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
- CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
- }
-
- return simplereqE;
- }
-
- /**
- * sendIndication_request
- *
- * @param pDoc
- * @param pIndication
- * @return Element sendIndication_request
- * @throws WBEMException
- */
- public Element sendIndication_request(Document pDoc, CIMInstance pIndication)
- throws WBEMException {
- Element simpleexpreqE = CIMXMLBuilderImpl.createSIMPLEEXPREQ(pDoc);
- Element expmethodcallE = CIMXMLBuilderImpl.createEXPMETHODCALL(pDoc, simpleexpreqE,
- "ExportIndication");
- Element expparamvalueE = CIMXMLBuilderImpl.createEXPPARAMVALUE(pDoc, expmethodcallE,
- "NewIndication");
-
- CIMXMLBuilderImpl.createINSTANCE(pDoc, expparamvalueE, pIndication);
-
- return simpleexpreqE;
- }
-}
+/*
+ (C) Copyright IBM Corp. 2005, 2013
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
+ * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
+ *
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 13521 2004-11-26 thschaef XML Request Composition for static method call is wrong
+ * 18075 2005-08-11 pineiro5 Can not use method CIMClient.invokeMethod
+ * 1535756 2006-08-07 lupusalex Make code warning free
+ * 1365086 2006-10-25 ebak Possible bug in createQualifier
+ * 1565892 2006-11-16 lupusalex Make SBLIM client JSR48 compliant
+ * 1610046 2006-12-18 lupusalex Does not escape trailing spaces
+ * 1610046 2007-01-10 lupusalex Rework: Does not escape trailing spaces
+ * 1649611 2007-01-31 lupusalex Interop issue: Quotes not escaped by client
+ * 1671502 2007-02-28 lupusalex Remove dependency from Xerces
+ * 1660756 2007-03-02 ebak Embedded object support
+ * 1689085 2007-04-10 ebak Embedded object enhancements for Pegasus
+ * 1669961 2006-04-16 lupusalex CIMTypedElement.getType() =>getDataType()
+ * 1715027 2007-05-08 lupusalex Make message id random
+ * 1719991 2007-05-16 ebak FVT: regression ClassCastException in EmbObjHandler
+ * 1734888 2007-06-11 ebak Wrong reference building in METHODCALL request
+ * 1827728 2007-11-12 ebak embeddedInstances: attribute EmbeddedObject not set
+ * 1827728 2007-11-20 ebak rework: embeddedInstances: attribute EmbeddedObject not set
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
+ * 2845211 2009-08-27 raman_arora Pull Enumeration Feature (SAX Parser)
+ * 2865222 2009-09-29 raman_arora enumerateQualifierTypes shouldn't require a class name
+ * 2858933 2009-10-12 raman_arora JSR48 new APIs: associatorClasses & associatorInstances
+ * 2886829 2009-11-18 raman_arora JSR48 new APIs: referenceClasses & referenceInstances
+ * 2944219 2010-02-05 blaschke-oss Problem with pull operations using client against EMC CIMOM
+ * 3027479 2010-07-09 blaschke-oss Dead store to local variable
+ * 3062747 2010-09-21 blaschke-oss SblimCIMClient does not log all CIM-XML responces.
+ * 3514537 2012-04-03 blaschke-oss TCK: execQueryInstances requires boolean, not Boolean
+ * 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors
+ * 3527580 2012-05-17 blaschke-oss WBEMClient should not throw IllegalArgumentException
+ * 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing
+ * 2616 2013-02-23 blaschke-oss Add new API WBEMClientSBLIM.sendIndication()
+ * 2689 2013-10-10 blaschke-oss createMETHODCALL should not add PARAMTYPE attribute
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cimxml;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.Random;
+import java.util.Vector;
+
+import org.metricshub.wbem.javax.cim.CIMArgument;
+import org.metricshub.wbem.javax.cim.CIMClass;
+import org.metricshub.wbem.javax.cim.CIMDataType;
+import org.metricshub.wbem.javax.cim.CIMInstance;
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+import org.metricshub.wbem.javax.cim.CIMQualifierType;
+import org.metricshub.wbem.javax.cim.CIMValuedElement;
+import org.metricshub.wbem.javax.wbem.WBEMException;
+import org.metricshub.wbem.sblim.cimclient.internal.logging.TimeStamp;
+import org.metricshub.wbem.sblim.cimclient.internal.util.MOF;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.CIMError;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMAssociatorNamesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMAssociatorsOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateClassOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateInstanceOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateNameSpaceOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMCreateQualifierTypeOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteClassOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteInstanceOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMDeleteQualifierTypeOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumClassNamesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumClassesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumInstanceNamesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumInstancesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumNameSpaceOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMEnumQualifierTypesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMExecQueryOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetClassOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetInstanceOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetPropertyOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMGetQualifierTypeOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMInvokeMethodOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMOperation;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMReferenceNamesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMReferencesOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetClassOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetInstanceOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetPropertyOp;
+import org.metricshub.wbem.sblim.cimclient.internal.wbem.operations.CIMSetQualifierTypeOp;
+import org.metricshub.wbem.javax.cim.CIMNamedElementInterface;
+import org.metricshub.wbem.javax.cim.CIMProperty;
+import org.metricshub.wbem.javax.cim.UnsignedInteger32;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Class CIMClientXML_HelperImpl is responsible for building CIM-XML requests
+ * and responses.
+ */
+public class CIMClientXML_HelperImpl {
+
+ private static class Counter {
+
+ private int iCounter;
+
+ protected Counter(int pCounter) {
+ this.iCounter = pCounter;
+ }
+
+ protected int incrementAndGet() {
+ return ++this.iCounter;
+ }
+ }
+
+ private static final String VERSION = "1.0";
+
+ private static final String ASSOCIATOR_NAMES = "AssociatorNames";
+
+ // Pull Enumeration variables
+ private static final String ASSOC_CLASS = "AssocClass";
+
+ private static final String CLASS_NAME = "ClassName";
+
+ private static final String CONTINUE_ON_ERROR = "ContinueOnError";
+
+ private static final String DEEP_INHERITANCE = "DeepInheritance";
+
+ private static final String ENUMERATION_CONTEXT = "EnumerationContext";
+
+ private static final String FILTER_QUERY_LANGUAGE = "FilterQueryLanguage";
+
+ private static final String FILTER_QUERY = "FilterQuery";
+
+ private static final String INCLUDE_CLASS_ORIGIN = "IncludeClassOrigin";
+
+ private static final String INSTANCE_NAME = "InstanceName";
+
+ private static final String MAX_OBJECT_COUNT = "MaxObjectCount";
+
+ private static final String PROPERTY_LIST = "PropertyList";
+
+ private static final String OPERATION_TIMEOUT = "OperationTimeout";
+
+ private static final String RESULT_CLASS = "ResultClass";
+
+ private static final String RETURN_QUERY_RESULT_CLASS = "ReturnQueryResultClass";
+
+ private static final String QUERY_RESULT_CLASS = "QueryResultClass";
+
+ private static final String ROLE = "Role";
+
+ private static final String RESULT_ROLE = "ResultRole";
+
+ private static final Random RANDOM = new Random();
+
+ private static final int MAX_ID = 1 << 20;
+
+ private final ThreadLocal iCurrentId = new ThreadLocal();
+
+ private final DocumentBuilder iBuilder;
+
+ private static String valueStr(CIMValuedElement> pE) {
+ Object o = pE.getValue();
+ return o == null ? MOF.NULL : o.toString();
+ }
+
+ /**
+ * Ctor.
+ *
+ * @throws ParserConfigurationException
+ */
+ public CIMClientXML_HelperImpl() throws ParserConfigurationException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ this.iBuilder = factory.newDocumentBuilder();
+ }
+
+ /**
+ * getDocumentBuilder
+ *
+ * @return DocumentBuilder
+ */
+ public DocumentBuilder getDocumentBuilder() {
+ return this.iBuilder;
+ }
+
+ /**
+ * newDocument
+ *
+ * @return Document
+ */
+ public Document newDocument() {
+ return this.iBuilder.newDocument();
+ }
+
+ /**
+ * parse
+ *
+ * @param pIS
+ * @return Document
+ * @throws IOException
+ * @throws SAXException
+ */
+ public Document parse(InputSource pIS) throws IOException, SAXException {
+ if (pIS == null) throw new IllegalArgumentException("null input stream argument");
+ return this.iBuilder.parse(pIS);
+ }
+
+ /**
+ * Serializes a given DOM document as (CIM-)XML to a given output stream
+ *
+ * @param pOS
+ * The output stream
+ * @param pDoc
+ * The documents
+ * @throws IOException
+ * Whenever something goes wrong
+ */
+ public static void serialize(OutputStream pOS, Document pDoc) throws IOException {
+ CimXmlSerializer.serialize(pOS, pDoc, false);
+ }
+
+ /**
+ * Serializes a given DOM document as (CIM-)XML to a given output stream.
+ * The document is pretty wrapped and indented and surrounded with markers
+ * for the begin and end.
+ *
+ * @param pOS
+ * The output stream
+ * @param pDoc
+ * The documents
+ * @throws IOException
+ */
+ public static void dumpDocument(OutputStream pOS, Document pDoc) throws IOException {
+ dumpDocument(pOS, pDoc, null);
+ }
+
+ /**
+ * Serializes a given DOM document as (CIM-)XML to a given output stream.
+ * The document is pretty wrapped and indented and surrounded with markers
+ * for the begin and end.
+ *
+ * @param pOS
+ * The output stream
+ * @param pDoc
+ * The documents
+ * @param pOrigin
+ * The origin of the output stream (request, indication response,
+ * etc.)
+ * @throws IOException
+ */
+ public static void dumpDocument(OutputStream pOS, Document pDoc, String pOrigin)
+ throws IOException {
+ // debug
+ if (pOS == null) { return; }
+ if (pOrigin == null) pOrigin = "unknown";
+ pOS.write("<--- ".getBytes());
+ pOS.write(pOrigin.getBytes());
+ pOS.write(" begin ".getBytes());
+ pOS.write(TimeStamp.formatWithMillis(System.currentTimeMillis()).getBytes());
+ pOS.write(" -----\n".getBytes());
+ CimXmlSerializer.serialize(pOS, pDoc, true);
+ pOS.write("\n---- ".getBytes());
+ pOS.write(pOrigin.getBytes());
+ pOS.write(" end ------>\n".getBytes());
+ }
+
+ /**
+ * createCIMMessage
+ *
+ * @param pDoc
+ * @param pRequestE
+ * @return Element
+ */
+ public Element createCIMMessage(Document pDoc, Element pRequestE) {
+ Element cimE = CIMXMLBuilderImpl.createCIM(pDoc);
+ Element messageE = CIMXMLBuilderImpl.createMESSAGE(pDoc, cimE, String.valueOf(getNextId()),
+ VERSION);
+ if (pRequestE != null) {
+ messageE.appendChild(pRequestE);
+ }
+ return messageE;
+ }
+
+ /**
+ * createMultiReq
+ *
+ * @param pDoc
+ * @return Element
+ */
+ public Element createMultiReq(Document pDoc) {
+ Element multireqE = CIMXMLBuilderImpl.createMULTIREQ(pDoc);
+ return multireqE;
+ }
+
+ /**
+ * associatorNames_request
+ *
+ * @param pDoc
+ * @param pObjectName
+ * @param pAssocClass
+ * @param pResultClass
+ * @param pRole
+ * @param pResultRole
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element associatorNames_request(Document pDoc, CIMObjectPath pObjectName,
+ String pAssocClass, String pResultClass, String pRole, String pResultRole)
+ throws WBEMException {
+
+ // obtain data
+ String className = pObjectName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+ CIMProperty>[] keysA = pObjectName.getKeys();
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ ASSOCIATOR_NAMES);
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
+
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
+ for (int i = 0; i < keysA.length; i++) {
+ CIMProperty> prop = keysA[i];
+ String propName = prop.getName();
+ // TODO: check that CIMDataType.toString() satisfies this
+ String propTypeStr = prop.getDataType().toString();
+ String propValueStr = valueStr(prop);
+ Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
+ CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
+ }
+ if (pAssocClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
+ }
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pResultRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * associatorNames_response
+ *
+ * @param pDoc
+ * @param pPathA
+ * @return Element
+ */
+ public static Element associatorNames_response(Document pDoc, CIMObjectPath[] pPathA) {
+ Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
+ Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
+ "associatorNames");
+ Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
+ try {
+ for (int i = 0; i < pPathA.length; i++) {
+ CIMXMLBuilderImpl.createOBJECTPATH(pDoc, iRetValE, pPathA[i]);
+ }
+ } catch (WBEMException e) {
+ throw new RuntimeException(e);
+ }
+ return simpRspE;
+ }
+
+ /**
+ * associatorInstances_request
+ *
+ * @param pDoc
+ * @param pObjectName
+ * @param pAssocClass
+ * @param pResultClass
+ * @param pRole
+ * @param pResultRole
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element associatorInstances_request(Document pDoc, CIMObjectPath pObjectName,
+ String pAssocClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
+
+ String className = pObjectName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+ CIMProperty>[] keysA = pObjectName.getKeys();
+
+ // Make sure keys are populated
+ if (keysA.length == 0) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "associatorInstances requires keys for the instance to be populated");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
+ for (int i = 0; i < keysA.length; i++) {
+ CIMProperty> prop = keysA[i];
+ String propName = prop.getName();
+ String propTypeStr = prop.getDataType().toString();
+ String propValueStr = valueStr(prop);
+
+ Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
+ CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
+ }
+ if (pAssocClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
+ }
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pResultRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * associatorClasses_request
+ *
+ * @param pDoc
+ * @param pObjectName
+ * @param pAssocClass
+ * @param pResultClass
+ * @param pRole
+ * @param pResultRole
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element associatorClasses_request(Document pDoc, CIMObjectPath pObjectName,
+ String pAssocClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException {
+
+ String className = pObjectName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ // Make sure keys are not populated
+ if (pObjectName.getKeys().length != 0) throw new WBEMException(
+ WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "Keys should not be populated for associatorClasses");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
+
+ if (pAssocClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
+ }
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pResultRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
+ }
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * associators_request
+ *
+ * @param pDoc
+ * @param pObjectName
+ * @param pAssocClass
+ * @param pResultClass
+ * @param pRole
+ * @param pResultRole
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element associators_request(Document pDoc, CIMObjectPath pObjectName,
+ String pAssocClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException {
+
+ // obtain data
+ String className = pObjectName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+ CIMProperty>[] keysA = pObjectName.getKeys();
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
+ for (int i = 0; i < keysA.length; i++) {
+ CIMProperty> prop = keysA[i];
+ String propName = prop.getName();
+ // TODO: check that CIMDataType.toString() satisfies this
+ String propTypeStr = prop.getDataType().toString();
+ // CIMXMLBuilderImpl.getTypeStr(pValue.getType());
+ String propValueStr = valueStr(prop);
+
+ Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
+ CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
+ }
+ if (pAssocClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
+ }
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pResultRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
+ }
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList"); // BB
+ // fixed
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * associators_response
+ *
+ * @param pDoc
+ * @param pNamedElementA
+ * @return Element
+ */
+ public static Element associators_response(Document pDoc,
+ CIMNamedElementInterface[] pNamedElementA) {
+ Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
+ Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "associators");
+ Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
+ try {
+ for (int i = 0; i < pNamedElementA.length; i++) {
+ CIMNamedElementInterface namedElement = pNamedElementA[i];
+ CIMObjectPath op = namedElement.getObjectPath();
+ String nameSpace = op == null ? null : op.getNamespace();
+ CIMXMLBuilderImpl
+ .createVALUEOBJECTWITHPATH(pDoc, iRetValE, namedElement, nameSpace);
+ /*
+ * CIMXMLBuilderImpl.createCLASSPATH( pDoc, iRetValE,
+ * pClassA[i].getObjectPath() );
+ * CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClassA[i]);
+ */
+
+ }
+ } catch (WBEMException e) {
+ throw new RuntimeException(e);
+ }
+ return simpRspE;
+ }
+
+ /**
+ * enumerateInstanceNames_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element enumerateInstanceNames_request(Document pDoc, CIMObjectPath pPath)
+ throws WBEMException {
+ // obtain data
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "EnumerateInstanceNames");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+
+ return simplereqE;
+ }
+
+ /**
+ * enumerateInstances_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pDeepInheritance
+ * @param pLocalOnly
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element enumerateInstances_request(Document pDoc, CIMObjectPath pPath,
+ boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
+ boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
+
+ // obtain data
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "EnumerateInstances");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+ return simplereqE;
+ }
+
+ /**
+ * getInstance_request
+ *
+ * @param pDoc
+ * @param pName
+ * @param pLocalOnly
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element getInstance_request(Document pDoc, CIMObjectPath pName, boolean pLocalOnly,
+ boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException {
+ // obtain data
+ String className = pName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetInstance");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "InstanceName");
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * deleteInstance_request
+ *
+ * @param pDoc
+ * @param pName
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element deleteInstance_request(Document pDoc, CIMObjectPath pName) throws WBEMException {
+
+ // obtain data
+ String className = pName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "DeleteInstance");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "InstanceName");
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
+
+ return simplereqE;
+ }
+
+ /**
+ * getClass_request
+ *
+ * @param pDoc
+ * @param pName
+ * @param pLocalOnly
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element getClass_request(Document pDoc, CIMObjectPath pName, boolean pLocalOnly,
+ boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException {
+
+ // obtain data
+ String className = pName.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetClass");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * createInstance_request
+ *
+ * @param pDoc
+ * @param pName
+ * @param pInstance
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element createInstance_request(Document pDoc, CIMObjectPath pName, CIMInstance pInstance)
+ throws WBEMException {
+
+ String className = pInstance.getObjectPath().getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "CreateInstance");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "NewInstance");
+
+ CIMXMLBuilderImpl.createINSTANCE(pDoc, iparamvalueE, pInstance);
+
+ return simplereqE;
+ }
+
+ /**
+ * invokeMethod_request
+ *
+ * @param pDoc
+ * @param pLocalPath
+ * @param pMethodName
+ * @param pInArgs
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element invokeMethod_request(Document pDoc, CIMObjectPath pLocalPath,
+ String pMethodName, CIMArgument>[] pInArgs) throws WBEMException {
+
+ // obtain data
+ String className = pLocalPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+ CIMProperty>[] keysA = pLocalPath.getKeys();
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element methodcallE = CIMXMLBuilderImpl.createMETHODCALL(pDoc, simplereqE, pMethodName);
+
+ // 13521
+ if (keysA.length > 0) {
+ Element localpathE = CIMXMLBuilderImpl.createLOCALINSTANCEPATH(pDoc, methodcallE);
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, localpathE, pLocalPath); // 13521
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, localpathE, pLocalPath); // 13521
+ } else {
+ CIMXMLBuilderImpl.createLOCALCLASSPATH(pDoc, methodcallE, pLocalPath);
+ }
+
+ buildParamValues(pDoc, methodcallE, pLocalPath, pInArgs);
+
+ return simplereqE;
+ }
+
+ /**
+ * invokeMethod_response
+ *
+ * @param pDoc
+ * @param pMethodName
+ * @param pLocalPath
+ * @param pRetVal
+ * @param pOutArgA
+ * @return Element
+ * @throws WBEMException
+ */
+ public static Element invokeMethod_response(Document pDoc, String pMethodName,
+ CIMObjectPath pLocalPath, Object pRetVal, CIMArgument>[] pOutArgA)
+ throws WBEMException {
+ if (pMethodName == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null method name");
+ Element simpleRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
+ Element methodRspE = CIMXMLBuilderImpl.createMETHODRESPONSE(pDoc, simpleRspE, pMethodName);
+
+ CIMXMLBuilderImpl.createRETURNVALUE(pDoc, methodRspE, pRetVal);
+
+ buildParamValues(pDoc, methodRspE, pLocalPath, pOutArgA);
+ return simpleRspE;
+ }
+
+ /**
+ * @param pLocalPath
+ */
+ private static void buildParamValues(Document pDoc, Element pParentE, CIMObjectPath pLocalPath,
+ CIMArgument>[] pArgA) throws WBEMException {
+ if (pArgA == null) return;
+ for (int i = 0; i < pArgA.length; i++) {
+ CIMArgument> arg = pArgA[i];
+ if (arg == null) continue;
+ CIMXMLBuilderImpl.createPARAMVALUE(pDoc, pParentE, arg);
+ }
+ }
+
+ // public CIMResponse createIndication_request(Document doc) throws
+ // CIMXMLParseException, CIMException {
+ // Element rootE = doc.getDocumentElement();
+ // CIMResponse response = (CIMResponse)xmlParser.parseCIM(rootE);
+ // response.checkError();
+ // return response;
+ // // Vector v = (Vector)response.getFirstReturnValue();
+ // //
+ // // //TODO: Should we return the whole list of instances or just the first
+ // instance?
+ // // //TODO: return the whole vector of indications
+ // // if (v.size() > 0)
+ // // return (CIMInstance)v.elementAt(0);
+ // // else
+ // // return null;
+ // }
+
+ /**
+ * createIndication_response
+ *
+ * @param error
+ * @return Document
+ */
+ public Document createIndication_response(CIMError error) {
+
+ // CIMXMLBuilderImpl.create XML
+ Document doc = this.iBuilder.newDocument();
+ Element cimE = CIMXMLBuilderImpl.createCIM(doc);
+ Element messageE = CIMXMLBuilderImpl.createMESSAGE(doc, cimE, String.valueOf(getNextId()),
+ "1.0");
+ Element simpleexprspE = CIMXMLBuilderImpl.createSIMPLEEXPRSP(doc, messageE);
+ Element expmethodresponseE = CIMXMLBuilderImpl.createEXPMETHODRESPONSE(doc, simpleexprspE,
+ "ExportIndication");
+ if (error == null) {
+ CIMXMLBuilderImpl.createIRETURNVALUE(doc, expmethodresponseE);
+ } else {
+ CIMXMLBuilderImpl.createERROR(doc, expmethodresponseE, error);
+ }
+ // Element
+ return doc;
+ }
+
+ /**
+ * createClass_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pClass
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element createClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass)
+ throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "CreateClass");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewClass");
+
+ CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
+
+ return simplereqE;
+ }
+
+ /**
+ * getQualifier_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pQt
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element getQualifier_request(Document pDoc, CIMObjectPath pPath, String pQt)
+ throws WBEMException {
+ // obtain data
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl
+ .createIMETHODCALL(pDoc, simplereqE, "GetQualifier");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "QualifierName");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
+
+ return simplereqE;
+ }
+
+ /**
+ * createQualifierType_request : This has been replaced by
+ * setQualifierType_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pQt
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element createQualifierType_request(Document pDoc, CIMObjectPath pPath,
+ CIMQualifierType> pQt) throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl
+ .createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "QualifierDeclaration");
+ CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
+
+ return simplereqE;
+ }
+
+ /**
+ * deleteClass_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element deleteClass_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "DeleteClass");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
+
+ CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
+
+ return simplereqE;
+ }
+
+ /**
+ * deleteQualifierType_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element deleteQualifierType_request(Document pDoc, CIMObjectPath pPath)
+ throws WBEMException {
+ // obtain data
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "DeleteQualifier");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "QualifierName");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
+ return simplereqE;
+ }
+
+ /**
+ * enumerateClasses_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pDeepInheritance
+ * @param pLocalOnly
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @return Element
+ */
+ public Element enumerateClasses_request(Document pDoc, CIMObjectPath pPath,
+ boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
+ boolean pIncludeClassOrigin) {
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "EnumerateClasses");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+ if (pPath != null && pPath.getObjectName() != null
+ && pPath.getObjectName().trim().length() != 0) {
+ String className = pPath.getObjectName();
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+ }
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+ return simplereqE;
+ }
+
+ /**
+ * enumerateClasses_response
+ *
+ * @param pDoc
+ * @param pClA
+ * @return Element
+ */
+ public static Element enumerateClasses_response(Document pDoc, CIMClass[] pClA) {
+ Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
+ Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
+ "enumerateClasses");
+ Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
+ try {
+ for (int i = 0; i < pClA.length; i++) {
+ CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClA[i]);
+ }
+ } catch (WBEMException e) {
+ throw new RuntimeException(e);
+ }
+ return simpRspE;
+ }
+
+ /**
+ * enumerateInstances_response
+ *
+ * @param pDoc
+ * @param pInstA
+ * @return Element
+ */
+ public static Element enumerateInstances_response(Document pDoc, CIMInstance[] pInstA) {
+ Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
+ Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
+ "enumerateInstances");
+ Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
+ try {
+ for (int i = 0; i < pInstA.length; i++) {
+ CIMXMLBuilderImpl.createINSTANCE(pDoc, iRetValE, pInstA[i]);
+ }
+ } catch (WBEMException e) {
+ throw new RuntimeException(e);
+ }
+ return simpRspE;
+ }
+
+ /**
+ * enumerateClassNames_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pDeepInheritance
+ * @return Element
+ */
+ public Element enumerateClassNames_request(Document pDoc, CIMObjectPath pPath,
+ boolean pDeepInheritance) {
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "EnumerateClassNames");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+
+ if (pPath != null && pPath.getObjectName() != null
+ && pPath.getObjectName().trim().length() != 0) {
+ String className = pPath.getObjectName();
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
+
+ return simplereqE;
+ }
+
+ /**
+ * getProperty_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pPropertyName
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element getProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName)
+ throws WBEMException {
+ // obtain data
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetProperty");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "InstanceName");
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
+
+ if (pPropertyName != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * referenceNames_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pResultClass
+ * @param pRole
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element referenceNames_request(Document pDoc, CIMObjectPath pPath, String pResultClass,
+ String pRole) throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "ReferenceNames");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
+
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * referenceClasses_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pResultClass
+ * @param pRole
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element referenceClasses_request(Document pDoc, CIMObjectPath pPath,
+ String pResultClass, String pRole, boolean pIncludeQualifiers,
+ boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ // Make sure keys are not populated
+ if (pPath.getKeys().length != 0) throw new WBEMException(
+ WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "Keys should not be populated for referenceClasses");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ // createOBJECTNAME will internally call createINSTANCENAME but as there
+ // are no keys Element containing keys will not be populated
+ CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
+
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+ return simplereqE;
+ }
+
+ /**
+ * referenceInstances_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pResultClass
+ * @param pRole
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element referenceInstances_request(Document pDoc, CIMObjectPath pPath,
+ String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList)
+ throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ // keys are required for CIMInstance
+ if (pPath.getKeys().length == 0) throw new WBEMException(
+ WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "refrenceInstances requires keys for the instance to be populated");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ // createOBJECTNAME will internally call createINSTANCENAME to populate
+ // Element containing keys
+ CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
+
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+ return simplereqE;
+ }
+
+ /**
+ * references_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pResultClass
+ * @param pRole
+ * @param pIncludeQualifiers
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element references_request(Document pDoc, CIMObjectPath pPath, String pResultClass,
+ String pRole, boolean pIncludeQualifiers, boolean pIncludeClassOrigin,
+ String[] pPropertyList) throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
+ CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
+
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * setClass_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pClass
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element setClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass)
+ throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ModifyClass");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "ModifiedClass");
+ CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
+
+ return simplereqE;
+ }
+
+ /**
+ * setInstance_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pInstance
+ * @param pIncludeQualifiers
+ * @param pPropertyList
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element setInstance_request(Document pDoc, CIMObjectPath pPath, CIMInstance pInstance,
+ boolean pIncludeQualifiers, String[] pPropertyList) throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "ModifyInstance");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "ModifiedInstance");
+ CIMXMLBuilderImpl.createVALUENAMEDINSTANCE(pDoc, iparamvalueE, pPath, pInstance);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++) {
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * setProperty_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pPropertyName
+ * @param pNewValue
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element setProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName,
+ Object pNewValue) throws WBEMException {
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "SetProperty");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "InstanceName");
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
+
+ if (pPropertyName != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
+ }
+
+ if (pNewValue != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewValue");
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pNewValue);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * setQualifierType_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pQt
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element setQualifierType_request(Document pDoc, CIMObjectPath pPath,
+ CIMQualifierType> pQt) throws WBEMException {
+ // Make sure class name exists, it is required to uniquely identify
+ // qualifier in namespace
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl
+ .createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "QualifierDeclaration");
+ CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
+
+ return simplereqE;
+ }
+
+ /**
+ * enumQualifierTypes_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element enumQualifierTypes_request(Document pDoc, CIMObjectPath pPath)
+ throws WBEMException {
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "EnumerateQualifiers");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ return simplereqE;
+ }
+
+ /**
+ * enumQualifierTypes_response
+ *
+ * @param pDoc
+ * @param pQualiTypeA
+ * @return Element
+ * @throws WBEMException
+ */
+ public static Element enumQualifierTypes_response(Document pDoc,
+ CIMQualifierType>[] pQualiTypeA) throws WBEMException {
+ Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
+ Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
+ "associatorNames");
+ Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
+ for (int i = 0; i < pQualiTypeA.length; i++) {
+ CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iRetValE, pQualiTypeA[i]);
+ }
+ return simpRspE;
+ }
+
+ /**
+ * execQuery_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pQuery
+ * @param pQueryLanguage
+ * @return Element
+ */
+ public Element execQuery_request(Document pDoc, CIMObjectPath pPath, String pQuery,
+ String pQueryLanguage) {
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ExecQuery");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element querylanguageE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ "QueryLanguage");
+ CIMXMLBuilderImpl.createVALUE(pDoc, querylanguageE, pQueryLanguage);
+
+ Element queryE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Query");
+ CIMXMLBuilderImpl.createVALUE(pDoc, queryE, pQuery);
+
+ return simplereqE;
+ }
+
+ /**
+ * performBatchOperation_request
+ *
+ * @param pDoc
+ * @param pOperations
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element performBatchOperation_request(Document pDoc, Vector pOperations)
+ throws WBEMException {
+
+ Element messageE = createCIMMessage(pDoc, null);
+ if (pOperations.size() > 1) {
+ Element multireqE = createMultiReq(pDoc);
+ messageE.appendChild(multireqE);
+ messageE = multireqE;
+ }
+ int i = 0;
+ Iterator iter = pOperations.iterator();
+ while (iter.hasNext()) {
+ CIMOperation op = iter.next();
+ try {
+ Element requestE = null;
+
+ if (op instanceof CIMAssociatorsOp) {
+ CIMAssociatorsOp associatorsOp = (CIMAssociatorsOp) op;
+ requestE = associators_request(pDoc, associatorsOp.getObjectName(),
+ associatorsOp.getAssocClass(), associatorsOp.getResultClass(),
+ associatorsOp.getRole(), associatorsOp.getResultRole(), associatorsOp
+ .isIncludeQualifiers(), associatorsOp.isIncludeClassOrigin(),
+ associatorsOp.getPropertyList());
+ } else if (op instanceof CIMAssociatorNamesOp) {
+ CIMAssociatorNamesOp associatorNamesOp = (CIMAssociatorNamesOp) op;
+ requestE = associatorNames_request(pDoc, associatorNamesOp.getObjectName(),
+ associatorNamesOp.getAssocClass(), associatorNamesOp.getResultClass(),
+ associatorNamesOp.getRole(), associatorNamesOp.getResultRole());
+ } else if (op instanceof CIMCreateClassOp) {
+ CIMCreateClassOp createClassOp = (CIMCreateClassOp) op;
+ requestE = createClass_request(pDoc, createClassOp.getObjectName(),
+ createClassOp.getCimClass());
+ } else if (op instanceof CIMCreateInstanceOp) {
+ CIMCreateInstanceOp createInstanceOp = (CIMCreateInstanceOp) op;
+ requestE = createInstance_request(pDoc, createInstanceOp.getObjectName(),
+ createInstanceOp.getInstance());
+ } else if (op instanceof CIMCreateNameSpaceOp) {
+ CIMCreateNameSpaceOp createNameSpaceOp = (CIMCreateNameSpaceOp) op;
+
+ String namespace = createNameSpaceOp.getNameSpace();
+ int j = namespace.lastIndexOf('/');
+
+ if (j < 0) throw new WBEMException(WBEMException.CIM_ERR_NOT_FOUND,
+ "Invalid namespace. Must contain at least /");
+ String parentNs = namespace.substring(0, j);
+ namespace = namespace.substring(j + 1);
+
+ /*
+ * CIMInstance inst = new CIMInstance();
+ * inst.setClassName("CIM_NameSpace"); CIMProperty prop =
+ * new CIMProperty("NameSpace"); prop.setValue(new
+ * CIMValue(namespace, CIMDataType
+ * .getPredefinedType(CIMDataType.STRING))); Vector v = new
+ * Vector(); v.add(prop); inst.setProperties(v);
+ */
+
+ CIMInstance inst = new CIMInstance(new CIMObjectPath(null, null, null, null,
+ "CIM_NameSpace", null), new CIMProperty[] { new CIMProperty(
+ "NameSpace", CIMDataType.STRING_T, namespace, true, false, null) });
+ CIMObjectPath object = new CIMObjectPath(null, null, null, parentNs, null, null);
+
+ requestE = createInstance_request(pDoc, object, inst);
+ } else if (op instanceof CIMCreateQualifierTypeOp) {
+ CIMCreateQualifierTypeOp createQualifierTypeOp = (CIMCreateQualifierTypeOp) op;
+ requestE = createQualifierType_request(pDoc, createQualifierTypeOp
+ .getObjectName(), createQualifierTypeOp.getQualifierType());
+ } else if (op instanceof CIMDeleteClassOp) {
+ CIMDeleteClassOp deleteClassOp = (CIMDeleteClassOp) op;
+ requestE = deleteClass_request(pDoc, deleteClassOp.getObjectName());
+ } else if (op instanceof CIMDeleteInstanceOp) {
+ CIMDeleteInstanceOp deleteInstanceOp = (CIMDeleteInstanceOp) op;
+ requestE = deleteClass_request(pDoc, deleteInstanceOp.getObjectName());
+ } else if (op instanceof CIMDeleteQualifierTypeOp) {
+ CIMDeleteQualifierTypeOp deleteQualifierTypeOp = (CIMDeleteQualifierTypeOp) op;
+ requestE = deleteClass_request(pDoc, deleteQualifierTypeOp.getObjectName());
+ } else if (op instanceof CIMEnumClassesOp) {
+ CIMEnumClassesOp enumClassesOp = (CIMEnumClassesOp) op;
+ requestE = enumerateClasses_request(pDoc, enumClassesOp.getObjectName(),
+ enumClassesOp.isDeep(), enumClassesOp.isLocalOnly(), enumClassesOp
+ .isIncludeQualifiers(), enumClassesOp.isIncludeClassOrigin());
+ } else if (op instanceof CIMEnumClassNamesOp) {
+ CIMEnumClassNamesOp enumClassNamesOp = (CIMEnumClassNamesOp) op;
+ requestE = enumerateClassNames_request(pDoc, enumClassNamesOp.getObjectName(),
+ enumClassNamesOp.isDeep());
+ } else if (op instanceof CIMEnumInstanceNamesOp) {
+ CIMEnumInstanceNamesOp enumInstanceNamesOp = (CIMEnumInstanceNamesOp) op;
+ requestE = enumerateInstanceNames_request(pDoc, enumInstanceNamesOp
+ .getObjectName());
+ } else if (op instanceof CIMEnumInstancesOp) {
+ CIMEnumInstancesOp enumInstancesOp = (CIMEnumInstancesOp) op;
+ requestE = enumerateInstances_request(pDoc, enumInstancesOp.getObjectName(),
+ enumInstancesOp.isDeep(), enumInstancesOp.isLocalOnly(),
+ enumInstancesOp.isIncludeQualifiers(), enumInstancesOp
+ .isIncludeClassOrigin(), enumInstancesOp.getPropertyList());
+ } else if (op instanceof CIMEnumNameSpaceOp) {
+ CIMEnumNameSpaceOp enumNameSpaceOp = (CIMEnumNameSpaceOp) op;
+ // ebak: here we have to set CIMObjectPath's objectname
+ // enumNameSpaceOp.getObjectName().setObjectName("CIM_NameSpace");
+ CIMObjectPath objPath = enumNameSpaceOp.getObjectName();
+ objPath = new CIMObjectPath(objPath.getScheme(), objPath.getHost(), objPath
+ .getPort(), objPath.getNamespace(), "CIM_NameSpace", objPath.getKeys());
+ requestE = enumerateInstanceNames_request(pDoc, enumNameSpaceOp.getObjectName());
+ } else if (op instanceof CIMEnumQualifierTypesOp) {
+ CIMEnumQualifierTypesOp enumQualifierTypesOp = (CIMEnumQualifierTypesOp) op;
+ requestE = enumQualifierTypes_request(pDoc, enumQualifierTypesOp
+ .getObjectName());
+ } else if (op instanceof CIMExecQueryOp) {
+ CIMExecQueryOp execQueryOp = (CIMExecQueryOp) op;
+ requestE = execQuery_request(pDoc, execQueryOp.getObjectName(), execQueryOp
+ .getQuery(), execQueryOp.getQueryLanguage());
+ } else if (op instanceof CIMGetPropertyOp) {
+ CIMGetPropertyOp getPropertyOp = (CIMGetPropertyOp) op;
+ requestE = getInstance_request(pDoc, getPropertyOp.getObjectName(), false,
+ false, false, new String[] { getPropertyOp.getPropertyName() });
+
+ } else if (op instanceof CIMGetClassOp) {
+ CIMGetClassOp getClassOp = (CIMGetClassOp) op;
+ requestE = getClass_request(pDoc, getClassOp.getObjectName(), getClassOp
+ .isLocalOnly(), getClassOp.isIncludeQualifiers(), getClassOp
+ .isIncludeClassOrigin(), getClassOp.getPropertyList());
+ } else if (op instanceof CIMGetInstanceOp) {
+ CIMGetInstanceOp getInstanceOp = (CIMGetInstanceOp) op;
+ requestE = getInstance_request(pDoc, getInstanceOp.getObjectName(),
+ getInstanceOp.isLocalOnly(), getInstanceOp.isIncludeQualifiers(),
+ getInstanceOp.isIncludeClassOrigin(), getInstanceOp.getPropertyList());
+ } else if (op instanceof CIMGetQualifierTypeOp) {
+ CIMGetQualifierTypeOp getQualifierTypeOp = (CIMGetQualifierTypeOp) op;
+ requestE = getQualifier_request(pDoc, getQualifierTypeOp.getObjectName(),
+ getQualifierTypeOp.getQualifierType());
+ } else if (op instanceof CIMInvokeMethodOp) {
+ CIMInvokeMethodOp invokeMethodOp = (CIMInvokeMethodOp) op;
+ requestE = invokeMethod_request(pDoc, invokeMethodOp.getObjectName(),
+ invokeMethodOp.getMethodCall(), invokeMethodOp.getInParams());
+ } else if (op instanceof CIMReferenceNamesOp) {
+ CIMReferenceNamesOp referenceNamesOp = (CIMReferenceNamesOp) op;
+ requestE = referenceNames_request(pDoc, referenceNamesOp.getObjectName(),
+ referenceNamesOp.getResultClass(), referenceNamesOp.getResultRole());
+ } else if (op instanceof CIMReferencesOp) {
+ CIMReferencesOp referencesOp = (CIMReferencesOp) op;
+ requestE = references_request(pDoc, referencesOp.getObjectName(), referencesOp
+ .getResultClass(), referencesOp.getRole(), referencesOp
+ .isIncludeQualifiers(), referencesOp.isIncludeClassOrigin(),
+ referencesOp.getPropertyList());
+ } else if (op instanceof CIMSetClassOp) {
+ CIMSetClassOp setClassOp = (CIMSetClassOp) op;
+ requestE = setClass_request(pDoc, setClassOp.getObjectName(), setClassOp
+ .getCimClass());
+ } else if (op instanceof CIMSetInstanceOp) {
+ CIMSetInstanceOp setInstanceOp = (CIMSetInstanceOp) op;
+ requestE = setInstance_request(pDoc, setInstanceOp.getObjectName(),
+ setInstanceOp.getInstance(), setInstanceOp.isIncludeQualifiers(),
+ setInstanceOp.getPropertyList());
+ } else if (op instanceof CIMSetPropertyOp) {
+ CIMSetPropertyOp setPropertyOp = (CIMSetPropertyOp) op;
+ requestE = setProperty_request(pDoc, setPropertyOp.getObjectName(),
+ setPropertyOp.getPropertyName(), setPropertyOp.getCimValue());
+ } else if (op instanceof CIMSetQualifierTypeOp) {
+ CIMSetQualifierTypeOp setQualifierTypeOp = (CIMSetQualifierTypeOp) op;
+ requestE = setQualifierType_request(pDoc, setQualifierTypeOp.getObjectName(),
+ setQualifierTypeOp.getQualifierType());
+ }
+ if (requestE == null) throw new WBEMException(
+ WBEMException.CIM_ERR_INVALID_PARAMETER, "Illegal batch operation number ("
+ + i + ") " + op.getClass());
+ messageE.appendChild(requestE);
+ } catch (WBEMException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new WBEMException(WBEMException.CIM_ERR_FAILED, "At batch operation (" + i
+ + ')', null, e);
+ }
+ i++;
+ }
+ return messageE;
+ }
+
+ /**
+ * Sets the message id counter to a given value. For use in units tests
+ * only.
+ *
+ * @param pId
+ * The new value
+ */
+ public void setId(int pId) {
+ this.iCurrentId.set(new Counter(pId - 1));
+ }
+
+ /**
+ * Get the next message id. If this method is called for the first time by
+ * the current thread it will choose a start value randomly. Afterwards the
+ * id is incremented by 1. Be aware that different threads will have
+ * distinct id counters.
+ *
+ * @return The next message id
+ */
+ private int getNextId() {
+ if (this.iCurrentId.get() == null) {
+ this.iCurrentId.set(new Counter(RANDOM.nextInt(MAX_ID)));
+ }
+ return this.iCurrentId.get().incrementAndGet();
+ }
+
+ /**
+ * pAssociatorPaths_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pAssocClass
+ * @param pResultClass
+ * @param pRole
+ * @param pResultRole
+ * @param pFilterQueryLanguage
+ * @param pFilterQuery
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element OpenAssociatorInstancePaths_request(Document pDoc, CIMObjectPath pPath,
+ String pAssocClass, String pResultClass, String pRole, String pResultRole,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenAssociatorInstancePaths");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ INSTANCE_NAME);
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
+
+ if (pAssocClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
+ }
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pResultRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
+ }
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * OpenAssociatorInstances_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pAssocClass
+ * @param pResultClass
+ * @param pRole
+ * @param pResultRole
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @param pFilterQueryLanguage
+ * @param pFilterQuery
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @return Element OpenAssociatorInstances_request
+ * @throws WBEMException
+ */
+ public Element OpenAssociatorInstances_request(Document pDoc, CIMObjectPath pPath,
+ String pAssocClass, String pResultClass, String pRole, String pResultRole,
+ boolean pIncludeClassOrigin, String[] pPropertyList, String pFilterQueryLanguage,
+ String pFilterQuery, UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
+ UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenAssociatorInstances");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ INSTANCE_NAME);
+ // createINSTANCENAME will take care of keyBindings
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
+
+ if (pAssocClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
+ }
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pResultRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
+ }
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++)
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * OpenEnumerateInstancePaths_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pFilterQueryLanguage
+ * @param pFilterQuery
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element OpenEnumerateInstancePaths_request(Document pDoc, CIMObjectPath pPath,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenEnumerateInstancePaths");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * OpenEnumerateInstances_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pPropertyList
+ * @param pIncludeClassOrigin
+ * @param pDeepInheritance
+ * @param pFilterQueryLanguage
+ * @param pFilterQuery
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element OpenEnumerateInstances_request(Document pDoc, CIMObjectPath pPath,
+ boolean pDeepInheritance, boolean pIncludeClassOrigin, String[] pPropertyList,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenEnumerateInstances");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, DEEP_INHERITANCE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++)
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * EnumerationCount_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pEnumerationContext
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element EnumerationCount_request(Document pDoc, CIMObjectPath pPath,
+ String pEnumerationContext) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "EnumerationCount");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ if (pEnumerationContext != null) {
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ ENUMERATION_CONTEXT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
+ }
+
+ return simplereqE;
+
+ }
+
+ /**
+ * CloseEnumeration_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pEnumerationContext
+ * @return Element
+ * @throws WBEMException
+ */
+ public Element CloseEnumeration_request(Document pDoc, CIMObjectPath pPath,
+ String pEnumerationContext) throws WBEMException {
+
+ String className = pPath.getObjectName();
+
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "CloseEnumeration");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ if (pEnumerationContext != null) {
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ ENUMERATION_CONTEXT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
+ }
+ return simplereqE;
+ }
+
+ /**
+ * referencePaths_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pResultClass
+ * @param pRole
+ * @param pFilterQueryLanguage
+ * @param pFilterQuery
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @return Element referencePaths_request
+ * @throws WBEMException
+ */
+ public Element OpenReferenceInstancePaths_request(Document pDoc, CIMObjectPath pPath,
+ String pResultClass, String pRole, String pFilterQueryLanguage, String pFilterQuery,
+ UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
+ UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenReferenceInstancePaths");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ INSTANCE_NAME);
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
+
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+
+ }
+
+ /**
+ * references_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pResultClass
+ * @param pRole
+ * @param pIncludeClassOrigin
+ * @param pPropertyList
+ * @param pFilterQueryLanguage
+ * @param pFilterQuery
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @return Element references_request
+ * @throws WBEMException
+ */
+ public Element OpenReferenceInstances_request(Document pDoc, CIMObjectPath pPath,
+ String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList,
+ String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
+ boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenReferenceInstances");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ INSTANCE_NAME);
+ CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
+
+ if (pResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
+ CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
+ }
+ if (pRole != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
+
+ if (pPropertyList != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
+ Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
+ for (int i = 0; i < pPropertyList.length; i++)
+ CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
+ }
+
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * OpenQueryInstances_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pFilterQuery
+ * @param pFilterQueryLanguage
+ * @param pReturnQueryResultClass
+ * @param pOperationTimeout
+ * @param pContinueOnError
+ * @param pMaxObjectCount
+ * @param pQueryResultClass
+ * @return Element OpenQueryInstances_request
+ * @throws WBEMException
+ */
+ public Element OpenQueryInstances_request(Document pDoc, CIMObjectPath pPath,
+ String pFilterQuery, String pFilterQueryLanguage, boolean pReturnQueryResultClass,
+ UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
+ UnsignedInteger32 pMaxObjectCount, CIMClass pQueryResultClass) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "OpenQueryInstances");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+
+ if (pFilterQuery != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
+ }
+ if (pFilterQueryLanguage != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ FILTER_QUERY_LANGUAGE);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
+ }
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ RETURN_QUERY_RESULT_CLASS);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pReturnQueryResultClass);
+
+ if (pOperationTimeout != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ OPERATION_TIMEOUT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
+ }
+
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+ if (pQueryResultClass != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ QUERY_RESULT_CLASS);
+ CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pQueryResultClass);
+ }
+ return simplereqE;
+ }
+
+ /**
+ * PullInstancesWithPath_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pContext
+ * @param pMaxObjectCount
+ * @return Element PullInstancesWithPath_request
+ * @throws WBEMException
+ */
+ public Element PullInstancesWithPath_request(Document pDoc, CIMObjectPath pPath,
+ String pContext, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "PullInstancesWithPath");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+
+ if (pContext != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ ENUMERATION_CONTEXT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
+ }
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * PullInstancePaths_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pContext
+ * @param pMaxObjectCount
+ * @return Element PullInstancePaths
+ * @throws WBEMException
+ */
+ public Element PullInstancePaths_request(Document pDoc, CIMObjectPath pPath, String pContext,
+ UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+
+ String className = pPath.getObjectName();
+
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "PullInstancePaths");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+
+ if (pContext != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ ENUMERATION_CONTEXT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
+ }
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * PullInstances_request
+ *
+ * @param pDoc
+ * @param pPath
+ * @param pContext
+ * @param pMaxObjectCount
+ * @return Element PullInstances_request
+ * @throws WBEMException
+ */
+ public Element PullInstances_request(Document pDoc, CIMObjectPath pPath, String pContext,
+ UnsignedInteger32 pMaxObjectCount) throws WBEMException {
+ String className = pPath.getObjectName();
+
+ if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
+ "null class name");
+
+ Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
+ Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
+ "PullInstances");
+ CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
+
+ Element iparamvalueE;
+
+ if (pContext != null) {
+ iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
+ ENUMERATION_CONTEXT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
+ }
+
+ if (pMaxObjectCount != null) {
+ iparamvalueE = CIMXMLBuilderImpl
+ .createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
+ CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
+ }
+
+ return simplereqE;
+ }
+
+ /**
+ * sendIndication_request
+ *
+ * @param pDoc
+ * @param pIndication
+ * @return Element sendIndication_request
+ * @throws WBEMException
+ */
+ public Element sendIndication_request(Document pDoc, CIMInstance pIndication)
+ throws WBEMException {
+ Element simpleexpreqE = CIMXMLBuilderImpl.createSIMPLEEXPREQ(pDoc);
+ Element expmethodcallE = CIMXMLBuilderImpl.createEXPMETHODCALL(pDoc, simpleexpreqE,
+ "ExportIndication");
+ Element expparamvalueE = CIMXMLBuilderImpl.createEXPPARAMVALUE(pDoc, expmethodcallE,
+ "NewIndication");
+
+ CIMXMLBuilderImpl.createINSTANCE(pDoc, expparamvalueE, pIndication);
+
+ return simpleexpreqE;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMMessage.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMMessage.java
similarity index 78%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMMessage.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMMessage.java
index b290726..b064249 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMMessage.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMMessage.java
@@ -1,199 +1,197 @@
-/*
- CIMMessage.java
-
- (C) Copyright IBM Corp. 2005, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
- * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
- *
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1535756 2006-08-07 lupusalex Make code warning free
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cimxml;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Hashtable;
-
-import org.w3c.dom.Document;
-
-/**
- * Class CIMMessage is used by the CIM-XML DOM parser.
- */
-public class CIMMessage {
-
- protected Document iDoc;
-
- protected Hashtable, ?> iElements;
-
- protected String iCimVersion;
-
- protected String iDtdVersion;
-
- protected String iId;
-
- protected String iProtocolVersion;
-
- protected String iMethod;
-
- protected boolean iIsCIMExport = false;
-
- protected boolean iIsSimple = false;
-
- protected boolean iIsRequest = false;
-
- protected CIMMessage() { /**/}
-
- /**
- * Ctor.
- *
- * @param pCimVersion
- * @param pDtdVersion
- * @param pId
- * @param pMethod
- */
- public CIMMessage(String pCimVersion, String pDtdVersion, String pId, String pMethod) {
- this.iCimVersion = pCimVersion;
- this.iDtdVersion = pDtdVersion;
- this.iId = pId;
- this.iMethod = pMethod;
- }
-
- /**
- * getCIMVersion
- *
- * @return String
- */
- public String getCIMVersion() {
- return this.iCimVersion;
- }
-
- /**
- * getDTDVersion
- *
- * @return String
- */
- public String getDTDVersion() {
- return this.iDtdVersion;
- }
-
- /**
- * isCIMOperation
- *
- * @return String
- */
- public boolean isCIMOperation() {
- return !this.iIsCIMExport;
- }
-
- /**
- * isCIMExport
- *
- * @return String
- */
- public boolean isCIMExport() {
- return this.iIsCIMExport;
- }
-
- /**
- * setId
- *
- * @param pId
- */
- public void setId(String pId) {
- this.iId = pId;
- }
-
- /**
- * setMethod
- *
- * @param pMethod
- */
- public void setMethod(String pMethod) {
-
- this.iMethod = pMethod;
- this.iIsCIMExport = (pMethod.toUpperCase().endsWith("EXPREQ") || pMethod.toUpperCase()
- .endsWith("EXPRSP"));
- this.iIsRequest = (pMethod.toUpperCase().endsWith("REQ"));
- this.iIsSimple = pMethod.toUpperCase().startsWith("SIMPLE");
- }
-
- /**
- * setCIMVersion
- *
- * @param pCimVersion
- */
- public void setCIMVersion(String pCimVersion) {
- this.iCimVersion = pCimVersion;
- }
-
- /**
- * setDTDVersion
- *
- * @param pDtdVersion
- */
- public void setDTDVersion(String pDtdVersion) {
- this.iDtdVersion = pDtdVersion;
- }
-
- /**
- * setIsRequest
- *
- * @param pValue
- */
- public void setIsRequest(boolean pValue) {
- this.iIsRequest = pValue;
- }
-
- /**
- * getId
- *
- * @return String
- */
- public String getId() {
- return this.iId;
- }
-
- /**
- * getProtocolVersion
- *
- * @return String
- */
- public String getProtocolVersion() {
- return this.iProtocolVersion;
- }
-}
+/*
+ CIMMessage.java
+
+ (C) Copyright IBM Corp. 2005, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
+ * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
+ *
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1535756 2006-08-07 lupusalex Make code warning free
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cimxml;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Hashtable;
+
+import org.w3c.dom.Document;
+
+/**
+ * Class CIMMessage is used by the CIM-XML DOM parser.
+ */
+public class CIMMessage {
+
+ protected Document iDoc;
+
+ protected Hashtable, ?> iElements;
+
+ protected String iCimVersion;
+
+ protected String iDtdVersion;
+
+ protected String iId;
+
+ protected String iProtocolVersion;
+
+ protected String iMethod;
+
+ protected boolean iIsCIMExport = false;
+
+ protected boolean iIsSimple = false;
+
+ protected boolean iIsRequest = false;
+
+ protected CIMMessage() { /**/}
+
+ /**
+ * Ctor.
+ *
+ * @param pCimVersion
+ * @param pDtdVersion
+ * @param pId
+ * @param pMethod
+ */
+ public CIMMessage(String pCimVersion, String pDtdVersion, String pId, String pMethod) {
+ this.iCimVersion = pCimVersion;
+ this.iDtdVersion = pDtdVersion;
+ this.iId = pId;
+ this.iMethod = pMethod;
+ }
+
+ /**
+ * getCIMVersion
+ *
+ * @return String
+ */
+ public String getCIMVersion() {
+ return this.iCimVersion;
+ }
+
+ /**
+ * getDTDVersion
+ *
+ * @return String
+ */
+ public String getDTDVersion() {
+ return this.iDtdVersion;
+ }
+
+ /**
+ * isCIMOperation
+ *
+ * @return String
+ */
+ public boolean isCIMOperation() {
+ return !this.iIsCIMExport;
+ }
+
+ /**
+ * isCIMExport
+ *
+ * @return String
+ */
+ public boolean isCIMExport() {
+ return this.iIsCIMExport;
+ }
+
+ /**
+ * setId
+ *
+ * @param pId
+ */
+ public void setId(String pId) {
+ this.iId = pId;
+ }
+
+ /**
+ * setMethod
+ *
+ * @param pMethod
+ */
+ public void setMethod(String pMethod) {
+
+ this.iMethod = pMethod;
+ this.iIsCIMExport = (pMethod.toUpperCase().endsWith("EXPREQ") || pMethod.toUpperCase()
+ .endsWith("EXPRSP"));
+ this.iIsRequest = (pMethod.toUpperCase().endsWith("REQ"));
+ this.iIsSimple = pMethod.toUpperCase().startsWith("SIMPLE");
+ }
+
+ /**
+ * setCIMVersion
+ *
+ * @param pCimVersion
+ */
+ public void setCIMVersion(String pCimVersion) {
+ this.iCimVersion = pCimVersion;
+ }
+
+ /**
+ * setDTDVersion
+ *
+ * @param pDtdVersion
+ */
+ public void setDTDVersion(String pDtdVersion) {
+ this.iDtdVersion = pDtdVersion;
+ }
+
+ /**
+ * setIsRequest
+ *
+ * @param pValue
+ */
+ public void setIsRequest(boolean pValue) {
+ this.iIsRequest = pValue;
+ }
+
+ /**
+ * getId
+ *
+ * @return String
+ */
+ public String getId() {
+ return this.iId;
+ }
+
+ /**
+ * getProtocolVersion
+ *
+ * @return String
+ */
+ public String getProtocolVersion() {
+ return this.iProtocolVersion;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMRequest.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMRequest.java
similarity index 75%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMRequest.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMRequest.java
index d7af6b1..a87d204 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMRequest.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMRequest.java
@@ -1,168 +1,166 @@
-/*
- CIMRequest.java
-
- (C) Copyright IBM Corp. 2005, 2009
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
- * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
- *
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1535756 2006-08-07 lupusalex Make code warning free
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cimxml;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.Vector;
-
-import org.sentrysoftware.wbem.javax.cim.CIMObjectPath;
-
-/**
- * Class CIMRequest is used by the CIM-XML DOM parser.
- *
- */
-public class CIMRequest extends CIMMessage {
-
- protected Vector iRequests = new Vector(0);
-
- protected Vector iParamValue = new Vector(0);
-
- protected String iMethodName;
-
- protected CIMObjectPath iPath;
-
- protected String iNamespace;
-
- /**
- * Ctor.
- */
- public CIMRequest() { /**/}
-
- /**
- * Ctor.
- *
- * @param pCimVersion
- * @param pDtdVersion
- * @param pId
- * @param pMethod
- */
- public CIMRequest(String pCimVersion, String pDtdVersion, String pId, String pMethod) {
- super(pCimVersion, pDtdVersion, pId, pMethod);
- }
-
- /**
- * addParamValue
- *
- * @param v
- */
- public void addParamValue(Object v) {
- if (v instanceof Vector) this.iParamValue.addAll((Vector>) v);
- else this.iParamValue.add(v);
- }
-
- /**
- * addRequest
- *
- * @param request
- */
- public void addRequest(CIMRequest request) {
- this.iRequests.add(request);
- }
-
- /**
- * getMethodName
- *
- * @return String
- */
- public String getMethodName() {
- return this.iMethodName;
- }
-
- /**
- * getNameSpace
- *
- * @return String
- */
- public String getNameSpace() {
- return this.iNamespace;
- }
-
- /**
- * getObjectPath
- *
- * @return String
- */
- public CIMObjectPath getObjectPath() {
- return this.iPath;
- }
-
- /**
- * getParamValue
- *
- * @return String
- */
- public Vector getParamValue() {
- return this.iParamValue;
- }
-
- /**
- * setMethodName
- *
- * @param methodName
- */
- public void setMethodName(String methodName) {
- this.iMethodName = methodName;
- }
-
- /**
- * setNameSpace
- *
- * @param namespace
- */
- public void setNameSpace(String namespace) {
- this.iNamespace = namespace;
- }
-
- /**
- * setObjectPath
- *
- * @param path
- */
- public void setObjectPath(CIMObjectPath path) {
- this.iPath = path;
- }
-}
+/*
+ CIMRequest.java
+
+ (C) Copyright IBM Corp. 2005, 2009
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
+ * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
+ *
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1535756 2006-08-07 lupusalex Make code warning free
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cimxml;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.Vector;
+
+import org.metricshub.wbem.javax.cim.CIMObjectPath;
+
+/**
+ * Class CIMRequest is used by the CIM-XML DOM parser.
+ *
+ */
+public class CIMRequest extends CIMMessage {
+
+ protected Vector iRequests = new Vector(0);
+
+ protected Vector iParamValue = new Vector(0);
+
+ protected String iMethodName;
+
+ protected CIMObjectPath iPath;
+
+ protected String iNamespace;
+
+ /**
+ * Ctor.
+ */
+ public CIMRequest() { /**/}
+
+ /**
+ * Ctor.
+ *
+ * @param pCimVersion
+ * @param pDtdVersion
+ * @param pId
+ * @param pMethod
+ */
+ public CIMRequest(String pCimVersion, String pDtdVersion, String pId, String pMethod) {
+ super(pCimVersion, pDtdVersion, pId, pMethod);
+ }
+
+ /**
+ * addParamValue
+ *
+ * @param v
+ */
+ public void addParamValue(Object v) {
+ if (v instanceof Vector) this.iParamValue.addAll((Vector>) v);
+ else this.iParamValue.add(v);
+ }
+
+ /**
+ * addRequest
+ *
+ * @param request
+ */
+ public void addRequest(CIMRequest request) {
+ this.iRequests.add(request);
+ }
+
+ /**
+ * getMethodName
+ *
+ * @return String
+ */
+ public String getMethodName() {
+ return this.iMethodName;
+ }
+
+ /**
+ * getNameSpace
+ *
+ * @return String
+ */
+ public String getNameSpace() {
+ return this.iNamespace;
+ }
+
+ /**
+ * getObjectPath
+ *
+ * @return String
+ */
+ public CIMObjectPath getObjectPath() {
+ return this.iPath;
+ }
+
+ /**
+ * getParamValue
+ *
+ * @return String
+ */
+ public Vector getParamValue() {
+ return this.iParamValue;
+ }
+
+ /**
+ * setMethodName
+ *
+ * @param methodName
+ */
+ public void setMethodName(String methodName) {
+ this.iMethodName = methodName;
+ }
+
+ /**
+ * setNameSpace
+ *
+ * @param namespace
+ */
+ public void setNameSpace(String namespace) {
+ this.iNamespace = namespace;
+ }
+
+ /**
+ * setObjectPath
+ *
+ * @param path
+ */
+ public void setObjectPath(CIMObjectPath path) {
+ this.iPath = path;
+ }
+}
diff --git a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMResponse.java b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMResponse.java
similarity index 80%
rename from src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMResponse.java
rename to src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMResponse.java
index 154a94b..22cab16 100644
--- a/src/main/java/org/sentrysoftware/wbem/sblim/cimclient/internal/cimxml/CIMResponse.java
+++ b/src/main/java/org/metricshub/wbem/sblim/cimclient/internal/cimxml/CIMResponse.java
@@ -1,229 +1,227 @@
-/*
- CIMResponse.java
-
- (C) Copyright IBM Corp. 2005, 2012
-
- THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
- ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
- CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
-
- You can obtain a current copy of the Eclipse Public License from
- http://www.opensource.org/licenses/eclipse-1.0.php
-
- @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
- * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
- *
- *
- * Change History
- * Flag Date Prog Description
- *-------------------------------------------------------------------------------
- * 1535756 2006-08-07 lupusalex Make code warning free
- * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
- * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
- * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
- * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
- * 3525135 2012-05-09 blaschke-oss Remove CIMResponse.isSuccessul
- */
-
-package org.sentrysoftware.wbem.sblim.cimclient.internal.cimxml;
-
-/*-
- * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
- * WBEM Java Client
- * ჻჻჻჻჻჻
- * Copyright (C) 2023 Sentry Software
- * ჻჻჻჻჻჻
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Lesser Public
- * License along with this program. If not, see
- * .
- * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
- */
-
-import java.util.List;
-import java.util.Vector;
-
-import org.sentrysoftware.wbem.javax.wbem.WBEMException;
-
-/**
- * Represent a CIMReponse message.
- */
-public class CIMResponse extends CIMMessage {
-
- protected Vector iResponses = new Vector(0);
-
- protected WBEMException iError = null;
-
- protected Vector iReturnValue = new Vector();
-
- protected Vector iParamValue = new Vector(0);
-
- /**
- * Constructs a CIMResponse object.
- *
- */
- public CIMResponse() { /**/}
-
- /**
- * Constructs a CIMResponse object with the specified CIMVersion, DTDVersion
- * and method.
- *
- * @param pCimVersion
- * @param pDtdVersion
- * @param pId
- * @param pMethod
- */
- public CIMResponse(String pCimVersion, String pDtdVersion, String pId, String pMethod) {
- super(pCimVersion, pDtdVersion, pId, pMethod);
- }
-
- /**
- * Constructs a CIM Response message from a given CIM Request.
- *
- * @param request
- */
- public CIMResponse(CIMRequest request) {
- super();
- this.iCimVersion = request.getCIMVersion();
- this.iDtdVersion = request.getDTDVersion();
- }
-
- /**
- * addParamValue
- *
- * @param o
- */
- public void addParamValue(Object o) {
- this.iParamValue.add(o);
- }
-
- /**
- * addParamValue
- *
- * @param v
- */
- public void addParamValue(Vector v) {
- this.iParamValue.addAll(v);
- }
-
- /**
- * addResponse
- *
- * @param response
- */
- public void addResponse(CIMResponse response) {
- this.iResponses.add(response);
- }
-
- /**
- * addReturnValue
- *
- * @param o
- */
- public void addReturnValue(Object o) {
- this.iReturnValue.add(o);
- }
-
- /**
- * Verify the status code for this CIMResponse.
- *
- * @throws WBEMException
- * if the status code is other than success.
- */
- public void checkError() throws WBEMException {
- if (this.iError != null) throw this.iError;
- }
-
- /**
- * getAllResponses
- *
- * @return List
- */
- public List getAllResponses() {
- return this.iResponses;
- }
-
- /**
- * getException
- *
- * @return WBEMException
- */
- public WBEMException getException() {
- return this.iError;
- }
-
- /**
- * isSuccessful
- *
- * @return boolean
- */
- public boolean isSuccessful() {
- return this.iError == null;
- }
-
- /**
- * getFirstResponse
- *
- * @return CIMResponse
- */
- public CIMResponse getFirstResponse() {
- if (this.iResponses != null && this.iResponses.size() > 0) return this.iResponses
- .elementAt(0);
- return null;
- }
-
- /**
- * getParamValues
- *
- * @return List
- */
- public List getParamValues() {
- return this.iParamValue;
- }
-
- /**
- * getFirstReturnValue
- *
- * @return List
- */
- public List getFirstReturnValue() {
- return this.iReturnValue;
- }
-
- /**
- * setError
- *
- * @param error
- */
- public void setError(WBEMException error) {
- this.iError = error;
- }
-
- /**
- * setParamValue
- *
- * @param paramValue
- */
- public void setParamValue(Vector paramValue) {
- this.iParamValue = paramValue;
- }
-
- /**
- * setReturnValue
- *
- * @param returnValue
- */
- public void setReturnValue(Vector returnValue) {
- this.iReturnValue = returnValue;
- }
-
-}
+/*
+ CIMResponse.java
+
+ (C) Copyright IBM Corp. 2005, 2012
+
+ THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
+ ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
+ CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
+
+ You can obtain a current copy of the Eclipse Public License from
+ http://www.opensource.org/licenses/eclipse-1.0.php
+
+ @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
+ * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
+ *
+ *
+ * Change History
+ * Flag Date Prog Description
+ *-------------------------------------------------------------------------------
+ * 1535756 2006-08-07 lupusalex Make code warning free
+ * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
+ * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
+ * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
+ * 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
+ * 3525135 2012-05-09 blaschke-oss Remove CIMResponse.isSuccessul
+ */
+
+package org.metricshub.wbem.sblim.cimclient.internal.cimxml;
+
+/*-
+ * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
+ * WBEM Java Client
+ * ჻჻჻჻჻჻
+ * Copyright 2023 - 2025 MetricsHub
+ * ჻჻჻჻჻჻
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
+ */
+
+import java.util.List;
+import java.util.Vector;
+
+import org.metricshub.wbem.javax.wbem.WBEMException;
+
+/**
+ * Represent a CIMReponse message.
+ */
+public class CIMResponse extends CIMMessage {
+
+ protected Vector iResponses = new Vector(0);
+
+ protected WBEMException iError = null;
+
+ protected Vector iReturnValue = new Vector();
+
+ protected Vector iParamValue = new Vector(0);
+
+ /**
+ * Constructs a CIMResponse object.
+ *
+ */
+ public CIMResponse() { /**/}
+
+ /**
+ * Constructs a CIMResponse object with the specified CIMVersion, DTDVersion
+ * and method.
+ *
+ * @param pCimVersion
+ * @param pDtdVersion
+ * @param pId
+ * @param pMethod
+ */
+ public CIMResponse(String pCimVersion, String pDtdVersion, String pId, String pMethod) {
+ super(pCimVersion, pDtdVersion, pId, pMethod);
+ }
+
+ /**
+ * Constructs a CIM Response message from a given CIM Request.
+ *
+ * @param request
+ */
+ public CIMResponse(CIMRequest request) {
+ super();
+ this.iCimVersion = request.getCIMVersion();
+ this.iDtdVersion = request.getDTDVersion();
+ }
+
+ /**
+ * addParamValue
+ *
+ * @param o
+ */
+ public void addParamValue(Object o) {
+ this.iParamValue.add(o);
+ }
+
+ /**
+ * addParamValue
+ *
+ * @param v
+ */
+ public void addParamValue(Vector v) {
+ this.iParamValue.addAll(v);
+ }
+
+ /**
+ * addResponse
+ *
+ * @param response
+ */
+ public void addResponse(CIMResponse response) {
+ this.iResponses.add(response);
+ }
+
+ /**
+ * addReturnValue
+ *
+ * @param o
+ */
+ public void addReturnValue(Object o) {
+ this.iReturnValue.add(o);
+ }
+
+ /**
+ * Verify the status code for this CIMResponse.
+ *
+ * @throws WBEMException
+ * if the status code is other than success.
+ */
+ public void checkError() throws WBEMException {
+ if (this.iError != null) throw this.iError;
+ }
+
+ /**
+ * getAllResponses
+ *
+ * @return List
+ */
+ public List