Skip to content
Permalink
Browse files

UdpClientProtocol implementation and testing complete

  • Loading branch information...
richturner committed Jul 2, 2019
1 parent 992fafb commit 81400627a4ac6f6c9766e29f5c5736d824c23dfe
@@ -482,7 +482,27 @@ protected void processLinkedAttributeWrite(AttributeEvent event, AssetAttribute
return;
}

info.sendConsumer.accept(event.getValue().orElse(null));
AssetAttribute attribute = getLinkedAttribute(event.getAttributeRef());
AttributeExecuteStatus status = null;

if (attribute.isExecutable()) {
status = event.getValue()
.flatMap(Values::getString)
.flatMap(AttributeExecuteStatus::fromString)
.orElse(null);

if (status != null && status != AttributeExecuteStatus.REQUEST_START) {
LOG.fine("Unsupported execution status: " + status);
return;
}
}

Value value = status != null ? null : event.getValue().orElse(null);
info.sendConsumer.accept(value);

if (status != null) {
updateLinkedAttribute(new AttributeState(event.getAttributeRef(), AttributeExecuteStatus.COMPLETED.asValue()));
}
}

protected void onConnectionStatusChanged(AttributeRef protocolRef, ConnectionStatus connectionStatus) {
@@ -494,8 +514,12 @@ protected void onConnectionStatusChanged(AttributeRef protocolRef, ConnectionSta

String str = value != null ? value.toString() : "";

if (!TextUtil.isNullOrEmpty(writeValue) && writeValue.contains(DYNAMIC_VALUE_PLACEHOLDER)) {
str = writeValue.replaceAll(DYNAMIC_VALUE_PLACEHOLDER_REGEXP, str);
if (!TextUtil.isNullOrEmpty(writeValue)) {
if (str.isEmpty()) {
str = writeValue;
} else {
str = writeValue.replaceAll(DYNAMIC_VALUE_PLACEHOLDER_REGEXP, str);
}
}

clientAndQueue.send(str, responseConsumer, attributeInfo);
@@ -72,7 +72,7 @@ public MetaItem get(int index) {
public MetaItem set(int index, MetaItem metaItem) {
checkBounds(index);
arrayValue.set(index, metaItem.getObjectValue());
return super.set(index, metaItem);
return metaItem;
}

@Override

0 comments on commit 8140062

Please sign in to comment.
You can’t perform that action at this time.