当前位置: 首页>>代码示例>>Java>>正文


Java VNFDConnectionPoint类代码示例

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


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

示例1: launchInstanceAndWait

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
@Override
public Server launchInstanceAndWait(
    BaseVimInstance vimInstance,
    String hostname,
    String image,
    String extId,
    String keyPair,
    Set<VNFDConnectionPoint> networks,
    Set<String> securityGroups,
    String s,
    Map<String, String> floatingIps,
    Set<Key> keys) {
  try {
    Thread.sleep((long) (Math.random() * 3500));
  } catch (InterruptedException e) {
    e.printStackTrace();
  }
  Server server = createServer();
  log.debug("Created server: " + server);
  return server;
}
 
开发者ID:openbaton,项目名称:test-plugin,代码行数:22,代码来源:TestClient.java

示例2: launchInstance

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
@Override
public Server launchInstance(
    BaseVimInstance vimInstance,
    String name,
    String image,
    String flavor,
    String keypair,
    Set<VNFDConnectionPoint> network,
    Set<String> secGroup,
    String userData) {
  return createServer();
}
 
开发者ID:openbaton,项目名称:test-plugin,代码行数:13,代码来源:TestClient.java

示例3: parseCPTemplate

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
/**
 * Parser of the Connection Point
 *
 * @param cpTemplate
 * @return
 */
