本文整理汇总了Java中org.openbaton.catalogue.mano.record.VNFRecordDependency类的典型用法代码示例。如果您正苦于以下问题:Java VNFRecordDependency类的具体用法?Java VNFRecordDependency怎么用?Java VNFRecordDependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VNFRecordDependency类属于org.openbaton.catalogue.mano.record包,在下文中一共展示了VNFRecordDependency类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleExceptionalCommandNames
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的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: getVNFDependency
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@ApiOperation(
value = "Retrieve VNF Dependencies from VNFR",
notes = "Returns all VNF Dependencies that reference the specified VNFR"
)
@RequestMapping(
value = "{id}/vnfdependencies/{id_vnfr}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.OK)
public VNFRecordDependency getVNFDependency(
@PathVariable("id") String id,
@PathVariable("id_vnfr") String id_vnfr,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
NetworkServiceRecord nsr = networkServiceRecordManagement.query(id, projectId);
return findVNFD(nsr.getVnf_dependency(), id_vnfr);
}
示例3: postVNFDependency
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@ApiOperation(
value = "Add a VNF Dependency to a NSR",
notes = "Adds a new VNF Dependency to the specified NSR"
)
@RequestMapping(
value = "{id}/vnfdependencies/",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.CREATED)
public VNFRecordDependency postVNFDependency(
@RequestBody @Valid VNFRecordDependency vnfDependency,
@PathVariable("id") String id,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
NetworkServiceRecord nsr = networkServiceRecordManagement.query(id, projectId);
nsr.getVnf_dependency().add(vnfDependency);
networkServiceRecordManagement.update(nsr, id, projectId);
return vnfDependency;
}
示例4: updateVNFD
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@ApiOperation(
value = "Updates a VNF Dependency in an NSR",
notes = "Updates a VNF Dependency based on the if of the VNF it concerns"
)
@RequestMapping(
value = "{id}/vnfdependencies/{id_vnfd}",
method = RequestMethod.PUT,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.ACCEPTED)
public VNFRecordDependency updateVNFD(
@RequestBody @Valid VNFRecordDependency vnfDependency,
@PathVariable("id") String id,
@PathVariable("id_vnfd") String id_vnfd,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
NetworkServiceRecord nsr = networkServiceRecordManagement.query(id, projectId);
nsr.getVnf_dependency().add(vnfDependency);
networkServiceRecordManagement.update(nsr, id, projectId);
return vnfDependency;
}
示例5: deleteVNFDependency
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
/**
* Removes a VNFDependency from an NSR.
*
* @param idNsr ID of the NSR
* @param idVnfd ID of the VNFDependency
* @param projectId the current projectId
*/
@Override
public void deleteVNFDependency(String idNsr, String idVnfd, String projectId)
throws NotFoundException {
NetworkServiceRecord nsr = query(idNsr, projectId);
VNFRecordDependency vnfDependency = null;
for (VNFRecordDependency vnfdep : nsr.getVnf_dependency()) {
if (vnfdep.getId().equals(idVnfd)) {
vnfDependency = vnfdep;
}
}
if (vnfDependency == null) {
throw new NotFoundException(
"No VNFDependency with ID " + idVnfd + " found in NSR with ID " + idNsr);
}
nsr.getVnf_dependency().remove(vnfDependency);
nsrRepository.saveCascade(nsr);
}
示例6: getDependencyForAVNFRecordTarget
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public VNFRecordDependency getDependencyForAVNFRecordTarget(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
NetworkServiceRecord nsr =
nsrRepository.findFirstById(virtualNetworkFunctionRecord.getParent_ns_id());
if (nsr.getStatus().ordinal() != Status.ERROR.ordinal()) {
Set<VNFRecordDependency> vnfRecordDependencies = nsr.getVnf_dependency();
for (VNFRecordDependency vnfRecordDependency : vnfRecordDependencies) {
vnfRecordDependency = vnfrDependencyRepository.findOne(vnfRecordDependency.getId());
if (vnfRecordDependency.getTarget().equals(virtualNetworkFunctionRecord.getName())) {
return vnfRecordDependency;
}
}
}
return null;
}
示例7: getDependencyForAVNFRecordSource
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public List<VNFRecordDependency> getDependencyForAVNFRecordSource(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord) {
List<VNFRecordDependency> res = new ArrayList<>();
NetworkServiceRecord nsr =
nsrRepository.findFirstById(virtualNetworkFunctionRecord.getParent_ns_id());
if (nsr.getStatus().ordinal() != Status.ERROR.ordinal()) {
Set<VNFRecordDependency> vnfRecordDependencies = nsr.getVnf_dependency();
for (VNFRecordDependency vnfRecordDependency : vnfRecordDependencies) {
vnfRecordDependency = vnfrDependencyRepository.findOne(vnfRecordDependency.getId());
log.trace(
"Checking if "
+ virtualNetworkFunctionRecord.getName()
+ " is source for "
+ vnfRecordDependency);
if (vnfRecordDependency.getIdType().containsKey(virtualNetworkFunctionRecord.getName())) {
res.add(vnfRecordDependency);
}
}
}
return res;
}
示例8: scale
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord scale(
Action scaleInOrOut,
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
VNFComponent component,
Object scripts,
VNFRecordDependency dependency)
throws Exception {
log.info(
scaleInOrOut.name()
+ " on VNFR "
+ virtualNetworkFunctionRecord.getName()
+ " with id "
+ virtualNetworkFunctionRecord.getId());
Thread.sleep((int) (Math.random() * 500) + 1000);
return virtualNetworkFunctionRecord;
}
示例9: modify
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord modify(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFRecordDependency dependency)
throws InterruptedException {
log.debug(
"VirtualNetworkFunctionRecord VERSION is: " + virtualNetworkFunctionRecord.getHbVersion());
log.debug("VirtualNetworkFunctionRecord NAME is: " + virtualNetworkFunctionRecord.getName());
log.debug("Got dependency: " + dependency);
log.debug("Parameters are: ");
for (Map.Entry<String, DependencyParameters> entry : dependency.getParameters().entrySet()) {
log.debug("Source type: " + entry.getKey());
log.debug("Parameters: " + entry.getValue().getParameters());
}
Thread.sleep(3000 + ((int) (Math.random() * 7000)));
return virtualNetworkFunctionRecord;
}
示例10: modify
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord modify(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord, VNFRecordDependency dependency)
throws InterruptedException {
log.info("MODIFY for VNFR " + virtualNetworkFunctionRecord.getName());
log.debug(
"VirtualNetworkFunctionRecord VERSION is: " + virtualNetworkFunctionRecord.getHb_version());
log.debug("VirtualNetworkFunctionRecord NAME is: " + virtualNetworkFunctionRecord.getName());
log.debug("Got dependency: " + dependency);
log.debug("Parameters are: ");
for (Map.Entry<String, DependencyParameters> entry : dependency.getParameters().entrySet()) {
log.debug("Source type: " + entry.getKey());
log.debug("Parameters: " + entry.getValue().getParameters());
}
Thread.sleep(3000 + ((int) (Math.random() * 7000)));
return virtualNetworkFunctionRecord;
}
示例11: resume
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord resume(
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
VNFCInstance vnfcInstance,
VNFRecordDependency dependency)
throws Exception {
return virtualNetworkFunctionRecord;
}
示例12: scale
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
@Override
public VirtualNetworkFunctionRecord scale(
Action scaleInOrOut,
VirtualNetworkFunctionRecord virtualNetworkFunctionRecord,
VNFComponent component,
Object scripts,
VNFRecordDependency dependency)
throws Exception {
return virtualNetworkFunctionRecord;
}
示例13: getVNFDependencies
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
/**
* Returns a List of all the VNFRecordDependencies contained in a particular NetworkServiceRecord.
*
* @param idNsr the ID of the NetworkServiceRecord
* @return a List of VNFRecordDependencies
* @throws SDKException
*/
@Help(
help =
"Get all the VirtualNetworkFunctionRecord dependencies of NetworkServiceRecord with specific id"
)
public List<VNFRecordDependency> getVNFDependencies(final String idNsr) throws SDKException {
String url = idNsr + "/vnfdependencies";
return Arrays.asList((VNFRecordDependency[]) requestGetAll(url, VNFRecordDependency.class));
}
示例14: getVNFDependency
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
/**
* Returns a specific VNFRecordDependency from a particular NetworkServiceRecord.
*
* @param idNsr the ID of the NetworkServiceRecord
* @param idVnfrDep the ID of the requested VNFRecordDependency
* @return the VNFRecordDependency
* @throws SDKException
*/
@Help(
help =
"Get the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id"
)
public VNFRecordDependency getVNFDependency(final String idNsr, final String idVnfrDep)
throws SDKException {
String url = idNsr + "/vnfdependencies" + "/" + idVnfrDep;
return (VNFRecordDependency) requestGet(url, VNFRecordDependency.class);
}
示例15: postVNFDependency
import org.openbaton.catalogue.mano.record.VNFRecordDependency; //导入依赖的package包/类
/**
* Add a new VNFRecordDependency to a NetworkServiceRecord.
*
* @param idNsr the ID of the NetworkServiceRecord
* @param vnfRecordDependency the new VNFRecordDependency
* @return the created VNFRecordDependency
* @throws SDKException
*/
@Help(
help =
"Create the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id"
)
public VNFRecordDependency postVNFDependency(
final String idNsr, final VNFRecordDependency vnfRecordDependency) throws SDKException {
String url = idNsr + "/vnfdependencies" + "/";
return (VNFRecordDependency) requestPost(url, vnfRecordDependency);
}