diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Interfaces.cs | 314 |
1 files changed, 157 insertions, 157 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Interfaces.cs b/OpenSim/Grid/AssetInventoryServer/Interfaces.cs index fd9ed2c..13b0205 100644 --- a/OpenSim/Grid/AssetInventoryServer/Interfaces.cs +++ b/OpenSim/Grid/AssetInventoryServer/Interfaces.cs | |||
@@ -1,157 +1,157 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2008 Intel Corporation | 2 | * Copyright (c) 2008 Intel Corporation |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * Redistribution and use in source and binary forms, with or without | 4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions | 5 | * modification, are permitted provided that the following conditions |
6 | * are met: | 6 | * are met: |
7 | * | 7 | * |
8 | * -- Redistributions of source code must retain the above copyright | 8 | * -- Redistributions of source code must retain the above copyright |
9 | * notice, this list of conditions and the following disclaimer. | 9 | * notice, this list of conditions and the following disclaimer. |
10 | * -- Redistributions in binary form must reproduce the above copyright | 10 | * -- Redistributions in binary form must reproduce the above copyright |
11 | * notice, this list of conditions and the following disclaimer in the | 11 | * notice, this list of conditions and the following disclaimer in the |
12 | * documentation and/or other materials provided with the distribution. | 12 | * documentation and/or other materials provided with the distribution. |
13 | * -- Neither the name of the Intel Corporation nor the names of its | 13 | * -- Neither the name of the Intel Corporation nor the names of its |
14 | * contributors may be used to endorse or promote products derived from | 14 | * contributors may be used to endorse or promote products derived from |
15 | * this software without specific prior written permission. | 15 | * this software without specific prior written permission. |
16 | * | 16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
19 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | 19 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
20 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS | 20 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS |
21 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 21 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
24 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | 24 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
25 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 25 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 26 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | using System; | 30 | using System; |
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Net; | 32 | using System.Net; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenMetaverse.StructuredData; | 34 | using OpenMetaverse.StructuredData; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | 36 | ||
37 | namespace OpenSim.Grid.AssetInventoryServer | 37 | namespace OpenSim.Grid.AssetInventoryServer |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// Response from a call to a backend provider | 40 | /// Response from a call to a backend provider |
41 | /// </summary> | 41 | /// </summary> |
42 | public enum BackendResponse | 42 | public enum BackendResponse |
43 | { | 43 | { |
44 | /// <summary>The call succeeded</summary> | 44 | /// <summary>The call succeeded</summary> |
45 | Success, | 45 | Success, |
46 | /// <summary>The resource requested was not found</summary> | 46 | /// <summary>The resource requested was not found</summary> |
47 | NotFound, | 47 | NotFound, |
48 | /// <summary>A server failure prevented the call from | 48 | /// <summary>A server failure prevented the call from |
49 | /// completing</summary> | 49 | /// completing</summary> |
50 | Failure | 50 | Failure |
51 | } | 51 | } |
52 | 52 | ||
53 | public class AssetInventoryServerPluginInitialiser : PluginInitialiserBase | 53 | public class AssetInventoryServerPluginInitialiser : PluginInitialiserBase |
54 | { | 54 | { |
55 | private AssetInventoryServer server; | 55 | private AssetInventoryServer server; |
56 | 56 | ||
57 | public AssetInventoryServerPluginInitialiser (AssetInventoryServer server) | 57 | public AssetInventoryServerPluginInitialiser (AssetInventoryServer server) |
58 | { | 58 | { |
59 | this.server = server; | 59 | this.server = server; |
60 | } | 60 | } |
61 | 61 | ||
62 | public override void Initialise (IPlugin plugin) | 62 | public override void Initialise (IPlugin plugin) |
63 | { | 63 | { |
64 | IAssetInventoryServerPlugin p = plugin as IAssetInventoryServerPlugin; | 64 | IAssetInventoryServerPlugin p = plugin as IAssetInventoryServerPlugin; |
65 | p.Initialise (server); | 65 | p.Initialise (server); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | #region Interfaces | 69 | #region Interfaces |
70 | 70 | ||
71 | public interface IAssetInventoryServerPlugin : IPlugin | 71 | public interface IAssetInventoryServerPlugin : IPlugin |
72 | { | 72 | { |
73 | void Initialise(AssetInventoryServer server); | 73 | void Initialise(AssetInventoryServer server); |
74 | } | 74 | } |
75 | 75 | ||
76 | public interface IStorageProvider | 76 | public interface IStorageProvider |
77 | { | 77 | { |
78 | BackendResponse TryFetchMetadata(UUID assetID, out Metadata metadata); | 78 | BackendResponse TryFetchMetadata(UUID assetID, out Metadata metadata); |
79 | BackendResponse TryFetchData(UUID assetID, out byte[] assetData); | 79 | BackendResponse TryFetchData(UUID assetID, out byte[] assetData); |
80 | BackendResponse TryFetchDataMetadata(UUID assetID, out Metadata metadata, out byte[] assetData); | 80 | BackendResponse TryFetchDataMetadata(UUID assetID, out Metadata metadata, out byte[] assetData); |
81 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData); | 81 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData); |
82 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData, out UUID assetID); | 82 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData, out UUID assetID); |
83 | int ForEach(Action<Metadata> action, int start, int count); | 83 | int ForEach(Action<Metadata> action, int start, int count); |
84 | } | 84 | } |
85 | 85 | ||
86 | public interface IAssetStorageProvider : IAssetInventoryServerPlugin | 86 | public interface IAssetStorageProvider : IAssetInventoryServerPlugin |
87 | { | 87 | { |
88 | BackendResponse TryFetchMetadata(UUID assetID, out Metadata metadata); | 88 | BackendResponse TryFetchMetadata(UUID assetID, out Metadata metadata); |
89 | BackendResponse TryFetchData(UUID assetID, out byte[] assetData); | 89 | BackendResponse TryFetchData(UUID assetID, out byte[] assetData); |
90 | BackendResponse TryFetchDataMetadata(UUID assetID, out Metadata metadata, out byte[] assetData); | 90 | BackendResponse TryFetchDataMetadata(UUID assetID, out Metadata metadata, out byte[] assetData); |
91 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData); | 91 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData); |
92 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData, out UUID assetID); | 92 | BackendResponse TryCreateAsset(Metadata metadata, byte[] assetData, out UUID assetID); |
93 | int ForEach(Action<Metadata> action, int start, int count); | 93 | int ForEach(Action<Metadata> action, int start, int count); |
94 | } | 94 | } |
95 | 95 | ||
96 | public interface IInventoryProvider | 96 | public interface IInventoryProvider |
97 | { | 97 | { |
98 | BackendResponse TryFetchItem(Uri owner, UUID itemID, out InventoryItem item); | 98 | BackendResponse TryFetchItem(Uri owner, UUID itemID, out InventoryItem item); |
99 | BackendResponse TryFetchFolder(Uri owner, UUID folderID, out InventoryFolder folder); | 99 | BackendResponse TryFetchFolder(Uri owner, UUID folderID, out InventoryFolder folder); |
100 | BackendResponse TryFetchFolderContents(Uri owner, UUID folderID, out InventoryCollection contents); | 100 | BackendResponse TryFetchFolderContents(Uri owner, UUID folderID, out InventoryCollection contents); |
101 | BackendResponse TryFetchFolderList(Uri owner, out List<InventoryFolder> folders); | 101 | BackendResponse TryFetchFolderList(Uri owner, out List<InventoryFolder> folders); |
102 | BackendResponse TryFetchInventory(Uri owner, out InventoryCollection inventory); | 102 | BackendResponse TryFetchInventory(Uri owner, out InventoryCollection inventory); |
103 | 103 | ||
104 | BackendResponse TryFetchActiveGestures(Uri owner, out List<InventoryItem> gestures); | 104 | BackendResponse TryFetchActiveGestures(Uri owner, out List<InventoryItem> gestures); |
105 | 105 | ||
106 | BackendResponse TryCreateItem(Uri owner, InventoryItem item); | 106 | BackendResponse TryCreateItem(Uri owner, InventoryItem item); |
107 | BackendResponse TryCreateFolder(Uri owner, InventoryFolder folder); | 107 | BackendResponse TryCreateFolder(Uri owner, InventoryFolder folder); |
108 | BackendResponse TryCreateInventory(Uri owner, InventoryFolder rootFolder); | 108 | BackendResponse TryCreateInventory(Uri owner, InventoryFolder rootFolder); |
109 | 109 | ||
110 | BackendResponse TryDeleteItem(Uri owner, UUID itemID); | 110 | BackendResponse TryDeleteItem(Uri owner, UUID itemID); |
111 | BackendResponse TryDeleteFolder(Uri owner, UUID folderID); | 111 | BackendResponse TryDeleteFolder(Uri owner, UUID folderID); |
112 | BackendResponse TryPurgeFolder(Uri owner, UUID folderID); | 112 | BackendResponse TryPurgeFolder(Uri owner, UUID folderID); |
113 | } | 113 | } |
114 | 114 | ||
115 | public interface IAuthenticationProvider | 115 | public interface IAuthenticationProvider |
116 | { | 116 | { |
117 | void AddIdentifier(UUID authToken, Uri identifier); | 117 | void AddIdentifier(UUID authToken, Uri identifier); |
118 | bool RemoveIdentifier(UUID authToken); | 118 | bool RemoveIdentifier(UUID authToken); |
119 | bool TryGetIdentifier(UUID authToken, out Uri identifier); | 119 | bool TryGetIdentifier(UUID authToken, out Uri identifier); |
120 | } | 120 | } |
121 | 121 | ||
122 | public interface IAuthorizationProvider | 122 | public interface IAuthorizationProvider |
123 | { | 123 | { |
124 | bool IsMetadataAuthorized(UUID authToken, UUID assetID); | 124 | bool IsMetadataAuthorized(UUID authToken, UUID assetID); |
125 | /// <summary> | 125 | /// <summary> |
126 | /// Authorizes access to the data for an asset. Access to asset data | 126 | /// Authorizes access to the data for an asset. Access to asset data |
127 | /// also implies access to the metadata for that asset | 127 | /// also implies access to the metadata for that asset |
128 | /// </summary> | 128 | /// </summary> |
129 | /// <param name="authToken">Authentication token to check for access</param> | 129 | /// <param name="authToken">Authentication token to check for access</param> |
130 | /// <param name="assetID">ID of the requested asset</param> | 130 | /// <param name="assetID">ID of the requested asset</param> |
131 | /// <returns>True if access is granted, otherwise false</returns> | 131 | /// <returns>True if access is granted, otherwise false</returns> |
132 | bool IsDataAuthorized(UUID authToken, UUID assetID); | 132 | bool IsDataAuthorized(UUID authToken, UUID assetID); |
133 | bool IsCreateAuthorized(UUID authToken); | 133 | bool IsCreateAuthorized(UUID authToken); |
134 | 134 | ||
135 | bool IsInventoryReadAuthorized(UUID authToken, Uri owner); | 135 | bool IsInventoryReadAuthorized(UUID authToken, Uri owner); |
136 | bool IsInventoryWriteAuthorized(UUID authToken, Uri owner); | 136 | bool IsInventoryWriteAuthorized(UUID authToken, Uri owner); |
137 | } | 137 | } |
138 | 138 | ||
139 | public interface IMetricsProvider | 139 | public interface IMetricsProvider |
140 | { | 140 | { |
141 | void LogAssetMetadataFetch(string extension, BackendResponse response, UUID assetID, DateTime time); | 141 | void LogAssetMetadataFetch(string extension, BackendResponse response, UUID assetID, DateTime time); |
142 | void LogAssetDataFetch(string extension, BackendResponse response, UUID assetID, int dataSize, DateTime time); | 142 | void LogAssetDataFetch(string extension, BackendResponse response, UUID assetID, int dataSize, DateTime time); |
143 | void LogAssetCreate(string extension, BackendResponse response, UUID assetID, int dataSize, DateTime time); | 143 | void LogAssetCreate(string extension, BackendResponse response, UUID assetID, int dataSize, DateTime time); |
144 | 144 | ||
145 | void LogInventoryFetch(string extension, BackendResponse response, Uri owner, UUID objID, bool folder, DateTime time); | 145 | void LogInventoryFetch(string extension, BackendResponse response, Uri owner, UUID objID, bool folder, DateTime time); |
146 | void LogInventoryFetchFolderContents(string extension, BackendResponse response, Uri owner, UUID folderID, DateTime time); | 146 | void LogInventoryFetchFolderContents(string extension, BackendResponse response, Uri owner, UUID folderID, DateTime time); |
147 | void LogInventoryFetchFolderList(string extension, BackendResponse response, Uri owner, DateTime time); | 147 | void LogInventoryFetchFolderList(string extension, BackendResponse response, Uri owner, DateTime time); |
148 | void LogInventoryFetchInventory(string extension, BackendResponse response, Uri owner, DateTime time); | 148 | void LogInventoryFetchInventory(string extension, BackendResponse response, Uri owner, DateTime time); |
149 | void LogInventoryFetchActiveGestures(string extension, BackendResponse response, Uri owner, DateTime time); | 149 | void LogInventoryFetchActiveGestures(string extension, BackendResponse response, Uri owner, DateTime time); |
150 | void LogInventoryCreate(string extension, BackendResponse response, Uri owner, bool folder, DateTime time); | 150 | void LogInventoryCreate(string extension, BackendResponse response, Uri owner, bool folder, DateTime time); |
151 | void LogInventoryCreateInventory(string extension, BackendResponse response, DateTime time); | 151 | void LogInventoryCreateInventory(string extension, BackendResponse response, DateTime time); |
152 | void LogInventoryDelete(string extension, BackendResponse response, Uri owner, UUID objID, bool folder, DateTime time); | 152 | void LogInventoryDelete(string extension, BackendResponse response, Uri owner, UUID objID, bool folder, DateTime time); |
153 | void LogInventoryPurgeFolder(string extension, BackendResponse response, Uri owner, UUID folderID, DateTime time); | 153 | void LogInventoryPurgeFolder(string extension, BackendResponse response, Uri owner, UUID folderID, DateTime time); |
154 | } | 154 | } |
155 | 155 | ||
156 | #endregion Interfaces | 156 | #endregion Interfaces |
157 | } | 157 | } |