Example #1
0
        public IAsyncResult BeginTenantExists(Guid tenantId, Namespace[] ns, AsyncCallback callback, object asyncState)
        {
            FindTenantRequest findTenantRequest   = LocatorServiceClientReader.ConstructTenantExistsRequest(tenantId, ns, this.glsReadFlag);
            LocatorService    locatorService      = this.AcquireServiceProxy();
            IAsyncResult      internalAsyncResult = locatorService.BeginFindTenant(this.requestIdentity, findTenantRequest, new AsyncCallback(LocatorServiceClientAdapter.OnWebServiceRequestCompleted), new GlsAsyncState(callback, asyncState, locatorService));

            return(new GlsAsyncResult(callback, asyncState, locatorService, internalAsyncResult));
        }
Example #2
0
        public bool TenantExists(Guid tenantId, Namespace[] ns)
        {
            FindTenantRequest  request            = LocatorServiceClientReader.ConstructTenantExistsRequest(tenantId, ns, this.glsReadFlag);
            LocatorService     proxy              = this.AcquireServiceProxy();
            FindTenantResponse findTenantResponse = GLSLogger.LoggingWrapper <FindTenantResponse>(this, tenantId.ToString(), proxy.GetHashCode().ToString(), () => proxy.FindTenant(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(findTenantResponse.TenantInfo != null);
        }
Example #3
0
        public FindTenantResult FindTenant(Guid tenantId, TenantProperty[] tenantProperties)
        {
            FindTenantRequest  request  = LocatorServiceClientReader.ConstructFindTenantRequest(tenantId, tenantProperties, this.glsReadFlag);
            LocatorService     proxy    = this.AcquireServiceProxy();
            FindTenantResponse response = GLSLogger.LoggingWrapper <FindTenantResponse>(this, tenantId.ToString(), proxy.GetHashCode().ToString(), () => proxy.FindTenant(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(LocatorServiceClientReader.ConstructFindTenantResult(response));
        }
Example #4
0
        internal static FindTenantRequest ConstructTenantExistsRequest(Guid tenantId, Namespace[] ns, GlsAPIReadFlag readFlag)
        {
            LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
            LocatorServiceClientAdapter.ThrowIfInvalidNamespace(ns);
            FindTenantRequest findTenantRequest = new FindTenantRequest();

            findTenantRequest.ReadFlag = (int)readFlag;
            string[] propertyNames = (from item in ns
                                      select NamespaceUtil.NamespaceWildcard(item)).ToArray <string>();
            findTenantRequest.Tenant = new TenantQuery
            {
                TenantId      = tenantId,
                PropertyNames = propertyNames
            };
            return(findTenantRequest);
        }