root / trunk / Pithos.Network / ContainerInfo.cs @ ac137734
History | View | Annotate | Download (2.8 kB)
1 | d7288179 | pkanavos | #region |
---|---|---|---|
2 | d7288179 | pkanavos | /* ----------------------------------------------------------------------- |
3 | d7288179 | pkanavos | * <copyright file="ContainerInfo.cs" company="GRNet"> |
4 | d7288179 | pkanavos | * |
5 | d7288179 | pkanavos | * Copyright 2011-2012 GRNET S.A. All rights reserved. |
6 | d7288179 | pkanavos | * |
7 | d7288179 | pkanavos | * Redistribution and use in source and binary forms, with or |
8 | d7288179 | pkanavos | * without modification, are permitted provided that the following |
9 | d7288179 | pkanavos | * conditions are met: |
10 | d7288179 | pkanavos | * |
11 | d7288179 | pkanavos | * 1. Redistributions of source code must retain the above |
12 | d7288179 | pkanavos | * copyright notice, this list of conditions and the following |
13 | d7288179 | pkanavos | * disclaimer. |
14 | d7288179 | pkanavos | * |
15 | d7288179 | pkanavos | * 2. Redistributions in binary form must reproduce the above |
16 | d7288179 | pkanavos | * copyright notice, this list of conditions and the following |
17 | d7288179 | pkanavos | * disclaimer in the documentation and/or other materials |
18 | d7288179 | pkanavos | * provided with the distribution. |
19 | d7288179 | pkanavos | * |
20 | d7288179 | pkanavos | * |
21 | d7288179 | pkanavos | * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
22 | d7288179 | pkanavos | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
23 | d7288179 | pkanavos | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
24 | d7288179 | pkanavos | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
25 | d7288179 | pkanavos | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
26 | d7288179 | pkanavos | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
27 | d7288179 | pkanavos | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
28 | d7288179 | pkanavos | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
29 | d7288179 | pkanavos | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | d7288179 | pkanavos | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
31 | d7288179 | pkanavos | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
32 | d7288179 | pkanavos | * POSSIBILITY OF SUCH DAMAGE. |
33 | d7288179 | pkanavos | * |
34 | d7288179 | pkanavos | * The views and conclusions contained in the software and |
35 | d7288179 | pkanavos | * documentation are those of the authors and should not be |
36 | d7288179 | pkanavos | * interpreted as representing official policies, either expressed |
37 | d7288179 | pkanavos | * or implied, of GRNET S.A. |
38 | d7288179 | pkanavos | * </copyright> |
39 | d7288179 | pkanavos | * ----------------------------------------------------------------------- |
40 | d7288179 | pkanavos | */ |
41 | d7288179 | pkanavos | #endregion |
42 | d7288179 | pkanavos | using System; |
43 | d7288179 | pkanavos | using System.Collections.Generic; |
44 | d7288179 | pkanavos | using Newtonsoft.Json; |
45 | d7288179 | pkanavos | using Pithos.Interfaces; |
46 | d7288179 | pkanavos | |
47 | d7288179 | pkanavos | namespace Pithos.Network |
48 | d7288179 | pkanavos | { |
49 | d7288179 | pkanavos | public class ContainerInfo |
50 | d7288179 | pkanavos | { |
51 | d7288179 | pkanavos | public string Account { get; set; } |
52 | d7288179 | pkanavos | |
53 | d7288179 | pkanavos | [JsonConverter(typeof(RelativeUriConverter))] |
54 | d7288179 | pkanavos | public Uri Name { get; set; } |
55 | d7288179 | pkanavos | |
56 | d7288179 | pkanavos | public string StorageUrl { get; set; } |
57 | d7288179 | pkanavos | public long Count { get; set; } |
58 | d7288179 | pkanavos | public long Bytes { get; set; } |
59 | d7288179 | pkanavos | public string BlockHash { get; set; } |
60 | d7288179 | pkanavos | public int BlockSize { get; set; } |
61 | d7288179 | pkanavos | |
62 | dc18b138 | pkanavos | public DateTimeOffset? Last_Modified { get; set; } |
63 | d7288179 | pkanavos | |
64 | d7288179 | pkanavos | public Dictionary<string, string> Tags { get; set; } |
65 | d7288179 | pkanavos | public Dictionary<string, string> Policies { get; set; } |
66 | d7288179 | pkanavos | |
67 | d7288179 | pkanavos | public Uri AccountKey |
68 | d7288179 | pkanavos | { |
69 | d7288179 | pkanavos | get { return new Uri(StorageUrl).Combine("../" + Account); } |
70 | d7288179 | pkanavos | } |
71 | d7288179 | pkanavos | |
72 | d7288179 | pkanavos | |
73 | d7288179 | pkanavos | public static ContainerInfo Empty=new ContainerInfo(); |
74 | d7288179 | pkanavos | |
75 | d7288179 | pkanavos | public ContainerInfo() |
76 | d7288179 | pkanavos | { |
77 | d7288179 | pkanavos | Tags = new Dictionary<string, string>(); |
78 | d7288179 | pkanavos | } |
79 | d7288179 | pkanavos | } |
80 | cfed7823 | Panagiotis Kanavos | } |