Skip to content

Commit

Permalink
refactor: remove deprecated elements from NamedStreamPipesEntity (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bossenti authored Nov 20, 2023
1 parent e39af80 commit defe9ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
}

@Deprecated
public String getUri() {
return elementId;
}

@Deprecated
public void setUri(String uri) {
this.elementId = uri;
}

public String getDom() {
return dom;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ public Response invokeAdapter(AdapterDescription adapterStreamDescription) {

try {
adapterManagement.invokeAdapter(adapterStreamDescription);
String responseMessage = "Stream adapter with id " + adapterStreamDescription.getUri() + " successfully started";
String responseMessage = "Stream adapter with id "
+ adapterStreamDescription.getElementId()
+ " successfully started";
logger.info(responseMessage);
return ok(Notifications.success(responseMessage));
} catch (AdapterException e) {
logger.error("Error while starting adapter with id " + adapterStreamDescription.getUri(), e);
logger.error("Error while starting adapter with id " + adapterStreamDescription.getElementId(), e);
return serverError(SpLogMessage.from(e));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ public class StreamBuilder {
private SpDataStream stream;
private EventSchema schema;

private StreamBuilder(String name, String description, String uri) {
private StreamBuilder(String name, String description, String elementId) {
stream = new SpDataStream();
stream.setName(name);
stream.setDescription(description);
stream.setUri(uri);
stream.setElementId(elementId);
}

private StreamBuilder(String uri) {
private StreamBuilder(String elementId) {
stream = new SpDataStream();
stream.setUri(uri);
stream.setElementId(elementId);
schema = new EventSchema();
}

public static StreamBuilder createStream(String name, String description, String uri) {
return new StreamBuilder(name, description, uri);
public static StreamBuilder createStream(String name, String description, String elementId) {
return new StreamBuilder(name, description, elementId);
}

public static StreamBuilder createStreamRestriction(String uri) {
return new StreamBuilder(uri);
public static StreamBuilder createStreamRestriction(String elementId) {
return new StreamBuilder(elementId);
}

public StreamBuilder property(String propertyName, URI propertyType, URI subclassOf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static <T extends NamedStreamPipesEntity> List<T> byUri(List<T> allElemen
return allElements
.stream()
.filter(e -> userElements.stream()
.anyMatch(u -> u.equals(e.getUri()))).collect(Collectors.toList());
.anyMatch(u -> u.equals(e.getElementId()))).collect(Collectors.toList());
}

}

0 comments on commit defe9ad

Please sign in to comment.