Skip to content

Commit

Permalink
chore: minor wording and cleanup (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal authored Dec 18, 2024
1 parent 82d032f commit 04577b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

@SupportsBatching
@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
@Tags({"CKAN","ckan","sql", "put", "rdbms", "database", "create", "insert", "relational","NGSIv2", "NGSI","FIWARE"})
@CapabilityDescription("Create a CKAN resource, package and dataset if not exits using the information coming from and NGSI event converted to flow file." +
"After insert all of the vales of the flow file content extraction the entities and attributes")
@Tags({"CKAN", "ckan", "Open Data", "NGSI-LD", "NGSI", "FIWARE"})
@CapabilityDescription("Create a CKAN resource, package and dataset if not exists using the information coming from an NGSI-LD event converted to flow file." +
"After insert all of the values of the flow file content extraction the entities and attributes")
public class NgsiLdToCkan extends AbstractProcessor {
protected static final PropertyDescriptor CKAN_HOST = new PropertyDescriptor.Builder()
.name("CKAN Host")
Expand Down Expand Up @@ -66,6 +66,7 @@ public class NgsiLdToCkan extends AbstractProcessor {
.description("The APi Key you are going o use in CKAN")
.required(true)
.defaultValue("XXXXXX")
.sensitive(true)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.build();

Expand Down Expand Up @@ -165,7 +166,7 @@ public void aggregate(Entity entity, long creationTime) {

final String orgName = ckanBackend.buildOrgName(organizationName, dcatMetadata);
ArrayList<Entity> entities = event.getEntitiesLD();
getLogger().info("[] Persisting data at NGSICKANSink (orgName=" + orgName+ ", ");
getLogger().info("Persisting data at NGSICKANSink: orgName=" + orgName);
getLogger().debug("DCAT metadata: {}" , dcatMetadata);

for (Entity entity : entities) {
Expand All @@ -185,8 +186,8 @@ public void aggregate(Entity entity, long creationTime) {
}
}

getLogger().info("[] Persisting data at NGSICKANSink (orgName=" + orgName
+ ", pkgName=" + pkgName + ", resName=" + resName + ", data=(" + aggregation + ")");
getLogger().info("Persisting data at NGSICKANSink: orgName=" + orgName
+ ", pkgName=" + pkgName + ", resName=" + resName + ", data=" + aggregation);

ckanBackend.persist(orgName, pkgName, pkgTitle, resName, aggregation, dcatMetadata,createDataStore);
} // for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

public class NGSIEvent {
public long creationTime;
public ArrayList <Entity> entities;
public ArrayList <Entity> entitiesLD;

public NGSIEvent(long creationTime, ArrayList<Entity> entitiesLD ){
Expand All @@ -24,14 +23,6 @@ public void setCreationTime(long creationTime) {
this.creationTime = creationTime;
}

public ArrayList<Entity> getEntities() {
return entities;
}

public void setEntities(ArrayList<Entity> entities) {
this.entities = entities;
}

public long getRecvTimeTs() {
return this.creationTime;
} // getRecvTimeTs
Expand Down

0 comments on commit 04577b4

Please sign in to comment.