use of org.opendaylight.controller.cluster.access.commands.CreateLocalHistoryRequest in project controller by opendaylight.
the class AbstractClientHistory method createHistoryProxy.
/**
* Create a new history proxy for a given shard.
*
* @throws InversibleLockException if the shard is being reconnected
*/
@GuardedBy("lock")
private ProxyHistory createHistoryProxy(final Long shard) {
final AbstractClientConnection<ShardBackendInfo> connection = client.getConnection(shard);
final LocalHistoryIdentifier proxyId = new LocalHistoryIdentifier(identifier.getClientId(), identifier.getHistoryId(), shard);
LOG.debug("Created proxyId {} for history {} shard {}", proxyId, identifier, shard);
final ProxyHistory ret = createHistoryProxy(proxyId, connection);
// Request creation of the history, if it is not the single history
if (ret.getIdentifier().getHistoryId() != 0) {
connection.sendRequest(new CreateLocalHistoryRequest(ret.getIdentifier(), connection.localActor()), this::createHistoryCallback);
}
return ret;
}
Aggregations