Exemple #1
0
        public SequencedMessage GetPageItems(DataMessage dataMessage)
        {
            int      sequenceId = (int)dataMessage.headers[DataMessage.SequenceIdHeader];
            Sequence sequence   = GetSequence(sequenceId);

            if (sequence != null)
            {
                IList DSids = dataMessage.headers["DSids"] as IList;
                //ArrayList items = new ArrayList(DSids.Count);
                SequencedMessage sequencedMessage = new SequencedMessage();
                object[]         items            = new object[DSids.Count];
                lock (_objLock)
                {
                    for (int i = 0; i < DSids.Count; i++)
                    {
                        Identity    identity    = new Identity(DSids[i] as IDictionary);
                        ItemWrapper itemWrapper = GetItem(identity);
                        //items.Add(item);
                        items[i] = itemWrapper.Instance;
                    }

                    sequencedMessage.destination     = dataMessage.destination;
                    sequencedMessage.sequenceId      = sequence.Id;
                    sequencedMessage.sequenceSize    = sequence.Size;
                    sequencedMessage.sequenceProxies = null;

                    sequencedMessage.body = items;
                }
                return(sequencedMessage);
            }
            else
            {
                DataServiceException dse = new DataServiceException(string.Format("Sequence {0} in destination {1} was not found", sequenceId, dataMessage.destination));
                throw dse;
            }
        }
		public PagedMessage GetPage(DataMessage dataMessage)
		{
			int sequenceId = (int)dataMessage.headers[DataMessage.SequenceIdHeader];
			Sequence sequence = GetSequence(sequenceId);
            if (sequence != null)
                return GetPagedMessage(dataMessage, sequence);
            else
            {
                DataServiceException dse = new DataServiceException(string.Format("Sequence {0} in destination {1} was not found", sequenceId, dataMessage.destination));
                throw dse;
            }
		}
		public SequencedMessage GetPageItems(DataMessage dataMessage)
		{
			int sequenceId = (int)dataMessage.headers[DataMessage.SequenceIdHeader];
			Sequence sequence = GetSequence(sequenceId);
            if (sequence != null)
            {
                IList DSids = dataMessage.headers["DSids"] as IList;
                //ArrayList items = new ArrayList(DSids.Count);
                SequencedMessage sequencedMessage = new SequencedMessage();
                object[] items = new object[DSids.Count];
                lock (_objLock)
                {
                    for (int i = 0; i < DSids.Count; i++)
                    {
                        Identity identity = new Identity(DSids[i] as IDictionary);
                        ItemWrapper itemWrapper = GetItem(identity);
                        //items.Add(item);
                        items[i] = itemWrapper.Instance;
                    }

                    sequencedMessage.destination = dataMessage.destination;
                    sequencedMessage.sequenceId = sequence.Id;
                    sequencedMessage.sequenceSize = sequence.Size;
                    sequencedMessage.sequenceProxies = null;

                    sequencedMessage.body = items;
                }
                return sequencedMessage;
            }
            else
            {
                DataServiceException dse = new DataServiceException(string.Format("Sequence {0} in destination {1} was not found", sequenceId, dataMessage.destination));
                throw dse;
            }
		}