Пример #1
0
        public SPServiceApplicationProxy CreateProxy(string name, SPServiceApplication serviceApplication, SPServiceProvisioningContext provisioningContext)
        {
            if (serviceApplication.GetType() != typeof(NodeServiceApplication))
            {
                throw new NotSupportedException();
            }
            if (serviceApplication == null)
            {
                throw new ArgumentNullException("serviceApplication");
            }

            // Verify the service proxy exists.
            NodeServiceProxy serviceProxy = (NodeServiceProxy)this.Farm.GetObject(name, this.Farm.Id, typeof(NodeServiceProxy));

            if (serviceProxy == null)
            {
                throw new InvalidOperationException("NodeServiceProxy does not exist in the farm.");
            }

            // If the application proxy doesn't exist, create it.
            NodeServiceApplicationProxy applicationProxy = serviceProxy.ApplicationProxies.GetValue <NodeServiceApplicationProxy>(name);

            if (applicationProxy == null)
            {
                Uri serviceAppAddress = ((NodeServiceApplication)serviceApplication).Uri;
                applicationProxy = new NodeServiceApplicationProxy(name, serviceProxy, serviceAppAddress);
            }

            return(applicationProxy);
        }
Пример #2
0
        public QueryResponse QueryMapByDomain(GlymaSessionConfiguration configuration, Guid domainId, int maxDepth, EdgeConditions edgeConditions, FilterConditions filterConditions)
        {
            QueryResponse result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.QueryMapByDomain(configuration, domainId, maxDepth, edgeConditions, filterConditions));

            return(result);
        }
Пример #3
0
        public MapParameter AddBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, MapParameter node, MapParameter relationship, DescriptorType descriptorType, MetadataType metadataType, string name, string value)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.AddBulkMetadata(configuration, sessionId, responseParameter, domainId, rootMapId, node, relationship, descriptorType, metadataType, name, value));

            return(result);
        }
Пример #4
0
        public int DeleteRootMap(GlymaSessionConfiguration configuration, Guid domainId, Guid rootMapId)
        {
            int result = 0;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.DeleteRootMap(configuration, domainId, rootMapId));

            return(result);
        }
Пример #5
0
        public Guid BeginTransaction(GlymaSessionConfiguration configuration)
        {
            Guid result = Guid.Empty;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.BeginTransaction(configuration));

            return(result);
        }
Пример #6
0
        public bool IsSessionCompleted(GlymaSessionConfiguration configuration, Guid sessionId)
        {
            bool result = false;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.IsSessionCompleted(configuration, sessionId));

            return(result);
        }
Пример #7
0
        public QueryResponse CreateRootMap(GlymaSessionConfiguration configuration, Guid domainId, string name, NodeType nodeType, string originalId)
        {
            QueryResponse result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.CreateRootMap(configuration, domainId, name, nodeType, originalId));

            return(result);
        }
Пример #8
0
        public MapParameter AddBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter rootMapId, NodeType nodeType, string originalId)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.AddBulkNode(configuration, sessionId, responseParameter, domainId, rootMapId, nodeType, originalId));

            return(result);
        }
Пример #9
0
        public MapResponse CreateDomain(GlymaSessionConfiguration configuration, string name)
        {
            MapResponse result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.CreateDomain(configuration, name));

            return(result);
        }
Пример #10
0
        public Dictionary <Guid, QueryResponse> QueryDomains(GlymaSessionConfiguration configuration)
        {
            Dictionary <Guid, QueryResponse> result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.QueryDomains(configuration));

            return(result);
        }
Пример #11
0
        public MapParameter DeleteMetadata(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter metadata)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.DeleteMetadata(configuration, sessionId, domainId, metadata));

            return(result);
        }
Пример #12
0
        public MapParameter DeleteBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.DeleteBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId));

            return(result);
        }
Пример #13
0
        public MapParameter UpdateBulkRelationship(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter relationshipId, Dictionary <DescriptorType, MapParameter> nodes, RelationshipType relationshipType)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.UpdateBulkRelationship(configuration, sessionId, responseParameter, domainId, relationshipId, nodes, relationshipType));

            return(result);
        }
Пример #14
0
        public GlymaVersion GetApplicationVersion()
        {
            GlymaVersion result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.GetApplicationVersion());

            return(result);
        }
Пример #15
0
        public MapParameter AddRelationship(GlymaSessionConfiguration configuration, Guid sessionId, MapParameter domainId, MapParameter rootMapId, Dictionary <DescriptorType, MapParameter> nodes, RelationshipType relationshipType, string originalId)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.AddRelationship(configuration, sessionId, domainId, rootMapId, nodes, relationshipType, originalId));

            return(result);
        }
Пример #16
0
        public MapParameter UpdateBulkNode(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter nodeId, NodeType nodeType)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.UpdateBulkNode(configuration, sessionId, responseParameter, domainId, nodeId, nodeType));

            return(result);
        }
Пример #17
0
        public MapResponse CompleteTransaction(GlymaSessionConfiguration configuration, Guid sessionId)
        {
            MapResponse result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.CompleteTransaction(configuration, sessionId));

            return(result);
        }
Пример #18
0
        public MapParameter UpdateBulkMetadata(GlymaSessionConfiguration configuration, Guid sessionId, Guid responseParameter, MapParameter domainId, MapParameter metadata, string name, string value)
        {
            MapParameter result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.UpdateBulkMetadata(configuration, sessionId, responseParameter, domainId, metadata, name, value));

            return(result);
        }
Пример #19
0
        public TypeResponse GetAllMapTypes(GlymaSessionConfiguration configuration)
        {
            TypeResponse result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.GetAllMapTypes(configuration));

            return(result);
        }
Пример #20
0
        public SearchMapResult SearchMap(GlymaSessionConfiguration configuration, Guid domainId, Guid rootMapUid, SearchConditions conditions, int pageNumber, int pageSize)
        {
            if (pageNumber == 0)
            {
                pageNumber = 1;
            }

            if (pageSize == 0)
            {
                pageSize = 5;
            }

            SearchMapResult result = null;

            // run the call against the application proxy
            NodeServiceApplicationProxy.Invoke(_serviceContext,
                                               proxy => result = proxy.SearchMap(configuration, domainId, rootMapUid, conditions, pageNumber, pageSize));

            return(result);
        }
Пример #21
0
        internal static void Invoke(SPServiceContext serviceContext, CodeToRunOnApplicationProxy codeBlock)
        {
            if (serviceContext == null)
            {
                throw new ArgumentNullException("serviceContext");
            }

            // Get service app proxy from the context.
            NodeServiceApplicationProxy proxy = (NodeServiceApplicationProxy)serviceContext.GetDefaultProxy(typeof(NodeServiceApplicationProxy));

            if (proxy == null)
            {
                throw new InvalidOperationException("Unable to obtain object reference to node service proxy.");
            }

            // Run the code block on the proxy.
            using (new SPServiceContextScope(serviceContext))
            {
                codeBlock(proxy);
            }
        }