• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LifecycleEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openbaton.catalogue.mano.common.LifecycleEvent的典型用法代码示例。如果您正苦于以下问题:Java LifecycleEvent类的具体用法?Java LifecycleEvent怎么用?Java LifecycleEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LifecycleEvent类属于org.openbaton.catalogue.mano.common包,在下文中一共展示了LifecycleEvent类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkIntegrityLifecycleEvents

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
private void checkIntegrityLifecycleEvents(
    VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor)
    throws NetworkServiceIntegrityException {
  if (virtualNetworkFunctionDescriptor.getLifecycle_event() != null) {
    for (LifecycleEvent event : virtualNetworkFunctionDescriptor.getLifecycle_event()) {
      if (event == null) {
        throw new NetworkServiceIntegrityException(
            "LifecycleEvent in VNFD " + virtualNetworkFunctionDescriptor.getName() + " is null");
      } else if (event.getEvent() == null) {
        throw new NetworkServiceIntegrityException(
            "Event in one LifecycleEvent of VNFD "
                + virtualNetworkFunctionDescriptor.getName()
                + " does not exist");
      }
    }
  }
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:18,代码来源:NSDUtils.java


示例2: terminate

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord terminate(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
  log.debug("RELEASE_RESOURCES");
  log.info("Releasing resources for VNFR: " + virtualNetworkFunctionRecord.getName());
  log.trace("Verison is: " + virtualNetworkFunctionRecord.getHbVersion());
  List<Event> events = new ArrayList<>();

  for (LifecycleEvent event : virtualNetworkFunctionRecord.getLifecycle_event()) {
    events.add(event.getEvent());
  }

  if (events.contains(Event.RELEASE)) {
    for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu())
      log.debug("Removing vdu: " + vdu);

    try {
      Thread.sleep(1000 + ((int) (Math.random() * 4000)));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:dummy-vnfm-amqp,代码行数:25,代码来源:DummyAMQPVNFManager.java


示例3: terminate

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord terminate(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
  log.debug("RELEASE_RESOURCES");
  log.info("Releasing resources for VNFR: " + virtualNetworkFunctionRecord.getName());
  log.trace("Verison is: " + virtualNetworkFunctionRecord.getHb_version());
  List<Event> events = new ArrayList<>();

  for (LifecycleEvent event : virtualNetworkFunctionRecord.getLifecycle_event()) {
    events.add(event.getEvent());
  }

  if (events.contains(Event.RELEASE)) {
    for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu())
      log.debug("Removing vdu: " + vdu);

    try {
      Thread.sleep(1000 + ((int) (Math.random() * 4000)));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:dummy-vnfm-rest,代码行数:25,代码来源:DummyRestVNFManager.java


示例4: getOpLifecycle

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
@SuppressWarnings({"unsafe", "unchecked"})
public Set<LifecycleEvent> getOpLifecycle() {

  Map<String, ArrayList> lifecycleMap = (Map<String, ArrayList>) lifecycle;
  Set<LifecycleEvent> lifecycleEvents = new HashSet<>();

  if (lifecycle != null) {
    for (String lifecycleName : lifecycleMap.keySet()) {

      LifecycleEvent lifecycleEvent = new LifecycleEvent();

      switch (lifecycleName.toLowerCase()) {
        case "instantiate":
          lifecycleEvent.setEvent(Event.INSTANTIATE);
          break;
        case "start":
          lifecycleEvent.setEvent(Event.START);
          break;
        case "configure":
          lifecycleEvent.setEvent(Event.CONFIGURE);
          break;
        case "delete":
          lifecycleEvent.setEvent(Event.TERMINATE);
          break;
        case "stop":
          lifecycleEvent.setEvent(Event.STOP);
          break;
      }

      ArrayList<String> cmds = new ArrayList<>();
      cmds.addAll(lifecycleMap.get(lifecycleName));
      lifecycleEvent.setLifecycle_events(cmds);

      lifecycleEvents.add(lifecycleEvent);
    }
  }

  return lifecycleEvents;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:40,代码来源:VNFInterfaces.java


示例5: createNetworkServiceRecord

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public static NetworkServiceRecord createNetworkServiceRecord(
    NetworkServiceDescriptor networkServiceDescriptor) {
  NetworkServiceRecord networkServiceRecord = new NetworkServiceRecord();
  networkServiceRecord.setDescriptor_reference(networkServiceDescriptor.getId());
  networkServiceRecord.setName(networkServiceDescriptor.getName());
  networkServiceRecord.setVendor(networkServiceDescriptor.getVendor());
  networkServiceRecord.setMonitoring_parameter(new HashSet<String>());
  networkServiceRecord
      .getMonitoring_parameter()
      .addAll(networkServiceDescriptor.getMonitoring_parameter());
  networkServiceRecord.setAuto_scale_policy(new HashSet<AutoScalePolicy>());
  networkServiceRecord
      .getAuto_scale_policy()
      .addAll(networkServiceDescriptor.getAuto_scale_policy());
  networkServiceRecord.setVnfr(new HashSet<VirtualNetworkFunctionRecord>());
  networkServiceRecord.setVnf_dependency(new HashSet<VNFRecordDependency>());

  networkServiceRecord.setLifecycle_event(new HashSet<LifecycleEvent>());
  Set<PhysicalNetworkFunctionRecord> pnfrs = new HashSet<>();
  if (networkServiceDescriptor.getPnfd() != null)
    for (PhysicalNetworkFunctionDescriptor physicalNetworkFunctionDescriptor :
        networkServiceDescriptor.getPnfd()) {
      pnfrs.add(createPhysicalNetworkFunctionRecord(physicalNetworkFunctionDescriptor));
    }
  networkServiceRecord.setPnfr(pnfrs);
  networkServiceRecord.setStatus(Status.NULL);
  networkServiceRecord.setVnffgr(new HashSet<VNFForwardingGraphRecord>());
  networkServiceRecord.setVersion(networkServiceDescriptor.getVersion());
  networkServiceRecord.setVlr(new HashSet<VirtualLinkRecord>());
  if (networkServiceDescriptor.getVld() != null) {
    for (VirtualLinkDescriptor virtualLinkDescriptor : networkServiceDescriptor.getVld()) {
      VirtualLinkRecord vlr = createVirtualLinkRecord(virtualLinkDescriptor);
      vlr.setParent_ns(networkServiceDescriptor.getId());
      networkServiceRecord.getVlr().add(vlr);
    }
  }
  return networkServiceRecord;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:39,代码来源:NSRUtils.java


示例6: createVirtualLinkRecord

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
private static VirtualLinkRecord createVirtualLinkRecord(
    VirtualLinkDescriptor virtualLinkDescriptor) {
  VirtualLinkRecord virtualLinkRecord = new VirtualLinkRecord();
  virtualLinkRecord.setName(virtualLinkDescriptor.getName());
  virtualLinkRecord.setConnectivity_type(virtualLinkDescriptor.getConnectivity_type());
  virtualLinkRecord.setDescriptor_reference(virtualLinkDescriptor.getId());
  virtualLinkRecord.setRoot_requirement(virtualLinkDescriptor.getRoot_requirement());
  virtualLinkRecord.setLeaf_requirement(virtualLinkDescriptor.getLeaf_requirement());
  virtualLinkRecord.setVendor(virtualLinkDescriptor.getVendor());

  virtualLinkRecord.setStatus(LinkStatus.LINKDOWN);

  virtualLinkRecord.setParent_ns(null);
  virtualLinkRecord.setExtId(null);
  virtualLinkRecord.setVim_id(null);

  virtualLinkRecord.setAllocated_capacity(new HashSet<String>());
  virtualLinkRecord.setAudit_log(new HashSet<String>());
  virtualLinkRecord.setNotification(new HashSet<String>());
  virtualLinkRecord.setLifecycle_event_history(new HashSet<LifecycleEvent>());
  virtualLinkRecord.setVnffgr_reference(new HashSet<VNFForwardingGraphRecord>());
  virtualLinkRecord.setConnection(new HashSet<String>());

  //TODO think about test_access -> different types on VLD and VLR
  //virtualLinkRecord.setTest_access("");

  virtualLinkRecord.setQos(new HashSet<String>());
  for (String qos : virtualLinkDescriptor.getQos()) {
    virtualLinkRecord.getQos().add(qos);
  }

  return virtualLinkRecord;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:34,代码来源:NSRUtils.java


示例7: getLifecycleEvent

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public static LifecycleEvent getLifecycleEvent(Collection<LifecycleEvent> events, Event event) {
  for (LifecycleEvent lce : events)
    if (lce.getEvent().ordinal() == event.ordinal()) {
      return lce;
    }
  return null;
}
 
开发者ID:openbaton,项目名称:openbaton-libs,代码行数:8,代码来源:VnfmUtils.java


示例8: prepareLifecycleScript

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
/**
 * Write the lifecycle scripts into a special directory in the charm so that they can be called by
 * the charm hooks. TODO
 *
 * @param fileName
 * @param nsId
 * @param vnfName
 * @param le
 * @throws Exception
 */
private void prepareLifecycleScript(
    String fileName, String nsId, String vnfName, LifecycleEvent le) throws Exception {
  File file = new File("/tmp/openbaton/juju/" + nsId + "/" + vnfName + "/hooks/" + fileName);
  if (!file.exists()) {
    file.createNewFile();
    Files.setPosixFilePermissions(file.toPath(), permissions);
  }

  String fileContent =
      "#!/bin/bash\necho \"`date '+%H-%M-%S'` "
          + vnfName
          + ": execute "
          + fileName
          + " hook\" >> "
          + scriptLogPath
          + "/"
          + vnfName
          + "\nsource hooks/paramVariables\n";
  fileContent += ("cd scripts\n");
  for (String scriptName : le.getLifecycle_events())
    fileContent +=
        ("echo \"`date '+%H-%M-%S'` "
            + vnfName
            + ": execute "
            + scriptName
            + "\" >> "
            + scriptLogPath
            + "/"
            + vnfName
            + "\nbash "
            + scriptName
            + "\necho \"`date '+%H-%M-%S'` "
            + vnfName
            + ": finished "
            + scriptName
            + "\" >> "
            + scriptLogPath
            + "/"
            + vnfName
            + "\n");
  fileContent +=
      "echo \"`date '+%H-%M-%S'` "
          + vnfName
          + ": finished "
          + fileName
          + " hook\" >> "
          + scriptLogPath
          + "/"
          + vnfName
          + "\n";
  try {
    Files.write(
        Paths.get(file.getAbsolutePath()), fileContent.getBytes(), StandardOpenOption.APPEND);
  } catch (IOException e) {
    log.error("Could not write to " + fileName + " file");
  }
}
 
开发者ID:openbaton,项目名称:juju-vnfm,代码行数:68,代码来源:JujuVnfm.java


示例9: copyLifecycleScripts

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
/**
 * Copy the lifecycle scripts into the correct charm.
 *
 * @param le
 * @param event
 * @param vnfdName
 * @return
 * @throws Exception
 */
private void copyLifecycleScripts(LifecycleEvent le, Event event, String vnfdName, String nsId)
    throws Exception {
  log.info("Copy scripts for lifecycle event " + event.name());

  File scriptsFolder = new File("/tmp/openbaton/juju/" + nsId + "/scripts/" + vnfdName);
  File[] listOfFiles = scriptsFolder.listFiles();
  if (listOfFiles.length > 1)
    throw new Exception(
        "There is more than one folder in /tmp/openbaton/juju/scripts/" + vnfdName);
  else if (listOfFiles.length < 1)
    throw new Exception(
        "No script folder found in /tmp/openbaton/juju/" + nsId + "/scripts/" + vnfdName);

  String gitFolderPath = "";

  for (int i = 0; i < listOfFiles.length; i++) {
    if (listOfFiles[i].isFile()) {
      throw new Exception(
          "Git Repository expected but just found a normal file: " + listOfFiles[i].getName());
    } else if (listOfFiles[i].isDirectory()) {
      gitFolderPath = listOfFiles[i].getPath();
    }
  }
  log.info("Found git folder " + gitFolderPath);

  String dirName = event.name().toLowerCase() + "Scripts";
  File scriptDir = new File("/tmp/openbaton/juju/" + nsId + "/" + vnfdName + "/hooks/" + dirName);
  if (!scriptDir.exists())
    (new File(
            "/tmp/openbaton/juju/"
                + nsId
                + "/"
                + vnfdName
                + "/hooks/"
                + le.getEvent().name().toLowerCase()
                + "Scripts"))
        .mkdirs();

  for (String script : le.getLifecycle_events()) {
    Files.copy(
        Paths.get(gitFolderPath + "/" + script),
        Paths.get(
            "/tmp/openbaton/juju/" + nsId + "/" + vnfdName + "/hooks/" + dirName + "/" + script),
        StandardCopyOption.COPY_ATTRIBUTES);
  }
}
 
开发者ID:openbaton,项目名称:juju-vnfm,代码行数:56,代码来源:JujuVnfm.java


示例10: executeScriptsForEvent

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public Iterable<String> executeScriptsForEvent(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, Event event)
    throws Exception { //TODO make it parallel
  Map<String, String> env = getMap(virtualNetworkFunctionRecord);
  Collection<String> res = new ArrayList<>();
  LifecycleEvent le =
      VnfmUtils.getLifecycleEvent(virtualNetworkFunctionRecord.getLifecycle_event(), event);

  if (le != null) {
    log.trace(
        "The number of scripts for "
            + virtualNetworkFunctionRecord.getName()
            + " are: "
            + le.getLifecycle_events());
    for (String script : le.getLifecycle_events()) {
      log.info(
          "Sending script: "
              + script
              + " to VirtualNetworkFunctionRecord: "
              + virtualNetworkFunctionRecord.getName());
      for (VirtualDeploymentUnit vdu : virtualNetworkFunctionRecord.getVdu()) {
        for (VNFCInstance vnfcInstance : vdu.getVnfc_instance()) {

          Map<String, String> tempEnv = new HashMap<>();
          for (Ip ip : vnfcInstance.getIps()) {
            log.debug("Adding net: " + ip.getNetName() + " with value: " + ip.getIp());
            tempEnv.put(ip.getNetName(), ip.getIp());
          }
          log.debug("adding floatingIp: " + vnfcInstance.getFloatingIps());
          for (Ip fip : vnfcInstance.getFloatingIps()) {
            tempEnv.put(fip.getNetName() + "_floatingIp", fip.getIp());
          }

          tempEnv.put("hostname", vnfcInstance.getHostname());
          tempEnv = modifyUnsafeEnvVarNames(tempEnv);
          env.putAll(tempEnv);
          log.info("Environment Variables are: " + env);

          String command = JsonUtils.getJsonObject("EXECUTE", script, env).toString();
          String output =
              ems.executeActionOnEMS(
                  vnfcInstance.getHostname(),
                  command,
                  virtualNetworkFunctionRecord,
                  vnfcInstance);
          res.add(output);
          log.debug("Saving log to file...");
          logUtils.saveLogToFile(virtualNetworkFunctionRecord, script, vnfcInstance, output);
          for (String key : tempEnv.keySet()) {
            env.remove(key);
          }
        }
      }
    }
  }
  return res;
}
 
开发者ID:openbaton,项目名称:generic-vnfm,代码行数:58,代码来源:LifeCycleManagement.java


示例11: getLifecycle_event_history

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public Set<LifecycleEvent> getLifecycle_event_history() {
  return lifecycle_event_history;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:4,代码来源:VirtualLinkRecord.java


示例12: setLifecycle_event_history

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public void setLifecycle_event_history(Set<LifecycleEvent> lifecycle_event_history) {
  this.lifecycle_event_history = lifecycle_event_history;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:4,代码来源:VirtualLinkRecord.java


示例13: getLifecycle_event

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public Set<LifecycleEvent> getLifecycle_event() {
  return lifecycle_event;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:4,代码来源:VirtualNetworkFunctionRecord.java


示例14: setLifecycle_event

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
public void setLifecycle_event(Set<LifecycleEvent> lifecycle_event) {
  this.lifecycle_event = lifecycle_event;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:4,代码来源:VirtualNetworkFunctionRecord.java


示例15: createVirtualNetworkFunctionDescriptor

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
private VirtualNetworkFunctionDescriptor createVirtualNetworkFunctionDescriptor() {
  VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor =
      new VirtualNetworkFunctionDescriptor();
  virtualNetworkFunctionDescriptor.setType("test");
  virtualNetworkFunctionDescriptor.setProjectId(projectId);
  virtualNetworkFunctionDescriptor.setEndpoint("test");
  virtualNetworkFunctionDescriptor.setName("" + ((int) (Math.random() * 10000)));
  virtualNetworkFunctionDescriptor.setMonitoring_parameter(new HashSet<String>());
  virtualNetworkFunctionDescriptor.getMonitoring_parameter().add("monitor1");
  virtualNetworkFunctionDescriptor.getMonitoring_parameter().add("monitor2");
  virtualNetworkFunctionDescriptor.getMonitoring_parameter().add("monitor3");
  virtualNetworkFunctionDescriptor.setAuto_scale_policy(new HashSet<AutoScalePolicy>());
  virtualNetworkFunctionDescriptor.setConnection_point(new HashSet<ConnectionPoint>());
  virtualNetworkFunctionDescriptor.setVirtual_link(new HashSet<InternalVirtualLink>());
  virtualNetworkFunctionDescriptor.setLifecycle_event(new HashSet<LifecycleEvent>());

  virtualNetworkFunctionDescriptor.setDeployment_flavour(
      new HashSet<VNFDeploymentFlavour>() {
        {
          VNFDeploymentFlavour vdf = new VNFDeploymentFlavour();
          vdf.setExtId("ext_id");
          vdf.setFlavour_key("flavor_name");
          add(vdf);
        }
      });
  virtualNetworkFunctionDescriptor.setVdu(
      new HashSet<VirtualDeploymentUnit>() {
        {
          VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
          vdu.setVm_image(
              new HashSet<String>() {
                {
                  add("mocked_image");
                }
              });
          HighAvailability highAvailability = new HighAvailability();
          highAvailability.setRedundancyScheme("1:N");
          highAvailability.setResiliencyLevel(ResiliencyLevel.ACTIVE_STANDBY_STATELESS);
          vdu.setHigh_availability(highAvailability);
          vdu.setComputation_requirement("high_requirements");
          vdu.setVnfc(new HashSet<VNFComponent>());
          vdu.setLifecycle_event(new HashSet<LifecycleEvent>());
          vdu.setMonitoring_parameter(
              new HashSet<String>() {
                {
                  add("monitor1");
                  add("monitor2");
                  add("monitor3");
                }
              });
          BaseVimInstance vimInstance = new OpenstackVimInstance();
          vimInstance.setName("vim_instance");
          vimInstance.setType("test");
          Set<String> vimInstanceNames = new LinkedHashSet<>();
          vimInstanceNames.add("vim_instance");
          vdu.setVimInstanceName(vimInstanceNames);
          add(vdu);
        }
      });
  return virtualNetworkFunctionDescriptor;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:62,代码来源:NetworkServiceRecordManagementClassSuiteTest.java


示例16: createNetworkServiceRecord

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
private NetworkServiceRecord createNetworkServiceRecord() {
  final NetworkServiceRecord nsr = new NetworkServiceRecord();
  nsr.setVendor("FOKUS");
  nsr.setProjectId(projectId);
  nsr.setStatus(Status.ACTIVE);
  nsr.setMonitoring_parameter(new HashSet<String>());
  nsr.getMonitoring_parameter().add("monitor1");
  nsr.getMonitoring_parameter().add("monitor2");
  nsr.getMonitoring_parameter().add("monitor3");
  HashSet<VirtualNetworkFunctionRecord> virtualNetworkFunctionRecords = new HashSet<>();
  VirtualNetworkFunctionRecord virtualNetworkFunctionRecord = new VirtualNetworkFunctionRecord();
  virtualNetworkFunctionRecord.setName("mocked_vnfr_name");
  virtualNetworkFunctionRecord.setType("test");
  virtualNetworkFunctionRecord.setMonitoring_parameter(
      new HashSet<String>() {
        {
          add("monitor1");
          add("monitor2");
          add("monitor3");
        }
      });
  VNFDeploymentFlavour vdf = new VNFDeploymentFlavour();
  vdf.setExtId("ext_id");
  vdf.setFlavour_key("flavor_name");
  virtualNetworkFunctionRecord.setDeployment_flavour_key(vdf.getFlavour_key());
  virtualNetworkFunctionRecord.setVdu(
      new HashSet<VirtualDeploymentUnit>() {
        {
          VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
          HighAvailability highAvailability = new HighAvailability();
          highAvailability.setRedundancyScheme("1:N");
          highAvailability.setResiliencyLevel(ResiliencyLevel.ACTIVE_STANDBY_STATELESS);
          vdu.setHigh_availability(highAvailability);
          vdu.setVm_image(
              new HashSet<String>() {
                {
                  add("mocked_image");
                }
              });
          vdu.setComputation_requirement("high_requirements");
          vdu.setVnfc(new HashSet<VNFComponent>());
          vdu.setVnfc_instance(new HashSet<VNFCInstance>());
          vdu.setLifecycle_event(new HashSet<LifecycleEvent>());
          vdu.setMonitoring_parameter(
              new HashSet<String>() {
                {
                  add("monitor1");
                  add("monitor2");
                  add("monitor3");
                }
              });
          BaseVimInstance vimInstance = new OpenstackVimInstance();
          vimInstance.setName("vim_instance");
          vimInstance.setType("test");
          add(vdu);
        }
      });
  virtualNetworkFunctionRecords.add(virtualNetworkFunctionRecord);
  nsr.setVnfr(virtualNetworkFunctionRecords);
  return nsr;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:62,代码来源:NetworkServiceRecordManagementClassSuiteTest.java


示例17: createVirtualLinkRecord

import org.openbaton.catalogue.mano.common.LifecycleEvent; //导入依赖的package包/类
private VirtualLinkRecord createVirtualLinkRecord() {
  VirtualLinkRecord virtualLinkRecord = new VirtualLinkRecord();
  virtualLinkRecord.setConnection(
      new HashSet<String>() {
        {
          add("connection1");
        }
      });
  virtualLinkRecord.setRoot_requirement("root_req");
  virtualLinkRecord.setVendor("vendor");
  virtualLinkRecord.setConnectivity_type("type");
  virtualLinkRecord.setLeaf_requirement("leaf_req");
  virtualLinkRecord.setQos(
      new HashSet<String>() {
        {
          add("qos");
        }
      });
  virtualLinkRecord.setVersion("version");
  virtualLinkRecord.setVim_id("vim_id");
  virtualLinkRecord.setVnffgr_reference(new HashSet<VNFForwardingGraphRecord>());
  virtualLinkRecord.setStatus(LinkStatus.NORMALOPERATION);
  virtualLinkRecord.setAudit_log(
      new HashSet<String>() {
        {
          add("audit_log_1");
        }
      });
  virtualLinkRecord.setAllocated_capacity(
      new HashSet<String>() {
        {
          add("allocated_cap");
        }
      });
  virtualLinkRecord.setTest_access(
      new HashSet<String>() {
        {
          add("test_access");
        }
      });
  virtualLinkRecord.setParent_ns("parent_id");
  virtualLinkRecord.setNumber_of_endpoints(3);
  virtualLinkRecord.setNotification(
      new HashSet<String>() {
        {
          add("notification");
        }
      });
  virtualLinkRecord.setLifecycle_event_history(
      new HashSet<LifecycleEvent>() {
        {
          LifecycleEvent lifecycleEvent = new LifecycleEvent();
          lifecycleEvent.setEvent(Event.INSTANTIATE);
          lifecycleEvent.setLifecycle_events(
              new ArrayList<String>() {
                {
                  add("command");
                }
              });
          add(lifecycleEvent);
        }
      });
  return virtualLinkRecord;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:65,代码来源:VirtualLinkManagementClassSuiteTest.java



注:本文中的org.openbaton.catalogue.mano.common.LifecycleEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Snippet类代码示例发布时间:2022-05-23
下一篇:
Java Builder类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap