use of org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier in project controller by opendaylight.
the class BouncingReconnectForwarder method findCohort.
private ProxyReconnectCohort findCohort(final ConnectionEntry entry) throws CohortNotFoundException {
final Request<?, ?> request = entry.getRequest();
final LocalHistoryIdentifier historyId;
if (request instanceof TransactionRequest) {
historyId = ((TransactionRequest<?>) request).getTarget().getHistoryId();
} else if (request instanceof LocalHistoryRequest) {
historyId = ((LocalHistoryRequest<?>) request).getTarget();
} else {
throw new IllegalArgumentException("Unhandled request " + request);
}
final ProxyReconnectCohort cohort = cohorts.get(historyId);
if (cohort == null) {
LOG.warn("Cohort for request {} not found, aborting it", request);
throw new CohortNotFoundException(historyId);
}
return cohort;
}
Aggregations