Пример #1
0
        /// <summary>
        /// Create a connection properties object.
        /// <param name="url"> URL to IndexServer</param>
        /// <returns>Properties object.</returns>
        /// <see>#PROP_URL PROP_URL</see>
        /// </summary>
        public static IXProperties CreateConnProperties(String url)
        {
            IXProperties props = new IXProperties();

            props[PROP_URL] = url;
            return(props);
        }
Пример #2
0
        /// <summary>
        /// Create a connection properties object.
        /// <param name="url"> URL to IndexServer</param>
        /// <param name="nbOfCnns"> Size of connection pool with connections to IndexServer.</param>
        /// <param name="timeoutSeconds"> </param>
        /// <returns>Properties object.</returns>
        /// <see>#PROP_URL PROP_URL</see>
        /// <see>#PROP_NB_OF_CNNS PROP_NB_OF_CNNS</see>
        /// <see>#PROP_TIMEOUT_SECONDS PROP_TIMEOUT_SECONDS</see>
        /// </summary>
        public static IXProperties CreateConnProperties(String url, int nbOfCnns, int timeoutSeconds)
        {
            IXProperties props = new IXProperties();

            props[PROP_URL]             = url;
            props[PROP_NB_OF_CNNS]      = Convert.ToString(nbOfCnns);
            props[PROP_TIMEOUT_SECONDS] = Convert.ToString(timeoutSeconds);
            return(props);
        }
Пример #3
0
 public IXAuthentication(ClientInfo clientInfo, IXProperties sessOpts, EAuthenticationType authType)
 {
     this.loginResult            = new LoginResult();
     this.loginResult.clientInfo = clientInfo;
     this.loginResult.user       = new UserInfo();
     this.sessOpts      = sessOpts;
     this.encrPasswords = new IXProperties();
     this.authType      = authType;
 }
Пример #4
0
        /// <summary>
        /// Creates a property collection that contains session options. The client
        /// application type property (SessionOptionsC.CLIENT_APP_TYPE)
        /// is set to SessionOptionsC.TYPE_PARTNER_APPLICATION.
        /// <param name="appName">Application name.</param>
        /// <param name="appVersion">Application version.</param>
        /// <returns>Properties object.</returns>
        /// <see>SessionOptions SessionOptions</see>
        /// </summary>
        public static IXProperties CreateSessionOptions(String appName, String appVersion)
        {
            IXProperties props = new IXProperties();

            props[SessionOptionsC.CLIENT_APP_NAME]    = appName;
            props[SessionOptionsC.CLIENT_APP_TYPE]    = SessionOptionsC.TYPE_PARTNER_APPLICATION;
            props[SessionOptionsC.CLIENT_APP_VERSION] = appVersion;
            return(props);
        }
Пример #5
0
 internal IXAuthentication_NameOrRunAsReportAs(
     ClientInfo clientInfo, IXProperties sessOpts, EAuthenticationType authType,
     String userName, String userPwd, String computerName, String runAs, bool reportAs)
     : base(clientInfo, sessOpts, authType)
 {
     this.userName     = userName;
     this.userPwd      = userPwd;
     this.computerName = computerName;
     this.runAs        = runAs;
     this.reportAs     = reportAs;
 }
Пример #6
0
 internal IXAuthentication_RunAsFromTicket(
     ClientInfo clientInfo, IXProperties sessOpts, EAuthenticationType authType, String runAs)
     : base(clientInfo, sessOpts, authType)
 {
     ciAdmin          = new ClientInfo();
     ciAdmin.ticket   = clientInfo.ticket;
     ciAdmin.language = clientInfo.language;
     ciAdmin.country  = clientInfo.country;
     ciAdmin.timeZone = clientInfo.timeZone;
     this.runAs       = runAs;
 }
Пример #7
0
        /// <summary>
        /// Initialize default connection properties.
        /// </summary>
        protected static void InitializeStatic()
        {
            if (defaultProps != null)
            {
                return;
            }
            IXProperties props = new IXProperties();

            props[PROP_NB_OF_CNNS]      = "100";
            props[PROP_TIMEOUT_SECONDS] = "600";
            defaultProps = props;
        }
Пример #8
0
 public IXConnection(IXConnFactory iXConnFactory,
                     BClient_Indexserver bclient, IXAuthentication auth, string url,
                     IXProperties connProps, IXProperties sessOpts)
 {
     this.iXConnFactory     = iXConnFactory;
     this.bclient           = bclient;
     this.auth              = auth;
     this.url               = url;
     this.connPropsVal      = connProps;
     this.sessionOptionsVal = sessOpts;
     this.ixVal             = new IXCachedConnIXServicePortIF(bclient.getTransport(), connProps);
     this.disposed          = false;
 }
