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


Java ConfigurationParameter.setConfKey方法代码示例

本文整理汇总了Java中org.openbaton.catalogue.nfvo.ConfigurationParameter.setConfKey方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationParameter.setConfKey方法的具体用法?Java ConfigurationParameter.setConfKey怎么用?Java ConfigurationParameter.setConfKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openbaton.catalogue.nfvo.ConfigurationParameter的用法示例。


在下文中一共展示了ConfigurationParameter.setConfKey方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configurationCreate

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
@Test
public void configurationCreate() {
  Configuration configuration = new Configuration();
  configuration.setId("123");
  ConfigurationParameter parameters = new ConfigurationParameter();
  parameters.setConfKey("test_key");
  parameters.setValue("test_value");
  configuration.setConfigurationParameters(new HashSet<ConfigurationParameter>());
  configuration.getConfigurationParameters().add(parameters);
  configuration.setName("configuration_test");
  when(mock.add(configuration)).thenReturn(configuration);

  log.info("" + restConfiguration.create(configuration, "project-id"));
  Configuration configuration2 = restConfiguration.create(configuration, "project-id");
  assertEquals(configuration, configuration2);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:17,代码来源:ApiRestConfigurationTest.java

示例2: configurationUpdate

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
@Test
public void configurationUpdate() throws NotFoundException {
  Configuration configuration = new Configuration();
  configuration.setId("123");
  ConfigurationParameter parameters = new ConfigurationParameter();
  parameters.setConfKey("test_key");
  parameters.setValue("test_value");
  configuration.setConfigurationParameters(new HashSet<ConfigurationParameter>());
  configuration.getConfigurationParameters().add(parameters);
  configuration.setName("configuration_test");
  when(mock.update(any(configuration.getClass()), anyString(), anyString()))
      .thenReturn(configuration);
  assertEquals(
      configuration,
      restConfiguration.update(configuration, configuration.getId(), "project-id"));
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:17,代码来源:ApiRestConfigurationTest.java

示例3: nfvImageManagementUpdateTest

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
@Test
public void nfvImageManagementUpdateTest() throws NotFoundException {
  Configuration configutation = createConfigutation();
  Configuration configuration2 = createConfigutation();
  configuration2.setName("UpdatedName");
  ConfigurationParameter configurationParameter = new ConfigurationParameter();
  configurationParameter.setConfKey("new_key");
  configurationParameter.setValue("new_value");
  configuration2.getConfigurationParameters().add(configurationParameter);
  when(configurationRepository.save(any(Configuration.class))).thenReturn(configuration2);
  when(configurationRepository.findFirstByIdAndProjectId(anyString(), eq(projectId)))
      .thenReturn(configuration2);
  configutation =
      configurationManagement.update(configuration2, configutation.getId(), projectId);
  assertEqualsConfiguration(configutation, configuration2);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:17,代码来源:ConfigurationManagementClassSuiteTest.java

示例4: nsrManagementDeleteTest

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
@Test
public void nsrManagementDeleteTest()
    throws VimException, InterruptedException, ExecutionException, NamingException,
        NotFoundException, WrongStatusException, PluginException, BadFormatException {
  NetworkServiceRecord nsd_exp = createNetworkServiceRecord();
  when(resourceManagement.release(any(VirtualDeploymentUnit.class), any(VNFCInstance.class)))
      .thenReturn(new AsyncResult<Void>(null));
  when(nsrRepository.findFirstByIdAndProjectId(nsd_exp.getId(), projectId)).thenReturn(nsd_exp);
  Configuration system = new Configuration();
  system.setConfigurationParameters(new HashSet<>());
  ConfigurationParameter configurationParameter = new ConfigurationParameter();
  configurationParameter.setConfKey("delete-on-all-status");
  configurationParameter.setValue("true");
  when(configurationManagement.queryByName("system")).thenReturn(system);
  nsrManagement.delete(nsd_exp.getId(), projectId);
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:17,代码来源:NetworkServiceRecordManagementClassSuiteTest.java

示例5: instantiate

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
/**
 * This operation allows creating a VNF instance.
 *
 * @param virtualNetworkFunctionRecord
 * @param scripts
 */
@Override
public VirtualNetworkFunctionRecord instantiate(
    VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
    Object scripts,
    Map<String, Collection<BaseVimInstance>> vimInstances)
    throws Exception {
  log.info(
      "Instantiation of VirtualNetworkFunctionRecord " + virtualNetworkFunctionRecord.getName());

  // vnfmHelper.saveScriptOnEms(virtualNetworkFunctionRecord, scripts);

  log.debug("added parameter to config");
  log.debug("CONFIGURATION: " + virtualNetworkFunctionRecord.getConfigurations());
  ConfigurationParameter cp = new ConfigurationParameter();
  cp.setConfKey("new_key");
  cp.setValue("new_value");
  virtualNetworkFunctionRecord.getConfigurations().getConfigurationParameters().add(cp);

  Thread.sleep((int) (Math.random() * 5000) + 4000);

  return virtualNetworkFunctionRecord;
}
 
开发者ID:openbaton,项目名称:dummy-vnfm-amqp,代码行数:29,代码来源:DummyAMQPVNFManager.java

示例6: configurationFindBy

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
@Test
public void configurationFindBy() {
  Configuration configuration = new Configuration();
  configuration.setId("123");
  ConfigurationParameter parameters = new ConfigurationParameter();
  parameters.setConfKey("test_key");
  parameters.setValue("test_value");
  configuration.setConfigurationParameters(new HashSet<ConfigurationParameter>());
  configuration.getConfigurationParameters().add(parameters);
  configuration.setName("configuration_test");
  when(mock.query(anyString(), anyString())).thenReturn(configuration);
  assertEquals(configuration, restConfiguration.findById(configuration.getId(), "project-id"));
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:14,代码来源:ApiRestConfigurationTest.java

示例7: updateConfigurationParameters

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
private Set<ConfigurationParameter> updateConfigurationParameters(
    Set<ConfigurationParameter> configurationParameters_nfvo,
    Set<ConfigurationParameter> configurationParameters_manager) {
  Set<ConfigurationParameter> configurationParameters = new HashSet<>();
  boolean found = false;
  //Updating existing Components, adding new ones and ignoring old ones
  for (ConfigurationParameter configurationParameter_manager : configurationParameters_manager) {
    //VNFCInstance ID is null -> NEW
    if (configurationParameter_manager.getId() == null) {
      configurationParameters.add(configurationParameter_manager);
      log.debug("Update: Added new ConfigurationParameter " + configurationParameter_manager);
      continue;
    }
    for (ConfigurationParameter configurationParameter_nfvo : configurationParameters_nfvo) {
      //Found Instance -> Updating
      if (configurationParameter_nfvo.getId().equals(configurationParameter_manager.getId())) {
        log.debug(
            "Update: Updating existing ConfigurationParameter "
                + configurationParameter_nfvo.getId());
        found = true;
        configurationParameter_nfvo.setConfKey(configurationParameter_manager.getConfKey());
        configurationParameter_nfvo.setValue(configurationParameter_manager.getValue());
        //Add updated ConfigurationParameter
        configurationParameters.add(configurationParameter_nfvo);
        //Proceed with the next ConfigurationParameter
        break;
      }
    }
    //ConfigurationParameter was not found -> NEW
    if (!found) {
      configurationParameters.add(configurationParameter_manager);
      log.debug(
          "Update: Added new ConfigurationParameter " + configurationParameter_manager.getId());
    }
  }
  log.debug("Update: Updated ConfigurationParameters " + configurationParameters);
  return configurationParameters;
}
 
开发者ID:openbaton,项目名称:NFVO,代码行数:39,代码来源:UpdatevnfrTask.java

示例8: parseVNFDTemplate

import org.openbaton.catalogue.nfvo.ConfigurationParameter; //导入方法依赖的package包/类
/**
 * Parser of the VNF template
 *
 * @param VNFDTemplate
 * @return
 */
public VirtualNetworkFunctionDescriptor parseVNFDTemplate(VNFDTemplate VNFDTemplate)
    throws NotFoundException {

  VirtualNetworkFunctionDescriptor vnfd = new VirtualNetworkFunctionDescriptor();

  // ADD SETTINGS
  if (VNFDTemplate.getMetadata() == null)
    throw new NotFoundException("The VNFD Template must have contain metadata child!");
  vnfd.setName(VNFDTemplate.getMetadata().getID());
  vnfd.setVendor(VNFDTemplate.getMetadata().getVendor());
  vnfd.setVersion(VNFDTemplate.getMetadata().getVersion());

  if (VNFDTemplate.getInputs() == null)
    throw new NotFoundException(
        "You should specify at least endpoint, deployment_flavour and type in inputs");
  vnfd.setDeployment_flavour(VNFDTemplate.getInputs().getDeploymentFlavourConverted());
  vnfd.setVnfPackageLocation(VNFDTemplate.getInputs().getVnfPackageLocation());
  if (VNFDTemplate.getInputs().getEndpoint() == null)
    throw new NotFoundException("No endpoint specified in inputs!");
  vnfd.setEndpoint(VNFDTemplate.getInputs().getEndpoint());
  if (VNFDTemplate.getInputs().getType() == null)
    throw new NotFoundException("No type specified in inputs!");
  vnfd.setType(VNFDTemplate.getInputs().getType());

  // ADD VDUs
  Set<VirtualDeploymentUnit> vdus = new HashSet<>();
  for (VDUNodeTemplate vdu : VNFDTemplate.getTopology_template().getVDUNodes()) {
    vdus.add(parseVDUTemplate(vdu, VNFDTemplate.getTopology_template().getCPNodes()));
  }
  vnfd.setVdu(vdus);

  // ADD VLs
  Set<InternalVirtualLink> vls = new HashSet<>();

  for (VLNodeTemplate vl : VNFDTemplate.getTopology_template().getVLNodes()) {

    vls.add(parseVL(vl));
  }

  vnfd.setVirtual_link(vls);
  vnfd.setLifecycle_event(VNFDTemplate.getInputs().getInterfaces().getOpLifecycle());

  //ADD CONFIGURATIONS
  if (VNFDTemplate.getInputs().getConfigurations() != null) {

    VNFConfigurations configurations = VNFDTemplate.getInputs().getConfigurations();

    Configuration configuration = new Configuration();
    configuration.setName(configurations.getName());

    Set<ConfigurationParameter> configurationParameters = new HashSet<>();

    for (HashMap<String, String> pair : configurations.getConfigurationParameters()) {

      ConfigurationParameter configurationParameter = new ConfigurationParameter();
      configurationParameter.setConfKey((String) pair.keySet().toArray()[0]);
      configurationParameter.setValue((String) pair.values().toArray()[0]);
      configurationParameters.add(configurationParameter);
    }

    configuration.setConfigurationParameters(configurationParameters);
    vnfd.setConfigurations(configuration);
  }

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


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