import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yangtools.yang.binding.DataContainer;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
};
private static final Logger LOG = LoggerFactory.getLogger(AbstractTopologySessionListener.class);
- // FIXME: make this private
- protected final ServerSessionManager serverSessionManager;
-
private final Map<SRPID, PCEPRequest> waitingRequests = new HashMap<>();
private final Map<SRPID, PCEPRequest> sendingRequests = new HashMap<>();
private final Map<String, ReportedLsp> lspData = new HashMap<>();
private final Map<PLSPID, String> lsps = new HashMap<>();
+ private final ServerSessionManager serverSessionManager;
private InstanceIdentifier<Node> topologyNode;
private InstanceIdentifier<Node1> topologyAugment;
private PathComputationClientBuilder pccBuilder;
Preconditions.checkNotNull(id, "ID parameter null.");
return this.lsps.get(id);
}
+
+ protected final <T extends DataObject> T readOperationalData(final InstanceIdentifier<T> id) {
+ return serverSessionManager.readOperationalData(id);
+ }
}
public synchronized ListenableFuture<OperationResult> addLsp(final AddLspArgs input) {
// Make sure there is no such LSP
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
- if (this.serverSessionManager.readOperationalData(lsp) != null) {
+ if (readOperationalData(lsp) != null) {
LOG.debug("Node {} already contains lsp {} at {}", input.getNode(), input.getName(), lsp);
return OperationResults.UNSENT.future();
}
public synchronized ListenableFuture<OperationResult> removeLsp(final RemoveLspArgs input) {
// Make sure the LSP exists, we need it for PLSP-ID
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
- final ReportedLsp rep = this.serverSessionManager.readOperationalData(lsp);
+ final ReportedLsp rep = readOperationalData(lsp);
if (rep == null) {
LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName());
return OperationResults.UNSENT.future();
public synchronized ListenableFuture<OperationResult> updateLsp(final UpdateLspArgs input) {
// Make sure the LSP exists
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
- final ReportedLsp rep = this.serverSessionManager.readOperationalData(lsp);
+ final ReportedLsp rep = readOperationalData(lsp);
if (rep == null) {
LOG.warn("Node {} does not contain LSP {}", input.getNode(), input.getName());
return OperationResults.UNSENT.future();
// Make sure the LSP exists
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
LOG.debug("Checking if LSP {} has operational state {}", lsp, op);
- final ReportedLsp rep = this.serverSessionManager.readOperationalData(lsp);
+ final ReportedLsp rep = readOperationalData(lsp);
if (rep == null) {
LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName());
return OperationResults.UNSENT.future();
public synchronized ListenableFuture<OperationResult> addLsp(final AddLspArgs input) {
// Make sure there is no such LSP
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
- if (this.serverSessionManager.readOperationalData(lsp) != null) {
+ if (readOperationalData(lsp) != null) {
LOG.debug("Node {} already contains lsp {} at {}", input.getNode(), input.getName(), lsp);
return OperationResults.UNSENT.future();
}
public synchronized ListenableFuture<OperationResult> removeLsp(final RemoveLspArgs input) {
// Make sure the LSP exists, we need it for PLSP-ID
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
- final ReportedLsp rep = this.serverSessionManager.readOperationalData(lsp);
+ final ReportedLsp rep = readOperationalData(lsp);
if (rep == null) {
LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName());
return OperationResults.UNSENT.future();
public synchronized ListenableFuture<OperationResult> updateLsp(final UpdateLspArgs input) {
// Make sure the LSP exists
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
- final ReportedLsp rep = this.serverSessionManager.readOperationalData(lsp);
+ final ReportedLsp rep = readOperationalData(lsp);
if (rep == null) {
LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName());
return OperationResults.UNSENT.future();
// Make sure the LSP exists
final InstanceIdentifier<ReportedLsp> lsp = lspIdentifier(input.getName()).build();
LOG.debug("Checking if LSP {} has operational state {}", lsp, op);
- final ReportedLsp rep = this.serverSessionManager.readOperationalData(lsp);
+ final ReportedLsp rep = readOperationalData(lsp);
if (rep == null) {
LOG.debug("Node {} does not contain LSP {}", input.getNode(), input.getName());
return OperationResults.UNSENT.future();