Пример #9
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="transport">BYPS Transport</param>
        /// <param name="connProps">Connection properties</param>
        public IXCachedConnIXServicePortIF(BTransport transport, IXProperties connProps)
            : base(transport)
        {
            int cacheLifetimeSecondsLong  = connProps.Get(IXConnFactory.PROP_CACHE_MASTERDATA_LIFETIME_SECONDS, 10 * 60);
            int cacheLifetimeSecondsShort = connProps.Get(IXConnFactory.PROP_CACHE_CONTENT_LIFETIME_SECONDS, 0);

            sordCache     = new SordCache(this, cacheLifetimeSecondsShort);
            docMaskCache  = new DocMaskCache(this, cacheLifetimeSecondsLong);
            colorCache    = new ColorDataCache(this, cacheLifetimeSecondsLong);
            keywordCache  = new KeywordCache(this, cacheLifetimeSecondsLong);
            sordTypeCache = new SordTypeCache(this, cacheLifetimeSecondsLong);
            colorCache    = new ColorDataCache(this, cacheLifetimeSecondsLong);
            counterCache  = new CounterInfoCache(this, cacheLifetimeSecondsLong);
            userNameCache = new UserNameCache(this, cacheLifetimeSecondsLong);
        }
Пример #10
0
        protected override void internalAuthenticate(BClient_Indexserver client, BAsyncResult <bool> asyncResult)
        {
            // Do not use the session properties initialized in the constructor of IXConnFactory.
            // The options set by the application that created the ticked should not be overwritten.
            // Especially, the options ixUrlBase and docUrlBase must not be changed to a relative URL.

            IXProperties sessOpts2 = new IXProperties();

            client.IXServicePortIF.getSessionFromTicket(SessionOptionsC.SESSION_FROM_AM_ADD,
                                                        (loginResult, ex) =>
            {
                this.setLoginResult(loginResult);
                asyncResult(false, ex);
            });
        }
Пример #11
0
        /// <summary>
        /// Converts the properties collections of session options into the
        /// appropriate IndexServer interface object.
        /// </summary>
        /// <returns></returns>
        public static SessionOptions makeSessOptsObj(IXProperties props)
        {
            SessionOptions opts = new SessionOptions();

            KeyValue[] kvs = opts.options = new KeyValue[props.Count];
            int        i   = 0;

            foreach (String k in props.Keys)
            {
                KeyValue kv = kvs[i++] = new KeyValue();
                kv.key   = k;
                kv.value = props[k];
            }
            return(opts);
        }
Пример #12
0
        public virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                Logout();
                iXConnFactory     = null;
                auth              = null;
                url               = null;
                connPropsVal      = null;
                sessionOptionsVal = null;
                ixVal             = null;
                constVal          = null;
                eventBusApiVal    = null;
                bclient           = null;
            }
            disposed = true;
        }
Пример #13
0
 /// <summary>
 /// <see cref="IXConnFactoryBase"/>
 /// </summary>
 /// <param name="props">Connection properties</param>
 /// <param name="sessOpts">Session options</param>
 public IXConnFactory(IXProperties props, IXProperties sessOpts)
     : base(props, sessOpts)
 {
 }
Пример #14
0
 internal IXAuthentication_FromTicket(
     ClientInfo clientInfo, IXProperties sessOpts, EAuthenticationType authType)
     : base(clientInfo, sessOpts, authType)
 {
 }
Пример #15
0
 internal IXAuthentication_SSO(ClientInfo clientInfo, IXProperties sessOpts, EAuthenticationType authType, String computerName)
     : base(clientInfo, sessOpts, authType)
 {
     this.computerName = computerName;
 }
Пример #16
0
 /// <summary>
 /// Constructor with default properties.
 /// </summary>
 /// <param name="defaultProps"></param>
 public IXProperties(IXProperties defaultProps)
 {
     map = new Dictionary <String, String>(defaultProps.map);
 }
Пример #17
0
 /// <summary>
 /// Constructor. The supplied connection properties are used to create the
 /// internal IXClient object. They are passed to each IXConnection object
 /// created by one of the create function. The given session options are passed
 /// to the IXConnLogin objects instanciated in the create functions. The
 /// functions createConnProperties and createSessionOptions.
 /// can help to create the properties collections.
 /// <param name="props"> Connection properties. </param>
 /// <param name="sessOpts"> Session options. </param>
 /// <see>#createConnProps createConnProps</see>
 /// <see>#createSessionOptions createSessionOptions</see>
 /// </summary>
 public IXConnFactoryBase(IXProperties props, IXProperties sessOpts)
 {
     this.connProps = props;
     this.sessOpts  = sessOpts;
     init();
 }
Пример #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="url">IndexServer URL</param>
 /// <param name="appName"></param>
 /// <param name="appVersion"></param>
 public IXConnFactoryBase(String url, String appName, String appVersion)
 {
     this.connProps = CreateConnProperties(url);
     this.sessOpts  = CreateSessionOptions(appName, appVersion);
     init();
 }