コード例 #1
0
        /// <summary>
        /// CreateProxy method override
        /// </summary>
        public SPServiceApplicationProxy CreateProxy(string name, SPServiceApplication serviceApplication, SPServiceProvisioningContext provisioningContext)
        {
            if (null == serviceApplication)
            {
                throw new ArgumentNullException("ServiceApplication");
            }

            if (serviceApplication.GetType() != typeof(IdentityServiceApplication))
            {
                throw new NotSupportedException();
            }

            IdentityServiceProxy serviceProxy = (IdentityServiceProxy)this.Farm.GetObject(string.Empty, this.Farm.Id, typeof(IdentityServiceProxy));

            if (null == serviceProxy)
            {
                throw new InvalidOperationException("SharePoint.IdentityServiceProxy doesn't exist in the farm");
            }
            ServiceApplicationProxy applicationProxy = serviceProxy.ApplicationProxies.GetValue <ServiceApplicationProxy>(name);

            if (null == applicationProxy)
            {
                applicationProxy = new ServiceApplicationProxy(name, serviceProxy, ((IdentityServiceApplication)serviceApplication).Uri);
            }
            return(applicationProxy);
        }
コード例 #2
0
 /// <summary>
 /// Execute method implementation
 /// </summary>
 public void DoExecute()
 {
     try
     {
         SPFarm farm = SPFarm.Local;
         IdentityServiceProxy serviceProxy = farm.ServiceProxies.GetValue <IdentityServiceProxy>();
         if (null != serviceProxy)
         {
             foreach (SPServiceApplicationProxy prxy in serviceProxy.ApplicationProxies)
             {
                 if (prxy is ServiceApplicationProxy)
                 {
                     if (CheckApplicationProxy(ServiceApplication, prxy as ServiceApplicationProxy))
                     {
                         ((ServiceApplicationProxy)prxy).LaunchReloadCommand(Environment.MachineName);
                     }
                 }
             }
         }
     }
     catch
     {
         // Do Nothing
     }
 }
コード例 #3
0
 public ServiceApplicationProxy(string name, IdentityServiceProxy serviceProxy, Uri serviceApplicationAddress) : base(name, serviceProxy, serviceApplicationAddress)
 {
     m_LoadBalancer = new SPRoundRobinServiceLoadBalancer(serviceApplicationAddress);
 }