class PacketDispatcher {

    public void sendPacketOut(byte[] payload, NodeConnectorRef ingress, NodeConnectorRef egress) {
        if (ingress == null || egress == null) {
            return;
        }
        InstanceIdentifier<Node> egressNodePath = getNodePath(egress.getValue());
        TransmitPacketInput input = new TransmitPacketInputBuilder() //
                .setPayload(payload) //
                .setNode(new NodeRef(egressNodePath)) //
                .setEgress(egress) //
                .setIngress(ingress) //
                .build();

        Futures.addCallback(JdkFutureAdapters.listenInPoolThread(packetProcessingService.transmitPacket(input)),
            new FutureCallback<RpcResult<Void>>() {
                @Override
                public void onSuccess(RpcResult<Void> result) {
                    LOG.debug("transmitPacket was successful");
                }

                @Override
                public void onFailure(Throwable failure) {
                    LOG.debug("transmitPacket for {} failed", input, failure);
                }
            }, MoreExecutors.directExecutor());
    }

}