예제 #1
0
        void CallBootStrapHTTPJoin()
        {
            try
            {
                try
                {
                    //ClsException.WriteToLogFile("calling http bs join");
                    clsBootStrapInfo objBootStrapInfo = App.chHttpBootStrapService.svcHttpBSJoin("", null);
                    VMuktiAPI.VMuktiInfo.MainConnectionString = objBootStrapInfo.ConnectionString;

                    switch (objBootStrapInfo.AuthType)
                    {
                    case "SIPAuthentication":
                        VMuktiAPI.VMuktiInfo.CurrentPeer.CurrAuthType = AuthType.SIPAuthentication;
                        break;

                    case "SQLAuthentication":
                        VMuktiAPI.VMuktiInfo.CurrentPeer.CurrAuthType = AuthType.SQLAuthentication;
                        break;

                    default:
                        VMuktiAPI.VMuktiInfo.CurrentPeer.CurrAuthType = AuthType.NotDecided;
                        break;
                    }

                    bool isSuperNode = false;
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithNetP2P)
                    {
                        isSuperNode = false;
                    }
                    else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.SuperNode)
                    {
                        isSuperNode = true;
                    }

                    //ClsException.WriteToLogFile("calling http bs svcHttpBsGetSuperNodeIP");
                    clsSuperNodeDataContract objSuperNodeDataContract = App.chHttpBootStrapService.svcHttpBsGetSuperNodeIP(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP, isSuperNode);
                    VMuktiAPI.VMuktiInfo.CurrentPeer.SuperNodeIP = objSuperNodeDataContract.SuperNodeIP;
                }
                catch (System.ServiceModel.EndpointNotFoundException ex)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CallBootStrapHttpJoin()", "Controls\\CtlLogin.xaml.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                }
                catch (System.ServiceModel.CommunicationException exp)
                {
                    VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "CallBootStrapHttpJoin()", "Controls\\CtlLogin.xaml.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "CallBootStrapHttpJoin()--1", "Controls\\CtlLogin.xaml.cs");
            }
        }
예제 #2
0
 public string[] IsAuthorizedUser(clsBootStrapInfo objBootStrapInfo, string strUserName, string strPassword)
 {
     if (EntIsAutherizedUser != null)
     {
         return(EntIsAutherizedUser(objBootStrapInfo, strUserName, strPassword));
     }
     else
     {
         return(null);
     }
 }