當前位置: 首頁>>代碼示例>>Java>>正文


Java Connection類代碼示例

本文整理匯總了Java中de.blinkt.openvpn.core.Connection的典型用法代碼示例。如果您正苦於以下問題:Java Connection類的具體用法?Java Connection怎麽用?Java Connection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Connection類屬於de.blinkt.openvpn.core包,在下文中一共展示了Connection類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: upgradeProfile

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
public void upgradeProfile() {
    if (mProfileVersion < 2) {
        /* default to the behaviour the OS used */
        mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT;
    }
    if (mProfileVersion < 4) {
        moveOptionsToConnection();
        mAllowedAppsVpnAreDisallowed = true;
    }
    if (mAllowedAppsVpn == null) mAllowedAppsVpn = new HashSet<>();
    if (mConnections == null) mConnections = new Connection[0];
    if (mProfileVersion < 6) {
        if (TextUtils.isEmpty(mProfileCreator)) mUserEditable = true;
    }
    mProfileVersion = CURRENT_PROFILE_VERSION;
}
 
開發者ID:akashdeepsingh9988,項目名稱:Cybernet-VPN,代碼行數:17,代碼來源:VpnProfile.java

示例2: checkProfile

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
int checkProfile(Context context) {
    if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) {
        if (mAlias == null) return R.string.no_keystore_cert_selected;
    }
    if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) {
        if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) return R.string.ipv4_format_error;
    }
    if (!mUseDefaultRoute) {
        if (!TextUtils.isEmpty(mCustomRoutes) && getCustomRoutes(mCustomRoutes).size() == 0) return R.string.custom_route_format_error;
        if (!TextUtils.isEmpty(mExcludedRoutes) && getCustomRoutes(mExcludedRoutes).size() == 0) return R.string.custom_route_format_error;
    }
    if (mUseTLSAuth && TextUtils.isEmpty(mTLSAuthFilename)) return R.string.missing_tlsauth;
    if ((mAuthenticationType == TYPE_USERPASS_CERTIFICATES || mAuthenticationType == TYPE_CERTIFICATES) && (TextUtils.isEmpty(mClientCertFilename) || TextUtils.isEmpty(mClientKeyFilename)))
        return R.string.missing_certificates;
    if ((mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES) && TextUtils.isEmpty(mCaFilename)) return R.string.missing_ca_certificate;
    boolean noRemoteEnabled = true;
    for (Connection c : mConnections)
        if (c.mEnabled) noRemoteEnabled = false;
    if (noRemoteEnabled) return R.string.remote_no_server_selected;
    // Everything okay
    return R.string.no_error_found;
}
 
開發者ID:akashdeepsingh9988,項目名稱:Cybernet-VPN,代碼行數:23,代碼來源:VpnProfile.java

示例3: upgradeProfile

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
public void upgradeProfile() {
    if (mProfileVersion < 2) {
        /* default to the behaviour the OS used */
        mAllowLocalLAN = Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT;
    }

    if (mProfileVersion < 4) {
        moveOptionsToConnection();
        mAllowedAppsVpnAreDisallowed = true;
    }
    if (mAllowedAppsVpn == null)
        mAllowedAppsVpn = new HashSet<>();
    if (mConnections == null)
        mConnections = new Connection[0];

    if (mProfileVersion < 6) {
        if (TextUtils.isEmpty(mProfileCreator))
            mUserEditable = true;
    }


    mProfileVersion = CURRENT_PROFILE_VERSION;

}
 
開發者ID:MaxSmile,項目名稱:EasyVPN-Free,代碼行數:25,代碼來源:VpnProfile.java

示例4: VpnProfile

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
public VpnProfile(String name) {
    mUuid = UUID.randomUUID();
    mName = name;
    mProfileVersion = CURRENT_PROFILE_VERSION;
    mConnections = new Connection[1];
    mConnections[0] = new Connection();
}
 
開發者ID:akashdeepsingh9988,項目名稱:Cybernet-VPN,代碼行數:8,代碼來源:VpnProfile.java

示例5: moveOptionsToConnection

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
private void moveOptionsToConnection() {
    mConnections = new Connection[1];
    Connection conn = new Connection();
    conn.mServerName = mServerName;
    conn.mServerPort = mServerPort;
    conn.mUseUdp = true;
    conn.mCustomConfiguration = "";
    mConnections[0] = conn;
}
 
