예제 #1
0
파일: WebState.cs 프로젝트: lulzzz/simias
        /// <summary>
        /// Get a connection to the home server of the specified member
        /// </summary>
        /// <param name="domainID">The domain ID</param>
        /// <param name="userID">The user to authenticate as.</param>
        /// <param name="authType">The authentication type.</param>
        /// <param name="host">Host information against which authentication has to be done.</param>
        /// <returns>a connection.</returns>
        internal static HostConnection GetConnection(string domainID, string userID, SimiasConnection.AuthType authType, HostNode host)
        {
            HostConnection conn;
            string         key = host.UserID;

            log.Debug("2-dID {0}, hUID {1}, UID {2}", domainID, host.UserID, userID);
            if (key != null)
            {
                lock (connectionTable)
                {
                    conn = (HostConnection)connectionTable[key];
                    if (conn == null)
                    {
                        conn                 = new HostConnection(domainID, userID, authType, host);
                        conn.key             = key;
                        connectionTable[key] = conn;
                    }
                }
            }
            else
            {
                conn = new HostConnection(domainID, userID, authType, host);
            }
            conn.InitializeConnection();
            return(conn);
        }
예제 #2
0
파일: WebState.cs 프로젝트: lulzzz/simias
        /// <summary>
        /// Get a connection to the home server of the specified member
        /// </summary>
        /// <param name="domainID">The domain ID</param>
        /// <param name="userID">The user to authenticate as.</param>
        /// <param name="authType">The authentication type.</param>
        /// <param name="member">The member</param>
        /// <returns>a connection.</returns>
        internal static HostConnection GetConnection(string domainID, string userID, SimiasConnection.AuthType authType, Member member)
        {
            HostConnection conn;
            string         key = member.HomeServer.UserID;

            if (key != null)
            {
                lock (connectionTable)
                {
                    conn = (HostConnection)connectionTable[key];
                    if (conn == null)
                    {
                        conn                 = new HostConnection(domainID, userID, authType, member);
                        conn.key             = key;
                        connectionTable[key] = conn;
                    }
                }
            }
            else
            {
                conn = new HostConnection(domainID, userID, authType, member);
            }
            conn.InitializeConnection();
            return(conn);
        }
예제 #3
0
파일: WebState.cs 프로젝트: lulzzz/simias
        /// <summary>
        /// Get a connection that can be used to access the host of specified collection.
        /// </summary>
        /// <param name="domainID">The domain ID</param>
        /// <param name="userID">The user to authenticate as.</param>
        /// <param name="authType">The type of authentication.</param>
        /// <param name="collection">The collection to be accessed</param>
        /// <returns>Connection</returns>
        internal static HostConnection GetConnection(string domainID, string userID, SimiasConnection.AuthType authType, Collection collection)
        {
            HostConnection conn;
            string         key = collection.HostID;

            if (key != null)
            {
                lock (connectionTable)
                {
                    conn = (HostConnection)connectionTable[key];
                    if (conn == null)
                    {
                        conn                 = new HostConnection(domainID, userID, authType, collection);
                        conn.key             = key;
                        connectionTable[key] = conn;
                    }
                }
            }
            else
            {
                conn = new HostConnection(domainID, userID, authType, collection);
            }
            conn.ssl = collection.SSL;
            conn.InitializeConnection();
            return(conn);
        }
예제 #4
0
파일: WebState.cs 프로젝트: lulzzz/simias
 /// <summary>
 /// Get a connection to the home server of the specified member
 /// </summary>
 /// <param name="domainID">The domain ID</param>
 /// <param name="userID">The user to authenticate as.</param>
 /// <param name="authType">The authentication type.</param>
 /// <param name="member">The member</param>
 /// <returns>a connection.</returns>
 public SimiasConnection(string domainID, string userID, AuthType authType, Member member)
 {
     connection = HostConnection.GetConnection(domainID, userID, authType, member);
     InitializeConnection();
 }
예제 #5
0
파일: WebState.cs 프로젝트: lulzzz/simias
 /// <summary>
 /// Get a connection that can be used to access the specified host.
 /// </summary>
 /// <param name="domainID">The domain ID</param>
 /// <param name="userID">The user to authenticate as.</param>
 /// <param name="authType">The authentication type.</param>
 /// <param name="host">The Host to connect to</param>
 /// <returns>Connection</returns>
 public SimiasConnection(string domainID, string userID, AuthType authType, HostNode host)
 {
     connection = HostConnection.GetConnection(domainID, userID, authType, host);
     InitializeConnection();
 }
예제 #6
0
파일: WebState.cs 프로젝트: lulzzz/simias
 /// <summary>
 /// Get a connection that can be used to access the specified collection.
 /// </summary>
 /// <param name="domainID">The domain ID</param>
 /// <param name="userID">The user to authenticate as.</param>
 /// <param name="authType">The type of authentication.</param>
 /// <param name="collection">The collection to be accessed</param>
 /// <returns>Connection</returns>
 public SimiasConnection(string domainID, string userID, AuthType authType, Collection collection)
 {
     connection = HostConnection.GetConnection(domainID, userID, authType, collection);
     InitializeConnection();
 }