Skip to content

Commit

Permalink
Merge branch 'openhab:main' into addon-dto-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfg authored Nov 26, 2023
2 parents 16845c5 + 32237a9 commit 6b1d750
Show file tree
Hide file tree
Showing 147 changed files with 911 additions and 361 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[![Jenkins Build Status](https://ci.openhab.org/job/openHAB-Core/badge/icon)](https://ci.openhab.org/job/openHAB-Core/)
[![EPL-2.0](https://img.shields.io/badge/license-EPL%202-green.svg)](https://opensource.org/licenses/EPL-2.0)
[![Crowdin](https://badges.crowdin.net/openhab-core/localized.svg)](https://crowdin.com/project/openhab-core)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=28054058)](https://www.bountysource.com/teams/openhab/issues?tracker_ids=28054058)

This project contains core bundles of the openHAB runtime.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void refreshSource() {
}

/**
* Add a {@link MarketplaceAddonHandler) to this service
* Add a {@link MarketplaceAddonHandler} to this service
*
* This needs to be implemented by the addon-services because the handlers are references to OSGi services and
* the @Reference annotation is not inherited.
Expand All @@ -147,7 +147,7 @@ public void refreshSource() {
protected abstract void addAddonHandler(MarketplaceAddonHandler handler);

/**
* Remove a {@link MarketplaceAddonHandler) from this service
* Remove a {@link MarketplaceAddonHandler} from this service
*
* This needs to be implemented by the addon-services because the handlers are references to OSGi services and
* unbind methods can't be inherited.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import org.openhab.core.events.AbstractEvent;

/**
* This is an {@link Event} that is sent on add-on operations, such as installing and uninstalling.
* This is an {@link org.openhab.core.events.Event} that is sent on add-on operations, such as installing and
* uninstalling.
*
* @author Kai Kreuzer - Initial contribution
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* This is an {@link EventFactory} for creating add-on events. The following event types are supported by this
* factory:
*
* {@link AddonEventFactory#TYPE}
* {@link AddonEvent#TYPE}
*
* @author Kai Kreuzer - Initial contribution
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AudioFormat {
null, null);

/**
* {@link AudioCodec} encoded data without any container header or footer,
* {@code AudioCodec} encoded data without any container header or footer,
* e.g. MP3 is a non-container format
*/
public static final String CONTAINER_NONE = "NONE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface AudioHTTPServer {
*
* @param stream the stream to serve on HTTP
* @return the relative URL to access the stream starting with a '/'
* @deprecated Use {@link AudioHTTPServer#serve(AudioStream, int, boolean, CompletableFuture)}
* @deprecated Use {@link AudioHTTPServer#serve(AudioStream, int, boolean)}
*/
@Deprecated
String serve(AudioStream stream);
Expand All @@ -54,7 +54,7 @@ public interface AudioHTTPServer {
* @param stream the stream to serve on HTTP
* @param seconds number of seconds for which the stream is available through HTTP
* @return the relative URL to access the stream starting with a '/'
* @deprecated Use {@link AudioHTTPServer#serve(AudioStream, int, boolean, CompletableFuture)}
* @deprecated Use {@link AudioHTTPServer#serve(AudioStream, int, boolean)}
*/
@Deprecated
String serve(AudioStream stream, int seconds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class AudioWaveUtils {

/**
*
* @param InputStream an inputStream of a wav file to analyze. The InputStream must have a fmt header
* @param inputStream an InputStream of a wav file to analyze. The InputStream must have a fmt header
* and support the mark/reset method
* @return The audio format, or the default audio format if an error occured
* @throws IOException If i/o exception occurs, or if the InputStream doesn't support the mark/reset
Expand Down Expand Up @@ -84,7 +84,7 @@ public static AudioFormat parseWavFormat(InputStream inputStream) throws IOExcep
* as if it is a pure PCM stream, it could try to play it and will
* do a "click" noise at the beginning.
*
* @param audio A wav container in an InputStream
* @param data A wav container in an InputStream
* @throws IOException
*/
public static void removeFMT(InputStream data) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private PercentType getSinkMockVolume(PercentType initialVolume) throws IOExcept

/**
*
* @param param - either default source or default sink
* @param param either default source or default sink
*/
private void assertAddedParameterOption(String param, Locale locale) {
String id = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
*
* @author Simon Merschjohann - Initial contribution
* @author Kai Kreuzer - improved logging and removed thread pool
* @author Jonathan Gilbert - added dependency tracking & per-script start levels; made reusable
* @author Jonathan Gilbert - added dependency tracking and per-script start levels; made reusable
* @author Jan N. Klug - Refactored dependency tracking to script engine factories
*/
@NonNullByDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Items should not be updated directly (setting the state property), but updates should
* be sent to the bus, so that all interested bundles are notified.
*
* Note: This class is a copy from the {@link org.openhab.core.model.script.actions.BusEvent} class
* Note: This class is a copy from the {@code org.openhab.core.model.script.actions.BusEvent} class
*
* @author Kai Kreuzer - Initial contribution
* @author Jan N. Klug - Refactored to interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* The methods of this class are made available as functions in the scripts.
*
* Note: This class is a copy from the {@link org.openhab.core.model.script.internal.engine.action.ThingActionService}
* Note: This class is a copy from the {@code org.openhab.core.model.script.internal.engine.action.ThingActionService}
* class
*
* @author Kai Kreuzer - Initial contribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public interface ModuleHandlerCallback {
* This method gets <b>enabled</b> {@link RuleStatus} for a {@link Rule}.
* The <b>enabled</b> rule statuses are {@link RuleStatus#UNINITIALIZED}, {@link RuleStatus#IDLE} and
* {@link RuleStatus#RUNNING}.
* The <b>disabled</b> rule status is {@link RuleStatus#DISABLED}.
* The <b>disabled</b> rule status is {@link RuleStatusDetail#DISABLED}.
*
* @param ruleUID UID of the {@link Rule}
* @return {@code true} when the {@link RuleStatus} is one of the {@link RuleStatus#UNINITIALIZED},
* {@link RuleStatus#IDLE} and {@link RuleStatus#RUNNING}, {@code false} when it is
* {@link RuleStatus#DISABLED} and {@code null} when it is not available.
* {@link RuleStatusDetail#DISABLED} and {@code null} when it is not available.
*/
@Nullable
Boolean isEnabled(String ruleUID);
Expand All @@ -47,7 +47,7 @@ public interface ModuleHandlerCallback {
* This method is used for changing <b>enabled</b> state of the {@link Rule}.
* The <b>enabled</b> rule statuses are {@link RuleStatus#UNINITIALIZED}, {@link RuleStatus#IDLE} and
* {@link RuleStatus#RUNNING}.
* The <b>disabled</b> rule status is {@link RuleStatus#DISABLED}.
* The <b>disabled</b> rule status is {@link RuleStatusDetail#DISABLED}.
*
* @param uid the unique identifier of the {@link Rule}.
* @param isEnabled a new <b>enabled / disabled</b> state of the {@link Rule}.
Expand All @@ -59,7 +59,7 @@ public interface ModuleHandlerCallback {
*
* @param ruleUID UID of the {@link Rule}
* @return {@link RuleStatusInfo} object containing status of the looking {@link Rule} or null when a rule with
* specified UID does not exists.
* specified UID does not exist.
*/
@Nullable
RuleStatusInfo getStatusInfo(String ruleUID);
Expand All @@ -69,7 +69,7 @@ public interface ModuleHandlerCallback {
*
* @param ruleUID UID of the {@link Rule}
* @return {@link RuleStatus} object containing status of the looking {@link Rule} or null when a rule with
* specified UID does not exists.
* specified UID does not exist.
*/
@Nullable
RuleStatus getStatus(String ruleUID);
Expand All @@ -79,15 +79,15 @@ public interface ModuleHandlerCallback {
* This should always be possible unless an action has a mandatory input that is linked to a trigger.
* In that case the action is skipped and the rule engine continues execution of rest actions.
*
* @param ruleUID id of the rule whose actions have to be executed.
* @param uid id of the rule whose actions have to be executed.
*/
void runNow(String uid);

/**
* Same as {@link #runNow(String)} with the additional option to enable/disable evaluation of
* conditions defined in the target rule. The context can be set here, too, but also might be {@code null}.
*
* @param ruleUID id of the rule whose actions have to be executed.
* @param uid id of the rule whose actions have to be executed.
* @param considerConditions if {@code true} the conditions of the rule will be checked.
* @param context the context that is passed to the conditions and the actions of the rule.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
* <ul>
* <li><b>Triggers:</b> a list of {@link Trigger} modules. Each {@link Trigger} from this list
* can start the evaluation of the Rule. A Rule with an empty list of {@link Trigger}s can
* only be triggered through the {@link RuleRegistry#runNow(String, boolean, java.util.Map)} method,
* or directly executed with the {@link RuleRegistry#runNow(String)} method.
* only be triggered through the {@link RuleManager#runNow(String, boolean, java.util.Map)} method,
* or directly executed with the {@link RuleManager#runNow(String)} method.
* <li><b>Conditions:</b> a list of {@link Condition} modules. When a Rule is triggered, the
* evaluation of the Rule {@link Condition}s will determine if the Rule will be executed.
* A Rule will be executed only when all it's {@link Condition}s are satisfied. If the {@link Condition}s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public interface RuleManager {
*
* @param ruleUID UID of the {@link Rule}
* @return {@link RuleStatusInfo} object containing status of the looking {@link Rule} or null when a rule with
* specified UID does not exists.
* specified UID does not exist.
*/
@Nullable
RuleStatusInfo getStatusInfo(String ruleUID);
Expand All @@ -73,7 +73,7 @@ public interface RuleManager {
*
* @param ruleUID UID of the {@link Rule}
* @return {@link RuleStatus} object containing status of the looking {@link Rule} or null when a rule with
* specified UID does not exists.
* specified UID does not exist.
*/
@Nullable
RuleStatus getStatus(String ruleUID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public static Predicate<Rule> hasAnyOfPrefixes(String... prefixes) {
/**
* Creates a {@link Predicate} which can be used to match {@link Rule}s with one or more tags.
*
* @param tags to search for.
* @return created {@link Predicate}.
*/
public static Predicate<Rule> hasTags() {
Expand All @@ -110,7 +109,6 @@ public static Predicate<Rule> hasTags() {
/**
* Creates a {@link Predicate} which can be used to match {@link Rule}s without tags.
*
* @param tags to search for.
* @return created {@link Predicate}.
*/
public static Predicate<Rule> hasNoTags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@
* The {@link RuleRegistry} provides basic functionality for managing {@link Rule}s.
* It can be used to
* <ul>
* <li>Add Rules with the {@link Registry#add(Object)} method.</li>
* <li>Add Rules with the {@link #add(Rule)} method.</li>
* <li>Get the existing rules with the {@link #getByTag(String)}, {@link #getByTags(String[])} methods.</li>
* <li>Update the existing rules with the {@link Registry#update(Object)} method.</li>
* <li>Remove Rules with the {@link Registry#remove(Object)} method.</li>
* <li>Update the existing rules with the {@link #update} method.</li>
* <li>Remove Rules with the {@link #remove(Object)} method.</li>
* <li>Manage the state (<b>enabled</b> or <b>disabled</b>) of the Rules:
* <ul>
* <li>A newly added Rule is always <b>enabled</b>.</li>
* <li>To check a Rule's state, use the {@link #isEnabled(String)} method.</li>
* <li>To change a Rule's state, use the {@link #setEnabled(String, boolean)} method.</li>
* <li>To check a Rule's state, use the {@link RuleManager#isEnabled(String)} method.</li>
* <li>To change a Rule's state, use the {@link RuleManager#setEnabled(String, boolean)} method.</li>
* </ul>
* </li>
* </ul>
* <p>
* The {@link RuleRegistry} manages the status of the Rules:
* <ul>
* <li>To check a Rule's status info, use the {@link #getStatusInfo(String)} method.</li>
* <li>The status of a Rule enabled with {@link #setEnabled(String, boolean)}, is first set to
* <li>To check a Rule's status info, use the {@link RuleManager#getStatusInfo(String)} method.</li>
* <li>The status of a Rule enabled with {@link RuleManager#setEnabled(String, boolean)}, is first set to
* {@link RuleStatus#UNINITIALIZED}.</li>
* <li>After a Rule is enabled, a verification procedure is initiated. If the verification of the modules IDs,
* connections between modules and configuration values of the modules is successful, and the module handlers are
* correctly set, the status is set to {@link RuleStatus#IDLE}.</li>
* <li>If some of the module handlers disappear, the Rule will become {@link RuleStatus#UNINITIALIZED} again.</li>
* <li>If one of the Rule's Triggers is triggered, the Rule becomes {@link RuleStatus#RUNNING}.
* When the execution is complete, it will become {@link RuleStatus#IDLE} again.</li>
* <li>If a Rule is disabled with {@link #setEnabled(String, boolean)}, it's status is set to
* {@link RuleStatus#DISABLED}.</li>
* <li>If a Rule is disabled with {@link RuleManager#setEnabled(String, boolean)}, it's status is set to
* {@link RuleStatusDetail#DISABLED}.</li>
* </ul>
*
* @author Yordan Mihaylov - Initial contribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
* <td><b>N/A</b></td>
* <td>
* <li>Triggered</li>
* <li><b>{@link RuleRegistry#runNow(String) runNow}</b></li></td>
* <li><b>{@link RuleManager#runNow(String) runNow}</b></li></td>
* </tr>
* <td></td>
* <tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public abstract class AbstractRuleRegistryEvent extends AbstractEvent {
* @param topic the topic of the event
* @param payload the payload of the event
* @param source the source of the event
* @param ruleDTO the ruleDTO for which this event is created
* @param rule the rule for which this event is created
*/
public AbstractRuleRegistryEvent(String topic, String payload, @Nullable String source, RuleDTO rule) {
super(topic, payload, source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class RuleAddedEvent extends AbstractRuleRegistryEvent {
* @param topic the topic of the event
* @param payload the payload of the event
* @param source the source of the event
* @param ruleDTO the rule for which this event is created
* @param rule the rule for which this event is created
*/
public RuleAddedEvent(String topic, String payload, @Nullable String source, RuleDTO rule) {
super(topic, payload, source, rule);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ private boolean calculateConditions(WrappedRule rule) {
}

/**
* This method evaluates actions of the {@link Rule} and set their {@link Output}s when they exists.
* This method evaluates actions of the {@link Rule} and set their {@link Output}s when they exist.
*
* @param rule executed rule.
*/
Expand Down Expand Up @@ -1207,7 +1207,7 @@ private void executeActions(WrappedRule rule, boolean stopOnFirstFail) {
* This method gets rule's status object.
*
* @param rUID rule's UID
* @return status of the rule or null when such rule does not exists.
* @return status of the rule or null when such rule does not exist.
*/
protected @Nullable RuleStatus getRuleStatus(String rUID) {
RuleStatusInfo info = getStatusInfo(rUID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
* <li>If one of the Rule's Triggers is triggered, the Rule becomes {@link RuleStatus#RUNNING}.
* When the execution is complete, it will become {@link RuleStatus#IDLE} again.</li>
* <li>If a Rule is disabled with {@link #setEnabled(String, boolean)}, it's status is set to
* {@link RuleStatus#DISABLED}.</li>
* {@link RuleStatusDetail#DISABLED}.</li>
* </ul>
*
* @author Yordan Mihaylov - Initial contribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class CompositeActionType extends ActionType {
* @param uid the {@link ActionType}'s identifier, or {@code null} if a random identifier should be
* generated.
* @param configDescriptions describing meta-data for the configuration of the future {@link Action} instances.
* @param children is a {@link List} of {@link Action}s.
* @param inputs a {@link List} with {@link Input} meta-information descriptions of the future
* {@link Action} instances.
* @param outputs a {@link List} with {@link Output} meta-information descriptions of the future
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
/**
* This class provides common functionality for creating {@link ModuleType} instances. Each {@link ModuleType} instance
* defines the meta-information needed for creation of a {@link Module} instance which is a building block for a
* {@link Rule}. The meta-information describes the {@link Configuration} of a {@link Module} providing list with
* {@link ConfigDescriptionParameter}s, {@link Input}s and {@link Output}s of a {@link Module}. Each {@link ModuleType}
* instance owns a unique id which is used as reference in the {@link Module}s, to find their meta-information.
* {@link Rule}. The meta-information describes the {@link org.openhab.core.config.core.Configuration} of a
* {@link Module} providing list with {@link ConfigDescriptionParameter}s, {@link Input}s and {@link Output}s of a
* {@link Module}. Each {@link ModuleType} instance owns a unique id which is used as reference in the {@link Module}s,
* to find their meta-information.
* <p>
* Whether the {@link ModuleType}s can be used by anyone, depends from their {@link Visibility} value, but they can be
* modified only by their creator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public interface ModuleTypeRegistry extends Registry<ModuleType, String> {
* This method is used for getting the {@link ModuleType}s filtered by tags.
*
* @param locale used for localization of the {@link ModuleType}.
* @param moduleTypeTag specifies the filter for getting the {@link ModuleType}s, if it is {@code null} then returns
* @param tags specifies the filter for getting the {@link ModuleType}s, if it is {@code null} then returns
* all {@link ModuleType}s.
* @param <T> the type of the required object.
* @return the {@link ModuleType}s, which correspond to the filter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public class ReferenceResolver {
* try to find values for {{firstName}} and {{lastName}} in the given context and replace them. References that are
* not found in the context - are not replaced.
*
* @param module module that is directly part of Rule or part of CompositeModule
* @param context containing Rule configuration or Composite configuration values.
*/
public static void updateConfiguration(Configuration config, Map<String, ?> context, Logger logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* concrete configuration parameter. Such parameter descriptions are collected
* within the {@link ConfigDescription} and can be retrieved from the {@link ConfigDescriptionRegistry}.
*
* This class defines available configuration parameter types in {@link ConfigDescriptionParameter#Type},
* This class defines available configuration parameter types in {@link ConfigDescriptionParameter.Type},
* it defines available unit types in {@link ConfigDescriptionParameter#UNITS} and available
* contexts (see {@link ConfigDescriptionParameter#getContext()}).
*
Expand Down
Loading

0 comments on commit 6b1d750

Please sign in to comment.