Package de.fhkn.in.uce.connectivitymanager.connection

Source Code of de.fhkn.in.uce.connectivitymanager.connection.UCESecureSocketFactory

/*
* Copyright (c) 2012 Alexander Diener,
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.fhkn.in.uce.connectivitymanager.connection;

import de.fhkn.in.uce.connectivitymanager.connection.configuration.ConnectionConfiguration;
import de.fhkn.in.uce.connectivitymanager.manager.source.UnsecureSourceSideConnectionEstablishment;
import de.fhkn.in.uce.connectivitymanager.manager.target.UnsecureTargetSideConnectionEstablishment;

public final class UCESecureSocketFactory extends UCESocketFactory {
    private static final UCESecureSocketFactory INSTANCE = new UCESecureSocketFactory();

    private UCESecureSocketFactory() {
        // private constructor
    }

    public static UCESecureSocketFactory getInstance() {
        return INSTANCE;
    }

    @Override
    protected UCESocket createNewSourceSocket(String targetId, ConnectionConfiguration configuration) {
        // TODO change source side conn est
        try {
            return new UCESecureSocket(targetId, configuration, new UnsecureSourceSideConnectionEstablishment());
        } catch (final Exception e) {
            throw new RuntimeException("Could not create UCESocket:", e); //$NON-NLS-1$
        }
    }

    @Override
    protected UCESocket createNewTargetSocket(String targetId) {
        try {
            return new UCESecureSocket(targetId, new UnsecureTargetSideConnectionEstablishment());
        } catch (final Exception e) {
            throw new RuntimeException("Could not create UCESocket:", e); //$NON-NLS-1$
        }
    }
}
TOP

Related Classes of de.fhkn.in.uce.connectivitymanager.connection.UCESecureSocketFactory

TOP
Copyright © 2018 www.massapi.com. 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.