Ejemplo n.º 1
0
        private void OnGetDataObjectsCore(object sender, MapAndListRequestEventArgs <v12.Protocol.Store.GetDataObjects, v12.Datatypes.Object.DataObject, v12.Protocol.Store.Chunk> args)
        {
            var handler = (v12.Protocol.Store.IStoreStore)sender;

            if (!string.Equals(args.Request.Body.Format, Formats.Xml, StringComparison.OrdinalIgnoreCase))
            {
                args.FinalError = handler.ErrorInfo().InvalidArgument("Format", args.Request.Body.Format);
            }
            else
            {
                args.Response1Map = new Dictionary <string, v12.Datatypes.Object.DataObject>();
                foreach (var kvp in args.Request.Body.Uris)
                {
                    var uri     = new EtpUri(kvp.Value);
                    var @object = Store.GetObject(EtpVersion.v12, uri);
                    if (@object != null)
                    {
                        args.Response1Map[kvp.Key] = @object.DataObject12(true);
                    }
                    else
                    {
                        args.ErrorMap[kvp.Key] = handler.ErrorInfo().NotFound(args.Request.Body.Uris[kvp.Key]);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void OnGetDataObjects(object sender, MapAndListRequestEventArgs <v12.Protocol.Store.GetDataObjects, v12.Datatypes.Object.DataObject, v12.Protocol.Store.Chunk> args)
 {
     Store.ExecuteWithLock(() =>
     {
         OnGetDataObjectsCore(sender, args);
     });
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Handles the GetDataObjects message from a customer.
 /// </summary>
 /// <param name="args">The <see cref="MapAndListRequestEventArgs{GetDataObjects, DataObject, Chunk}"/> instance containing the event data.</param>
 protected virtual void HandleGetDataObjects(MapAndListRequestEventArgs <GetDataObjects, DataObject, Chunk> args)
 {
 }