本文整理汇总了Java中org.osc.sdk.controller.exception.NetworkPortNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java NetworkPortNotFoundException类的具体用法?Java NetworkPortNotFoundException怎么用?Java NetworkPortNotFoundException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NetworkPortNotFoundException类属于org.osc.sdk.controller.exception包,在下文中一共展示了NetworkPortNotFoundException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeInspectionPort
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
@Override
public void removeInspectionPort(InspectionPortElement inspectionPort)
throws NetworkPortNotFoundException, Exception {
if (inspectionPort == null) {
LOG.warn("Attempt to remove a null Inspection Port");
return;
}
InspectionPortElement foundInspectionPort = getInspectionPort(inspectionPort);
if (foundInspectionPort != null) {
this.utils.removeSingleInspectionPort(foundInspectionPort.getElementId());
} else {
NetworkElement ingress = inspectionPort.getIngressPort();
NetworkElement egress = inspectionPort.getEgressPort();
LOG.warn("Attempt to remove nonexistent Inspection Port for ingress {} and egress {}", ingress, egress);
}
}
开发者ID:opensecuritycontroller,项目名称:sdn-controller-nsc-plugin,代码行数:20,代码来源:SampleSdnRedirectionApi.java
示例2: installInspectionHook
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
@Override
public String installInspectionHook(NetworkElement inspectedPort, InspectionPortElement inspectionPort,
Long tag, TagEncapsulationType encType, Long order, FailurePolicyType failurePolicyType)
throws NetworkPortNotFoundException, Exception {
if (inspectedPort == null) {
throw new IllegalArgumentException("Attempt to install an Inspection Hook with no Inspected Port");
}
if (inspectionPort == null) {
throw new IllegalArgumentException("Attempt to install an Inspection Hook with null Inspection Port");
}
LOG.info("Installing Inspection Hook for (Inspected {} ; Inspection Port {}):", inspectedPort, inspectionPort);
LOG.info("Tag: {}; EncType: {}; Order: {}, Fail Policy: {}", tag, encType, order, failurePolicyType);
InspectionHookEntity retValEntity = this.txControl.required(() -> {
InspectionPortEntity dbInspectionPort = (InspectionPortEntity) getInspectionPort(inspectionPort);
this.utils.throwExceptionIfNullEntity(dbInspectionPort, inspectionPort);
InspectionHookEntity inspectionHookEntity = this.utils.findInspHookByInspectedAndPort(inspectedPort, dbInspectionPort);
if (inspectionHookEntity == null) {
inspectionHookEntity = this.utils.makeInspectionHookEntity(inspectedPort, dbInspectionPort, tag,
encType, order, failurePolicyType);
} else {
inspectionHookEntity.setEncType(encType);
inspectionHookEntity.setOrder(order);
inspectionHookEntity.setFailurePolicyType(failurePolicyType);
inspectionHookEntity.setTag(tag);
}
return this.em.merge(inspectionHookEntity);
});
return retValEntity.getHookId();
}
开发者ID:opensecuritycontroller,项目名称:sdn-controller-nsc-plugin,代码行数:38,代码来源:SampleSdnRedirectionApi.java
示例3: isPortRegistered
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
private boolean isPortRegistered() throws NetworkPortNotFoundException, Exception {
SdnRedirectionApi controller = this.apiFactoryService.createNetworkRedirectionApi(this.dai);
try {
DefaultNetworkPort ingressPort = new DefaultNetworkPort(this.dai.getInspectionOsIngressPortId(),
this.dai.getInspectionIngressMacAddress());
DefaultNetworkPort egressPort = new DefaultNetworkPort(this.dai.getInspectionOsEgressPortId(),
this.dai.getInspectionEgressMacAddress());
InspectionPortElement inspectionPort = null;
if (this.apiFactoryService.supportsPortGroup(this.dai.getVirtualSystem())) {
DeploymentSpec ds = this.dai.getDeploymentSpec();
String domainId = OpenstackUtil.extractDomainId(ds.getProjectId(), ds.getProjectName(),
ds.getVirtualSystem().getVirtualizationConnector(),
new ArrayList<NetworkElement>(Arrays.asList(ingressPort)));
if (domainId != null) {
ingressPort.setParentId(domainId);
egressPort.setParentId(domainId);
//Element object in DefaultInspectionport is not used at this point, hence null
inspectionPort = controller.getInspectionPort(new DefaultInspectionPort(ingressPort, egressPort, null));
} else {
log.warn("DomainId is missing, cannot be null");
}
} else {
inspectionPort = controller.getInspectionPort(new DefaultInspectionPort(ingressPort, egressPort, null));
}
return inspectionPort != null;
} finally {
controller.close();
}
}
示例4: getInspectionHookTag
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
@Override
public Long getInspectionHookTag(NetworkElement inspectedPort, InspectionPortElement inspectionPort)
throws NetworkPortNotFoundException, Exception {
InspectionHookElement inspectionHook = getInspectionHook(inspectedPort, inspectionPort);
return inspectionHook == null ? null : inspectionHook.getTag();
}
开发者ID:opensecuritycontroller,项目名称:sdn-controller-nsc-plugin,代码行数:7,代码来源:SampleSdnRedirectionApi.java
示例5: installInspectionHook
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Creates an inspection hook on SDN controller, see {@link InspectionHookElement}
*
* @param networkElement provides a network element containing the port to be protected
* @param inspectionPort provides inspection port belonging to network inspection devices(In case of SFC, this is the
* port chain id.
* @param tag provides a tag made available to inspection port data path
* @param encType provides the tag encapsulation type
* @param order provides an order in which to insert the inspection hook
* @param failurePolicyType provides the failure policy type
* @return the identifier of the inspection hook. In case of SFC, this identifier is the same as {@link InspectionPortElement#getElementId()}
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
String installInspectionHook(NetworkElement networkElement, InspectionPortElement inspectionPort, Long tag,
TagEncapsulationType encType, Long order, FailurePolicyType failurePolicyType)
throws NetworkPortNotFoundException, Exception;
示例6: setInspectionHookTag
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Sets policy tag for a specific inspection hook on SDN controller.
*
* @param inspectedPort provides port on which behalf traffic is being inspected
* @param inspectionPort provides inspection port belonging to network inspection device
* @param tag provides a tag
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
void setInspectionHookTag(NetworkElement inspectedPort, InspectionPortElement inspectionPort, Long tag)
throws NetworkPortNotFoundException, Exception;
示例7: getInspectionHookTag
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Retrieves the policy tag of an installed inspection hook from SDN controller.
*
* @param inspectedPort provides port on which behalf traffic is being inspected
* @param inspectionPort provides inspection port belonging to network inspection device
* @return the inspection hook tag, null if not found
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
Long getInspectionHookTag(NetworkElement inspectedPort, InspectionPortElement inspectionPort)
throws NetworkPortNotFoundException, Exception;
示例8: setInspectionHookFailurePolicy
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Sets the failure policy of an inspection hook on SDN controller.
*
* @param inspectedPort provides port on which behalf traffic is being inspected
* @param inspectionPort provides inspection port belonging to network inspection device
* @param failurePolicyType provides the failure policy type
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
void setInspectionHookFailurePolicy(NetworkElement inspectedPort, InspectionPortElement inspectionPort,
FailurePolicyType failurePolicyType) throws NetworkPortNotFoundException, Exception;
示例9: getInspectionHookFailurePolicy
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Retrieves the failure policy type of an installed inspection hook from SDN controller.
*
* @param inspectedPort provides port on which behalf traffic is being inspected
* @param inspectionPort provides inspection port belonging to network inspection device
* @return the failure policy type, null if not found
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
FailurePolicyType getInspectionHookFailurePolicy(NetworkElement inspectedPort, InspectionPortElement inspectionPort)
throws NetworkPortNotFoundException, Exception;
示例10: getInspectionHook
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Retrieves an inspection hook element previously created from SDN controller.
*
* @param inspectedPort provides port on which behalf traffic is being inspected
* @param inspectionPort provides inspection port belonging to network inspection device
* @return the inspection hook element, null if not found
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
InspectionHookElement getInspectionHook(NetworkElement inspectedPort, InspectionPortElement inspectionPort)
throws NetworkPortNotFoundException, Exception;
示例11: updateInspectionHook
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Updates an inspection hook on SDN controller.
*
* @param existingInspectionHook provides inspection hook to be updated
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
void updateInspectionHook(InspectionHookElement existingInspectionHook)
throws NetworkPortNotFoundException, Exception;
示例12: registerInspectionPort
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Creates an inspection port on SDN controller.
* The call to register the same port multiple times will result in no-op.
* <p>
* In case of SFC, the return element is the port pair id.
*
* @param inspectionPort provides the inspection port to be created
* @return an element
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
Element registerInspectionPort(InspectionPortElement inspectionPort) throws NetworkPortNotFoundException, Exception;
示例13: removeInspectionPort
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Deletes an inspection port previously created on SDN controller.
* <p>
* No-op if no inspection port is found on SDN controller to be deleted.
*
* @param inspectionPort provides the inspection port to be deleted
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
void removeInspectionPort(InspectionPortElement inspectionPort) throws NetworkPortNotFoundException, Exception;
示例14: getInspectionPort
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Retrieves an inspection port element previously created from SDN controller.
*
* @param inspectionPort provides the inspection port element to be retrieved
* @return the inspection port element, null if not found
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
InspectionPortElement getInspectionPort(InspectionPortElement inspectionPort)
throws NetworkPortNotFoundException, Exception;
示例15: setInspectionHookOrder
import org.osc.sdk.controller.exception.NetworkPortNotFoundException; //导入依赖的package包/类
/**
* Sets an inspection hook order on SDN controller.
*
* @param inspectedPort provides port on which behalf traffic is being inspected
* @param inspectionPort provides inspection port belonging to network inspection device
* @param order provides the order in which to insert the inspection hook
* @throws NetworkPortNotFoundException when port is not found
* @throws Exception upon failure
*/
void setInspectionHookOrder(NetworkElement inspectedPort, InspectionPortElement inspectionPort, Long order)
throws NetworkPortNotFoundException, Exception;