Annotation of /trunk/GridServer/Interfaces.cs
Parent Directory
|
Revision Log
Revision 70 - (view) (download)
| 1 : | jhurliman | 65 | /* |
| 2 : | * Copyright (c) 2008 Intel Corporation | ||
| 3 : | * All rights reserved. | ||
| 4 : | * Redistribution and use in source and binary forms, with or without | ||
| 5 : | * modification, are permitted provided that the following conditions | ||
| 6 : | * are met: | ||
| 7 : | * | ||
| 8 : | * -- Redistributions of source code must retain the above copyright | ||
| 9 : | * notice, this list of conditions and the following disclaimer. | ||
| 10 : | * -- Redistributions in binary form must reproduce the above copyright | ||
| 11 : | * notice, this list of conditions and the following disclaimer in the | ||
| 12 : | * documentation and/or other materials provided with the distribution. | ||
| 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 | ||
| 15 : | * this software without specific prior written permission. | ||
| 16 : | * | ||
| 17 : | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 18 : | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 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 | ||
| 21 : | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| 22 : | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| 23 : | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| 24 : | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| 25 : | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
| 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. | ||
| 28 : | */ | ||
| 29 : | |||
| 30 : | using System; | ||
| 31 : | using System.Collections.Generic; | ||
| 32 : | using OpenMetaverse; | ||
| 33 : | |||
| 34 : | namespace GridServer | ||
| 35 : | { | ||
| 36 : | jhurliman | 70 | /// <summary> |
| 37 : | /// Response from a call to a backend provider | ||
| 38 : | /// </summary> | ||
| 39 : | public enum BackendResponse | ||
| 40 : | { | ||
| 41 : | /// <summary>The call succeeded</summary> | ||
| 42 : | Success, | ||
| 43 : | /// <summary>The resource requested was not found</summary> | ||
| 44 : | NotFound, | ||
| 45 : | /// <summary>A server failure prevented the call from | ||
| 46 : | /// completing</summary> | ||
| 47 : | Failure | ||
| 48 : | } | ||
| 49 : | |||
| 50 : | jhurliman | 65 | public interface IAvatarProvider |
| 51 : | { | ||
| 52 : | bool SaveAvatar(Avatar avatar); | ||
| 53 : | bool RemoveAvatar(UUID avatarID); | ||
| 54 : | bool TryGetAvatar(UUID avatarID, out Avatar avatar); | ||
| 55 : | bool TryGetAvatar(string firstName, string lastName, out Avatar avatar); | ||
| 56 : | List<Avatar> AvatarSearch(string searchQuery); | ||
| 57 : | |||
| 58 : | bool AddAvatarMapping(string loginKey, UUID avatarID); | ||
| 59 : | bool RemoveAvatarMapping(string loginKey); | ||
| 60 : | bool TryGetAvatar(string loginKey, out Avatar avatar); | ||
| 61 : | |||
| 62 : | int ForEach(Action<Avatar> action, int start, int count); | ||
| 63 : | } | ||
| 64 : | |||
| 65 : | public interface ISessionProvider | ||
| 66 : | { | ||
| 67 : | UUID CreateSession(UUID avatarID); | ||
| 68 : | bool RemoveSession(UUID authToken); | ||
| 69 : | bool TryGetAvatar(UUID authToken, out Avatar avatar); | ||
| 70 : | bool TryGetSession(UUID avatarID, out UUID authToken); | ||
| 71 : | |||
| 72 : | int CurrentSessionCount(); | ||
| 73 : | } | ||
| 74 : | |||
| 75 : | jhurliman | 69 | public interface IAuthorizationProvider |
| 76 : | { | ||
| 77 : | bool IsAvatarAuthorized(UUID authToken, UUID avatarID); | ||
| 78 : | bool IsRegionAuthorized(UUID authToken, UUID regionID); | ||
| 79 : | jhurliman | 70 | bool IsRegionCreateAuthorized(UUID authToken); |
| 80 : | bool IsRegionDeleteAuthorized(UUID authToken, UUID regionID); | ||
| 81 : | jhurliman | 69 | } |
| 82 : | |||
| 83 : | jhurliman | 65 | public interface IGridProvider |
| 84 : | { | ||
| 85 : | jhurliman | 70 | BackendResponse TryCreateRegion(Region region); |
| 86 : | BackendResponse TryCreateRegionNearest(Region region); | ||
| 87 : | BackendResponse TryDeleteRegion(UUID id); | ||
| 88 : | BackendResponse TryDeleteRegion(uint x, uint y); | ||
| 89 : | BackendResponse TryFetchRegion(UUID id, out Region region); | ||
| 90 : | BackendResponse TryFetchRegion(uint x, uint y, out Region region); | ||
| 91 : | |||
| 92 : | BackendResponse RegionSearch(string query, out List<Region> results); | ||
| 93 : | jhurliman | 65 | int RegionCount(); |
| 94 : | int OnlineRegionCount(); | ||
| 95 : | |||
| 96 : | int ForEach(Action<Region> action, int start, int count); | ||
| 97 : | } | ||
| 98 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

