예제 #1
0
        /// <summary>
        ///     Get all known type descriptions from the server. Used by generic clients (like cache monitoring tools)
        ///     to produce queries without having dependencies to the .NET type.
        /// </summary>
        /// <returns></returns>
        public IDictionary <string, TypeDescription> GetKnownTypes()
        {
            var request = new GetKnownTypesRequest();

            var response = Channel.SendRequest(request);

            if (response is ExceptionResponse exResponse)
            {
                throw new CacheException("Error while getting server information", exResponse.Message,
                                         exResponse.CallStack);
            }

            var concreteResponse = (ServerDescriptionResponse)response;

            return(concreteResponse.KnownTypesByFullName);
        }
예제 #2
0
        /// <summary>
        ///     Return useful information about the server process and the "data stores"
        ///     A "data store" is a data container on the server containing all the objects of a given type
        /// </summary>
        /// <returns></returns>
        public ServerDescriptionResponse GetServerDescription()
        {
            var request = new GetKnownTypesRequest();

            var response = Channel.SendRequest(request);

            if (response is ExceptionResponse exResponse)
            {
                throw new CacheException("Error while getting server information", exResponse.Message,
                                         exResponse.CallStack);
            }

            var concreteResponse = response as ServerDescriptionResponse;

            Dbg.CheckThat(concreteResponse != null);
            return(concreteResponse);
        }