/// <summary>
 /// Adds a new Space to the repository, identified by the specified parameter.
 /// </summary>
 public void AddSpace(string identifier, IObjectSpaceSimple objectspace)
 {
     if (!this.spaces.ContainsKey(identifier))
     {
         this.spaces.Add(identifier, objectspace);
     }
 }
Example #2
0
        private IMessage ExecuteHelper <T>(ObjectQueryRequest <T> request)
        {
            IObjectSpaceSimple ts = this.repository.GetSpace(request.Target);

            if (ts != null)
            {
                T result = ts.Query <T>();
                return(new ObjectQueryResponse <T>(request.Source, request.Session, request.Target, result, StatusCode.OK, StatusMessage.OK));
            }
            return(new ObjectQueryResponse <T>(request.Source, request.Session, request.Target, default(T), StatusCode.NOT_FOUND, StatusMessage.NOT_FOUND));
        }
Example #3
0
        private IMessage ExecuteHelper <T>(ObjectGetAllRequest <T> request)
        {
            IObjectSpaceSimple ts = this.repository.GetSpace(request.Target);

            if (ts != null)
            {
                IEnumerable <T> results = ts.GetAll <T>();
                return(new ObjectGetAllResponse <T>(request.Source, request.Session, request.Target, results, StatusCode.OK, StatusMessage.OK));
            }
            return(new ObjectGetAllResponse <T>(request.Source, request.Session, request.Target, new List <T>(), StatusCode.NOT_FOUND, StatusMessage.NOT_FOUND));
        }
Example #4
0
        private IMessage ExecuteHelper <T>(ObjectPutRequest <T> request)
        {
            IObjectSpaceSimple ts = this.repository.GetSpace(request.Target);

            if (ts != null)
            {
                ts.Put(request.Element);
                return(new ObjectPutResponse <T>(request.Source, request.Session, request.Target, StatusCode.OK, StatusMessage.OK));
            }
            return(new ObjectPutResponse <T>(request.Source, request.Session, request.Target, StatusCode.NOT_FOUND, StatusMessage.NOT_FOUND));
        }
Example #5
0
 public Consumer(string name, IObjectSpaceSimple ts) : base(name, ts)
 {
 }
 public ObjectSpaceAgentBaseSimple(string name, IObjectSpaceSimple space)
 {
     this.name = name;
     this.space = space;
 }