/Plugins/GraphDS/Services/Implementations/RemoteAPIService/ServiceContracts/API Services/IGraphDS_API.cs

https://github.com/karsten-wolfert/sones · C# · 192 lines · 132 code · 39 blank · 21 comment · 0 complexity · be42751069f7678a38f0dabc0ae14922 MD5 · raw file

  1. /*
  2. * sones GraphDB - Community Edition - http://www.sones.com
  3. * Copyright (C) 2007-2011 sones GmbH
  4. *
  5. * This file is part of sones GraphDB Community Edition.
  6. *
  7. * sones GraphDB is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as published by
  9. * the Free Software Foundation, version 3 of the License.
  10. *
  11. * sones GraphDB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with sones GraphDB. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. using System;
  21. using System.Collections.Generic;
  22. using System.Linq;
  23. using System.Text;
  24. using System.ServiceModel;
  25. using sones.Library.Commons.Security;
  26. using sones.Library.Commons.Transaction;
  27. using sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceRequests;
  28. using sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceTypeManagement;
  29. using sones.GraphDS.Services.RemoteAPIService.DataContracts.QueryResult;
  30. using sones.GraphDS.Services.RemoteAPIService.DataContracts;
  31. using sones.GraphDS.Services.RemoteAPIService.DataContracts.ChangesetObjects;
  32. using sones.GraphDS.Services.RemoteAPIService.DataContracts.InsertPayload;
  33. using sones.GraphDS.Services.RemoteAPIService.DataContracts.PayloadObjects;
  34. using sones.GraphDS.Services.RemoteAPIService.DataContracts.InstanceObjects;
  35. using sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceRequests.Expression;
  36. using sones.GraphDB.TypeSystem;
  37. using sones.Library.CollectionWrapper;
  38. namespace sones.GraphDS.Services.RemoteAPIService.API_Services
  39. {
  40. [ServiceContract(Namespace = sonesRPCServer.Namespace, Name = "GraphDSService")]
  41. [ServiceKnownType(typeof(ServicePropertyMultiplicity))]
  42. public interface IGraphDS_API
  43. {
  44. [OperationContract]
  45. ServiceVertexType CreateVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken,
  46. ServiceVertexTypePredefinition myVertexTypePreDef);
  47. [OperationContract]
  48. ServiceVertexType AlterVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken,
  49. ServiceVertexType myVertexType, ServiceAlterVertexChangeset myChangeset);
  50. [OperationContract]
  51. ServiceEdgeType AlterEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
  52. ServiceEdgeType myEdgeType, ServiceAlterEdgeChangeset myChangeset);
  53. [OperationContract(Name="GetVertexTypeByName")]
  54. ServiceVertexType GetVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken, String myVertexTypeName);
  55. [OperationContract(Name="GetVertexTypeByID")]
  56. ServiceVertexType GetVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken, Int64 myVertexTypeID);
  57. [OperationContract]
  58. Int64 BeginTransaction(SecurityToken mySecurityToken);
  59. [OperationContract]
  60. void CommitTransaction(SecurityToken mySecurityToken, Int64 myTransactionToken);
  61. [OperationContract]
  62. void RollbackTransaction(SecurityToken mySecurityToken, Int64 myTransactionToken);
  63. [OperationContract]
  64. void Shutdown(SecurityToken mySecurityToken);
  65. [OperationContract]
  66. List<Int64> Clear(SecurityToken mySecurityToken, Int64 myTransactionToken);
  67. [OperationContract]
  68. ServiceEdgeType CreateEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
  69. ServiceEdgeTypePredefinition myEdgeTypePreDef);
  70. [OperationContract]
  71. List<ServiceEdgeType> CreateEdgeTypes(SecurityToken mySecurityToken, Int64 myTransactionToken,
  72. IEnumerable<ServiceEdgeTypePredefinition> myEdgeTypePreDef);
  73. [OperationContract]
  74. ServiceIndexDefinition CreateIndex(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceIndexPredefinition myVertexTypePreDef);
  75. [OperationContract]
  76. List<ServiceVertexType> CreateVertexTypes(SecurityToken mySecurityToken, Int64 myTransactionToken,
  77. List<ServiceVertexTypePredefinition> myVertexTypePreDef);
  78. [OperationContract]
  79. Tuple<IEnumerable<IComparable>, IEnumerable<IComparable>> Delete(SecurityToken mySecurityToken, Int64 myTransactionToken,
  80. ServiceVertexType myVertexType, IEnumerable<Int64> myVertexIDs = null, ServiceDeletePayload myDeletePayload = null);
  81. [OperationContract]
  82. ServiceIndexDefinition DescribeIndex(SecurityToken mySecurityToken, Int64 myTransactionToken,
  83. String myVertexTypeName, String myIndexName);
  84. [OperationContract]
  85. List<ServiceIndexDefinition> DescribeIndices(SecurityToken mySecurityToken, Int64 myTransactionToken,
  86. String myVertexTypeName);
  87. [OperationContract]
  88. List<ServiceIndexDefinition> DescribeIndicesByNames(SecurityToken mySecurityToken, Int64 myTransactionToken,
  89. String myVertexTypeName, List<String> myIndexNames);
  90. [OperationContract]
  91. Dictionary<Int64, String> DropEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken,
  92. ServiceEdgeType myEdgeType);
  93. [OperationContract]
  94. void DropIndex(SecurityToken mySecurityToken, Int64 myTransactionToken,
  95. ServiceVertexType myVertexType, String myIndexName, String myEdition);
  96. [OperationContract]
  97. Dictionary<Int64, String> DropVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken,
  98. ServiceVertexType myVertexType);
  99. [OperationContract]
  100. List<ServiceEdgeType> GetAllEdgeTypes(SecurityToken mySecurityToken, Int64 myTransactionToken,
  101. String myEdition);
  102. [OperationContract]
  103. List<ServiceVertexType> GetAllVertexTypes(SecurityToken mySecurityToken, Int64 myTransactionToken,
  104. String myEdition);
  105. [OperationContract(Name="GetEdgeTypeByName")]
  106. ServiceEdgeType GetEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken, String myEdgeTypeName, String myEdition = null);
  107. [OperationContract(Name="GetEdgeTypeByID")]
  108. ServiceEdgeType GetEdgeType(SecurityToken mySecurityToken, Int64 myTransactionToken, Int64 myEdgeTypeID, String myEdition = null);
  109. [OperationContract]
  110. ServiceVertexInstance GetVertex(SecurityToken mySecurityToken, Int64 myTransactionToken,
  111. ServiceVertexType myVertexType, Int64 myVertexID);
  112. [OperationContract]
  113. UInt64 GetVertexCount(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceVertexType myVertexType);
  114. [OperationContract(Name = "GetVerticesByType")]
  115. List<ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceVertexType myVertexType);
  116. [OperationContract(Name = "GetVerticesByExpression")]
  117. [ServiceKnownType(typeof(ServiceBinaryExpression))]
  118. [ServiceKnownType(typeof(ServiceBinaryOperator))]
  119. [ServiceKnownType(typeof(ServiceUnaryExpression))]
  120. [ServiceKnownType(typeof(ServiceUnaryLogicOperator))]
  121. [ServiceKnownType(typeof(ServicePropertyExpression))]
  122. [ServiceKnownType(typeof(ServiceSingleLiteralExpression))]
  123. [ServiceKnownType(typeof(ServiceRangeLiteralExpression))]
  124. [ServiceKnownType(typeof(ServiceCollectionLiteralExpression))]
  125. List<ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceBaseExpression myExpression);
  126. [OperationContract]
  127. ServiceVertexInstance Insert(SecurityToken mySecurityToken, Int64 myTransactionToken, String myVertexTypeName,
  128. ServiceInsertPayload myPayload);
  129. [OperationContract]
  130. void LogOff(SecurityToken mySecurityToken);
  131. [OperationContract]
  132. SecurityToken LogOn(ServiceUserPasswordCredentials myUserCredentials);
  133. [OperationContract]
  134. [ServiceKnownType(typeof(ServiceVertexView))]
  135. [ServiceKnownType(typeof(ServiceEdgeView))]
  136. [ServiceKnownType(typeof(ServiceHyperEdgeView))]
  137. [ServiceKnownType(typeof(ServiceSingleEdgeView))]
  138. [ServiceKnownType(typeof(ServicePropertyMultiplicity))]
  139. [ServiceKnownType(typeof(ServiceIndexDefinition))]
  140. [ServiceKnownType(typeof(ServiceEdgeMultiplicity))]
  141. [ServiceKnownType(typeof(ListCollectionWrapper))]
  142. ServiceQueryResult Query(SecurityToken mySecToken, Int64 myTransactionToken, String myQueryString, String myLanguage);
  143. //[OperationContract] There is no plan to implement the Travers method yet, because there is no way to transport traverser logic from the client
  144. //List<ServiceVertexInstance>Traverse(SecurityToken mySecToken, Int64 myTransactionToken);
  145. [OperationContract]
  146. List<ServiceVertexInstance> Update(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceVertexType myVertexType, IEnumerable<Int64> myVertexIDs,
  147. ServiceUpdateChangeset myUpdateChangeset);
  148. [OperationContract]
  149. void RebuildIndices(SecurityToken mySecurityToken, Int64 myTransactionToken, IEnumerable<String> myVertexTypeNames);
  150. [OperationContract]
  151. void TruncateVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken, String myVertexTypeName);
  152. }
  153. }