use of org.eclipse.milo.opcua.stack.core.types.structured.SetPublishingModeResponse in project milo by eclipse.
the class SubscriptionManager method setPublishingMode.
public void setPublishingMode(ServiceRequest service) {
SetPublishingModeRequest request = (SetPublishingModeRequest) service.getRequest();
List<UInteger> subscriptionIds = l(request.getSubscriptionIds());
StatusCode[] results = new StatusCode[subscriptionIds.size()];
for (int i = 0; i < subscriptionIds.size(); i++) {
Subscription subscription = subscriptions.get(subscriptionIds.get(i));
if (subscription == null) {
results[i] = new StatusCode(StatusCodes.Bad_SubscriptionIdInvalid);
} else {
subscription.setPublishingMode(request);
results[i] = StatusCode.GOOD;
}
}
ResponseHeader header = service.createResponseHeader();
SetPublishingModeResponse response = new SetPublishingModeResponse(header, results, new DiagnosticInfo[0]);
service.setResponse(response);
}
Aggregations