Пример #1
0
  public ServiceFunctionChain createServiceFunctionChain(
      List<Class<? extends ServiceFunctionTypeIdentity>> sfTypes) {

    short order = 0;
    List<SfcServiceFunction> sfcSfs = new ArrayList<SfcServiceFunction>();
    for (Class<? extends ServiceFunctionTypeIdentity> sfType : sfTypes) {
      String name = sfType.getName() + "Abstract";
      SfcServiceFunctionBuilder sfcSfBuilder = new SfcServiceFunctionBuilder();
      sfcSfBuilder.setKey(new SfcServiceFunctionKey(name));
      sfcSfBuilder.setName(name);
      sfcSfBuilder.setOrder(order++);
      sfcSfBuilder.setType(sfType);
      sfcSfs.add(sfcSfBuilder.build());
    }

    SfcName sfcName = new SfcName(SFC_NAME_PREFIX + String.valueOf(SFC_NAME_INDEX++));
    ServiceFunctionChainBuilder sfcBuilder = new ServiceFunctionChainBuilder();
    sfcBuilder.setName(sfcName);
    sfcBuilder.setKey(new ServiceFunctionChainKey(sfcName));
    sfcBuilder.setSymmetric(true);
    sfcBuilder.setSfcServiceFunction(sfcSfs);

    return sfcBuilder.build();
  }
 public SfcServiceFunctionBuilder sfcServiceFunctionBuilder(
     SfcServiceFunctionBuilder sfcServiceFunctionBuilder, String name, SftType type) {
   return sfcServiceFunctionBuilder.setName(name).setType(type);
 }