Ejemplo n.º 1
0
        public bool IsSealed(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(Response.IsSealed);
        }
Ejemplo n.º 2
0
 public void DropIndex(SecurityToken mySecurityToken, Int64 myTransactionToken,
                       ServiceVertexType myVertexType, String myIndexName, String myEdition)
 {
     var Request  = ServiceRequestFactory.MakeRequestDropIndex(myVertexType, myIndexName, myEdition);
     var Response = this.GraphDS.DropIndex(mySecurityToken, myTransactionToken, Request,
                                           ServiceReturnConverter.ConverteToVoid);
 }
Ejemplo n.º 3
0
        public bool HasProperties(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, bool myIncludeAncestorDefinitions)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(Response.HasProperties(myIncludeAncestorDefinitions));
        }
Ejemplo n.º 4
0
        public bool HasProperty(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, string myPropertyName)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(Response.HasProperty(myPropertyName));
        }
Ejemplo n.º 5
0
        public ServiceVertexInstance GetVertex(SecurityToken mySecurityToken, Int64 myTransactionToken,
                                               ServiceVertexType myVertexType, Int64 myVertexID)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertex(myVertexType, myVertexID);
            var Response = this.GraphDS.GetVertex <IVertex>(mySecurityToken, myTransactionToken, Request,
                                                            ServiceReturnConverter.ConvertOnlyVertexInstance);

            return(new ServiceVertexInstance(Response));
        }
Ejemplo n.º 6
0
        public ServiceVertexType AlterVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken,
                                                 ServiceVertexType myVertexType, ServiceAlterVertexChangeset myChangeset)
        {
            var Request  = ServiceRequestFactory.MakeRequestAlterVertexType(myVertexType, myChangeset);
            var Response = this.GraphDS.AlterVertexType <IVertexType>(mySecurityToken, myTransactionToken, Request,
                                                                      ServiceReturnConverter.ConvertOnlyVertexType);

            return(new ServiceVertexType(Response));
        }
Ejemplo n.º 7
0
        public Tuple <IEnumerable <IComparable>, IEnumerable <IComparable> > Delete(SecurityToken mySecurityToken, Int64 myTransactionToken,
                                                                                    ServiceVertexType myVertexType, IEnumerable <Int64> myVertexIDs = null, ServiceDeletePayload myDeletePayload = null)
        {
            var Request = ServiceRequestFactory.MakeRequestDelete(myVertexType, myVertexIDs, myDeletePayload);
            var Result  = this.GraphDS.Delete <Tuple <IEnumerable <IComparable>, IEnumerable <IComparable> > >(mySecurityToken, myTransactionToken, Request,
                                                                                                               ServiceReturnConverter.ConverteAllLists);

            return(Result);
        }
Ejemplo n.º 8
0
        public Dictionary <Int64, String> DropVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken,
                                                         ServiceVertexType myVertexType)
        {
            var Request  = ServiceRequestFactory.MakeRequestDropVertexType(myVertexType);
            var Response = this.GraphDS.DropVertexType <Dictionary <Int64, String> >(mySecurityToken, myTransactionToken, Request,
                                                                                     ServiceReturnConverter.ConverteOnlyDeletedTypeIDs);

            return(Response);
        }
Ejemplo n.º 9
0
        public bool IsDescendant(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, ServiceVertexType myOtherType)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myOtherType.Name);
            var BaseType = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            Request = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(Response.IsDescendant(BaseType));
        }
Ejemplo n.º 10
0
        public static ServiceBaseType ToServiceBaseType(IBaseType myBaseType)
        {
            ServiceBaseType svcBaseType = null;

            if (myBaseType is IVertexType)
            {
                svcBaseType = new ServiceVertexType((IVertexType)myBaseType);
            }
            else if (myBaseType is IEdgeType)
            {
                svcBaseType = new ServiceEdgeType((IEdgeType)myBaseType);
            }
            return(svcBaseType);
        }
