aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/User
diff options
context:
space:
mode:
authorMelanie2009-09-06 04:28:42 +0100
committerMelanie2009-09-06 04:28:42 +0100
commit2a8f66b221e93fb2d693c1c273c2dee85439f835 (patch)
treeea20d88556279d7d56bc9a15e7372652a814f835 /OpenSim/Services/Connectors/User
parentMerge branch 'master' of ssh://MyConnection/var/git/opensim (diff)
downloadopensim-SC-2a8f66b221e93fb2d693c1c273c2dee85439f835.zip
opensim-SC-2a8f66b221e93fb2d693c1c273c2dee85439f835.tar.gz
opensim-SC-2a8f66b221e93fb2d693c1c273c2dee85439f835.tar.bz2
opensim-SC-2a8f66b221e93fb2d693c1c273c2dee85439f835.tar.xz
Revising the user account data interfaces. No user functionality yet
Diffstat (limited to 'OpenSim/Services/Connectors/User')
-rw-r--r--OpenSim/Services/Connectors/User/UserServiceConnector.cs145
1 files changed, 13 insertions, 132 deletions
diff --git a/OpenSim/Services/Connectors/User/UserServiceConnector.cs b/OpenSim/Services/Connectors/User/UserServiceConnector.cs
index fb03844..d418938 100644
--- a/OpenSim/Services/Connectors/User/UserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/User/UserServiceConnector.cs
@@ -39,7 +39,7 @@ using OpenMetaverse;
39 39
40namespace OpenSim.Services.Connectors 40namespace OpenSim.Services.Connectors
41{ 41{
42 public class UserServicesConnector : IUserAccountDataService 42 public class UserServicesConnector : IUserAccountService
43 { 43 {
44 private static readonly ILog m_log = 44 private static readonly ILog m_log =
45 LogManager.GetLogger( 45 LogManager.GetLogger(
@@ -81,153 +81,34 @@ namespace OpenSim.Services.Connectors
81 m_ServerURI = serviceURI; 81 m_ServerURI = serviceURI;
82 } 82 }
83 83
84 public UserAccountData GetUserAccountData(UUID scopeID, string firstName, string lastName) 84 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
85 { 85 {
86 string uri = m_ServerURI + "/users/"; 86 return null;
87 UserAccountData data = new UserAccountData();
88 data.FirstName = firstName;
89 data.LastName = lastName;
90 data.ScopeID = scopeID;
91 data.UserID = UUID.Zero;
92
93 try
94 {
95 data = SynchronousRestObjectRequester.
96 MakeRequest<UserAccountData, UserAccountData>("POST", uri, data);
97 }
98 catch (Exception e)
99 {
100 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
101 return null;
102 }
103
104 if (data.UserID == UUID.Zero)
105 return null;
106
107 return data;
108 } 87 }
109 88
110 public UserAccountData GetUserAccountData(UUID scopeID, UUID userID) 89 public UserAccount GetUserAccount(UUID scopeID, UUID userID)
111 { 90 {
112 string uri = m_ServerURI + "/users/"; 91 return null;
113 UserAccountData data = new UserAccountData();
114 data.FirstName = String.Empty;
115 data.LastName = String.Empty;
116 data.ScopeID = scopeID;
117 data.UserID = userID;
118
119 try
120 {
121 data = SynchronousRestObjectRequester.
122 MakeRequest<UserAccountData, UserAccountData>("POST", uri, data);
123 }
124 catch (Exception e)
125 {
126 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
127 return null;
128 }
129
130 if (data.UserID == UUID.Zero)
131 return null;
132
133 return data;
134 } 92 }
135 93
136 public bool SetHomePosition(UserAccountData data, UUID regionID, UUID regionSecret) 94 public bool SetHomePosition(UserAccount data, UUID regionID, UUID regionSecret)
137 { 95 {
138 string uri = m_ServerURI + "/user/"; 96 return false;
139 bool result = false;
140
141 UserAccountDataMessage msg = new UserAccountDataMessage();
142
143 msg.Data = data;
144 msg.RegionID = regionID;
145 msg.RegionSecret = regionSecret;
146
147 try
148 {
149 result = SynchronousRestObjectRequester.
150 MakeRequest<UserAccountDataMessage, bool>("POST", uri, msg);
151 }
152 catch (Exception e)
153 {
154 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
155 return false;
156 }
157
158 return result;
159 } 97 }
160 98
161 public bool SetUserAccountData(UserAccountData data, UUID principalID, UUID sessionID) 99 public bool SetUserAccount(UserAccount data, UUID principalID, string token)
162 { 100 {
163 string uri = m_ServerURI + "/user/"; 101 return false;
164 bool result = false;
165
166 UserAccountDataMessage msg = new UserAccountDataMessage();
167
168 msg.Data = data;
169 msg.PrincipalID = principalID;
170 msg.SessionID = sessionID;
171
172 try
173 {
174 result = SynchronousRestObjectRequester.
175 MakeRequest<UserAccountDataMessage, bool>("POST", uri, msg);
176 }
177 catch (Exception e)
178 {
179 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
180 return false;
181 }
182
183 return result;
184 } 102 }
185 103
186 public bool CreateUserAccountData(UserAccountData data, UUID principalID, UUID sessionID) 104 public bool CreateUserAccount(UserAccount data, UUID principalID, string token)
187 { 105 {
188 string uri = m_ServerURI + "/newuser/"; 106 return false;
189 bool result = false;
190
191 UserAccountDataMessage msg = new UserAccountDataMessage();
192
193 msg.Data = data;
194 msg.PrincipalID = principalID;
195 msg.SessionID = sessionID;
196
197 try
198 {
199 result = SynchronousRestObjectRequester.
200 MakeRequest<UserAccountDataMessage, bool>("POST", uri, msg);
201 }
202 catch (Exception e)
203 {
204 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
205 return false;
206 }
207
208 return result;
209 } 107 }
210 108
211 public List<UserAccountData> GetUserAccountData(UUID scopeID, string query) 109 public List<UserAccount> GetUserAccount(UUID scopeID, string query)
212 { 110 {
213 string uri = m_ServerURI + "/userlist/"; 111 return null;
214 UserAccountData data = new UserAccountData();
215 data.FirstName = query;
216 data.ScopeID = scopeID;
217 List<UserAccountData> result;
218
219 try
220 {
221 result = SynchronousRestObjectRequester.
222 MakeRequest<UserAccountData, List<UserAccountData>>("POST", uri, data);
223 }
224 catch (Exception e)
225 {
226 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
227 return null;
228 }
229
230 return result;
231 } 112 }
232 } 113 }
233} 114}