From: Alan Webb <alan_webb@us.ibm.com>

Fixed problem with REST services caused by changes to the OpenSim
  core code base - the comms manager had been 'modularized'.

  Also added additional debugging to RemoteAdmin interface.
0.6.5-rc1
Dr Scofield 2009-03-27 12:49:27 +00:00
parent f2b8691c9c
commit bf4d701cd5
6 changed files with 67 additions and 49 deletions

View File

@ -48,6 +48,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static Object rslock = new Object();
private OpenSimBase m_app;
private BaseHttpServer m_httpd;
private IConfig m_config;
@ -186,6 +188,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Restart Region request complete");
return response;
}
@ -194,6 +197,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
m_log.Info("[RADMIN]: Alert request started");
try
{
Hashtable requestData = (Hashtable) request.Params[0];
@ -230,6 +235,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Alert request complete");
return response;
}
@ -238,6 +244,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
m_log.Info("[RADMIN]: Load height maps request started");
try
{
Hashtable requestData = (Hashtable) request.Params[0];
@ -283,12 +291,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["error"] = e.Message;
}
m_log.Info("[RADMIN]: Load height maps request complete");
return response;
}
public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
{
m_log.Info("[RADMIN]: Received Shutdown Administrator Request");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
@ -347,6 +359,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Shutdown Administrator Request complete");
return response;
}
@ -433,7 +446,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
lock (this)
lock (rslock)
{
int m_regionLimit = m_config.GetInt("region_limit", 0);
@ -605,6 +618,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: CreateRegion: request complete");
return response;
}
}
@ -641,7 +655,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
lock (this)
lock (rslock)
{
try
{
@ -671,6 +685,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: DeleteRegion: request complete");
return response;
}
}
@ -719,7 +734,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
lock (this)
lock (rslock)
{
try
{
@ -779,6 +794,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: CreateUser: request complete");
return response;
}
}
@ -852,6 +868,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: UserExists: request complete");
return response;
}
@ -899,7 +916,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
lock (this)
lock (rslock)
{
try
{
@ -1002,6 +1019,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
}
m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
return response;
}
@ -1043,7 +1061,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
lock (this)
lock (rslock)
{
try
{
@ -1099,6 +1117,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Load OAR Administrator Request complete");
return response;
}
}
@ -1195,6 +1214,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Save OAR Administrator Request complete");
return response;
}
@ -1204,7 +1224,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
lock (this)
lock (rslock)
{
try
{
@ -1277,6 +1297,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Load XML Administrator Request complete");
return response;
}
}
@ -1360,6 +1381,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Save XML Administrator Request complete");
return response;
}
@ -1415,6 +1437,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
m_log.Info("[RADMIN]: Query XML Administrator Request complete");
return response;
}
@ -1422,4 +1445,4 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
}
}
}
}

View File

@ -69,11 +69,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal static IRestHandler Plugin = null;
internal static OpenSimBase main = null;
internal static CommunicationsManager Comms = null;
internal static IInventoryServices InventoryServices = null;
internal static IUserService UserServices = null;
internal static IAvatarService AvatarServices = null;
internal static IAssetCache AssetServices = null;
internal static string Prefix = null;
internal static IConfig Config = null;
internal static string GodKey = null;
@ -87,6 +82,39 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
internal static string Scheme = AS_BASIC;
internal static int DumpLineSize = 32; // Should be a multiple of 16 or (possibly) 4
/// <summary>
/// These are all dependent upon the Comms manager
/// being initialized. So they have to be properties
/// because the comms manager is now a module and is
/// not guaranteed to be there when the rest handler
/// initializes.
/// </summary>
internal static CommunicationsManager Comms
{
get { return main.CommunicationsManager; }
}
internal static IInventoryServices InventoryServices
{
get { return Comms.InventoryService; }
}
internal static IUserService UserServices
{
get { return Comms.UserService; }
}
internal static IAvatarService AvatarServices
{
get { return Comms.AvatarService; }
}
internal static IAssetCache AssetServices
{
get { return Comms.AssetCache; }
}
/// <summary>
/// HTTP requires that status information be generated for PUT
/// and POST opertaions. This is in support of that. The

View File

@ -55,16 +55,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.InfoFormat("{0} User appearance services initializing", MsgId);
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
// This is better than a null reference.
if (Rest.AvatarServices == null)
throw new Exception(String.Format("{0} OpenSim inventory services are not available",
MsgId));
if (Rest.UserServices == null)
throw new Exception(String.Format("{0} OpenSim user profile services are not available",
MsgId));
// If a relative path was specified for the handler's domain,
// add the standard prefix to make it absolute, e.g. /admin

View File

@ -46,12 +46,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.InfoFormat("{0} Asset services initializing", MsgId);
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
// This is better than a null reference.
if (Rest.AssetServices == null)
throw new Exception(String.Format("{0} OpenSim asset services are not available",
MsgId));
// If the handler specifies a relative path for its domain
// then we must add the standard absolute prefix, e.g. /admin

View File

@ -227,16 +227,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// them easy to reach from anywhere in the assembly.
Rest.main = openSim;
if(Rest.main == null)
throw new Exception("OpenSim base pointer is null");
Rest.Plugin = this;
Rest.Comms = Rest.main.CommunicationsManager;
Rest.UserServices = Rest.Comms.UserService;
Rest.InventoryServices = Rest.Comms.InventoryService;
Rest.AssetServices = Rest.Comms.AssetCache;
Rest.AvatarServices = Rest.Comms.AvatarService;
Rest.Config = Config;
Rest.Prefix = Prefix;
Rest.GodKey = GodKey;
Rest.Authenticate = Rest.Config.GetBoolean("authenticate", Rest.Authenticate);
Rest.Scheme = Rest.Config.GetString("auth-scheme", Rest.Scheme);
Rest.Secure = Rest.Config.GetBoolean("secured", Rest.Secure);
@ -253,7 +250,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
(Rest.Authenticate ? "" : "not "));
Rest.Log.InfoFormat("{0} Security is {1}enabled", MsgId,
(Rest.Authenticate ? "" : "not "));
(Rest.Secure ? "" : "not "));
Rest.Log.InfoFormat("{0} Extended URI escape processing is {1}enabled", MsgId,
(Rest.ExtendedEscape ? "" : "not "));

View File

@ -62,20 +62,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
Rest.Log.InfoFormat("{0} Inventory services initializing", MsgId);
Rest.Log.InfoFormat("{0} Using REST Implementation Version {1}", MsgId, Rest.Version);
// This is better than a null reference.
if (Rest.InventoryServices == null)
throw new Exception(String.Format("{0} OpenSim inventory services are not available",
MsgId));
if (Rest.UserServices == null)
throw new Exception(String.Format("{0} OpenSim user services are not available",
MsgId));
if (Rest.AssetServices == null)
throw new Exception(String.Format("{0} OpenSim asset services are not available",
MsgId));
// If a relative path was specified for the handler's domain,
// add the standard prefix to make it absolute, e.g. /admin