Ejemplo n.º 11
0
        public static RequestDelete MakeRequestDelete(ServiceVertexType myVertexType, IEnumerable <Int64> myVertexIDs = null, ServiceDeletePayload myDeletePayload = null)
        {
            RequestGetVertices PreRequest = null;

            if (myVertexIDs != null)
            {
                PreRequest = new RequestGetVertices(myVertexType.Name, myVertexIDs);
            }
            else
            {
                PreRequest = new RequestGetVertices(myVertexType.Name);
            }

            RequestDelete Request = new RequestDelete(PreRequest);

            if (myDeletePayload != null)
            {
                foreach (var toDel in myDeletePayload.ToBeDeletedAttributes)
                {
                    Request.AddAttribute(toDel);
                }
            }
            return(Request);
        }
Ejemplo n.º 12
0
 internal RemoteVertexType(ServiceVertexType myVertexType, IServiceToken myServiceToken) : base(myVertexType, myServiceToken)
 {
     _IsAbstract = myVertexType.IsAbstract;
 }
Ejemplo n.º 13
0
        public static RequestAlterVertexType MakeRequestAlterVertexType(ServiceVertexType myVertexType, ServiceAlterVertexChangeset myChangeset)
        {
            var Request = new RequestAlterVertexType(myVertexType.Name);

            #region Add Attributes

            if (myChangeset.ToBeAddedProperties != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedProperties)
                {
                    Request.AddProperty(toAdd.ToPropertyPredefinition());
                }
            }

            if (myChangeset.ToBeAddedIncomingEdges != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedIncomingEdges)
                {
                    Request.AddIncomingEdge(toAdd.ToIncomingEdgePredefinition());
                }
            }

            if (myChangeset.ToBeAddedOutgoingEdges != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedOutgoingEdges)
                {
                    Request.AddOutgoingEdge(toAdd.ToOutgoingEdgePredefinition());
                }
            }

            if (myChangeset.ToBeAddedUniques != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedUniques)
                {
                    Request.AddUnique(toAdd.ToUniquePredefinition());
                }
            }

            if (myChangeset.ToBeAddedMandatories != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedMandatories)
                {
                    Request.AddMandatory(toAdd.ToMandatoryPredefinition());
                }
            }

            if (myChangeset.ToBeAddedIndices != null)
            {
                foreach (var toAdd in myChangeset.ToBeAddedIndices)
                {
                    Request.AddIndex(toAdd.ToIndexPredefinition());
                }
            }


            #endregion

            #region Remove Attributes

            if (myChangeset.ToBeRemovedProperties != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedProperties)
                {
                    Request.RemoveProperty(toDel);
                }
            }

            if (myChangeset.ToBeRemovedIncomingEdges != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedIncomingEdges)
                {
                    Request.RemoveIncomingEdge(toDel);
                }
            }

            if (myChangeset.ToBeRemovedOutgoingEdges != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedOutgoingEdges)
                {
                    Request.RemoveOutgoingEdge(toDel);
                }
            }

            if (myChangeset.ToBeRemovedUniques != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedUniques)
                {
                    Request.RemoveUnique(toDel);
                }
            }

            if (myChangeset.ToBeRemovedMandatories != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedMandatories)
                {
                    Request.RemoveMandatory(toDel);
                }
            }

            if (myChangeset.ToBeRemovedIndices != null)
            {
                foreach (var toDel in myChangeset.ToBeRemovedIndices)
                {
                    Request.RemoveIndex(toDel.Key, toDel.Value);
                }
            }

            #endregion

            #region define / undefine

            if (myChangeset.ToBeDefinedAttributes != null)
            {
                foreach (var toDefine in myChangeset.ToBeDefinedAttributes)
                {
                    Request.DefineAttribute(toDefine.ToUnknownAttributePredefinition());
                }
            }

            if (myChangeset.ToBeUndefinedAttributes != null)
            {
                foreach (var toUndefine in myChangeset.ToBeUndefinedAttributes)
                {
                    Request.UndefineAttribute(toUndefine);
                }
            }

            #endregion

            #region Rename Task

            if (myChangeset.ToBeRenamedProperties != null)
            {
                foreach (var toRename in myChangeset.ToBeRenamedProperties)
                {
                    Request.RenameAttribute(toRename.Key, toRename.Value);
                }
            }

            #endregion

            if (myChangeset.Comment != null)
            {
                Request.SetComment(myChangeset.Comment);
            }

            if (myChangeset.NewTypeName != null)
            {
                Request.RenameType(myChangeset.NewTypeName);
            }

            //todo add unknown attribute

            return(Request);
        }
