use of org.eclipse.milo.opcua.stack.core.types.structured.ModifySubscriptionRequest in project milo by eclipse.
the class SubscriptionManager method modifySubscription.
public void modifySubscription(ServiceRequest service) throws UaException {
ModifySubscriptionRequest request = (ModifySubscriptionRequest) service.getRequest();
UInteger subscriptionId = request.getSubscriptionId();
Subscription subscription = subscriptions.get(subscriptionId);
if (subscription == null) {
throw new UaException(StatusCodes.Bad_SubscriptionIdInvalid);
}
subscription.modifySubscription(request);
ResponseHeader header = service.createResponseHeader();
ModifySubscriptionResponse response = new ModifySubscriptionResponse(header, subscription.getPublishingInterval(), uint(subscription.getLifetimeCount()), uint(subscription.getMaxKeepAliveCount()));
service.setResponse(response);
}
Aggregations