Skip to content

Commit

Permalink
removed ThingLinkManager and with it the auto-linking feature and "Si…
Browse files Browse the repository at this point in the history
…mple Mode" (openhab#1385)

* removed ThingLinkManager and with it the auto-linking feature and "Simple Mode"

Signed-off-by: Kai Kreuzer <kai@openhab.org>

* removed feature from REST API as well

Signed-off-by: Kai Kreuzer <kai@openhab.org>

* removed tests

Signed-off-by: Kai Kreuzer <kai@openhab.org>
GitOrigin-RevId: 857679f
  • Loading branch information
kaikreuzer authored and splatch committed Jul 11, 2023
1 parent 49d9ec4 commit 12393c6
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 606 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.openhab.core.thing.link.AbstractLink;
import org.openhab.core.thing.link.ItemChannelLink;
import org.openhab.core.thing.link.ItemChannelLinkRegistry;
import org.openhab.core.thing.link.ThingLinkManager;
import org.openhab.core.thing.link.dto.ItemChannelLinkDTO;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
Expand Down Expand Up @@ -72,7 +71,6 @@ public class ItemChannelLinkResource implements RESTResource {
public static final String PATH_LINKS = "links";

private ItemChannelLinkRegistry itemChannelLinkRegistry;
private ThingLinkManager thingLinkManager;

@Context
UriInfo uriInfo;
Expand All @@ -97,15 +95,6 @@ public Response getAll(
return Response.ok(new Stream2JSONInputStream(linkStream)).build();
}

@GET
@Path("/auto")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Tells whether automatic link mode is active or not", response = Boolean.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = Boolean.class) })
public Response isAutomatic() {
return Response.ok(thingLinkManager.isAutoLinksEnabled()).build();
}

@GET
@Path("/{itemName}/{channelUID}")
@ApiOperation(value = "Retrieves an individual link.")
Expand Down Expand Up @@ -180,15 +169,6 @@ public Response unlink(@PathParam("itemName") @ApiParam(value = "itemName") Stri
}
}

@Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
protected void setThingLinkManager(ThingLinkManager thingLinkManager) {
this.thingLinkManager = thingLinkManager;
}

protected void unsetThingLinkManager(ThingLinkManager thingLinkManager) {
this.thingLinkManager = null;
}

@Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
protected void setItemChannelLinkRegistry(ItemChannelLinkRegistry itemChannelLinkRegistry) {
this.itemChannelLinkRegistry = itemChannelLinkRegistry;
Expand All @@ -205,7 +185,7 @@ private ItemChannelLinkDTO toBeans(ItemChannelLink link) {

@Override
public boolean isSatisfied() {
return itemChannelLinkRegistry != null && thingLinkManager != null;
return itemChannelLinkRegistry != null;
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0
https://openhab.org/schemas/config-description-1.0.0.xsd">

<config-description uri="system:links">
<parameter name="autoLinks" type="boolean" required="true">
<label>Simple Mode</label>
<description><![CDATA[
<p>In simple mode, links and their according items are automatically created for new Things.</p>
<p>If the simple mode is turned off, the user has the full control about which items channels are linked to. Existing links will remain untouched.</p>
]]>
</description>
<default>true</default>
</parameter>
</config-description>

<config-description uri="system:firmware-status-info-job">
<parameter name="period" type="integer" min="1" required="true">
<label>Period</label>
Expand Down
Loading

0 comments on commit 12393c6

Please sign in to comment.