開發者ID:akashdeepsingh9988,項目名稱:Cybernet-VPN,代碼行數:10,代碼來源:VpnProfile.java

示例6: clone

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
@Override
protected VpnProfile clone() throws CloneNotSupportedException {
    VpnProfile copy = (VpnProfile) super.clone();
    copy.mUuid = UUID.randomUUID();
    copy.mConnections = new Connection[mConnections.length];
    int i = 0;
    for (Connection conn : mConnections) {
        copy.mConnections[i++] = conn.clone();
    }
    copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone();
    return copy;
}
 
開發者ID:akashdeepsingh9988,項目名稱:Cybernet-VPN,代碼行數:13,代碼來源:VpnProfile.java

示例7: VpnProfile

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
public VpnProfile(String name) {
    mUuid = UUID.randomUUID();
    mName = name;
    mProfileVersion = CURRENT_PROFILE_VERSION;

    mConnections = new Connection[1];
    mConnections[0] = new Connection();
}
 
開發者ID:MaxSmile,項目名稱:EasyVPN-Free,代碼行數:9,代碼來源:VpnProfile.java

示例8: moveOptionsToConnection

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
private void moveOptionsToConnection() {
    mConnections = new Connection[1];
    Connection conn = new Connection();

    conn.mServerName = mServerName;
    conn.mServerPort = mServerPort;
    conn.mUseUdp = mUseUdp;
    conn.mCustomConfiguration = "";

    mConnections[0] = conn;

}
 
開發者ID:MaxSmile,項目名稱:EasyVPN-Free,代碼行數:13,代碼來源:VpnProfile.java

示例9: moveOptionsToConnection

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
private void moveOptionsToConnection(VpnProfile profile) {
    profile.mConnections = new Connection[1];
    Connection conn = new Connection();

    conn.mServerName = profile.mServerName;
    conn.mServerPort = profile.mServerPort;
    conn.mUseUdp = profile.mUseUdp;
    conn.mCustomConfiguration = "";

    profile.mConnections[0] = conn;

}
 
開發者ID:proxysh,項目名稱:Safejumper-for-Android,代碼行數:13,代碼來源:AppActivity.java

示例10: checkProfile

import de.blinkt.openvpn.core.Connection; //導入依賴的package包/類
public int checkProfile(Context context) {
    if (mAuthenticationType == TYPE_KEYSTORE || mAuthenticationType == TYPE_USERPASS_KEYSTORE) {
        if (mAlias == null)
            return R.string.no_keystore_cert_selected;
    }

    if (!mUsePull || mAuthenticationType == TYPE_STATICKEYS) {
        if (mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null)
            return R.string.ipv4_format_error;
    }
    if (!mUseDefaultRoute) {
        if (!TextUtils.isEmpty(mCustomRoutes) && getCustomRoutes(mCustomRoutes).size() == 0)
            return R.string.custom_route_format_error;

        if (!TextUtils.isEmpty(mExcludedRoutes) && getCustomRoutes(mExcludedRoutes).size() == 0)
            return R.string.custom_route_format_error;

    }

    if (mUseTLSAuth && TextUtils.isEmpty(mTLSAuthFilename))
        return R.string.missing_tlsauth;

    if ((mAuthenticationType == TYPE_USERPASS_CERTIFICATES || mAuthenticationType == TYPE_CERTIFICATES)
            && (TextUtils.isEmpty(mClientCertFilename) || TextUtils.isEmpty(mClientKeyFilename)))
        return R.string.missing_certificates;

    if ((mAuthenticationType == TYPE_CERTIFICATES || mAuthenticationType == TYPE_USERPASS_CERTIFICATES)
            && TextUtils.isEmpty(mCaFilename))
        return R.string.missing_ca_certificate;


    boolean noRemoteEnabled = true;
    for (Connection c : mConnections)
        if (c.mEnabled)
            noRemoteEnabled = false;

    if (noRemoteEnabled)
        return R.string.remote_no_server_selected;

    // Everything okay
    return R.string.no_error_found;

}
 
開發者ID:MaxSmile,項目名稱:EasyVPN-Free,代碼行數:44,代碼來源:VpnProfile.java


注:本文中的de.blinkt.openvpn.core.Connection類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。