Permalink
Browse files

[GRAPHDB-543] bug fixed along with other changes

  • Loading branch information...
1 parent 4df84ee commit 2c932a9e839cd9e84f1b407a2fe1476a1fa69c8e Markus Zorn committed Nov 23, 2011
@@ -109,7 +109,6 @@ public TagExampleWithGraphMappingFramework(String[] myArgs)
Dictionary<string, object> RemoteAPIParameter = new Dictionary<string, object>();
RemoteAPIParameter.Add("IPAddress", IPAddress.Parse("127.0.0.1"));
RemoteAPIParameter.Add("Port", (ushort)9970);
- RemoteAPIParameter.Add("IsSecure", true);
_dsServer.StartService("sones.RemoteAPIService", RemoteAPIParameter);
#endregion
@@ -203,7 +202,7 @@ public virtual void OnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
public void Run()
{
- GraphDSClient = new GraphDS_RemoteClient(new Uri("https://localhost:9970/rpc"), true);
+ GraphDSClient = new GraphDS_RemoteClient(new Uri("http://localhost:9970/rpc"));
SecToken = GraphDSClient.LogOn(new RemoteUserPasswordCredentials("test", "test"));
TransToken = GraphDSClient.BeginTransaction(SecToken);
@@ -322,8 +322,6 @@ public TResult Update<TResult>(sones.Library.Commons.Security.SecurityToken mySe
var svcVertices = _GraphDSService.Update(
mySecurityToken,
myTransactionID,
- new ServiceVertexType(myRequestUpdate.GetVerticesRequest.VertexTypeName),
- myRequestUpdate.GetVerticesRequest.VertexIDs.ToList(),
new ServiceUpdateChangeset(myRequestUpdate));
var vertices = svcVertices.Select(x => new RemoteVertex(x, this));
RunningTime.Stop();

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -10,32 +10,55 @@ public partial class ServiceUpdateChangeset
{
internal ServiceUpdateChangeset(RequestUpdate myRequestUpdate)
{
+ this.VertexTypeName = myRequestUpdate.GetVerticesRequest.VertexTypeName;
+ this.VertexTypeID = myRequestUpdate.GetVerticesRequest.VertexTypeID;
+ this.VertexIDs = myRequestUpdate.GetVerticesRequest.VertexIDs.ToList();
+ this.Expression = (myRequestUpdate.GetVerticesRequest.Expression == null) ? null : ConvertHelper.ToServiceExpression(myRequestUpdate.GetVerticesRequest.Expression);
+
this.Comment = myRequestUpdate.UpdatedComment;
this.Edition = myRequestUpdate.UpdatedEdition;
- this.AddedElementsToCollectionProperties = new Dictionary<string,List<object>>();
- foreach(var item in myRequestUpdate.AddedElementsToCollectionProperties)
- this.AddedElementsToCollectionProperties.Add(item.Key, item.Value.Select(x => (object)x).ToList());
+ if (myRequestUpdate.AddedElementsToCollectionProperties != null)
+ {
+ this.AddedElementsToCollectionProperties = new Dictionary<string, List<object>>();
+ foreach (var item in myRequestUpdate.AddedElementsToCollectionProperties)
+ this.AddedElementsToCollectionProperties.Add(item.Key, item.Value.Select(x => (object)x).ToList());
+ }
- this.RemovedElementsFromCollectionProperties = new Dictionary<string,List<object>>();
- foreach(var item in myRequestUpdate.RemovedElementsFromCollectionProperties)
- this.RemovedElementsFromCollectionProperties.Add(item.Key, item.Value.Select(x => (object)x).ToList());
+ if (myRequestUpdate.RemovedElementsFromCollectionProperties != null)
+ {
+ this.RemovedElementsFromCollectionProperties = new Dictionary<string, List<object>>();
+ foreach (var item in myRequestUpdate.RemovedElementsFromCollectionProperties)
+ this.RemovedElementsFromCollectionProperties.Add(item.Key, item.Value.Select(x => (object)x).ToList());
+ }
- this.AddedElementsToCollectionEdges = new Dictionary<string,ServiceEdgePredefinition>();
- foreach (var item in myRequestUpdate.AddedElementsToCollectionEdges)
- this.AddedElementsToCollectionEdges.Add(item.Key, new ServiceEdgePredefinition(item.Value));
+ if (myRequestUpdate.AddedElementsToCollectionEdges != null)
+ {
+ this.AddedElementsToCollectionEdges = new Dictionary<string, ServiceEdgePredefinition>();
+ foreach (var item in myRequestUpdate.AddedElementsToCollectionEdges)
+ this.AddedElementsToCollectionEdges.Add(item.Key, new ServiceEdgePredefinition(item.Value));
+ }
- this.RemovedElementsFromCollectionEdges = new Dictionary<string,ServiceEdgePredefinition>();
- foreach (var item in myRequestUpdate.RemovedElementsFromCollectionEdges)
- this.RemovedElementsFromCollectionEdges.Add(item.Key, new ServiceEdgePredefinition(item.Value));
+ if (myRequestUpdate.RemovedElementsFromCollectionEdges != null)
+ {
+ this.RemovedElementsFromCollectionEdges = new Dictionary<string, ServiceEdgePredefinition>();
+ foreach (var item in myRequestUpdate.RemovedElementsFromCollectionEdges)
+ this.RemovedElementsFromCollectionEdges.Add(item.Key, new ServiceEdgePredefinition(item.Value));
+ }
+
- this.UpdatedUnstructuredProperties = myRequestUpdate.UpdatedUnstructuredProperties.ToDictionary(k => k.Key, v => v.Value);
- this.UpdatedStructuredProperties = myRequestUpdate.UpdatedStructuredProperties.ToDictionary(k => k.Key, v => (object)v.Value);
+ this.UpdatedUnstructuredProperties = (myRequestUpdate.UpdatedUnstructuredProperties == null)
+ ? null : myRequestUpdate.UpdatedUnstructuredProperties.ToDictionary(k => k.Key, v => v.Value);
+ this.UpdatedStructuredProperties = (myRequestUpdate.UpdatedStructuredProperties == null)
+ ? null : myRequestUpdate.UpdatedStructuredProperties.ToDictionary(k => k.Key, v => (object)v.Value);
- this.UpdatedOutgoingEdges = myRequestUpdate.UpdateOutgoingEdges.Select(x => new ServiceEdgePredefinition(x)).ToList();
- this.UpdateOutgoingEdgesProperties = myRequestUpdate.UpdateOutgoingEdgesProperties.Select(x => new ServiceSingleEdgeUpdateDefinition(x)).ToList();
+ this.UpdatedOutgoingEdges = (myRequestUpdate.UpdateOutgoingEdges == null)
+ ? null : myRequestUpdate.UpdateOutgoingEdges.Select(x => new ServiceEdgePredefinition(x)).ToList();
+ this.UpdateOutgoingEdgesProperties = (myRequestUpdate.UpdateOutgoingEdgesProperties == null)
+ ? null : myRequestUpdate.UpdateOutgoingEdgesProperties.Select(x => new ServiceSingleEdgeUpdateDefinition(x)).ToList();
- this.UpdatedUnknownProperties = myRequestUpdate.UpdatedUnknownProperties.ToDictionary(k => k.Key, v => v.Value);
+ this.UpdatedUnknownProperties = (myRequestUpdate.UpdatedUnknownProperties == null)
+ ? null : myRequestUpdate.UpdatedUnknownProperties.ToDictionary(k => k.Key, v => v.Value);
this.RemovedAttributes = myRequestUpdate.RemovedAttributes;
}
}
@@ -26,12 +26,27 @@
using sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceRequests;
using sones.GraphDS.Services.RemoteAPIService.DataContracts.InstanceObjects;
using sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceTypeManagement;
+using sones.GraphDS.Services.RemoteAPIService.DataContracts.ServiceRequests.Expression;
namespace sones.GraphDS.Services.RemoteAPIService.DataContracts.ChangesetObjects
{
[DataContract(Namespace = sonesRPCServer.Namespace)]
public class ServiceUpdateChangeset
{
+ // getvertexrequest
+ [DataMember]
+ public String VertexTypeName;
+
+ [DataMember]
+ public Int64 VertexTypeID;
+
+ [DataMember]
+ public List<Int64> VertexIDs;
+
+ [DataMember]
+ public ServiceBaseExpression Expression;
+
+ // updaterequest
[DataMember]
public String Comment;
@@ -56,9 +71,6 @@ public class ServiceUpdateChangeset
[DataMember]
public Dictionary<String, IComparable> UpdatedStructuredProperties;
- //[DataMember]
- //public IDictionary<String, Stream> UpdatedBinaryProperties;
-
[DataMember]
public List<ServiceEdgePredefinition> UpdatedOutgoingEdges;
@@ -181,21 +181,21 @@ public List<ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, In
RequestGetVertices Request;
if (myVertexType.Name == null)
{
- Request = new RequestGetVertices(myVertexType.ID);
+ Request = ServiceRequestFactory.MakeRequestGetVertices(myVertexType.ID);
}
else
{
- Request = ServiceRequestFactory.MakeRequestGetVertices(myVertexType);
+ 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();
}
- public List<ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, long myTransToken, ServiceBaseExpression myExpression)
+ public List<ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, long myTransactionToken, ServiceBaseExpression myExpression)
{
var Request = ServiceRequestFactory.MakeRequestGetVertices(myExpression);
- var Response = this.GraphDS.GetVertices<IEnumerable<IVertex>>(mySecurityToken, myTransToken, Request,
+ var Response = this.GraphDS.GetVertices<IEnumerable<IVertex>>(mySecurityToken, myTransactionToken, Request,
ServiceReturnConverter.ConvertOnlyVertices);
return Response.Select(x => new ServiceVertexInstance(x)).ToList();
}
@@ -245,14 +245,14 @@ public List<ServiceVertexInstance> GetVertices(SecurityToken mySecurityToken, lo
return Response.Select(x => new ServiceIndexDefinition(x)).ToList();
}
- public List<ServiceIndexDefinition> DescribeIndicesByNames(SecurityToken mySecurityToken, Int64 myTransToken,
+ public List<ServiceIndexDefinition> DescribeIndicesByNames(SecurityToken mySecurityToken, Int64 myTransactionToken,
String myVertexTypeName, List<String> myIndexNames)
{
var ResponseList = new List<ServiceIndexDefinition>();
foreach (var item in myIndexNames)
{
var Request = ServiceRequestFactory.MakeRequestDescribeIndex(myVertexTypeName, item);
- var Response = this.GraphDS.DescribeIndex<IEnumerable<IIndexDefinition>>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConverteOnlyIndexDefinitions);
+ var Response = this.GraphDS.DescribeIndex<IEnumerable<IIndexDefinition>>(mySecurityToken, myTransactionToken, Request, ServiceReturnConverter.ConverteOnlyIndexDefinitions);
foreach (var index in Response)
{
ResponseList.Add(new ServiceIndexDefinition(index));
@@ -290,56 +290,56 @@ public ServiceQueryResult Query(SecurityToken mySecurityToken, Int64 myTransacti
return new ServiceQueryResult(this.GraphDS.Query(mySecurityToken, myTransactionToken, myQueryString, myLanguage));
}
- public List<ServiceVertexInstance> Update(SecurityToken mySecurityToken, Int64 myTransToken, ServiceVertexType myVertexType, IEnumerable<long> myVertexIDs, ServiceUpdateChangeset myUpdateChangeset)
+ public List<ServiceVertexInstance> Update(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceUpdateChangeset myUpdateChangeset)
{
- var Request = ServiceRequestFactory.MakeRequestUpdate(myVertexType, myVertexIDs, myUpdateChangeset);
- var Response = this.GraphDS.Update<IEnumerable<IVertex>>(mySecurityToken, myTransToken, Request, ServiceReturnConverter.ConvertOnlyVertices);
+ var Request = ServiceRequestFactory.MakeRequestUpdate(myUpdateChangeset);
+ var Response = this.GraphDS.Update<IEnumerable<IVertex>>(mySecurityToken, myTransactionToken, Request, ServiceReturnConverter.ConvertOnlyVertices);
return Response.Select(x => new ServiceVertexInstance(x)).ToList();
}
- public ServiceVertexType GetVertexType(SecurityToken mySecurityToken, Int64 myTransToken, string myVertexTypeName)
+ public ServiceVertexType GetVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken, string myVertexTypeName)
{
var Request = ServiceRequestFactory.MakeRequestGetVertexType(myVertexTypeName);
- var Response = this.GraphDS.GetVertexType<IVertexType>(mySecurityToken, myTransToken, Request,
+ var Response = this.GraphDS.GetVertexType<IVertexType>(mySecurityToken, myTransactionToken, Request,
ServiceReturnConverter.ConvertOnlyVertexType);
return new ServiceVertexType(Response);
}
- public ServiceVertexType GetVertexType(SecurityToken mySecurityToken, Int64 myTransToken, Int64 myVertexTypeID)
+ public ServiceVertexType GetVertexType(SecurityToken mySecurityToken, Int64 myTransactionToken, Int64 myVertexTypeID)
{
var Request = ServiceRequestFactory.MakeRequestGetVertexType(myVertexTypeID);
- var Response = this.GraphDS.GetVertexType<IVertexType>(mySecurityToken, myTransToken, Request,
+ var Response = this.GraphDS.GetVertexType<IVertexType>(mySecurityToken, myTransactionToken, Request,
ServiceReturnConverter.ConvertOnlyVertexType);
return new ServiceVertexType(Response);
}
- public void CommitTransaction(SecurityToken mySecurityToken, Int64 myTransToken)
+ public void CommitTransaction(SecurityToken mySecurityToken, Int64 myTransactionToken)
{
- this.GraphDS.CommitTransaction(mySecurityToken, myTransToken);
+ this.GraphDS.CommitTransaction(mySecurityToken, myTransactionToken);
}
- public void RollbackTransaction(SecurityToken mySecurityToken, Int64 myTransToken)
+ public void RollbackTransaction(SecurityToken mySecurityToken, Int64 myTransactionToken)
{
- this.GraphDS.RollbackTransaction(mySecurityToken, myTransToken);
+ this.GraphDS.RollbackTransaction(mySecurityToken, myTransactionToken);
}
public void Shutdown(SecurityToken mySecurityToken)
{
this.GraphDS.Shutdown(mySecurityToken);
}
- public void RebuildIndices(SecurityToken mySecurityToken, long myTransToken, IEnumerable<string> myVertexTypeNames)
+ public void RebuildIndices(SecurityToken mySecurityToken, long myTransactionToken, IEnumerable<string> myVertexTypeNames)
{
var Request = ServiceRequestFactory.MakeRequestRebuildIndices(myVertexTypeNames);
- var Response = this.GraphDS.RebuildIndices(mySecurityToken, myTransToken, Request, (Statistics) => Statistics);
+ var Response = this.GraphDS.RebuildIndices(mySecurityToken, myTransactionToken, Request, (Statistics) => Statistics);
return;
}
- public void TruncateVertexType(SecurityToken mySecurityToken, long myTransToken, string myVertexTypeName)
+ public void TruncateVertexType(SecurityToken mySecurityToken, long myTransactionToken, string myVertexTypeName)
{
var Request = ServiceRequestFactory.MakeRequestTruncate(myVertexTypeName);
- this.GraphDS.Truncate(mySecurityToken, myTransToken, Request, (x) => x);
+ this.GraphDS.Truncate(mySecurityToken, myTransactionToken, Request, (x) => x);
}
}
}
@@ -180,8 +180,7 @@ public interface IGraphDS_API
//List<ServiceVertexInstance>Traverse(SecurityToken mySecToken, Int64 myTransactionToken);
[OperationContract]
- List<ServiceVertexInstance> Update(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceVertexType myVertexType, IEnumerable<Int64> myVertexIDs,
- ServiceUpdateChangeset myUpdateChangeset);
+ List<ServiceVertexInstance> Update(SecurityToken mySecurityToken, Int64 myTransactionToken, ServiceUpdateChangeset myUpdateChangeset);
[OperationContract]
void RebuildIndices(SecurityToken mySecurityToken, Int64 myTransactionToken, IEnumerable<String> myVertexTypeNames);
Oops, something went wrong.

0 comments on commit 2c932a9

Please sign in to comment.