Example #1
0
 /// <summary>
 /// Returns the connection for the given archive name.
 /// If no connection object already exists, a new object ist created.
 /// </summary>
 /// <param name="arcName">Archive name</param>
 /// <returns>Connection</returns>
 /// <exception>System.IO.IOException</exception>
 public virtual FSConnection GetConnection(String arcName)
 {
     lock (mapConns)
     {
         FSConnection conn = null;
         if (!mapConns.TryGetValue(arcName, out conn))
         {
             mapConns[arcName] = conn = CreateConnection(arcName);
         }
         return(conn);
     }
 }
Example #2
0
        /// <summary>
        /// Creates a connection to IndexServer that is initialized by the
        /// session ticket of ELOFS.
        /// </summary>
        /// <param name="arcName">Archive name</param>
        /// <returns>Connection to IndexServer</returns>
        protected virtual FSConnection CreateConnection(String arcName)
        {
            String       login_properties = getLoginPropertiesFileName(arcName);
            IXProperties lprops           = new IXProperties();

            lprops.Read(login_properties);

            String   url      = lprops["url"];
            IXClient ixClient = new IXClient(url, nbOfConnections, timeoutSeconds);

            FSConnLogin connLogin = new FSConnLogin(ixClient, login_properties);

            IXProperties connProps = new IXProperties();

            FSConnection conn = new FSConnection(config, arcName, new IXConnection(ixClient, connLogin, connProps));

            return(conn);
        }