@Test public void testCreateFlowClassifier() { flowClassifierMgr.storageService = storageService; injectEventDispatcher(flowClassifierMgr, new TestEventDispatcher()); flowClassifierMgr.activate(); flowClassifier = flowClassifierBuilder.setFlowClassifierId(flowClassifierId).setTenantId(tenantId) .setName(name).setDescription(description).setEtherType(ethType).setProtocol(protocol) .setMinSrcPortRange(minSrcPortRange).setMaxSrcPortRange(maxSrcPortRange) .setMinDstPortRange(minDstPortRange).setMaxDstPortRange(maxDstPortRange).setSrcIpPrefix(srcIpPrefix) .setDstIpPrefix(dstIpPrefix).setSrcPort(virtualSrcPort).setDstPort(virtualDstPort).build(); assertThat(flowClassifierMgr.createFlowClassifier(flowClassifier), is(true)); }
@Override public boolean createFlowClassifier(FlowClassifier flowClassifier) { log.debug("createFlowClassifier"); checkNotNull(flowClassifier, FLOW_CLASSIFIER_NOT_NULL); FlowClassifierId id = flowClassifier.flowClassifierId(); flowClassifierStore.put(id, flowClassifier); if (!flowClassifierStore.containsKey(id)) { log.debug("Flow Classifier creation is failed whose identifier is {}.", id.toString()); return false; } return true; }
FlowClassifierManager extends AbstractListenerManager<FlowClassifierEvent, FlowClassifierListener> implements FlowClassifierService { @Override public boolean createFlowClassifier(FlowClassifier flowClassifier) { log.debug("createFlowClassifier"); checkNotNull(flowClassifier, FLOW_CLASSIFIER_NOT_NULL); FlowClassifierId id = flowClassifier.flowClassifierId(); flowClassifierStore.put(id, flowClassifier); if (!flowClassifierStore.containsKey(id)) { log.debug("Flow Classifier creation is failed whose identifier is {}.", id.toString()); return false; } return true; } }
FlowClassifierManager extends AbstractListenerManager<FlowClassifierEvent, FlowClassifierListener> implements FlowClassifierService { @Override public boolean createFlowClassifier(FlowClassifier flowClassifier) { log.debug("createFlowClassifier"); checkNotNull(flowClassifier, FLOW_CLASSIFIER_NOT_NULL); FlowClassifierId id = flowClassifier.flowClassifierId(); flowClassifierStore.put(id, flowClassifier); if (!flowClassifierStore.containsKey(id)) { log.debug("Flow Classifier creation is failed whose identifier is {}.", id.toString()); return false; } return true; }  }
FlowClassifierManager extends AbstractListenerManager<FlowClassifierEvent, FlowClassifierListener> implements FlowClassifierService { @Override public boolean createFlowClassifier(FlowClassifier flowClassifier) { log.debug("createFlowClassifier"); checkNotNull(flowClassifier, FLOW_CLASSIFIER_NOT_NULL); FlowClassifierId id = flowClassifier.flowClassifierId(); flowClassifierStore.put(id, flowClassifier); if (!flowClassifierStore.containsKey(id)) { log.debug("Flow Classifier creation is failed whose identifier is {}.", id.toString()); return false; } return true; }  @Override boolean exists(FlowClassifierId id); @Override int getFlowClassifierCount(); @Override Iterable<FlowClassifier> getFlowClassifiers(); @Override FlowClassifier getFlowClassifier(FlowClassifierId id); @Override boolean createFlowClassifier(FlowClassifier flowClassifier); @Override boolean updateFlowClassifier(FlowClassifier flowClassifier); @Override boolean removeFlowClassifier(FlowClassifierId id); }
FlowClassifierManager extends AbstractListenerManager<FlowClassifierEvent, FlowClassifierListener> implements FlowClassifierService { @Override public boolean createFlowClassifier(FlowClassifier flowClassifier) { log.debug("createFlowClassifier"); checkNotNull(flowClassifier, FLOW_CLASSIFIER_NOT_NULL); FlowClassifierId id = flowClassifier.flowClassifierId(); flowClassifierStore.put(id, flowClassifier); if (!flowClassifierStore.containsKey(id)) { log.debug("Flow Classifier creation is failed whose identifier is {}.", id.toString()); return false; } return true; }  @Override boolean exists(FlowClassifierId id); @Override int getFlowClassifierCount(); @Override Iterable<FlowClassifier> getFlowClassifiers(); @Override FlowClassifier getFlowClassifier(FlowClassifierId id); @Override boolean createFlowClassifier(FlowClassifier flowClassifier); @Override boolean updateFlowClassifier(FlowClassifier flowClassifier); @Override boolean removeFlowClassifier(FlowClassifierId id);  }