Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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