aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IUserService.cs
diff options
context:
space:
mode:
authorMelanie2009-12-31 01:16:16 +0000
committerMelanie2009-12-31 01:16:16 +0000
commit3507005d9decdbf579fb2b7b9928a7d97bd6cf5b (patch)
treed4b6c1ed6928f54fedb3dd0bf5371c7c38a66c55 /OpenSim/Services/Interfaces/IUserService.cs
parentMake ScopeID be wild on user queries. Just pass it as UUID.Zero (diff)
downloadopensim-SC-3507005d9decdbf579fb2b7b9928a7d97bd6cf5b.zip
opensim-SC-3507005d9decdbf579fb2b7b9928a7d97bd6cf5b.tar.gz
opensim-SC-3507005d9decdbf579fb2b7b9928a7d97bd6cf5b.tar.bz2
opensim-SC-3507005d9decdbf579fb2b7b9928a7d97bd6cf5b.tar.xz
Remove CreateUserAccount. Rename SetUserAccount to StoreUserAccount.
Implement the fetch operations fully. Rename one last UserService file to UserAccountService
Diffstat (limited to 'OpenSim/Services/Interfaces/IUserService.cs')
-rw-r--r--OpenSim/Services/Interfaces/IUserService.cs105
1 files changed, 0 insertions, 105 deletions
diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs
deleted file mode 100644
index 1bdaaab..0000000
--- a/OpenSim/Services/Interfaces/IUserService.cs
+++ /dev/null
@@ -1,105 +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;
31
32namespace OpenSim.Services.Interfaces
33{
34 public class UserAccount
35 {
36 public UserAccount()
37 {
38 }
39
40 public UserAccount(UUID principalID)
41 {
42 PrincipalID = principalID;
43 }
44
45 public string FirstName;
46 public string LastName;
47 public string Email;
48 public UUID PrincipalID;
49 public UUID ScopeID;
50
51 public Dictionary<string, object> ServiceURLs;
52
53 public int Created;
54
55 public UserAccount(Dictionary<string, object> kvp)
56 {
57 if (kvp.ContainsKey("FirstName"))
58 FirstName = kvp["FirstName"].ToString();
59 if (kvp.ContainsKey("LastName"))
60 LastName = kvp["LastName"].ToString();
61 if (kvp.ContainsKey("Email"))
62 Email = kvp["Email"].ToString();
63 if (kvp.ContainsKey("PrincipalID"))
64 UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID);
65 if (kvp.ContainsKey("ScopeID"))
66 UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID);
67 if (kvp.ContainsKey("Created"))
68 Convert.ToInt32(kvp["Created"].ToString());
69 if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary<string, string>))
70 ServiceURLs = (Dictionary<string, object>)kvp["ServiceURLs"];
71 }
72
73 public Dictionary<string, object> ToKeyValuePairs()
74 {
75 Dictionary<string, object> result = new Dictionary<string, object>();
76 result["FirstName"] = FirstName;
77 result["LastName"] = LastName;
78 result["Email"] = Email;
79 result["PrincipalID"] = PrincipalID.ToString();
80 result["ScopeID"] = ScopeID.ToString();
81 result["Created"] = Created.ToString();
82 result["ServiceURLs"] = ServiceURLs;
83
84 return result;
85 }
86 };
87
88 public interface IUserAccountService
89 {
90 UserAccount GetUserAccount(UUID scopeID, UUID userID);
91 UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName);
92 UserAccount GetUserAccount(UUID scopeID, string Email);
93 // Returns the list of avatars that matches both the search
94 // criterion and the scope ID passed
95 //
96 List<UserAccount> GetUserAccounts(UUID scopeID, string query);
97
98 // Update all updatable fields
99 //
100 bool SetUserAccount(UserAccount data);
101
102 // Creates a user data record
103 bool CreateUserAccount(UserAccount data);
104 }
105}