Search in sources :

Example 1 with ModifySubscriptionRequest

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);
}
Also used : ResponseHeader(org.eclipse.milo.opcua.stack.core.types.structured.ResponseHeader) ModifySubscriptionResponse(org.eclipse.milo.opcua.stack.core.types.structured.ModifySubscriptionResponse) ModifySubscriptionRequest(org.eclipse.milo.opcua.stack.core.types.structured.ModifySubscriptionRequest) UaException(org.eclipse.milo.opcua.stack.core.UaException) UInteger(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger)

Aggregations

UaException (org.eclipse.milo.opcua.stack.core.UaException)1 UInteger (org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger)1 ModifySubscriptionRequest (org.eclipse.milo.opcua.stack.core.types.structured.ModifySubscriptionRequest)1 ModifySubscriptionResponse (org.eclipse.milo.opcua.stack.core.types.structured.ModifySubscriptionResponse)1 ResponseHeader (org.eclipse.milo.opcua.stack.core.types.structured.ResponseHeader)1