public Resource(RestItem restItem, IConnectClient client)
            : base(restItem, client)
        {
            Logger = LogManager.GetLogger(typeof(Resource).ToString());
            Logger.DebugFormat("Instantiated fixtureName=\"{0}\" fixtureId=\"{1}\"", restItem.Name, Id);

            _pauseStream = new ManualResetEvent(true);
        }
 internal Resource(NameValueCollection headers, RestItem restItem)
     : base(headers, restItem)
 {
     _logger.DebugFormat("Instantiated fixtureName=\"{0}\"", restItem.Name);
     _pauseStream = new ManualResetEvent(true);
     _echoResetEvent = new AutoResetEvent(false);
     _echoTimerEvent = new AutoResetEvent(true);
 }
 internal Endpoint(NameValueCollection headers, RestItem restItem)
 {
     Headers = headers;
     State = restItem;
 }
 internal Feature(NameValueCollection headers, RestItem restItem)
     : base(headers, restItem)
 {
 }
 internal Endpoint(RestItem restItem, IConnectClient connectClient)
 {
     State = restItem;
     ConnectClient = connectClient;
 }
        /// <summary>
        ///     Creates a RestItem object for testing purposes as
        ///     it was returned by the UDAPI service
        /// </summary>
        /// <param name="properties"></param>
        /// <returns></returns>
        private static RestItem GetRestItem(Dictionary<string, string> properties)
        {
            string id = properties.ContainsKey("id") ? properties["id"] : "UnknownResourceId";
            string sport = properties.ContainsKey("sport") ? properties["sport"] : "Football";


            // RestItem as returned by the UDAPI service
            RestItem item = new RestItem {
                Name = properties.ContainsKey("name") ? properties["name"] : "UnknownResource",
                Content = new Summary {
                    Id = id,
                    MatchStatus = properties.ContainsKey("matchstatus") ? Convert.ToInt32(properties["matchstatus"]) : 40,
                    Sequence = properties.ContainsKey("sequence") ? Convert.ToInt32(properties["sequence"]) : 1,
                    StartTime = properties.ContainsKey("starttime") ? properties["starttime"] : DateTime.UtcNow.ToString(),
                    Tags = new List<Tag>
                    {
                        new Tag
                        {
                            Id = 2,
                            Key = "Competition",
                            Value = properties.ContainsKey("competition") ? properties["competition"] : "UnknownCompetition"
                        },
                        new Tag
                        {
                            Id = 1,
                            Key = "Participant",
                            Value = properties.ContainsKey("participant2") ? properties["participant2"] : "UnknownAwayParticipant"
                        },
                        new Tag
                        {
                            Id = 0,
                            Key = "Participant",
                            Value = properties.ContainsKey("participant1") ? properties["participant1"] : "UnknownHomeParticipant"
                        }
                    }
                },

                Links = new List<RestLink>(),
            };

            // links to the resource services
            var restlink = new RestLink {
                Relation = "http://api.sportingsolutions.com/rels/snapshot",
                Href = string.Format("http://apicui.sportingsolutions.com/UnifiedDataAPI/snapshot/{0}/{1}/fake-random-token-0", sport, id),
                Verbs = new[] { "GET" }
            };

            item.Links.Add(restlink);

            restlink = new RestLink {
                Relation = "http://api.sportingsolutions.com/rels/stream/amqp",
                Href = string.Format("http://apicui.sportingsolutions.com/UnifiedDataAPI/strean/{0}/{1}/fake-random-token-1", sport, id),
                Verbs = new[] { "GET" }
            };
            item.Links.Add(restlink);

            restlink = new RestLink {
                Relation = "http://api.sportingsolutions.com/rels/sequence",
                Href = string.Format("http://apicui.sportingsolutions.com/UnifiedDataAPI/sequence/{0}/{1}/fake-random-token-2", sport, id),
                Verbs = new[] { "GET" }
            };
            item.Links.Add(restlink);

            restlink = new RestLink {
                Relation = "http://api.sportingsolutions.com/rels/stream/echo",
                Href = "http://apicui.sportingsolutions.com/EchoRestService/echo/fake-random-token-3",
                Verbs = new[] { "POST" }
            };
            item.Links.Add(restlink);

            restlink = new RestLink {
                Relation = "http://api.sportingsolutions.com/rels/stream/batchecho",
                Href = "http://apicui.sportingsolutions.com/EchoRestService/batchecho/fake-random-token-4",
                Verbs = new[] { "POST" }
            };
            item.Links.Add(restlink);

            return item;
        }
 internal Feature(RestItem restItem, IConnectClient connectClient)
     : base(restItem, connectClient)
 {
     Logger = LogManager.GetLogger(typeof(Feature).ToString());
     Logger.DebugFormat("Instantiated feature={0}", restItem.Name);
 }
 internal Service(NameValueCollection headers, RestItem restItem)
     : base(headers, restItem)
 {
 }
 internal Service(NameValueCollection headers, RestItem restItem)
     : base(headers, restItem)
 {
     _logger.DebugFormat("Instantiated Service {0}",restItem.Name);
 }
 internal Resource(NameValueCollection headers, RestItem restItem)
     : base(headers, restItem)
 {
     _pauseStream = new ManualResetEvent(true);
 }