@Test public void testGetDirectConnectionTechnique() throws Exception { final NATTraversalTechnique expectedResult = new NATTraversalTechniqueMock("DirectConnection", 3, true); final NATTraversalTechnique actualResult = this.registry.getNATTraversalTechniqueByName("DirectConnection"); assertEquals("DirectConnection is requested.", expectedResult, actualResult); }
@Override public NATTraversalTechnique getNATTraversalTechniqueByName(final String name) throws NATTraversalTechniqueNotFoundException { NATTraversalTechnique result = null; final Iterator<NATTraversalTechnique> iterator = this.pluginLoader.getPluginIterator(); while (iterator.hasNext()) { final NATTraversalTechnique travTech = iterator.next(); if (name.equals(travTech.getMetaData().getTraversalTechniqueName())) { result = travTech; break; } } if (result == null) { throw new NATTraversalTechniqueNotFoundException(name); } return result.copy(); }
NATTraversalRegistryImpl implements NATTraversalRegistry { @Override public NATTraversalTechnique getNATTraversalTechniqueByName(final String name) throws NATTraversalTechniqueNotFoundException { NATTraversalTechnique result = null; final Iterator<NATTraversalTechnique> iterator = this.pluginLoader.getPluginIterator(); while (iterator.hasNext()) { final NATTraversalTechnique travTech = iterator.next(); if (name.equals(travTech.getMetaData().getTraversalTechniqueName())) { result = travTech; break; } } if (result == null) { throw new NATTraversalTechniqueNotFoundException(name); } return result.copy(); } }
NATTraversalRegistryImpl implements NATTraversalRegistry { @Override public NATTraversalTechnique getNATTraversalTechniqueByName(final String name) throws NATTraversalTechniqueNotFoundException { NATTraversalTechnique result = null; final Iterator<NATTraversalTechnique> iterator = this.pluginLoader.getPluginIterator(); while (iterator.hasNext()) { final NATTraversalTechnique travTech = iterator.next(); if (name.equals(travTech.getMetaData().getTraversalTechniqueName())) { result = travTech; break; } } if (result == null) { throw new NATTraversalTechniqueNotFoundException(name); } return result.copy(); } private  NATTraversalRegistryImpl(); }
NATTraversalRegistryImpl implements NATTraversalRegistry { @Override public NATTraversalTechnique getNATTraversalTechniqueByName(final String name) throws NATTraversalTechniqueNotFoundException { NATTraversalTechnique result = null; final Iterator<NATTraversalTechnique> iterator = this.pluginLoader.getPluginIterator(); while (iterator.hasNext()) { final NATTraversalTechnique travTech = iterator.next(); if (name.equals(travTech.getMetaData().getTraversalTechniqueName())) { result = travTech; break; } } if (result == null) { throw new NATTraversalTechniqueNotFoundException(name); } return result.copy(); } private  NATTraversalRegistryImpl(); @Override List<NATTraversalTechnique> getAllSupportedNATTraversalTechniques(); @Override NATTraversalTechnique getNATTraversalTechniqueByName(final String name); @Override Set<NATTraversalRule> getRulesForDecisionTreeLearning(); @Override List<NATTraversalTechnique> getAllFallbackTechniques(); @Override NATTraversalTechnique getNATTraversalTechniqueByEncoding(final int encoding); static NATTraversalRegistry getInstance(); }
NATTraversalRegistryImpl implements NATTraversalRegistry { @Override public NATTraversalTechnique getNATTraversalTechniqueByName(final String name) throws NATTraversalTechniqueNotFoundException { NATTraversalTechnique result = null; final Iterator<NATTraversalTechnique> iterator = this.pluginLoader.getPluginIterator(); while (iterator.hasNext()) { final NATTraversalTechnique travTech = iterator.next(); if (name.equals(travTech.getMetaData().getTraversalTechniqueName())) { result = travTech; break; } } if (result == null) { throw new NATTraversalTechniqueNotFoundException(name); } return result.copy(); } private  NATTraversalRegistryImpl(); @Override List<NATTraversalTechnique> getAllSupportedNATTraversalTechniques(); @Override NATTraversalTechnique getNATTraversalTechniqueByName(final String name); @Override Set<NATTraversalRule> getRulesForDecisionTreeLearning(); @Override List<NATTraversalTechnique> getAllFallbackTechniques(); @Override NATTraversalTechnique getNATTraversalTechniqueByEncoding(final int encoding); static NATTraversalRegistry getInstance();  }