diff options
author | Oren Hurvitz | 2014-04-07 15:01:06 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-04-08 08:11:29 +0100 |
commit | e00f1a0410a3f57dea4a0cae1376a5d73609d75b (patch) | |
tree | 84cef48ff2538764daee803b3e5aec168859d354 /OpenSim | |
parent | Better (amend to previous commit) (diff) | |
download | opensim-SC_OLD-e00f1a0410a3f57dea4a0cae1376a5d73609d75b.zip opensim-SC_OLD-e00f1a0410a3f57dea4a0cae1376a5d73609d75b.tar.gz opensim-SC_OLD-e00f1a0410a3f57dea4a0cae1376a5d73609d75b.tar.bz2 opensim-SC_OLD-e00f1a0410a3f57dea4a0cae1376a5d73609d75b.tar.xz |
Allow invalidating the users cache
Diffstat (limited to '')
7 files changed, 36 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 529bfd7..6d4ac39 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -190,7 +190,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
190 | // | 190 | // |
191 | public bool StoreUserAccount(UserAccount data) | 191 | public bool StoreUserAccount(UserAccount data) |
192 | { | 192 | { |
193 | return UserAccountService.StoreUserAccount(data); | 193 | bool ret = UserAccountService.StoreUserAccount(data); |
194 | if (ret) | ||
195 | m_Cache.Cache(data.PrincipalID, data); | ||
196 | return ret; | ||
197 | } | ||
198 | |||
199 | public void InvalidateCache(UUID userID) | ||
200 | { | ||
201 | m_Cache.Invalidate(userID); | ||
194 | } | 202 | } |
195 | 203 | ||
196 | #endregion | 204 | #endregion |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index ddef75f..ed52e48 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -61,6 +61,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
61 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); | 61 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); |
62 | } | 62 | } |
63 | 63 | ||
64 | public void Invalidate(UUID userID) | ||
65 | { | ||
66 | m_UUIDCache.Remove(userID); | ||
67 | } | ||
68 | |||
64 | public UserAccount Get(UUID userID, out bool inCache) | 69 | public UserAccount Get(UUID userID, out bool inCache) |
65 | { | 70 | { |
66 | UserAccount account = null; | 71 | UserAccount account = null; |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 7e36c69..698c4c0 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -191,6 +191,11 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
191 | return accounts; | 191 | return accounts; |
192 | } | 192 | } |
193 | 193 | ||
194 | public void InvalidateCache(UUID userID) | ||
195 | { | ||
196 | m_accountCache.Remove(userID); | ||
197 | } | ||
198 | |||
194 | public bool StoreUserAccount(UserAccount data) | 199 | public bool StoreUserAccount(UserAccount data) |
195 | { | 200 | { |
196 | // m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); | 201 | // m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); |
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs index 97d9458..8110fe5 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs | |||
@@ -187,6 +187,10 @@ namespace OpenSim.Services.Connectors | |||
187 | return accounts; | 187 | return accounts; |
188 | } | 188 | } |
189 | 189 | ||
190 | public void InvalidateCache(UUID userID) | ||
191 | { | ||
192 | } | ||
193 | |||
190 | public virtual bool StoreUserAccount(UserAccount data) | 194 | public virtual bool StoreUserAccount(UserAccount data) |
191 | { | 195 | { |
192 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 196 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs index 65f9dd5..fa7dd0b 100644 --- a/OpenSim/Services/HypergridService/UserAccountCache.cs +++ b/OpenSim/Services/HypergridService/UserAccountCache.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Reflection; | 3 | using System.Reflection; |
4 | 4 | ||
@@ -95,6 +95,11 @@ namespace OpenSim.Services.HypergridService | |||
95 | return null; | 95 | return null; |
96 | } | 96 | } |
97 | 97 | ||
98 | public void InvalidateCache(UUID userID) | ||
99 | { | ||
100 | m_UUIDCache.Remove(userID); | ||
101 | } | ||
102 | |||
98 | public bool StoreUserAccount(UserAccount data) | 103 | public bool StoreUserAccount(UserAccount data) |
99 | { | 104 | { |
100 | return false; | 105 | return false; |
diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 1b85980..2f7702c 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs | |||
@@ -189,5 +189,7 @@ namespace OpenSim.Services.Interfaces | |||
189 | /// <param name="data"></param> | 189 | /// <param name="data"></param> |
190 | /// <returns></returns> | 190 | /// <returns></returns> |
191 | bool StoreUserAccount(UserAccount data); | 191 | bool StoreUserAccount(UserAccount data); |
192 | |||
193 | void InvalidateCache(UUID userID); | ||
192 | } | 194 | } |
193 | } | 195 | } |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 1852e4f..40d8095 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -256,6 +256,10 @@ namespace OpenSim.Services.UserAccountService | |||
256 | return MakeUserAccount(d[0]); | 256 | return MakeUserAccount(d[0]); |
257 | } | 257 | } |
258 | 258 | ||
259 | public void InvalidateCache(UUID userID) | ||
260 | { | ||
261 | } | ||
262 | |||
259 | public bool StoreUserAccount(UserAccount data) | 263 | public bool StoreUserAccount(UserAccount data) |
260 | { | 264 | { |
261 | // m_log.DebugFormat( | 265 | // m_log.DebugFormat( |