Package de.fhkn.in.uce.plugininterface

Examples of de.fhkn.in.uce.plugininterface.NATTraversalTechnique


    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof NATTraversalTechnique) {
            NATTraversalTechnique other = (NATTraversalTechnique) obj;
            return this.metaData.getTraversalTechniqueName().equals(other.getMetaData().getTraversalTechniqueName());
        }
        return false;
    }
View Full Code Here


        assertTrue(this.containsAll(expectedResult, actualResult));
    }

    @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);
    }
View Full Code Here

        while (true) {
            final Future<Message> waitingResult = complServiceConnReq.poll();
            if (null != waitingResult) {
                try {
                    final Message connRequest = waitingResult.get();
                    final NATTraversalTechnique usedNatTraversalTechnique = this
                            .getUsedTraversalTechniqueFromMessage(connRequest);
                    final ExecutorService estabExecutor = Executors.newSingleThreadExecutor();
                    complServiceConnEst = new ExecutorCompletionService<Socket>(estabExecutor);
                    logger.debug(
                            "Starting target-side with {}", usedNatTraversalTechnique.getMetaData().getTraversalTechniqueName()); //$NON-NLS-1$
                    complServiceConnEst.submit(new ConnectionEstablishmentTask(usedNatTraversalTechnique, targetId,
                            this.mediatorConnection.getControlConnection(), connRequest));
                    checkEstTask = true;
                } catch (final Exception e) {
                    logger.equals(e.getMessage());
View Full Code Here

        waitingExecutor.shutdownNow();
        return result;
    }

    private NATTraversalTechnique getUsedTraversalTechniqueFromMessage(final Message message) throws Exception {
        NATTraversalTechnique result = null;
        if (message.hasAttribute(NATTraversalTechniqueAttribute.class)) {
            final NATTraversalTechniqueAttribute usedTechAttr = message
                    .getAttribute(NATTraversalTechniqueAttribute.class);
            result = this.registry.getNATTraversalTechniqueByEncoding(usedTechAttr.getEncoded());
        } else {
View Full Code Here

    }

    @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) {
View Full Code Here

    }

    @Override
    public NATTraversalTechnique getNATTraversalTechniqueByEncoding(final int encoding)
            throws NATTraversalTechniqueNotFoundException {
        NATTraversalTechnique result = null;
        final List<NATTraversalTechnique> availableTechniques = this.getAllSupportedNATTraversalTechniques();
        for (NATTraversalTechnique natTraversalTechnique : availableTechniques) {
            if (natTraversalTechnique.getMetaData().getAttribute().getEncoded() == encoding) {
                result = natTraversalTechnique;
                break;
View Full Code Here

        final Iterator<NATTraversalTechnique> iterator = this.serviceLoader.iterator();
        if (!iterator.hasNext()) {
            throw new RuntimeException("No NAT Traversal Techniques found.");
        }
        while (iterator.hasNext()) {
            final NATTraversalTechnique plugin = iterator.next();
            this.logger.info("Found plugin: {}", plugin.getMetaData().getTraversalTechniqueName()); //$NON-NLS-1$
        }
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.plugininterface.NATTraversalTechnique

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.