Ejemplo n.º 1
0
        private IList <UddiLookupResponse> GetUddiResponses(LookupParameters lookupParameters)
        {
            bool filterResponseByProfile = lookupParameters.ProfileIds != null;

            IList <UddiLookupResponse> lookupResponses = new List <UddiLookupResponse>();
            UddiLookupKey key = new UddiLookupKey(lookupParameters.Identifier, lookupParameters.ServiceId, this.uddiProxy.Endpoint.Address.Uri, lookupParameters.ProfileConformanceClaim);

            IList <UddiService> uddiServices;

            if (!uddiServiceCache.TryGetValue(key, out uddiServices))
            {
                uddiServices = this.GetUddiServices(lookupParameters.Identifier, lookupParameters.ServiceId, lookupParameters.ProfileConformanceClaim);

                if (uddiServices.Count > 0)
                {
                    uddiServiceCache.Set(key, uddiServices);
                }
            }

            UddiLookupResponse lookupResponse;

            foreach (UddiService uddiService in uddiServices)
            {
                if (uddiService.IsInactiveOrExpired())
                {
                    continue;
                }
                else
                {
                    IEnumerable <UddiBinding> supportedBindings = uddiService.Bindings;
                    if (filterResponseByProfile)
                    {
                        supportedBindings = uddiService.GetBindingsSupportingOneOrMoreProfileAndRole(lookupParameters.ProfileIds, lookupParameters.ProfileRoleIdentifier);
                    }

                    foreach (UddiBinding uddiBinding in supportedBindings)
                    {
                        lookupResponse = GetLookupResponse(lookupParameters, uddiService, uddiBinding);
                        lookupResponses.Add(lookupResponse);
                    }
                }
            }

            return(lookupResponses);
        }
Ejemplo n.º 2
0
        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            UddiLookupKey other = (UddiLookupKey)obj;

            if (!identifier.Equals(other.identifier))
            {
                return(false);
            }

            if (serviceId == null && other.serviceId != null)
            {
                return(false);
            }
            if (serviceId != null && other.serviceId == null)
            {
                return(false);
            }
            if (serviceId != null && other.serviceId != null && !serviceId.Equals(other.serviceId))
            {
                return(false);
            }

            if (!endpoint.Equals(other.endpoint))
            {
                return(false);
            }

            if (!profileConformanceClaim.Equals(other.profileConformanceClaim))
            {
                return(false);
            }

            return(true);
        }