Filling in some more web handlers

integration
BlueWall 2012-04-22 22:47:29 -04:00
parent e8909703ae
commit 6a69c3ac04
3 changed files with 170 additions and 20 deletions

View File

@ -66,28 +66,62 @@ namespace OpenSim.Server.Handlers.Integration
{
OSDMap request = null;
if (ServerUtils.ParseStringToOSDMap(body, out request) == false)
{
return FailureResult();
// Dictionary<string, object> request = ServerUtils.ParseQueryString(body);
}
if (!request.ContainsKey("command"))
{
return FailureResult("Error, no command defined!");
string command = request["command"].AsString();
}
string command = request["command"].AsString ();
// command...
switch (command)
{
// agent
case "list_plugins":
return HandleListPlugins(request);
case "list_available":
return HandleListAvailablePlugins(request);
case "install_plugin":
return HandleInstallPlugin(request);
case "uninstall_plugin":
return HandleUnInstallPlugin(request);
case "enable_plugin":
return HandleEnablePlugin (request);
case "disable_plugin":
return HandleDisblePlugin(request);
case "plugin_info":
return HandlePluginInfo(request);
break;
case "list_repos":
return HandleListRepositories (request);
case "add_repo":
return HandleAddRepository(request);
case "remove_repo":
return HandleRemoveRepository(request);
case "enable_repo":
return HandleEnablePlugin(request);
case "disable_repo":
return HandleDisableRepository(request);
default:
m_log.DebugFormat("[INTEGRATION HANDLER]: unknown method {0} request {1}", command.Length, command);
return FailureResult("IntegrationHandler: Unrecognized method requested!");
m_log.DebugFormat(
"[INTEGRATION HANDLER]: unknown method {0} request {1}",
command.Length,
command
);
return FailureResult ("IntegrationHandler: Unrecognized method requested!");
}
}
catch (Exception e)
@ -99,30 +133,77 @@ namespace OpenSim.Server.Handlers.Integration
}
#region web handlers
// List installed plugins
private byte[] HandleListPlugins(OSDMap request)
{
return m_IntegrationService.HandleWebListPlugins(request);
}
// Show plugin info
private byte[] HandlePluginInfo(OSDMap request)
{
return m_IntegrationService.HandleWebPluginInfo(request);
}
public byte[] HandleWebListAvailablePlugins(OSDMap request)
// Enable plugin
private byte[] HandleEnablePlugin(OSDMap request)
{
return m_IntegrationService.HandleWebListAvailablePlugins(request);
return m_IntegrationService.HandleWebEnablePlugin(request);
}
public byte[] HandleWebInstallPlugin(OSDMap request)
// Disable plugin
private byte[] HandleDisblePlugin(OSDMap request)
{
return m_IntegrationService.HandleWebDisablePlugin(request);
}
// Install plugin
public byte[] HandleInstallPlugin(OSDMap request)
{
return m_IntegrationService.HandleWebInstallPlugin(request);
}
public byte[] HnadleWebUnInstallPlugin(OSDMap request)
// Uninstall plugin
public byte[] HandleUnInstallPlugin(OSDMap request)
{
return m_IntegrationService.HandleWebUnInstallPlugin(request);
}
// List available plugins
public byte[] HandleListAvailablePlugins(OSDMap request)
{
return m_IntegrationService.HandleWebListAvailablePlugins(request);
}
// List repositories
public byte[] HandleListRepositories(OSDMap request)
{
return m_IntegrationService.HandleWebListRepositories(request);
}
// Add repository
public byte[] HandleAddRepository(OSDMap request)
{
return m_IntegrationService.HandleWebAddRepository(request);
}
// Remove repository
public byte[] HandleRemoveRepository(OSDMap request)
{
return m_IntegrationService.HandleWebRemoveRepositroy(request);
}
// Enable repository
public byte[] HandleEnableRepository(OSDMap request)
{
return m_IntegrationService.HandleEnableRepository(request);
}
// Disable repository
public byte[] HandleDisableRepository(OSDMap request)
{
return m_IntegrationService.HandleWebDisableRepository(request);
}
#endregion web handlers
#region utility

View File

@ -249,28 +249,90 @@ namespace OpenSim.Services.IntegrationService
}
#endregion
#region web handlers
public byte[] HandleWebListPlugins(OSDMap request)
// #region web handlers
// public byte[] HandleWebListPlugins(OSDMap request)
// {
// return Ux.FailureResult("Not Implemented");
// }
//
// public byte[] HandleWebPluginInfo(OSDMap request)
// {
// return Ux.FailureResult("Not Implemented");
// }
//
// public byte[] HandleWebListAvailablePlugins(OSDMap request)
// {
// return Ux.FailureResult("Not Implemented");
// }
//
// public byte[] HandleWebInstallPlugin(OSDMap request)
// {
// return Ux.FailureResult("Not Implemented");
// }
//
// public byte[] HandleWebUnInstallPlugin(OSDMap request)
// {
// return Ux.FailureResult("Not Implemented");
// }
// #endregion
#region IIntegrationService implementation
public byte[] HandleWebListRepositories (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebPluginInfo(OSDMap request)
public byte[] HandleWebAddRepository (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebListAvailablePlugins(OSDMap request)
public byte[] HandleWebRemoveRepositroy (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebInstallPlugin(OSDMap request)
public byte[] HandleEnableRepository (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebUnInstallPlugin(OSDMap request)
public byte[] HandleWebDisableRepository (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebListPlugins (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebPluginInfo (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebListAvailablePlugins (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebInstallPlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebUnInstallPlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebEnablePlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebDisablePlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}

View File

@ -37,11 +37,18 @@ namespace OpenSim.Services.Interfaces
public interface IIntegrationService
{
#region Web handlers
byte[] HandleWebListRepositories(OSDMap request);
byte[] HandleWebAddRepository(OSDMap request);
byte[] HandleWebRemoveRepositroy(OSDMap request);
byte[] HandleEnableRepository(OSDMap request);
byte[] HandleWebDisableRepository(OSDMap request);
byte[] HandleWebListPlugins(OSDMap request);
byte[] HandleWebPluginInfo(OSDMap request);
byte[] HandleWebListAvailablePlugins(OSDMap request);
byte[] HandleWebInstallPlugin(OSDMap request);
byte[] HandleWebUnInstallPlugin(OSDMap request);
byte[] HandleWebEnablePlugin(OSDMap request);
byte[] HandleWebDisablePlugin(OSDMap request);
#endregion
}
}