@Override
public void add(final InstanceIdentifier<PortChain> path, final PortChain newPortChain) {
processPortChain(newPortChain);
- eventProcessor.submit(new Runnable() {
- @Override
- public void run() {
- processPortChain(newPortChain);
- }
- });
+ eventProcessor.submit(() -> processPortChain(newPortChain));
}
private void processPortChain(PortChain newPortChain) {
LOG.info("Call RPC for creating RSP :{}", rpInput);
Future<RpcResult<CreateRenderedPathOutput>> result = this.rspService.createRenderedPath(rpInput);
try {
- result.get();
- processFlowClassifiers(newPortChain, newPortChain.getFlowClassifiers(), rpInput.getName());
+ if (result.get() != null) {
+ CreateRenderedPathOutput output = result.get().getResult();
+ LOG.debug("RSP name received from SFC : {}", output.getName());
+ processFlowClassifiers(newPortChain, newPortChain.getFlowClassifiers(), output.getName());
+ } else {
+ LOG.error("RSP creation failed : {}", rpInput);
+ }
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error occurred during creating Rendered Service Path using RPC call", e);
}