OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IGroupsData.cs
Go to the documentation of this file.
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 
28 using System.Collections.Generic;
29 using OpenSim.Data;
30 using OpenMetaverse;
31 
32 namespace OpenSim.Data
33 {
34  public class GroupData
35  {
36  public UUID GroupID;
37  public Dictionary<string, string> Data;
38  }
39 
40  public class MembershipData
41  {
42  public UUID GroupID;
43  public string PrincipalID;
44  public Dictionary<string, string> Data;
45  }
46 
47  public class RoleData
48  {
49  public UUID GroupID;
50  public UUID RoleID;
51  public Dictionary<string, string> Data;
52  }
53 
54  public class RoleMembershipData
55  {
56  public UUID GroupID;
57  public UUID RoleID;
58  public string PrincipalID;
59  }
60 
61  public class PrincipalData
62  {
63  public string PrincipalID;
64  public UUID ActiveGroupID;
65  }
66 
67  public class InvitationData
68  {
69  public UUID InviteID;
70  public UUID GroupID;
71  public UUID RoleID;
72  public string PrincipalID;
73  public Dictionary<string, string> Data;
74  }
75 
76  public class NoticeData
77  {
78  public UUID GroupID;
79  public UUID NoticeID;
80  public Dictionary<string, string> Data;
81  }
82 
83 
84  public interface IGroupsData
85  {
86  // groups table
87  bool StoreGroup(GroupData data);
88  GroupData RetrieveGroup(UUID groupID);
89  GroupData RetrieveGroup(string name);
90  GroupData[] RetrieveGroups(string pattern);
91  bool DeleteGroup(UUID groupID);
92  int GroupsCount();
93 
94  // membership table
95  MembershipData RetrieveMember(UUID groupID, string pricipalID);
96  MembershipData[] RetrieveMembers(UUID groupID);
97  MembershipData[] RetrieveMemberships(string pricipalID);
98  bool StoreMember(MembershipData data);
99  bool DeleteMember(UUID groupID, string pricipalID);
100  int MemberCount(UUID groupID);
101 
102  // roles table
103  bool StoreRole(RoleData data);
104  RoleData RetrieveRole(UUID groupID, UUID roleID);
105  RoleData[] RetrieveRoles(UUID groupID);
106  bool DeleteRole(UUID groupID, UUID roleID);
107  int RoleCount(UUID groupID);
108 
109  // rolememberhip table
110  RoleMembershipData[] RetrieveRolesMembers(UUID groupID);
111  RoleMembershipData[] RetrieveRoleMembers(UUID groupID, UUID roleID);
112  RoleMembershipData[] RetrieveMemberRoles(UUID groupID, string principalID);
113  RoleMembershipData RetrieveRoleMember(UUID groupID, UUID roleID, string principalID);
114  int RoleMemberCount(UUID groupID, UUID roleID);
115  bool StoreRoleMember(RoleMembershipData data);
116  bool DeleteRoleMember(RoleMembershipData data);
117  bool DeleteMemberAllRoles(UUID groupID, string principalID);
118 
119  // principals table
120  bool StorePrincipal(PrincipalData data);
121  PrincipalData RetrievePrincipal(string principalID);
122  bool DeletePrincipal(string principalID);
123 
124  // invites table
125  bool StoreInvitation(InvitationData data);
126  InvitationData RetrieveInvitation(UUID inviteID);
127  InvitationData RetrieveInvitation(UUID groupID, string principalID);
128  bool DeleteInvite(UUID inviteID);
129  void DeleteOldInvites();
130 
131  // notices table
132  bool StoreNotice(NoticeData data);
133  NoticeData RetrieveNotice(UUID noticeID);
134  NoticeData[] RetrieveNotices(UUID groupID);
135  bool DeleteNotice(UUID noticeID);
136  void DeleteOldNotices();
137 
138  // combinations
139  MembershipData RetrievePrincipalGroupMembership(string principalID, UUID groupID);
140  MembershipData[] RetrievePrincipalGroupMemberships(string principalID);
141 
142  // Misc
143  }
144 }
Dictionary< string, string > Data
Definition: IGroupsData.cs:80
Dictionary< string, string > Data
Definition: IGroupsData.cs:37
Dictionary< string, string > Data
Definition: IGroupsData.cs:73
Dictionary< string, string > Data
Definition: IGroupsData.cs:44
Dictionary< string, string > Data
Definition: IGroupsData.cs:51