Ejemplo n.º 1
0
 public TResult DescribeIndex <TResult>(sones.Library.Commons.Security.SecurityToken mySecurityToken, Int64 myTransactionToken, RequestDescribeIndex myRequestDescribeIndex, Converter.DescribeIndexResultConverter <TResult> myOutputconverter)
 {
     return(_iGraphDB.DescribeIndex <TResult>(mySecurityToken,
                                              myTransactionToken,
                                              myRequestDescribeIndex,
                                              myOutputconverter));
 }
Ejemplo n.º 2
0
        public override QueryResult GetResult(
            GQLPluginManager myPluginManager,
            IGraphDB myGraphDB,
            SecurityToken mySecurityToken,
            TransactionToken myTransactionToken)
        {
            var resultingVertices = new List<IVertexView>();
            ASonesException error = null;

            #region Specific index

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

            var 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 = new List<IVertexView>() { 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);
        }
Ejemplo n.º 3
0
        public override IEnumerable<IVertexView> GetResult(
                                                GQLPluginManager myPluginManager,
                                                IGraphDB myGraphDB,
                                                SecurityToken mySecurityToken,
                                                Int64 myTransactionToken)
        {
            IEnumerable<IVertexView> resultingVertices = new List<IVertexView>();

            #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)
            {
                throw new IndexTypeDoesNotExistException(_TypeName, _IndexName);
            }

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

            resultingVertices = GenerateOutput(indices, _IndexName);

            return resultingVertices;

            #endregion

        }
Ejemplo n.º 4
0
        public override IEnumerable <IVertexView> GetResult(
            GQLPluginManager myPluginManager,
            IGraphDB myGraphDB,
            SecurityToken mySecurityToken,
            Int64 myTransactionToken)
        {
            IEnumerable <IVertexView> resultingVertices = new List <IVertexView>();

            #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)
            {
                throw new IndexTypeDoesNotExistException(_TypeName, _IndexName);
            }

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

            resultingVertices = GenerateOutput(indices, _IndexName);

            return(resultingVertices);

            #endregion
        }