Skip to content

Commit

Permalink
Merge pull request #2257 from telefonicaid/task/alterationType_constant
Browse files Browse the repository at this point in the history
move alterationType to a constant
  • Loading branch information
fgalan authored Jun 12, 2023
2 parents 41e865a + a0b124d commit 031fb46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void initialize(NGSIEvent event) {
} // if
for (NotifyContextRequest.ContextAttribute contextAttribute : contextAttributes) {
String attrName = contextAttribute.getName();
if (!attrName.equals("alterationType")) {
if (!attrName.equals(NGSIConstants.ALTERATION_TYPE)) {
aggregation.put(attrName, new ArrayList<JsonElement>());
aggregation.put(attrName + "_md", new ArrayList<JsonElement>());
aggregation.put(attrName + NGSIConstants.AUTOGENERATED_ATTR_TYPE, new ArrayList<JsonElement>());
Expand Down Expand Up @@ -187,7 +187,7 @@ public void aggregate(NGSIEvent event) {
}
} else if (attrType.equals("TextUnrestricted")) {
attrValue = jsonParser.parse(getEscapedString(attrValue, "'"));
} else if (attrName.equals("alterationType")) {
} else if (attrName.equals(NGSIConstants.ALTERATION_TYPE)) {
LOGGER.debug("alterationType=" + attrValue.getAsString());
if (attrValue.getAsString().equals("entityDelete")) {
// keep info for lastDataDelete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private NGSIConstants() {
public static final String ATTR_MD_FILE = "attrMdFile";

public static final String AUTOGENERATED_ATTR_TYPE = "_attr_internal_type";
public static final String ALTERATION_TYPE = "alterationType";

public static final int ROLLBACK_CHANNEL_EXCEPTION_THRESHOLD = 10;
public static final int ROLLBACK_EXCEPTION_THRESHOLD = 10;
Expand Down

0 comments on commit 031fb46

Please sign in to comment.