private VNFDConnectionPoint parseCPTemplate(CPNodeTemplate cpTemplate) {

  VNFDConnectionPoint cp = new VNFDConnectionPoint();
  cp.setVirtual_link_reference(cpTemplate.getRequirements().getVirtualLink().get(0));

  if (cpTemplate.getProperties() != null) {
    if (cpTemplate.getProperties().getFloatingIP() != null) {
      cp.setFloatingIp(cpTemplate.getProperties().getFloatingIP());
    }
    cp.setInterfaceId(cpTemplate.getProperties().getInterfaceId());
  }

  return cp;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:21,代码来源:TOSCAParser.java

示例4: parseVDUTemplate

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
/**
 * Parser of the Virtual Deployment Unit
 *
 * @param vduTemplate
 * @param cps
 * @return
 */
private VirtualDeploymentUnit parseVDUTemplate(
    VDUNodeTemplate vduTemplate, List<CPNodeTemplate> cps) {

  VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
  vdu.setName(vduTemplate.getName());

  // ADD Settings
  vdu.setScale_in_out(vduTemplate.getProperties().getScale_in_out());
  vdu.setVm_image(vduTemplate.getArtifacts());
  if (vduTemplate.getProperties().getFault_management_policy() != null) {
    vdu.setFault_management_policy(
        vduTemplate.getProperties().getFault_management_policy().getFaultManagementPolicies());
  }

  vdu.setVimInstanceName(vduTemplate.getProperties().getVim_instance_name());

  // ADD VNF Connection Points
  Set<VNFComponent> vnfComponents = new HashSet<>();
  VNFComponent vnfc = new VNFComponent();
  Set<VNFDConnectionPoint> connectionPoints = new HashSet<>();

  for (CPNodeTemplate cp : cps) {
    if (cp.getRequirements().getVirtualBinding().contains(vduTemplate.getName())) {
      connectionPoints.add(parseCPTemplate(cp));
    }
  }

  vnfc.setConnection_point(connectionPoints);
  vnfComponents.add(vnfc);
  vdu.setVnfc(vnfComponents);

  return vdu;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:41,代码来源:TOSCAParser.java

示例5: launchInstance

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
Server launchInstance(
BaseVimInstance vimInstance,
String name,
String image,
String flavor,
String keypair,
Set<VNFDConnectionPoint> networks,
Set<String> secGroup,
String userData)
throws VimDriverException;
 
开发者ID:openbaton,项目名称:NFVO,代码行数:11,代码来源:ClientInterfaces.java

示例6: launchInstanceAndWait

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
Server launchInstanceAndWait(
BaseVimInstance vimInstance,
String hostname,
String image,
String extId,
String keyPair,
Set<VNFDConnectionPoint> networks,
Set<String> securityGroups,
String s,
Map<String, String> floatingIps,
Set<Key> keys)
throws VimDriverException;
 
开发者ID:openbaton,项目名称:NFVO,代码行数:13,代码来源:ClientInterfaces.java

示例7: launchInstance

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
@Override
public Server launchInstance(
    BaseVimInstance vimInstance,
    String name,
    String image,
    String flavor,
    String keypair,
    Set<VNFDConnectionPoint> networks,
    Set<String> secGroup,
    String userData)
    throws VimDriverException {
  List<Serializable> params = new ArrayList<>();
  params.add(vimInstance);
  params.add(name);
  params.add(image);
  params.add(flavor);
  params.add(keypair);
  params.add((Serializable) networks);
  params.add((Serializable) secGroup);
  params.add(userData);
  Serializable res = null;
  try {
    res = pluginCaller.executeRPC("launchInstance", params, Server.class);
  } catch (IOException | PluginException | InterruptedException e) {
    throw new VimDriverException(e.getMessage());
  }
  return (Server) res;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:29,代码来源:VimDriverCaller.java

示例8: updateVNFDConnectionPoints

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
private Set<VNFDConnectionPoint> updateVNFDConnectionPoints(
    Set<VNFDConnectionPoint> vnfdConnectionPoints_nfvo,
    Set<VNFDConnectionPoint> vnfdConnectionPoints_manager) {
  Set<VNFDConnectionPoint> vnfdConnectionPoints = new HashSet<>();
  boolean found = false;
  //Updating existing VNFDConnectionPoints, adding new ones and ignoring old ones
  for (VNFDConnectionPoint vnfdConnectionPoint_manager : vnfdConnectionPoints_manager) {
    //VNFDConnectionPoint ID is null -> NEW
    if (vnfdConnectionPoint_manager.getId() == null) {
      vnfdConnectionPoints.add(vnfdConnectionPoint_manager);
      log.debug("Update: Added new VNFDConnectionPoint " + vnfdConnectionPoint_manager);
      continue;
    }
    for (VNFDConnectionPoint vnfdConnectionPoint_nfvo : vnfdConnectionPoints_nfvo) {
      //Found VNFDConnectionPoint -> Updating
      if (vnfdConnectionPoint_nfvo.getId().equals(vnfdConnectionPoint_manager.getId())) {
        found = true;
        log.debug(
            "Update: Updating existing VNFDConnectionPoint " + vnfdConnectionPoint_nfvo.getId());
        vnfdConnectionPoint_nfvo.setVirtual_link_reference(
            vnfdConnectionPoint_manager.getVirtual_link_reference());
        vnfdConnectionPoint_nfvo.setType(vnfdConnectionPoint_manager.getType());
        //Add updated VNFDConnectionPoint
        vnfdConnectionPoints.add(vnfdConnectionPoint_nfvo);
        //Proceed with the next VNFDConnectionPoint
        break;
      }
    }
    //VNFDConnectionPoint not found -> NEW
    if (!found) {
      vnfdConnectionPoints.add(vnfdConnectionPoint_manager);
      log.debug("Update: Added new VNFDConnectionPoint " + vnfdConnectionPoint_manager.getId());
    }
  }
  log.debug("Update: Updated VNFDConnectionPoints " + vnfdConnectionPoints);
  return vnfdConnectionPoints;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:38,代码来源:UpdatevnfrTask.java

示例9: createVDU

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
private VirtualDeploymentUnit createVDU() {
  VirtualDeploymentUnit vdu = new VirtualDeploymentUnit();
  OpenstackVimInstance vimInstance = createVIM();
  HashSet<VNFComponent> vnfcs = new HashSet<>();
  VNFComponent vnfc = new VNFComponent();
  Set<VNFDConnectionPoint> vnfdCps = new HashSet<>();
  VNFDConnectionPoint vnfcCp = new VNFDConnectionPoint();
  vnfcCp.setVirtual_link_reference("network1");
  vnfdCps.add(vnfcCp);
  vnfc.setConnection_point(vnfdCps);
  vnfcs.add(vnfc);
  vdu.setVnfc(vnfcs);
  Set<String> monitoring_parameter = new HashSet<>();
  monitoring_parameter.add("parameter_1");
  monitoring_parameter.add("parameter_2");
  monitoring_parameter.add("parameter_3");
  vdu.setMonitoring_parameter(monitoring_parameter);
  vdu.setComputation_requirement("m1.small");
  Set<String> vm_images = new HashSet<>();
  vm_images.add("image_1234");
  vdu.setVm_image(vm_images);
  vimInstance.setFlavours(new HashSet<>());
  DeploymentFlavour deploymentFlavour = new DeploymentFlavour();
  deploymentFlavour.setExtId("ext_id");
  deploymentFlavour.setFlavour_key("m1.small");
  vimInstance.getFlavours().add(deploymentFlavour);
  return vdu;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:29,代码来源:VimTestSuiteClass.java

示例10: createBaseNetwork

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
public static BaseNetwork createBaseNetwork(
    NetworkServiceDescriptor networkServiceDescriptor,
    VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor,
    VNFDConnectionPoint vnfdConnectionPoint,
    BaseVimInstance vimInstance)
    throws BadRequestException {
  if (vimInstance instanceof OpenstackVimInstance) {
    Network network = new Network();
    HashSet<Subnet> subnets = new HashSet<>();
    Subnet subnet = new Subnet();
    subnet.setName(String.format("%s_subnet", vnfdConnectionPoint.getVirtual_link_reference()));
    subnet.setCidr(
        getCidrFromVLName(
            vnfdConnectionPoint.getVirtual_link_reference(),
            networkServiceDescriptor,
            virtualNetworkFunctionDescriptor));
    subnets.add(subnet);
    network.setSubnets(subnets);
    network.setName(vnfdConnectionPoint.getVirtual_link_reference());
    return network;
  } else if (vimInstance instanceof DockerVimInstance) {
    DockerNetwork networkdc = new DockerNetwork();
    networkdc.setName(vnfdConnectionPoint.getVirtual_link_reference());
    networkdc.setSubnet(
        getCidrFromVLName(
            vnfdConnectionPoint.getVirtual_link_reference(),
            networkServiceDescriptor,
            virtualNetworkFunctionDescriptor));
    return networkdc;
  } else {
    BaseNetwork networkb = new BaseNetwork();
    networkb.setName(vnfdConnectionPoint.getVirtual_link_reference());
    return networkb;
  }
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:36,代码来源:VimInstanceUtils.java

示例11: isVNFDConnectionPointExisting

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
private boolean isVNFDConnectionPointExisting(
    VNFDConnectionPoint vnfdConnectionPoint, BaseNetwork network) {
  if (network.getName().equals(vnfdConnectionPoint.getVirtual_link_reference())
      || network.getExtId().equals(vnfdConnectionPoint.getVirtual_link_reference())) {
    if (vnfdConnectionPoint.getFixedIp() != null
        && !vnfdConnectionPoint.getFixedIp().equals("")) {
      if (network instanceof Network) {
        Network osNet = (Network) network;
        return osNet.getSubnets() == null
            || osNet.getSubnets().size() <= 0
            || osNet
                .getSubnets()
                .stream()
                .anyMatch(
                    subnet ->
                        new SubnetUtils(subnet.getCidr())
                            .getInfo()
                            .isInRange(vnfdConnectionPoint.getFixedIp()));
      } else if (network instanceof DockerNetwork) {
        DockerNetwork dockerNetwork = (DockerNetwork) network;
        return new SubnetUtils(dockerNetwork.getSubnet())
            .getInfo()
            .isInRange(vnfdConnectionPoint.getFixedIp());
      } else return true;
    } else {
      return true;
    }
  } else return false;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:30,代码来源:NetworkServiceRecordManagement.java

示例12: allocateVNFC

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
private VNFCInstance allocateVNFC(
    BaseVimInstance vimInstance,
    VirtualDeploymentUnit virtualDeploymentUnit,
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
    org.openbaton.nfvo.vim_interfaces.resource_management.ResourceManagement vim,
    VNFComponent component,
    String userdata,
    Set<Key> keys)
    throws InterruptedException, ExecutionException, VimException, PluginException {

  log.trace("UserData is: " + userdata);
  Map<String, String> floatinIps = new HashMap<>();
  for (VNFDConnectionPoint connectionPoint : component.getConnection_point()) {
    floatinIps.put(connectionPoint.getVirtual_link_reference(), connectionPoint.getFloatingIp());
  }
  log.info("FloatingIp chosen are: " + floatinIps);
  VNFCInstance added =
      vim.allocate(
              vimInstance,
              virtualDeploymentUnit,
              virtualNetworkFunctionRecord,
              component,
              userdata,
              floatinIps,
              keys)
          .get();

  virtualDeploymentUnit.getVnfc_instance().add(added);
  if (!floatinIps.isEmpty() && added.getFloatingIps().isEmpty())
    log.warn("NFVO wasn't able to associate FloatingIPs. Is there enough available?");
  return added;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:33,代码来源:ResourceManagement.java

示例13: launchInstance

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
Server launchInstance(
VimInstance vimInstance,
String name,
String image,
String flavor,
String keypair,
Set<VNFDConnectionPoint> networks,
Set<String> secGroup,
String userData)
throws VimDriverException;
 
开发者ID:openbaton,项目名称:openbaton-libs,代码行数:11,代码来源:ClientInterfaces.java

示例14: launchInstanceAndWait

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
Server launchInstanceAndWait(
VimInstance vimInstance,
String hostname,
String image,
String extId,
String keyPair,
Set<VNFDConnectionPoint> networks,
Set<String> securityGroups,
String s,
Map<String, String> floatingIps,
Set<Key> keys)
throws VimDriverException;
 
开发者ID:openbaton,项目名称:openbaton-libs,代码行数:13,代码来源:ClientInterfaces.java

示例15: launchInstance

import org.openbaton.catalogue.mano.descriptor.VNFDConnectionPoint; //导入依赖的package包/类
@Override
public Server launchInstance(
    VimInstance vimInstance,
    String name,
    String image,
    String flavor,
    String keypair,
    Set<VNFDConnectionPoint> networks,
    Set<String> secGroup,
    String userData)
    throws VimDriverException {
  List<Serializable> params = new ArrayList<>();
  params.add(vimInstance);
  params.add(name);
  params.add(image);
  params.add(flavor);
  params.add(keypair);
  params.add((Serializable) networks);
  params.add((Serializable) secGroup);
  params.add(userData);
  Serializable res = null;
  try {
    res = pluginCaller.executeRPC("launchInstance", params, Server.class);
  } catch (IOException | PluginException | InterruptedException e) {
    throw new VimDriverException(e.getMessage());
  }
  return (Server) res;
}
 
开发者ID:openbaton,项目名称:openbaton-libs,代码行数:29,代码来源:VimDriverCaller.java


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