本文整理汇总了Java中org.openbaton.catalogue.mano.descriptor.VNFDependency类的典型用法代码示例。如果您正苦于以下问题:Java VNFDependency类的具体用法?Java VNFDependency怎么用?Java VNFDependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VNFDependency类属于org.openbaton.catalogue.mano.descriptor包,在下文中一共展示了VNFDependency类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleExceptionalCommandNames
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* This method modifies commands which do not use the object provided by their names. For example
* the command NetworkServiceRecord-createVNFCInstance will not create a NetworkServiceRecord but
* a VNFCInstance. Therefore the clazz attribute in the command object has to be changed from
* NetworkServiceRecord to VNFCInstance.
*
* @param command
*/
private static void handleExceptionalCommandNames(Command command) {
if (command.getClazz().equals(NetworkServiceRecord.class)) {
if (command.getMethod().getName().equals("createVNFCInstance"))
command.setClazz(VNFCInstance.class);
if (command.getMethod().getName().equals("createVNFR"))
command.setClazz(VirtualNetworkFunctionRecord.class);
if (command.getMethod().getName().equals("postVNFDependency"))
command.setClazz(VNFRecordDependency.class);
if (command.getMethod().getName().equals("updateVNFDependency"))
command.setClazz(VNFRecordDependency.class);
}
if (command.getClazz().equals(NetworkServiceDescriptor.class)) {
if (command.getMethod().getName().equals("createVNFD"))
command.setClazz(VirtualNetworkFunctionDescriptor.class);
if (command.getMethod().getName().equals("createVNFDependency"))
command.setClazz(VNFDependency.class);
}
}
示例2: parseRelationships
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* Parser of the relationship template
*
* @param nsd
* @param relationshipsTemplates
*/
private void parseRelationships(
NetworkServiceDescriptor nsd, Map<String, RelationshipsTemplate> relationshipsTemplates) {
if (relationshipsTemplates == null) return;
for (String key : relationshipsTemplates.keySet()) {
VNFDependency vnfDependency = new VNFDependency();
RelationshipsTemplate relationshipsTemplate = relationshipsTemplates.get(key);
vnfDependency.setSource(relationshipsTemplate.getSource());
vnfDependency.setTarget(relationshipsTemplate.getTarget());
vnfDependency.setParameters(new HashSet<>(relationshipsTemplate.getParameters()));
nsd.getVnf_dependency().add(vnfDependency);
}
}
示例3: getVNFDependencies
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* Returns the list of VNFDependency into a NSD with id
*
* @param id : The id of NSD
* @return List<VNFDependency>: The List of VNFDependency into NSD @
*/
@ApiOperation(
value = "Returns the list of VNFDependency from NSD",
notes = "Returns all the VNF Dependencies specified in the NSD"
)
@RequestMapping(
value = "{id}/vnfdependencies",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.OK)
public Set<VNFDependency> getVNFDependencies(
@PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
NetworkServiceDescriptor nsd = networkServiceDescriptorManagement.query(id, projectId);
if (nsd == null)
throw new NotFoundException("Did not find a Network Service Descriptor with ID " + id);
return nsd.getVnf_dependency();
}
示例4: getVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@ApiOperation(
value = "Returns the list of VNF Dependency for a VNF from the NSD",
notes = "Returns all the VNF Dependencies only for a specific VNF specified in the NSD"
)
@RequestMapping(
value = "{idNsd}/vnfdependencies/{idVnfd}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.OK)
public VNFDependency getVNFDependency(
@PathVariable("idNsd") String idNsd,
@PathVariable("idVnfd") String idVnfd,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
return networkServiceDescriptorManagement.getVnfDependency(idNsd, idVnfd, projectId);
}
示例5: postVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@ApiOperation(
value = "Add a VNF Dependency",
notes = "Adds a new VNF dependency to the Network Service Descriptor"
)
@RequestMapping(
value = "{idNsd}/vnfdependencies/",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.CREATED)
public VNFDependency postVNFDependency(
@RequestBody @Valid VNFDependency vnfDependency,
@PathVariable("idNsd") String idNsd,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
networkServiceDescriptorManagement.saveVNFDependency(idNsd, vnfDependency, projectId);
return vnfDependency;
}
示例6: updateVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@ApiOperation(
value = "Update a VNF Dependency",
notes = "Updates a VNF dependency to the Network Service Descriptor"
)
@RequestMapping(
value = "{idNsd}/vnfdependencies/{idVnf}",
method = RequestMethod.PUT,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.ACCEPTED)
public VNFDependency updateVNFDependency(
@RequestBody @Valid VNFDependency vnfDependency,
@PathVariable("idNsd") String idNsd,
@PathVariable("idVnf") String idVnf,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
networkServiceDescriptorManagement.saveVNFDependency(idNsd, vnfDependency, projectId);
return vnfDependency;
}
示例7: init
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@Before
public void init() {
MockitoAnnotations.initMocks(this);
networkServiceDescriptor = new NetworkServiceDescriptor();
networkServiceDescriptor.setVendor("Fokus");
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor =
new VirtualNetworkFunctionDescriptor();
virtualNetworkFunctionDescriptor.setVendor("Fokus");
networkServiceDescriptor.getVnfd().add(virtualNetworkFunctionDescriptor);
VNFDependency vnfdependency = new VNFDependency();
networkServiceDescriptor.getVnf_dependency().add(vnfdependency);
PhysicalNetworkFunctionDescriptor pDescriptor = new PhysicalNetworkFunctionDescriptor();
networkServiceDescriptor.getPnfd().add(pDescriptor);
Security security = new Security();
networkServiceDescriptor.setNsd_security(security);
}
示例8: createNetworkServiceDescriptor
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
private NetworkServiceDescriptor createNetworkServiceDescriptor() {
final NetworkServiceDescriptor nsd = new NetworkServiceDescriptor();
nsd.setId("mocked-id");
nsd.setProjectId(projectId);
nsd.setVendor("FOKUS");
nsd.setName("dummy-nsd");
Set<VirtualNetworkFunctionDescriptor> virtualNetworkFunctionDescriptors = new HashSet<>();
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor1 =
getVirtualNetworkFunctionDescriptor();
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor2 =
getVirtualNetworkFunctionDescriptor();
virtualNetworkFunctionDescriptors.add(virtualNetworkFunctionDescriptor1);
nsd.setVnfd(virtualNetworkFunctionDescriptors);
VNFDependency vnfDependency = new VNFDependency();
vnfDependency.setSource(virtualNetworkFunctionDescriptor1.getName());
vnfDependency.setTarget(virtualNetworkFunctionDescriptor2.getName());
nsd.getVnf_dependency().add(vnfDependency);
return nsd;
}
示例9: getVNFDependencies
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* Return a List with all the VNFDependencies that are contained in a specific
* NetworkServiceDescriptor.
*
* @param idNSD the ID of the NetworkServiceDescriptor
* @return the List of VNFDependencies
* @throws SDKException if the request fails
*/
@Help(
help =
"Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id"
)
public List<VNFDependency> getVNFDependencies(final String idNSD) throws SDKException {
String url = idNSD + "/vnfdependencies";
return Arrays.asList((VNFDependency[]) requestGetAll(url, VNFDependency.class));
}
示例10: getVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* Return a specific VNFDependency that is contained in a particular NetworkServiceDescriptor.
*
* @param idNSD the ID of the NetworkServiceDescriptor
* @param idVnfd the VNFDependencies' ID
* @return the VNFDependency
* @throws SDKException
*/
@Help(
help =
"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id"
)
public VNFDependency getVNFDependency(final String idNSD, final String idVnfd)
throws SDKException {
String url = idNSD + "/vnfdependencies" + "/" + idVnfd;
return (VNFDependency) requestGet(url, VNFDependency.class);
}
示例11: createVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* Add a new VNFDependency to a specific NetworkServiceDescriptor.
*
* @param idNSD the ID of the NetworkServiceDescriptor
* @param vnfDependency the new VNFDependency
* @return the new VNFDependency
* @throws SDKException
*/
@Help(
help =
"Create the VirtualNetworkFunctionDescriptor dependency of a NetworkServiceDescriptor with specific id"
)
public VNFDependency createVNFDependency(final String idNSD, final VNFDependency vnfDependency)
throws SDKException {
String url = idNSD + "/vnfdependencies" + "/";
return (VNFDependency) requestPost(url, vnfDependency);
}
示例12: updateVNFD
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
/**
* Update a specific VNFDependency which is contained in a particular NetworkServiceDescriptor.
*
* @param idNSD the ID of the NetworkServiceDescriptor containing the VNFDependency
* @param idVnfDep the ID of the VNFDependency which shall be updated
* @param vnfDependency the updated version of the VNFDependency
* @return the updated VNFDependency
* @throws SDKException if the request fails
*/
@Help(
help =
"Update the VirtualNetworkFunctionDescriptor dependency of a NetworkServiceDescriptor with specific id"
)
public VNFDependency updateVNFD(
final String idNSD, final String idVnfDep, final VNFDependency vnfDependency)
throws SDKException {
String url = idNSD + "/vnfdependencies" + "/" + idVnfDep;
return (VNFDependency) requestPut(url, vnfDependency);
}
示例13: postVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@Test
public void postVNFDependency() throws NotFoundException {
VNFDependency vnfd = new VNFDependency();
Set<VNFDependency> list = new HashSet<>();
networkServiceDescriptor.setVnf_dependency(list);
when(nsdManagement.saveVNFDependency(anyString(), any(VNFDependency.class), anyString()))
.thenReturn(vnfd);
VNFDependency vnsDependency1 =
restNetworkService.postVNFDependency(vnfd, networkServiceDescriptor.getId(), "");
assertEquals(vnfd, vnsDependency1);
}
示例14: getVNFDependency
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@Test
public void getVNFDependency() throws NotFoundException {
when(nsdManagement.query(anyString(), anyString())).thenReturn(networkServiceDescriptor);
VNFDependency vnfd = networkServiceDescriptor.getVnf_dependency().iterator().next();
assertEquals(
vnfd.getId(),
restNetworkService.getVNFDependency(
networkServiceDescriptor.getId(),
networkServiceDescriptor.getVnf_dependency().iterator().next().getId(),
"pi"));
}
示例15: getVNFDependencies
import org.openbaton.catalogue.mano.descriptor.VNFDependency; //导入依赖的package包/类
@Test
public void getVNFDependencies() throws NotFoundException {
when(nsdManagement.query(anyString(), anyString())).thenReturn(networkServiceDescriptor);
Set<VNFDependency> vnfds = networkServiceDescriptor.getVnf_dependency();
assertEquals(
vnfds, restNetworkService.getVNFDependencies(networkServiceDescriptor.getId(), "pi"));
}