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