public static RspName generateReversedPathName(RspName directRspName) { return new RspName(directRspName.getValue() + REVERSED_PATH_SUFFIX); }
private InstanceIdentifier<RenderedServicePath> getRspId(String rspName) { return InstanceIdentifier.builder(RenderedServicePaths.class) .child(RenderedServicePath.class, new RenderedServicePathKey(new RspName(rspName))).build(); }
public InstanceIdentifier<RenderedServicePath> getRspId(String rspName) { return InstanceIdentifier.builder(RenderedServicePaths.class) .child(RenderedServicePath.class, new RenderedServicePathKey(new RspName(rspName))).build(); }
RspName rspName = new RspName(sfServicePath.getName().getValue()); SfcProviderServiceForwarderAPI.deletePathFromServiceForwarderState(rspName); rspList.add(rspName);
/** * This method reads the operational state for a service function. * <p> * * @param serviceFunctionName SF name * @return A ServiceFunctionState object that is a list of all paths using * this service function, null otherwise */ public static List<RspName> getRspsBySfName(SfName serviceFunctionName) { printTraceStart(LOG); List<SfServicePath> sfServicePathList; List<RspName> rspList = new ArrayList<>(); ServiceFunctionStateKey serviceFunctionStateKey = new ServiceFunctionStateKey(serviceFunctionName); InstanceIdentifier<ServiceFunctionState> sfStateIID = InstanceIdentifier.builder(ServiceFunctionsState.class) .child(ServiceFunctionState.class, serviceFunctionStateKey) .build(); ServiceFunctionState dataSfcStateObject = SfcDataStoreAPI.readTransactionAPI(sfStateIID, LogicalDatastoreType.OPERATIONAL); if (dataSfcStateObject != null) { sfServicePathList = dataSfcStateObject.getSfServicePath(); for (SfServicePath sfServicePath : sfServicePathList) { RspName rspName = new RspName(sfServicePath.getName().getValue()); rspList.add(rspName); } } else { LOG.warn("getRspsBySfName() Service Function {} has no operational state", serviceFunctionName); } printTraceStop(LOG); return rspList; }
RspName rspName = new RspName(sfcPath.getName() + "-gbp-rsp"); ReadOnlyTransaction rTx = UlnMapperDatastoreDependency.getDataProvider().newReadOnlyTransaction(); RenderedServicePath renderedServicePath; rspName = new RspName(rspName.getValue() + "-Reverse"); rsp = getRspByName(rspName, rTx); if (rsp == null) {
SfcProviderServiceForwarderAPI.deletePathFromServiceForwarderState(new RspName(input.getName())); SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionState(new SfpName(input.getName())); ret = SfcProviderRenderedPathAPI.deleteRenderedServicePath(new RspName(input.getName())); DeleteRenderedPathOutputBuilder deleteRenderedPathOutputBuilder = new DeleteRenderedPathOutputBuilder(); deleteRenderedPathOutputBuilder.setResult(ret);
boolean ret = true; RspName rspNameFromSfpName = new RspName(sfpName.getValue()); RenderedServicePath renderedServicePath = SfcProviderRenderedPathAPI.readRenderedServicePath(rspNameFromSfpName);
/** * This method gets all necessary information for a system to construct * a NSH header and associated overlay packet to target the first * service hop of a Rendered Service Path * <p> * * @param input RPC input including a Rendered Service Path name * @return RPC output including a renderedServicePathFirstHop. */ @Override public Future<RpcResult<ReadRenderedServicePathFirstHopOutput>> readRenderedServicePathFirstHop( ReadRenderedServicePathFirstHopInput input) { RenderedServicePathFirstHop renderedServicePathFirstHop = null; RpcResultBuilder<ReadRenderedServicePathFirstHopOutput> rpcResultBuilder; renderedServicePathFirstHop = SfcProviderRenderedPathAPI.readRenderedServicePathFirstHop(new RspName(input.getName())); ReadRenderedServicePathFirstHopOutput renderedServicePathFirstHopOutput = null; if (renderedServicePathFirstHop != null) { ReadRenderedServicePathFirstHopOutputBuilder renderedServicePathFirstHopOutputBuilder = new ReadRenderedServicePathFirstHopOutputBuilder(); renderedServicePathFirstHopOutputBuilder.setRenderedServicePathFirstHop(renderedServicePathFirstHop); renderedServicePathFirstHopOutput = renderedServicePathFirstHopOutputBuilder.build(); rpcResultBuilder = RpcResultBuilder.success(renderedServicePathFirstHopOutput); } else { String message = "Error Reading RSP First Hop from DataStore: " + input.getName(); rpcResultBuilder = RpcResultBuilder.<ReadRenderedServicePathFirstHopOutput>failed() .withError(ErrorType.APPLICATION, message); } return Futures.immediateFuture(rpcResultBuilder.build()); }
.readRenderedServicePathFirstHop(new RspName(rsp.getName()));
if (serviceFunctionPath.getName() != null) { renderedServicePathBuilder .setName(new RspName(serviceFunctionPath.getName().getValue() + "-Path-" + pathId)); } else { LOG.error("{}: Failed to set RSP Name as it was null and SFP Name was null.", renderedServicePathBuilder.setName(new RspName(createRenderedPathInput.getName()));
RspName rspName = new RspName(sfcPath.getName().getValue() + tenantName + "-gbp-rsp"); ReadOnlyTransaction rTx = ctx.getDataBroker().newReadOnlyTransaction(); RenderedServicePath renderedServicePath; rspName = new RspName(rspName.getValue() + "-Reverse"); rsp = getRspByName(rspName, rTx); tunnelId = (long) netElements.getDstEpOrdinals().getTunnelId();