public void HandlerDelete(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders)
 {
     Log.InfoFormat("Handling Delete request");
     var handler = GetHandler(incomingHeaders);
     handler.HandlerDelete(GetSelectors(incomingHeaders));
     Log.InfoFormat("Delete request handled successfully");
 }
 public EndpointReference HandleCreate(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders, ExtractBodyDelegate extractBodyCallback)
 {
     Log.InfoFormat("Handling Create request");
     var handler = GetHandler(incomingHeaders);
     var result = handler.HandleCreate(extractBodyCallback);
     Log.InfoFormat("Create request handled successfully");
     return result;
 }
        public object HandlePut(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders, ExtractBodyDelegate extractBodyCallback)
        {
            Log.InfoFormat("Handling Put request");
            var fragmentExpression = GetFragmentExpression(incomingHeaders, outgoingHeaders);
            var selectors = GetSelectors(incomingHeaders);
            var handler = GetHandler(incomingHeaders);

            var result = handler.HandlePut(fragmentExpression, selectors, extractBodyCallback);
            Log.InfoFormat("Put request handled successfully");
            return result;
        }
        public object HandleGet(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders)
        {
            Log.InfoFormat("Handling Get request");
            var fragmentExpression = GetFragmentExpression(incomingHeaders, outgoingHeaders);
            var selectors = GetSelectors(incomingHeaders);
            var handler = GetHandler(incomingHeaders);

            var result = handler.HandleGet(fragmentExpression, selectors);
            Log.InfoFormat("Get request handled successfully");
            return result;
        }
 private static string GetFragmentExpression(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders)
 {
     var fragmentTransferHeader = incomingHeaders.GetHeader<FragmentTransferHeader>();
     string fragmentExpression = null;
     if (fragmentTransferHeader != null)
     {
         Log.InfoFormat("Requesting fragment '{0}'", fragmentTransferHeader.Expression);
         outgoingHeaders.AddHeader(fragmentTransferHeader, true);
         fragmentExpression = fragmentTransferHeader.Expression;
     }
     else
     {
         Log.Debug("Not a fragment request.");
     }
     return fragmentExpression;
 }
 public void HandlerDelete(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders)
 {
     _data = null;
 }
 public EndpointReference HandleCreate(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders, ExtractBodyDelegate extractBodyCallback)
 {
     _data = (SampleData)extractBodyCallback(typeof(SampleData));
     return new EndpointReference("http://example.com");
 }
 public object HandlePut(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders, ExtractBodyDelegate extractBodyCallback)
 {
     _data = (SampleData)extractBodyCallback(typeof (SampleData));
     return _data;
 }
 public object HandleGet(IIncomingHeaders incomingHeaders, IOutgoingHeaders outgoingHeaders)
 {
     return _data;
 }