Allow invalidating the users cache

0.8.0.3
Oren Hurvitz 2014-04-07 15:01:06 +03:00
parent 86105a1533
commit e00f1a0410
7 changed files with 36 additions and 3 deletions

View File

@ -190,7 +190,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
//
public bool StoreUserAccount(UserAccount data)
{
return UserAccountService.StoreUserAccount(data);
bool ret = UserAccountService.StoreUserAccount(data);
if (ret)
m_Cache.Cache(data.PrincipalID, data);
return ret;
}
public void InvalidateCache(UUID userID)
{
m_Cache.Invalidate(userID);
}
#endregion

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@ -61,6 +61,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
//m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
}
public void Invalidate(UUID userID)
{
m_UUIDCache.Remove(userID);
}
public UserAccount Get(UUID userID, out bool inCache)
{
UserAccount account = null;

View File

@ -191,6 +191,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
return accounts;
}
public void InvalidateCache(UUID userID)
{
m_accountCache.Remove(userID);
}
public bool StoreUserAccount(UserAccount data)
{
// m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name);

View File

@ -187,6 +187,10 @@ namespace OpenSim.Services.Connectors
return accounts;
}
public void InvalidateCache(UUID userID)
{
}
public virtual bool StoreUserAccount(UserAccount data)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Reflection;
@ -95,6 +95,11 @@ namespace OpenSim.Services.HypergridService
return null;
}
public void InvalidateCache(UUID userID)
{
m_UUIDCache.Remove(userID);
}
public bool StoreUserAccount(UserAccount data)
{
return false;

View File

@ -189,5 +189,7 @@ namespace OpenSim.Services.Interfaces
/// <param name="data"></param>
/// <returns></returns>
bool StoreUserAccount(UserAccount data);
void InvalidateCache(UUID userID);
}
}

View File

@ -256,6 +256,10 @@ namespace OpenSim.Services.UserAccountService
return MakeUserAccount(d[0]);
}
public void InvalidateCache(UUID userID)
{
}
public bool StoreUserAccount(UserAccount data)
{
// m_log.DebugFormat(