Ejemplo n.º 1
0
 public ServiceEdgeType AlterEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
     ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset)
 {
     var Request = ServiceRequestFactory.MakeRequestAlterEdgeType(myEdgeType, myChangeset);
     var Response = this.GraphDS.AlterEdgeType<IEdgeType>(mySecurityToken, myTransactionToken, Request,
        ServiceReturnConverter.ConvertOnlyEdgeType);
     return new ServiceEdgeType(Response);
 }
 public ServiceOutgoingEdgeDefinition(IOutgoingEdgeDefinition myOutgoingEdgeDefinition)
     : base(myOutgoingEdgeDefinition)
 {
     this.EdgeType = new ServiceEdgeType(myOutgoingEdgeDefinition.EdgeType);
     this.InnerEdgeType = new ServiceEdgeType(myOutgoingEdgeDefinition.InnerEdgeType);
     this.SourceVertexType = new ServiceVertexType(myOutgoingEdgeDefinition.SourceVertexType);
     this.TargetVertexType = new ServiceVertexType(myOutgoingEdgeDefinition.TargetVertexType);
     this.Multiplicity = ConvertHelper.ToServiceEdgeMultiplicity(myOutgoingEdgeDefinition.Multiplicity);
 }
Ejemplo n.º 3
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.º 4
0
        public static RequestAlterEdgeType MakeRequestAlterEdgeType(ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset)
        {
            var Request = new RequestAlterEdgeType(myEdgeType.Name);

            #region Add Attributes

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

            #endregion

            #region Remove Attributes

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

            #endregion

            #region Rename Task

            if (myChangeset.ToBeRenamedProperties != null)
            {
                foreach(var item in myChangeset.ToBeRenamedProperties)
                {
                    Request.RenameAttribute(item.Key, item.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.º 5
0
 public static RequestDropEdgeType MakeRequestDropEdgeType(ServiceEdgeType myEdgeType)
 {
     RequestDropEdgeType Request = new RequestDropEdgeType(myEdgeType.Name);
     return Request;
 }
Ejemplo n.º 6
0
 public List<ServiceEdgeType> GetDescendantEdgeTypesAndSelf(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.GetDescendantEdgeTypesAndSelf().Select(x => new ServiceEdgeType(x)).ToList();
 }
Ejemplo n.º 7
0
 public List<ServiceAttributeDefinition> GetAttributeDefinitions(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, bool myIncludeAncestorDefinitions)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.GetAttributeDefinitions(myIncludeAncestorDefinitions).Select(x => ConvertHelper.ToServiceAttributeDefinition(x)).ToList();
 }
Ejemplo n.º 8
0
 public ServiceAttributeDefinition GetAttributeDefinitionByID(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, long myAttributeID)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return ConvertHelper.ToServiceAttributeDefinition(Response.GetAttributeDefinition(myAttributeID));
 }
Ejemplo n.º 9
0
 public ServiceEdgeType ParentEdgeType(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return new ServiceEdgeType(Response.ParentEdgeType);
 }
Ejemplo n.º 10
0
 public bool IsDescendantOrSelf(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, ServiceEdgeType myOtherType)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myOtherType.Name);
     var BaseType = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.IsDescendantOrSelf(BaseType);
 }
Ejemplo n.º 11
0
 public bool HasProperty(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, string myAttributeName)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.HasProperty(myAttributeName);
 }
Ejemplo n.º 12
0
 public bool HasProperties(SecurityToken mySecurityToken, Int64 myTransToken, ServiceEdgeType myServiceEdgeType, bool myIncludeAncestorDefinitions)
 {
     var Request = ServiceRequestFactory.MakeRequestGetEdgeType(myServiceEdgeType.Name);
     var Response = this.GraphDS.GetEdgeType<IEdgeType>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyEdgeType);
     return Response.HasProperties(myIncludeAncestorDefinitions);
 }
Ejemplo n.º 13
0
 public Dictionary<Int64, String> DropEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
     ServiceEdgeType myEdgeType)
 {
     var Request = ServiceRequestFactory.MakeRequestDropEdgeType(myEdgeType);
     var Response = this.GraphDS.DropEdgeType<Dictionary<Int64, String>>(mySecurityToken, myTransactionToken, Request,
         ServiceReturnConverter.ConverteOnlyDeletedTypeIDs);
     return Response;
 }