Ejemplo n.º 1
0
        public virtual IXConnection CreateAdmin(ClientInfo ci, String userName, String userPwd, String computerName, String reportAs)
        {
            if (ci == null)
            {
                ci = MakeDefaultClientInfo();
            }

            EAuthenticationType authType = EAuthenticationType.REPORT_AS;

            IXAuthentication auth = new IXAuthentication_NameOrRunAsReportAs(ci, sessOpts, authType,
                                                                             userName, userPwd, computerName, reportAs, true);

            BSyncResult <IXConnection> asyncResult = new BSyncResult <IXConnection>();

            internalCreateConnection(auth, BAsyncResultHelper.ToDelegate(asyncResult));
            return(asyncResult.GetResult());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create aconnection for the given user.
        /// <param name="ci"> ClientInfo object with language, country and timezone</param>
        /// <param name="userName"> User name.</param>
        /// <param name="userPwd"> Plain text user password.</param>
        /// <param name="computerName"> Computer name.</param>
        /// <param name="runAs"> User name or ID if this should be a run-as connection.</param>
        /// <returns>IXConnection object.</returns>
        /// @throws java.rmi.RemoteException
        /// </summary>
        public virtual IXConnection Create(ClientInfo ci, String userName, String userPwd,
                                           String computerName, String runAs)
        {
            if (ci == null)
            {
                ci = MakeDefaultClientInfo();
            }

            EAuthenticationType authType = runAs != null && runAs.Length != 0 ?
                                           EAuthenticationType.RUN_AS : EAuthenticationType.NAME_PASSWORD;

            IXAuthentication auth = new IXAuthentication_NameOrRunAsReportAs(ci, sessOpts, authType,
                                                                             userName, userPwd, computerName, runAs, false);

            BSyncResult <IXConnection> asyncResult = new BSyncResult <IXConnection>();

            internalCreateConnection(auth, BAsyncResultHelper.ToDelegate(asyncResult));
            return(asyncResult.GetResult());
        }