LOG.info("Started clustering services for node {}", deviceInfo);
} catch (final Exception ex) {
LOG.warn("Not able to start clustering services for node {}", deviceInfo);
- executorService.submit(() -> contextChainMastershipWatcher
+ executorService.execute(() -> contextChainMastershipWatcher
.onNotAbleToStartMastershipMandatory(deviceInfo, ex.toString()));
}
}
@Override
- public ListenableFuture<Void> closeServiceInstance() {
+ public ListenableFuture<?> closeServiceInstance() {
contextChainMastershipWatcher.onSlaveRoleAcquired(deviceInfo);
- final ListenableFuture<List<Void>> servicesToBeClosed = Futures
- .allAsList(Lists.reverse(contexts)
- .stream()
- .map(OFPContext::closeServiceInstance)
- .collect(Collectors.toList()));
+ final ListenableFuture<?> servicesToBeClosed = Futures.allAsList(Lists.reverse(contexts).stream()
+ .map(OFPContext::closeServiceInstance)
+ .collect(Collectors.toList()));
return Futures.transform(servicesToBeClosed, (input) -> {
LOG.info("Closed clustering services for node {}", deviceInfo);
auxiliaryConnections.clear();
// If we are still registered and we are not already closing, then close the registration
- if (Objects.nonNull(registration)) {
+ if (registration != null) {
try {
registration.close();
registration = null;
@Override
public boolean addAuxiliaryConnection(@Nonnull ConnectionContext connectionContext) {
- return (connectionContext.getFeatures().getAuxiliaryId() != 0)
- && (!ConnectionContext.CONNECTION_STATE.RIP.equals(primaryConnection.getConnectionState()))
+ return connectionContext.getFeatures().getAuxiliaryId() != 0
+ && !ConnectionContext.CONNECTION_STATE.RIP.equals(primaryConnection.getConnectionState())
&& auxiliaryConnections.add(connectionContext);
}
masterStateOnDevice.set(false);
rpcRegistration.set(false);
}
-}
\ No newline at end of file
+}