Ejemplo n.º 14
0
 public static RequestGetVertexCount MakeRequestGetVertexCount(ServiceVertexType myVertexTypeName)
 {
     return(new RequestGetVertexCount(myVertexTypeName.Name));
 }
Ejemplo n.º 15
0
 public static RequestGetVertex MakeRequestGetVertex(ServiceVertexType myVertexType, Int64 myVertexID, String myEdition = null)
 {
     return(new RequestGetVertex(myVertexType.Name, myVertexID, myEdition));
 }
Ejemplo n.º 16
0
        public static RequestDropVertexType MakeRequestDropVertexType(ServiceVertexType myVertexType)
        {
            RequestDropVertexType Request = new RequestDropVertexType(myVertexType.Name);

            return(Request);
        }
Ejemplo n.º 17
0
        public static RequestDropIndex MakeRequestDropIndex(ServiceVertexType myVertexType, String myIndexName, String myEdition)
        {
            RequestDropIndex Request = new RequestDropIndex(myVertexType.Name, myIndexName, myEdition);

            return(Request);
        }
Ejemplo n.º 18
0
        public List <ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceVertexType myVertexType)
        {
            RequestGetVertices Request;

            if (myVertexType.Name == null)
            {
                Request = ServiceRequestFactory.MakeRequestGetVertices(myVertexType.ID);
            }
            else
            {
                Request = ServiceRequestFactory.MakeRequestGetVertices(myVertexType.Name);
            }
            var Response = this.GraphDS.GetVertices <IEnumerable <IVertex> >(mySecurityToken, myTransactionToken, Request,
                                                                             ServiceReturnConverter.ConvertOnlyVertices);

            return(Response.Select(x => new ServiceVertexInstance(x)).ToList());
        }
Ejemplo n.º 19
0
        public ServiceAttributeDefinition GetAttributeDefinitionByID(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, long myAttributeID)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(ConvertHelper.ToServiceAttributeDefinition(Response.GetAttributeDefinition(myAttributeID)));
        }
Ejemplo n.º 20
0
        public UInt64 GetVertexCount(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceVertexType myVertexType)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexCount(myVertexType);
            var Response = this.GraphDS.GetVertexCount <UInt64>(mySecurityToken, myTransactionToken, Request,
                                                                ServiceReturnConverter.ConvertOnlyCount);

            return(Response);
        }
Ejemplo n.º 21
0
        public ServiceIncomingEdgeDefinition GetIncomingEdgeDefinition(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, string myEdgeName)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(new ServiceIncomingEdgeDefinition(Response.GetIncomingEdgeDefinition(myEdgeName)));
        }
Ejemplo n.º 22
0
        public ServiceOutgoingEdgeDefinition GetOutgoingEdgeDefinition(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, string myEdgeName)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);
            var value    = Response.GetOutgoingEdgeDefinition(myEdgeName);

            if (value != null)
            {
                return(new ServiceOutgoingEdgeDefinition(value));
            }
            return(null);
        }
Ejemplo n.º 23
0
        public List <ServiceIndexDefinition> GetIndexDefinitions(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType, bool myIncludeAncestorDefinitions)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(Response.GetIndexDefinitions(myIncludeAncestorDefinitions).Select(x => new ServiceIndexDefinition(x)).ToList());
        }
Ejemplo n.º 24
0
        public List <ServiceVertexType> ChildrenVertexTypes(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myServiceVertexType)
        {
            var Request  = ServiceRequestFactory.MakeRequestGetVertexType(myServiceVertexType.Name);
            var Response = this.GraphDS.GetVertexType <IVertexType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertexType);

            return(Response.ChildrenVertexTypes.Select(x => new ServiceVertexType(x)).ToList());
        }