Search in sources :

Example 1 with FlappingSingletonService

use of org.opendaylight.controller.clustering.it.provider.impl.FlappingSingletonService in project controller by opendaylight.

the class MdsalLowLevelTestProvider method registerFlappingSingleton.

@Override
public Future<RpcResult<Void>> registerFlappingSingleton() {
    LOG.debug("Received register-flapping-singleton.");
    if (flappingSingletonService != null) {
        final RpcError error = RpcResultBuilder.newError(ErrorType.RPC, "Registration present.", "flapping-singleton already registered");
        return Futures.immediateFuture(RpcResultBuilder.<Void>failed().withRpcError(error).build());
    }
    flappingSingletonService = new FlappingSingletonService(singletonService);
    return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
}
Also used : FlappingSingletonService(org.opendaylight.controller.clustering.it.provider.impl.FlappingSingletonService) RpcError(org.opendaylight.yangtools.yang.common.RpcError)

Aggregations

FlappingSingletonService (org.opendaylight.controller.clustering.it.provider.impl.FlappingSingletonService)1 RpcError (org.opendaylight.yangtools.yang.common.RpcError)1