Search in sources :

Example 1 with SetPublishingModeRequest

use of org.eclipse.milo.opcua.stack.core.types.structured.SetPublishingModeRequest 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);
}
Also used : ResponseHeader(org.eclipse.milo.opcua.stack.core.types.structured.ResponseHeader) SetPublishingModeResponse(org.eclipse.milo.opcua.stack.core.types.structured.SetPublishingModeResponse) SetPublishingModeRequest(org.eclipse.milo.opcua.stack.core.types.structured.SetPublishingModeRequest) UInteger(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger) StatusCode(org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode) Unsigned.uint(org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint)

Aggregations

StatusCode (org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode)1 UInteger (org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger)1 Unsigned.uint (org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.uint)1 ResponseHeader (org.eclipse.milo.opcua.stack.core.types.structured.ResponseHeader)1 SetPublishingModeRequest (org.eclipse.milo.opcua.stack.core.types.structured.SetPublishingModeRequest)1 SetPublishingModeResponse (org.eclipse.milo.opcua.stack.core.types.structured.SetPublishingModeResponse)1