diff --git a/cnf/maven/build.maven b/cnf/maven/build.maven index b32f78cb..c83ccfb2 100644 --- a/cnf/maven/build.maven +++ b/cnf/maven/build.maven @@ -1,9 +1,7 @@ # Google - com.google.mug:mug:8.0 # bnd - biz.aQute.bnd:biz.aQute.bnd.util:7.0.0 biz.aQute.bnd:biz.aQute.bndlib:7.0.0 biz.aQute.bnd:biz.aQute.launchpad:7.0.0 @@ -11,21 +9,17 @@ biz.aQute.bnd:biz.aQute.remote.agent:7.0.0 biz.aQute.bnd:biz.aQute.resolve:7.0.0 # Apache - org.apache.commons:commons-exec:1.4.0 org.apache.felix:org.apache.felix.healthcheck.api:2.0.4 # Font Awesome FX - de.jensd:fontawesomefx:8.9 # OSGi R6 (Required for Remote Agent) - org.osgi:osgi.cmpn:6.0.0 org.osgi:osgi.core:6.0.0 # OSGi R8 (Required for RCP Application) - org.osgi:org.osgi.application:1.0.0 org.osgi:org.osgi.namespace.contract:1.0.0 org.osgi:org.osgi.namespace.extender:1.0.1 @@ -54,24 +48,19 @@ org.osgi:osgi.annotation:8.1.0 org.osgi:osgi.core:8.0.0 # TilesFx - eu.hansolo:tilesfx:21.0.3 eu.hansolo:toolbox:21.0.5 eu.hansolo:toolboxfx:21.0.3 # FormsFx - com.dlsc.formsfx:formsfx-core:11.6.0 # JGraphT - org.jgrapht:jgrapht-core:1.5.2 org.jgrapht:jgrapht-io:1.5.2 # Required for Tic-Tac-Toe Sample Extension - eu.lestard:advanced-bindings:0.4.0 # Logging Facade - com.j256.simplelogging:simplelogging:3.0 \ No newline at end of file diff --git a/cnf/maven/runtime.maven b/cnf/maven/runtime.maven index f4609c64..3631dfb8 100644 --- a/cnf/maven/runtime.maven +++ b/cnf/maven/runtime.maven @@ -1,20 +1,19 @@ # UI - com.google.code.gson:gson:2.11.0 -# Apache - +# Apache Utilities commons-io:commons-io:2.16.1 -org.apache.aries.component-dsl:org.apache.aries.component-dsl.component-dsl:1.2.2 org.apache.commons:commons-lang3:3.14.0 org.apache.commons:commons-text:1.12.0 -# JSON +# Apache OSGi Component Management +org.apache.aries.component-dsl:org.apache.aries.component-dsl.component-dsl:1.2.2 +# JSON Processing org.glassfish:jakarta.json:2.0.1 +com.google.code.gson:gson:2.11.0 -# Felix - +# Felix (OSGi) org.apache.felix:org.apache.felix.cm.json:2.0.6 org.apache.felix:org.apache.felix.configadmin:1.9.26 org.apache.felix:org.apache.felix.configurator:1.0.18 @@ -25,16 +24,14 @@ org.apache.felix:org.apache.felix.eventadmin:1.6.4 org.apache.felix:org.apache.felix.metatype:1.2.4 org.apache.felix:org.apache.felix.scr:2.2.10 -# OSGi - +# OSGi Core Services org.osgi:org.osgi.service.component:1.5.1 org.osgi:org.osgi.service.prefs:1.1.2 org.osgi:org.osgi.util.function:1.2.0 org.osgi:org.osgi.util.promise:1.3.0 org.osgi:org.osgi.util.pushstream:1.1.0 -# Equinox - +# Equinox (OSGi) org.eclipse.platform:org.eclipse.equinox.app:1.7.0 org.eclipse.platform:org.eclipse.equinox.bidi:1.5.0 org.eclipse.platform:org.eclipse.equinox.common:3.19.0 @@ -53,7 +50,6 @@ org.eclipse.platform:org.eclipse.osgi:3.19.0 org.eclipse.platform:org.eclipse.osgi.services:3.12.0 # Eclipse e4 - org.eclipse.platform:org.eclipse.e4.core.commands:1.1.300 org.eclipse.platform:org.eclipse.e4.core.contexts:1.12.500 org.eclipse.platform:org.eclipse.e4.core.di:1.9.300 @@ -67,8 +63,7 @@ org.eclipse.platform:org.eclipse.e4.ui.model.workbench:2.4.200 org.eclipse.platform:org.eclipse.e4.ui.services:1.6.300 org.eclipse.platform:org.eclipse.e4.ui.workbench:1.15.100 -# Eclipse Platform - +# Eclipse Platform Core org.eclipse.platform:org.eclipse.core.commands:3.12.0 org.eclipse.platform:org.eclipse.core.contenttype:3.9.300 org.eclipse.platform:org.eclipse.core.databinding:1.13.200 @@ -84,7 +79,6 @@ org.eclipse.platform:org.eclipse.core.runtime:3.31.0 org.eclipse.platform:org.eclipse.core.variables:3.6.300 # OSGi Logging - org.apache.sling:org.apache.sling.commons.log:5.5.0 org.apache.sling:org.apache.sling.commons.logservice:1.1.0 org.slf4j:slf4j-api:1.7.36 \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/CDIComponentRuntimeDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/CDIComponentRuntimeDTO.java index eb01b74f..7f899ad4 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/CDIComponentRuntimeDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/CDIComponentRuntimeDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -21,9 +21,25 @@ import org.osgi.service.cdi.runtime.dto.ContainerDTO; import org.osgi.service.cdi.runtime.dto.template.ContainerTemplateDTO; +/** + * Represents the runtime state and configuration of CDI (Contexts and Dependency + * Injection) components within the OSGi framework. This class extends the + * {@link DTO} class to provide a standardized data transfer object for CDI component + * runtime information. + *
+ * The {@code CDIComponentRuntimeDTO} class contains collections of {@link ContainerDTO} + * instances, which represent the current state of CDI containers, and + * {@link ContainerTemplateDTO} instances, which define the template configurations + * for these containers. It is used to transfer CDI component runtime data between + * different components or systems in a consistent format. + *
+ */ public class CDIComponentRuntimeDTO extends DTO { - public Collection+ * Each instance of this class holds a single configuration entry, defined by + * its key, value, and type, which can be used in different contexts such as + * configuration management or data exchange. + *
+ */ public class ConfigValue { - public String key; - public Object value; + /** The key of the configuration entry. */ + public String key; + + /** The value associated with the configuration key. */ + public Object value; + + /** The type of the configuration value, represented by {@link XAttributeDefType}. */ public XAttributeDefType type; + /** + * Default constructor required for JSON serialization. + */ public ConfigValue() { // required for JSON serialization } + /** + * Constructs a new {@code ConfigValue} instance with the specified key, value, and type. + * + * @param key the key of the configuration entry, must not be null + * @param value the value associated with the key, can be any object + * @param type the type of the configuration value, must not be null + */ public ConfigValue(final String key, final Object value, final XAttributeDefType type) { - this.key = key; + this.key = key; this.value = value; - this.type = type; + this.type = type; } + /** + * Factory method to create a new {@code ConfigValue} instance. + * + * @param key the key of the configuration entry, must not be null + * @param value the value associated with the key, can be any object + * @param type the type of the configuration value, must not be null + * @return a new {@code ConfigValue} instance with the specified key, value, and type + */ public static ConfigValue create(final String key, final Object value, final XAttributeDefType type) { return new ConfigValue(key, value, type); } -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/DmtDataType.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/DmtDataType.java index c50e5681..9e72d463 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/DmtDataType.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/DmtDataType.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -15,17 +15,46 @@ ******************************************************************************/ package com.osgifx.console.agent.dto; +/** + * Enum representing the different data types that can be used in a DMT (Device + * Management Tree) structure within the OSGi framework. These types are utilized + * to define the format and nature of data stored in or retrieved from a DMT node. + */ public enum DmtDataType { + + /** Base64-encoded binary data. */ BASE64, + + /** Binary data. */ BINARY, + + /** Boolean value (true or false). */ BOOLEAN, + + /** Date value in a standardized format. */ DATE, + + /** Floating-point numeric value. */ FLOAT, + + /** Integer numeric value. */ INTEGER, + + /** Null value, indicating the absence of data. */ NULL, + + /** String value. */ STRING, + + /** Time value in a standardized format. */ TIME, + + /** XML-formatted data. */ XML, + + /** Long numeric value. */ LONG, + + /** Combined date and time value in a standardized format. */ DATE_TIME } \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/HttpServiceRuntimeDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/HttpServiceRuntimeDTO.java index 7445abc5..115fd686 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/HttpServiceRuntimeDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/HttpServiceRuntimeDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -18,8 +18,20 @@ import org.osgi.dto.DTO; import org.osgi.service.http.runtime.dto.RuntimeDTO; +/** + * Represents the runtime status and configuration of an HTTP service within + * the OSGi framework. This class extends the {@link DTO} class to provide a + * standardized data transfer object for HTTP service runtime information. + *+ * The {@code HttpServiceRuntimeDTO} class contains a reference to a {@link RuntimeDTO} + * instance, which encapsulates details about the runtime environment of the HTTP + * service. It is used to transfer HTTP service runtime data between different + * components or systems in a consistent format. + *
+ */ public class HttpServiceRuntimeDTO extends DTO { + /** The runtime details of the HTTP service, represented by {@link RuntimeDTO}. */ public RuntimeDTO runtime; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/JaxRsServiceRuntimeDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/JaxRsServiceRuntimeDTO.java index ba4188b4..a3861533 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/JaxRsServiceRuntimeDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/JaxRsServiceRuntimeDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -18,8 +18,20 @@ import org.osgi.dto.DTO; import org.osgi.service.jaxrs.runtime.dto.RuntimeDTO; +/** + * Represents the runtime status and configuration of a JAX-RS service within + * the OSGi framework. This class extends the {@link DTO} class to provide a + * standardized data transfer object for JAX-RS runtime information. + *+ * The {@code JaxRsServiceRuntimeDTO} class contains details about the JAX-RS + * service runtime environment, encapsulated in the {@link RuntimeDTO} instance. + * It is used to transfer JAX-RS runtime data between different components or + * systems in a consistent format. + *
+ */ public class JaxRsServiceRuntimeDTO extends DTO { + /** The runtime details of the JAX-RS service, represented by {@link RuntimeDTO}. */ public RuntimeDTO runtime; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/RuntimeDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/RuntimeDTO.java index b3aeaaf9..d66d5d4f 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/RuntimeDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/RuntimeDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -18,12 +18,34 @@ import org.osgi.dto.DTO; import org.osgi.framework.dto.FrameworkDTO; +/** + * Represents the comprehensive runtime information of various components and + * services within the OSGi framework. This class extends the {@link DTO} class + * to provide a standardized data transfer object for aggregating runtime details + * of the OSGi environment. + *+ * The {@code RuntimeDTO} class includes references to runtime details of several + * key components, such as the framework itself ({@link FrameworkDTO}), service + * components, JAX-RS services, HTTP services, and CDI components. It is used to + * transfer an aggregated view of the OSGi runtime state between different components + * or systems in a consistent format. + *
+ */ public class RuntimeDTO extends DTO { - public FrameworkDTO framework; + /** The runtime details of the OSGi framework, represented by {@link FrameworkDTO}. */ + public FrameworkDTO framework; + + /** The runtime details of the Service Component Runtime (SCR). */ public ServiceComponentRuntimeDTO scr; - public JaxRsServiceRuntimeDTO jaxrs; - public HttpServiceRuntimeDTO http; - public CDIComponentRuntimeDTO cdi; -} + /** The runtime details of the JAX-RS service. */ + public JaxRsServiceRuntimeDTO jaxrs; + + /** The runtime details of the HTTP service. */ + public HttpServiceRuntimeDTO http; + + /** The runtime details of the CDI (Contexts and Dependency Injection) components. */ + public CDIComponentRuntimeDTO cdi; + +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/ServiceComponentRuntimeDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/ServiceComponentRuntimeDTO.java index b2fcfd0c..5d4195b7 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/ServiceComponentRuntimeDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/ServiceComponentRuntimeDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -21,9 +21,25 @@ import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO; import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO; +/** + * Represents the runtime details of service components within the OSGi framework. + * This class extends the {@link DTO} class to provide a standardized data transfer + * object for information related to the runtime state and configuration of service + * components. + *+ * The {@code ServiceComponentRuntimeDTO} class contains collections of + * {@link ComponentDescriptionDTO} instances, which describe the service components, + * and {@link ComponentConfigurationDTO} instances, which provide details about + * the current configurations of these components. It is used to transfer service + * component runtime data between different components or systems in a consistent format. + *
+ */ public class ServiceComponentRuntimeDTO extends DTO { - public Collection+ * The {@code XAttributeDefType} enum also includes utility methods to determine + * the appropriate type for a given object value and to retrieve the corresponding + * class type for each enum constant. + *
+ */ public enum XAttributeDefType { + /** Represents a single String value. */ STRING, + + /** Represents an array of String values. */ STRING_ARRAY, + + /** Represents a list of String values. */ STRING_LIST, + + /** Represents a single Integer value. */ INTEGER, + + /** Represents an array of Integer values. */ INTEGER_ARRAY, + + /** Represents a list of Integer values. */ INTEGER_LIST, + + /** Represents a single Boolean value. */ BOOLEAN, + + /** Represents an array of Boolean values. */ BOOLEAN_ARRAY, + + /** Represents a list of Boolean values. */ BOOLEAN_LIST, + + /** Represents a single Double value. */ DOUBLE, + + /** Represents an array of Double values. */ DOUBLE_ARRAY, + + /** Represents a list of Double values. */ DOUBLE_LIST, + + /** Represents a single Float value. */ FLOAT, + + /** Represents an array of Float values. */ FLOAT_ARRAY, + + /** Represents a list of Float values. */ FLOAT_LIST, + + /** Represents a single Character value. */ CHAR, + + /** Represents an array of Character values. */ CHAR_ARRAY, + + /** Represents a list of Character values. */ CHAR_LIST, + + /** Represents a single Long value. */ LONG, + + /** Represents an array of Long values. */ LONG_ARRAY, + + /** Represents a list of Long values. */ LONG_LIST, + + /** Represents a password value stored as a String. */ PASSWORD; + /** + * Determines the appropriate {@code XAttributeDefType} for the given object value. + * + * @param value the object to determine the type for + * @return the corresponding {@code XAttributeDefType} based on the object's class + */ public static XAttributeDefType getType(final Object value) { final Class> clazz = value.getClass(); if (clazz.equals(String.class)) { @@ -158,6 +218,12 @@ public static XAttributeDefType getType(final Object value) { return XAttributeDefType.STRING; } + /** + * Returns the corresponding Java class for the specified {@code XAttributeDefType}. + * + * @param type the {@code XAttributeDefType} for which to get the class + * @return the corresponding Java class, or null if the type is not recognized + */ public static Class> clazz(final XAttributeDefType type) { switch (type) { case STRING: @@ -180,4 +246,4 @@ public static Class> clazz(final XAttributeDefType type) { } } -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XComponentDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XComponentDTO.java index 621dec3f..8a6ec6fb 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XComponentDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XComponentDTO.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -20,26 +20,74 @@ import org.osgi.dto.DTO; +/** + * Represents the details and runtime state of a component within the OSGi + * framework. This class extends the {@link DTO} class to provide a standardized + * data transfer object for component-related information. + *+ * The {@code XComponentDTO} class contains information such as the component's + * identifier, name, state, properties, references, lifecycle methods, and any + * related errors or failures. It is used to transfer component data between + * different components or systems in a consistent format. + *
+ */ public class XComponentDTO extends DTO { - public long id; - public String name; - public String state; - public String registeringBundle; - public long registeringBundleId; - public String factory; - public String scope; - public String implementationClass; - public String configurationPolicy; - public List+ * The {@code XComponentReferenceFilterDTO} class contains information such as + * the component name, the target key for filtering, and the filter expression + * to be applied. It is used to specify criteria for selecting or matching + * references in the OSGi service registry. + *
+ */ public class XComponentReferenceFilterDTO extends DTO { + /** The name of the component to which this filter applies. */ public String componentName; + + /** The key used to target a specific reference for filtering. */ public String targetKey; + + /** The LDAP-style filter expression used to filter the component reference. */ public String targetFilter; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XConfigurationDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XConfigurationDTO.java index 1bad1a9e..cdae5926 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XConfigurationDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XConfigurationDTO.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -20,15 +20,43 @@ import org.osgi.dto.DTO; +/** + * Represents a configuration object within the OSGi framework. This class extends + * the {@link DTO} class to provide a standardized data transfer object for + * configuration-related information. + *+ * The {@code XConfigurationDTO} class contains details such as the PID (Persistent + * Identifier), factory PID, location, whether the configuration is a factory or + * persisted configuration, and its properties. Additionally, it includes information + * about the object class definition and any component reference filters that apply + * to the configuration. It is used to transfer configuration data between different + * components or systems in a consistent format. + *
+ */ public class XConfigurationDTO extends DTO { - public String pid; - public String factoryPid; - public String location; - public boolean isFactory; - public boolean isPersisted; - public XObjectClassDefDTO ocd; - public Map+ * The {@code XHealthCheckDTO} class includes information such as the service ID, + * name, MBean name, scheduling details like cron expression or interval, result + * time-to-live (TTL), sticky duration for non-OK results, and associated tags. + * It is used to transfer health check data between different components or systems + * in a consistent format. + *
+ */ public class XHealthCheckDTO extends DTO { - public long serviceID; - public String name; - public String mbeanName; - public String cronExpression; - public Long interval; - public Long resultTTL; - public Long keepNonOkResultsSticky; + /** The unique service ID of the health check. */ + public long serviceID; + + /** The name of the health check. */ + public String name; + + /** The MBean name associated with this health check. */ + public String mbeanName; + + /** The cron expression defining the schedule for this health check. */ + public String cronExpression; + + /** The interval in milliseconds between executions of this health check. */ + public Long interval; + + /** The time-to-live (TTL) in milliseconds for the health check results. */ + public Long resultTTL; + + /** The duration in milliseconds to keep non-OK results sticky. */ + public Long keepNonOkResultsSticky; + + /** A list of tags associated with this health check. */ public List+ * The {@code XHealthCheckResultDTO} class includes details such as the name and + * tags of the health check, a list of individual results, the time taken to + * execute the health check, the timestamp when it finished, and whether the + * health check execution timed out. It is used to transfer health check results + * between different components or systems in a consistent format. + *
+ */ public class XHealthCheckResultDTO extends DTO { + /** + * Represents an individual result entry for a health check execution. + * This class extends the {@link DTO} class to provide structured information + * about the outcome of a health check. + */ public static class ResultDTO extends DTO { + + /** The status of the health check result (e.g., "OK", "WARN", "CRITICAL"). */ public String status; + + /** The message associated with the health check result, providing details about the status. */ public String message; + + /** The log level associated with the health check result (e.g., "INFO", "ERROR"). */ public String logLevel; + + /** The exception message, if any, associated with the health check result. */ public String exception; } - public String healthCheckName; - public List+ * The {@code XHttpComponentDTO} class contains details about various types of + * HTTP components, such as servlets, filters, listeners, and error pages. It + * includes information like component name, service ID, context details, supported + * patterns, and specific settings related to each component type. + *
+ */ public class XHttpComponentDTO extends DTO { - public String name; - public boolean asyncSupported; - public long serviceId; + // General Component Information + /** The name of the HTTP component. */ + public String name; + + /** Indicates whether asynchronous processing is supported by this component. */ + public boolean asyncSupported; + + /** The service ID associated with this HTTP component. */ + public long serviceId; + + /** A list of URL patterns that this HTTP component is mapped to. */ public List+ * The {@code XLogEntryDTO} class includes details such as the bundle that generated + * the log entry, the log level, the message, any associated exception, the timestamp + * of when the log was recorded, and additional information about the thread and logger + * involved. + *
+ */ public class XLogEntryDTO extends DTO { + // Bundle Information + /** The bundle that generated the log entry. */ public XBundleDTO bundle; - public String level; - public String message; - public String exception; - public long loggedAt; - public String threadInfo; - public String logger; - -} + + // Log Details + /** The log level of the entry (e.g., "DEBUG", "INFO", "WARN", "ERROR"). */ + public String level; + + /** The message of the log entry. */ + public String message; + + /** The exception message, if any, associated with the log entry. */ + public String exception; + + // Log Context Information + /** The timestamp in milliseconds when the log entry was recorded. */ + public long loggedAt; + + /** Information about the thread that generated the log entry. */ + public String threadInfo; + + /** The name of the logger that created the log entry. */ + public String logger; + +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XObjectClassDefDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XObjectClassDefDTO.java index bf418ff2..426db00d 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XObjectClassDefDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XObjectClassDefDTO.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -19,14 +19,42 @@ import org.osgi.dto.DTO; +/** + * Represents an object class definition (OCD) within the OSGi framework. + * This class extends the {@link DTO} class to provide a standardized data transfer + * object for information related to object class definitions, which are used for + * configuration metadata. + *+ * The {@code XObjectClassDefDTO} class contains details such as the ID, PID, factory + * PID, name, description, descriptor location, and associated attribute definitions. + * It is used to transfer object class definition data between different components + * or systems in a consistent format. + *
+ */ public class XObjectClassDefDTO extends DTO { - public String id; - public String pid; - public String factoryPid; - public String name; - public String description; - public String descriptorLocation; + // Identification Information + /** The unique identifier of the object class definition. */ + public String id; + + /** The persistent identifier (PID) associated with this object class definition. */ + public String pid; + + /** The factory persistent identifier (factory PID), if this is a factory object class definition. */ + public String factoryPid; + + // Descriptive Information + /** The name of the object class definition. */ + public String name; + + /** A description of the object class definition. */ + public String description; + + /** The location of the descriptor associated with this object class definition. */ + public String descriptorLocation; + + // Attribute Definitions + /** A list of attribute definitions associated with this object class definition. */ public List+ * The {@code XReferenceDTO} class includes details such as the reference name, + * interface, cardinality, policy, and methods for binding and unbinding the reference. + * It is used to transfer reference data between different components or systems + * in a consistent format. + *
+ */ public class XReferenceDTO extends DTO { - public String name; - public String interfaceName; - public String cardinality; - public String policy; - public String policyOption; - public String target; - public String bind; - public String unbind; - public String updated; - public String field; - public String fieldOption; - public String scope; + // Basic Reference Information + /** The name of the reference. */ + public String name; + + /** The fully qualified name of the service interface for this reference. */ + public String interfaceName; + + // Cardinality and Policy Information + /** The cardinality of the reference (e.g., "1..1", "0..n"). */ + public String cardinality; + + /** The policy for this reference (e.g., "static", "dynamic"). */ + public String policy; + + /** The policy option for this reference (e.g., "greedy", "reluctant"). */ + public String policyOption; + + // Target Filter Information + /** The target filter expression for this reference. */ + public String target; + + // Binding and Lifecycle Methods + /** The method name used to bind the reference. */ + public String bind; + + /** The method name used to unbind the reference. */ + public String unbind; + + /** The method name used to update the reference. */ + public String updated; + + // Field and Injection Information + /** The field name used for injecting this reference. */ + public String field; + + /** The field option for this reference (e.g., "replace", "update"). */ + public String fieldOption; + + /** The scope of the reference (e.g., "singleton", "prototype"). */ + public String scope; + + // Parameter and Collection Information + /** The parameter index associated with this reference in a constructor or method. */ public Integer parameter; - public String collectionType; -} + /** The collection type for this reference if it is a collection (e.g., "list", "set"). */ + public String collectionType; + +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XResultDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XResultDTO.java index c491a17c..2a346050 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XResultDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XResultDTO.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -17,13 +17,30 @@ import org.osgi.dto.DTO; +/** + * Represents a result within the OSGi framework. This class extends the {@link DTO} + * class to provide a standardized data transfer object for result-related information. + *+ * The {@code XResultDTO} class includes details such as the result status and a + * response message. It is used to transfer result data between different components + * or systems in a consistent format. + *
+ */ public class XResultDTO extends DTO { + /** Constant representing a successful result. */ public static final int SUCCESS = 1; - public static final int ERROR = 2; + + /** Constant representing an error result. */ + public static final int ERROR = 2; + + /** Constant representing a skipped result. */ public static final int SKIPPED = 3; - public int result; + /** The result status (e.g., SUCCESS, ERROR, SKIPPED). */ + public int result; + + /** The response message associated with the result. */ public String response; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XRoleDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XRoleDTO.java index 43bf3b10..1c66f49f 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XRoleDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XRoleDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -20,19 +20,46 @@ import org.osgi.dto.DTO; +/** + * Represents a role within the OSGi framework, which can be a user, group, or + * default role. This class extends the {@link DTO} class to provide a standard + * data transfer object for roles and their associated properties. + *+ * The {@code XRoleDTO} class holds information about the role type, name, properties, + * credentials, and members (both basic and required). It is used for transferring + * role data between different components or systems in a consistent format. + *
+ */ public class XRoleDTO extends DTO { + /** + * Enumeration of the possible types of roles. + */ public enum Type { + /** A role representing an individual user. */ USER, + /** A role representing a group of users. */ GROUP, + /** A default role used when no specific role is assigned. */ DEFAULT } - public Type type; - public String name; + /** The type of the role, represented by the {@link Type} enum. */ + public Type type; + + /** The name of the role. */ + public String name; + + /** A map containing the properties associated with the role. */ public Map+ * The {@code XSatisfiedReferenceDTO} class includes details such as the reference + * name, target, object class, and an array of associated service references. It + * is used to transfer information about satisfied references between different + * components or systems in a consistent format. + *
+ */ public class XSatisfiedReferenceDTO extends DTO { - public String name; - public String target; - public String objectClass; + /** The name of the satisfied reference. */ + public String name; + + /** The target filter expression for the satisfied reference. */ + public String target; + + /** The fully qualified name of the object class associated with the satisfied reference. */ + public String objectClass; + + /** An array of service references that satisfy this reference. */ public ServiceReferenceDTO[] serviceReferences; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XServiceInfoDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XServiceInfoDTO.java index 0c21a433..88ec6617 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XServiceInfoDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XServiceInfoDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -17,9 +17,22 @@ import org.osgi.dto.DTO; +/** + * Represents information about a service in the OSGi framework. This class extends + * the {@link DTO} class to provide a standard data transfer object for service-related + * information. + *+ * The {@code XServiceInfoDTO} class holds details such as the unique identifier of the + * service and its object class, which can be used for transferring service data between + * different components or systems in a consistent format. + *
+ */ public class XServiceInfoDTO extends DTO { - public long id; + /** The unique identifier of the service. */ + public long id; + + /** The fully qualified name of the service's object class. */ public String objectClass; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XThreadDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XThreadDTO.java index b819a064..6316c313 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XThreadDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XThreadDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -17,15 +17,41 @@ import org.osgi.dto.DTO; +/** + * Represents the state and attributes of a thread within the OSGi framework. + * This class extends the {@link DTO} class to provide a standard data transfer + * object for thread-related information. + *+ * The {@code XThreadDTO} class holds various details about a thread, such as its + * name, identifier, priority, state, and whether it is interrupted, alive, daemon, + * or deadlocked. It is used for transferring thread data between different components + * or systems in a consistent format. + *
+ */ public class XThreadDTO extends DTO { - public String name; - public long id; - public int priority; - public String state; + /** The name of the thread. */ + public String name; + + /** The unique identifier of the thread. */ + public long id; + + /** The priority of the thread. */ + public int priority; + + /** The current state of the thread, represented as a string. */ + public String state; + + /** Indicates whether the thread is currently interrupted. */ public boolean isInterrupted; + + /** Indicates whether the thread is currently alive. */ public boolean isAlive; + + /** Indicates whether the thread is a daemon thread. */ public boolean isDaemon; + + /** Indicates whether the thread is in a deadlocked state. */ public boolean isDeadlocked; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XUnsatisfiedReferenceDTO.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XUnsatisfiedReferenceDTO.java index a49dd654..cd44b817 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XUnsatisfiedReferenceDTO.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/dto/XUnsatisfiedReferenceDTO.java @@ -2,14 +2,14 @@ * Copyright 2021-2024 Amit Kumar Mondal * * 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 + * 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 + * 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 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. ******************************************************************************/ @@ -17,10 +17,26 @@ import org.osgi.dto.DTO; +/** + * Represents an unsatisfied service reference within the OSGi framework. + * This class extends the {@link DTO} class to provide a standard data transfer + * object for information about service references that are currently unsatisfied. + *+ * The {@code XUnsatisfiedReferenceDTO} class contains details such as the name of + * the unsatisfied reference, the target filter expression, and the object class + * associated with the reference. It is used to transfer information about unsatisfied + * service references between different components or systems in a consistent format. + *
+ */ public class XUnsatisfiedReferenceDTO extends DTO { + /** The name of the unsatisfied service reference. */ public String name; + + /** The target filter expression for the unsatisfied reference. */ public String target; + + /** The fully qualified name of the object class associated with the reference. */ public String objectClass; -} +} \ No newline at end of file diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/MqttClient.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/MqttClient.java index ec73bc47..5e058111 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/MqttClient.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/MqttClient.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -25,39 +25,68 @@ import com.osgifx.console.agent.rpc.mqtt.api.Mqtt5Publisher; import com.osgifx.console.agent.rpc.mqtt.api.Mqtt5Subscriber; +/** + * Manages MQTT clients for publishing and subscribing to messages within the OSGi framework. + * This class uses {@link ServiceTracker} to track instances of {@link Mqtt5Publisher} and + * {@link Mqtt5Subscriber} services, allowing for dynamic service binding and unbinding. + */ public final class MqttClient { - private final ServiceTracker+ * Implementations of this interface are responsible for publishing a given message + * to the associated MQTT topic defined within the message. + *
*/ public interface Mqtt5Publisher { /** - * Publish the specified message to the associated topic contained in the message + * Publishes the specified MQTT message to the topic defined in the + * {@link Mqtt5Message}. + *+ * The topic and other parameters necessary for the message are encapsulated + * within the {@link Mqtt5Message} object. + *
* - * @param message the message to publish + * @param message the {@link Mqtt5Message} to be published, containing the topic + * and message payload + * @throws IllegalArgumentException if the message is null or invalid */ void publish(Mqtt5Message message); diff --git a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/api/Mqtt5Subscriber.java b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/api/Mqtt5Subscriber.java index c354234b..5a0e6aa0 100644 --- a/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/api/Mqtt5Subscriber.java +++ b/com.osgifx.console.agent.api/src/main/java/com/osgifx/console/agent/rpc/mqtt/api/Mqtt5Subscriber.java @@ -5,7 +5,7 @@ * 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 + * 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 @@ -18,16 +18,30 @@ import org.osgi.util.pushstream.PushStream; /** - * The consumer interface to plugin custom functionality for consuming MQTT messages + * Represents a subscriber for MQTT version 5 messages. This interface allows for + * the implementation of custom functionality to consume messages from specified + * MQTT topics. + *+ * Implementations of this interface are responsible for subscribing to a given + * topic and providing a mechanism to receive and process messages asynchronously + * using a {@link PushStream}. + *
*/ public interface Mqtt5Subscriber { /** - * Subscribe to the specified topic + * Subscribes to the specified MQTT topic and returns a {@link PushStream} that + * allows asynchronous processing of incoming messages from that topic. + *+ * The topic parameter identifies the channel to which the subscriber will listen + * for incoming messages. + *
* - * @param topic the topic to subscribe to - * @return {@link PushStream} instance for the subscription + * @param topic the MQTT topic to subscribe to, must not be null or empty + * @return a {@link PushStream} instance representing the stream of messages + * received from the subscribed topic + * @throws IllegalArgumentException if the topic is null or empty */ - PushStream+ * The {@code OSGiCompendiumService} enum provides a standard list of OSGi services + * used in the framework, such as the Service Component Runtime (SCR), Configuration + * Admin (CM), Metatype, DMT Admin, User Admin, Logger Admin, and Event Admin. + *
+ */ public enum OSGiCompendiumService { + /** Service Component Runtime (SCR) service. */ SCR("SCR"), + + /** Configuration Admin (CM) service. */ CM("Config Admin"), + + /** Metatype service for managing metatype information. */ METATYPE("Metatype"), + + /** Device Management Tree (DMT) Admin service. */ DMT("DMT Admin"), + + /** User Admin service for managing user accounts and groups. */ USER_ADMIN("User Admin"), + + /** Logger Admin service according to OSGi R7 specification. */ LOGGER_ADMIN("R7 Logger Admin"), + + /** Event Admin service for managing event delivery. */ EVENT_ADMIN("Event Admin"), - HTTP_RUNTIME("Event Admin"); - String comprehensibleName; + /** HTTP Runtime service. */ + HTTP_RUNTIME("HTTP Runtime"); + /** The comprehensible name of the OSGi compendium service. */ + public final String comprehensibleName; + + /** + * Constructs an {@code OSGiCompendiumService} with a comprehensible name. + * + * @param comprehensibleName the human-readable name of the OSGi service + */ OSGiCompendiumService(final String comprehensibleName) { this.comprehensibleName = comprehensibleName; } -} + /** + * Returns the comprehensible name of the OSGi compendium service. + * + * @return the human-readable name of the service + */ + public String getComprehensibleName() { + return comprehensibleName; + } +} \ No newline at end of file