Search in sources :

Example 6 with ReadRequest

use of org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest in project netconf by opendaylight.

the class ReadAdapter method handle.

@SuppressWarnings("checkstyle:IllegalThrows")
public void handle(final Object message, final ActorRef sender, final ActorRef self) {
    if (message instanceof ReadRequest) {
        final ReadRequest readRequest = (ReadRequest) message;
        final YangInstanceIdentifier path = readRequest.getPath();
        final LogicalDatastoreType store = readRequest.getStore();
        read(path, store, sender, self);
    } else if (message instanceof ExistsRequest) {
        final ExistsRequest readRequest = (ExistsRequest) message;
        final YangInstanceIdentifier path = readRequest.getPath();
        final LogicalDatastoreType store = readRequest.getStore();
        exists(path, store, sender, self);
    }
}
Also used : ExistsRequest(org.opendaylight.netconf.topology.singleton.messages.transactions.ExistsRequest) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) ReadRequest(org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest)

Aggregations

ReadRequest (org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest)6 Test (org.junit.Test)4 NormalizedNodeMessage (org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage)3 Optional (java.util.Optional)2 ReadFailedException (org.opendaylight.mdsal.common.api.ReadFailedException)2 Failure (akka.actor.Status.Failure)1 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)1 EmptyReadResponse (org.opendaylight.netconf.topology.singleton.messages.transactions.EmptyReadResponse)1 ExistsRequest (org.opendaylight.netconf.topology.singleton.messages.transactions.ExistsRequest)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1