Exemplo n.º 1
0
        public override QueryResult GetResult(
            GQLPluginManager myPluginManager,
            IGraphDB myGraphDB,
            SecurityToken mySecurityToken,
            Int64 myTransactionToken)
        {
            IEnumerable<IVertexView> resultingVertices = new List<IVertexView>();
            ASonesException error = null;

            #region Specific index

            var request = new RequestDescribeIndex(_TypeName, _IndexName, _IndexEdition);

            IEnumerable<IIndexDefinition> indices = null;

            if (request.IndexName == String.Empty && request.TypeName == String.Empty && request.Edition == String.Empty)
            {
                indices = myGraphDB.DescribeIndices<IEnumerable<IIndexDefinition>>(mySecurityToken, myTransactionToken, request, (stats, definitions) => definitions);
            }
            else
            {
                indices = myGraphDB.DescribeIndex<IEnumerable<IIndexDefinition>>(mySecurityToken, myTransactionToken, request, (stats, definitions) => definitions);
            }

            if (indices == null)
            {
                error = new IndexTypeDoesNotExistException(_TypeName, _IndexName);
            }

            if (String.IsNullOrEmpty(_IndexEdition))
            {
                //_IndexEdition = DBConstants.DEFAULTINDEX;
            }

            resultingVertices = GenerateOutput(indices, _IndexName);

            #endregion

            if(error != null)
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Failed, resultingVertices, error);
            else
                return new QueryResult("", SonesGQLConstants.GQL, 0L, ResultType.Successful, resultingVertices);
        }
Exemplo n.º 2
0
        public TResult DescribeIndices <TResult>(sones.Library.Commons.Security.SecurityToken mySecurityToken, long myTransactionID, sones.GraphDB.Request.RequestDescribeIndex myRequestDescribeIndex, sones.GraphDB.Request.Converter.DescribeIndicesResultConverter <TResult> myOutputconverter)
        {
            Stopwatch RunningTime = Stopwatch.StartNew();
            var       svcIndices  = _GraphDSService.DescribeIndices(mySecurityToken, myTransactionID, myRequestDescribeIndex.TypeName);
            var       indices     = svcIndices.Select(x => new RemoteIndexDefinition(x, this));

            RunningTime.Stop();
            return(myOutputconverter(new RequestStatistics(new TimeSpan(RunningTime.ElapsedTicks)), indices));
        }
Exemplo n.º 3
0
        public TResult DescribeIndex <TResult>(SecurityToken mySecurityToken, long myTransactionID, sones.GraphDB.Request.RequestDescribeIndex myRequestDescribeIndex, sones.GraphDB.Request.Converter.DescribeIndexResultConverter <TResult> myOutputconverter)
        {
            Stopwatch RunningTime         = Stopwatch.StartNew();
            var       svcIndex            = _GraphDSService.DescribeIndex(mySecurityToken, myTransactionID, myRequestDescribeIndex.TypeName, myRequestDescribeIndex.IndexName);
            List <IIndexDefinition> index = new List <IIndexDefinition>();

            index.Add(new RemoteIndexDefinition(svcIndex, this));
            RunningTime.Stop();
            return(myOutputconverter(new RequestStatistics(new TimeSpan(RunningTime.ElapsedTicks)), index));
        }