adminagent.java
来自「开源的axis2框架的源码。用于开发WEBSERVER」· Java 代码 · 共 624 行 · 第 1/2 页
JAVA
624 行
serviceName).getOperation(new QName(operationName));
od.engageModule(
configContext.getAxisConfiguration().getModule(moduleName));
req.getSession().setAttribute(Constants.ENGAGE_STATUS,
moduleName
+
" module engaged to the operation successfully");
} catch (AxisFault axisFault) {
req.getSession().setAttribute(Constants.ENGAGE_STATUS, axisFault.getMessage());
}
}
req.getSession().setAttribute("operation", null);
renderView(ENGAGE_TO_OPERATION_JSP_NAME, req, res);
}
protected void processEngageToService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
populateSessionInformation(req);
String moduleName = req.getParameter("modules");
req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
req.getSession().setAttribute("modules", null);
String serviceName = req.getParameter("axisService");
req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
if ((serviceName != null) && (moduleName != null)) {
try {
configContext.getAxisConfiguration().getService(serviceName).engageModule(
configContext.getAxisConfiguration().getModule(moduleName));
req.getSession().setAttribute(Constants.ENGAGE_STATUS,
moduleName
+
" module engaged to the service successfully");
} catch (AxisFault axisFault) {
req.getSession().setAttribute(Constants.ENGAGE_STATUS, axisFault.getMessage());
}
}
req.getSession().setAttribute("axisService", null);
renderView(ENGAGING_MODULE_TO_SERVICE_JSP_NAME, req, res);
}
protected void processEngageToServiceGroup(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
Iterator services = configContext.getAxisConfiguration().getServiceGroups();
req.getSession().setAttribute(Constants.SERVICE_GROUP_MAP, services);
String moduleName = req.getParameter("modules");
req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
req.getSession().setAttribute("modules", null);
String serviceName = req.getParameter("axisService");
req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
if ((serviceName != null) && (moduleName != null)) {
configContext.getAxisConfiguration().getServiceGroup(serviceName).engageModule(
configContext.getAxisConfiguration().getModule(moduleName));
req.getSession().setAttribute(Constants.ENGAGE_STATUS,
moduleName
+
" module engaged to the service group successfully");
}
req.getSession().setAttribute("axisService", null);
renderView(ENGAGING_MODULE_TO_SERVICE_GROUP_JSP_NAME, req, res);
}
protected void processLogout(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
req.getSession().invalidate();
renderView("index.jsp", req, res);
}
protected void processviewServiceGroupConetxt(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String type = req.getParameter("TYPE");
String sgID = req.getParameter("ID");
ServiceGroupContext sgContext = configContext.getServiceGroupContext(sgID);
req.getSession().setAttribute("ServiceGroupContext",sgContext);
req.getSession().setAttribute("TYPE",type);
req.getSession().setAttribute("ConfigurationContext",configContext);
renderView("viewServiceGroupContext.jsp", req, res);
}
protected void processviewServiceContext(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String type = req.getParameter("TYPE");
String sgID = req.getParameter("PID");
String ID = req.getParameter("ID");
ServiceGroupContext sgContext = configContext.getServiceGroupContext(sgID);
if (sgContext != null) {
AxisService service = sgContext.getDescription().getService(ID);
ServiceContext serviceContext = sgContext.getServiceContext(service);
req.setAttribute("ServiceContext",serviceContext);
req.setAttribute("TYPE",type);
} else {
req.setAttribute("ServiceContext",null);
req.setAttribute("TYPE",type);
}
renderView("viewServiceContext.jsp", req, res);
}
protected void processSelectServiceParaEdit(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
populateSessionInformation(req);
req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "SERVICE_PARAMETER");
renderView(SELECT_SERVICE_JSP_NAME, req, res);
}
protected void processListOperation(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
populateSessionInformation(req);
req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "MODULE");
renderView(SELECT_SERVICE_JSP_NAME, req, res);
}
protected void processActivateService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
if (req.getParameter("submit") != null) {
String serviceName = req.getParameter("axisService");
String turnon = req.getParameter("turnon");
if (serviceName != null) {
if (turnon != null) {
configContext.getAxisConfiguration().startService(serviceName);
}
}
}
populateSessionInformation(req);
renderView(ACTIVATE_SERVICE_JSP_NAME, req, res);
}
protected void processDeactivateService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
if (req.getParameter("submit") != null) {
String serviceName = req.getParameter("axisService");
String turnoff = req.getParameter("turnoff");
if (serviceName != null) {
if (turnoff != null) {
configContext.getAxisConfiguration().stopService(serviceName);
}
populateSessionInformation(req);
}
} else {
populateSessionInformation(req);
}
renderView(IN_ACTIVATE_SERVICE_JSP_NAME, req, res);
}
protected void processViewGlobalHandlers(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
req.getSession().setAttribute(Constants.GLOBAL_HANDLERS,
configContext.getAxisConfiguration());
renderView(VIEW_GLOBAL_HANDLERS_JSP_NAME, req, res);
}
protected void processViewServiceHandlers(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String service = req.getParameter("axisService");
if (service != null) {
req.getSession().setAttribute(Constants.SERVICE_HANDLERS,
configContext.getAxisConfiguration().getService(service));
}
renderView(VIEW_SERVICE_HANDLERS_JSP_NAME, req, res);
}
protected void processListPhases(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
PhasesInfo info = configContext.getAxisConfiguration().getPhasesInfo();
req.getSession().setAttribute(Constants.PHASE_LIST, info);
renderView(LIST_PHASES_JSP_NAME, req, res);
}
protected void processListServiceGroups(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
Iterator serviceGroups = configContext.getAxisConfiguration().getServiceGroups();
populateSessionInformation(req);
req.getSession().setAttribute(Constants.SERVICE_GROUP_MAP, serviceGroups);
renderView(LIST_SERVICE_GROUP_JSP, req, res);
}
protected void processListService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
populateSessionInformation(req);
req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP,
configContext.getAxisConfiguration().getFaultyServices());
renderView(LIST_SERVICES_JSP_NAME, req, res);
}
protected void processListSingleService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
req.getSession().setAttribute(Constants.IS_FAULTY, ""); //Clearing out any old values.
String serviceName = req.getParameter("serviceName");
if (serviceName != null) {
AxisService service = configContext.getAxisConfiguration().getService(serviceName);
req.getSession().setAttribute(Constants.SINGLE_SERVICE, service);
}
renderView(LIST_SINGLE_SERVICES_JSP_NAME, req, res);
}
protected void processListContexts(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
req.getSession().setAttribute(Constants.CONFIG_CONTEXT, configContext);
renderView("ViewContexts.jsp", req, res);
}
protected void processglobalModules(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
Collection modules = configContext.getAxisConfiguration().getEngagedModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
renderView(LIST_GLOABLLY_ENGAGED_MODULES_JSP_NAME, req, res);
}
protected void processListModules(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
HashMap modules = configContext.getAxisConfiguration().getModules();
req.getSession().setAttribute(Constants.MODULE_MAP, modules);
req.getSession().setAttribute(Constants.ERROR_MODULE_MAP,
configContext.getAxisConfiguration().getFaultyModules());
renderView(LIST_AVAILABLE_MODULES_JSP_NAME, req, res);
}
protected void processdisengageModule(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String type = req.getParameter("type");
String serviceName = req.getParameter("serviceName");
String moduleName = req.getParameter("module");
AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
AxisService service = axisConfiguration.getService(serviceName);
AxisModule module = axisConfiguration.getModule(moduleName);
if (type.equals("operation")) {
if (service.isEngaged(module.getName()) ||
axisConfiguration.isEngaged(module.getName())) {
req.getSession().setAttribute("status", "Can not disengage module " + moduleName +
". This module is engaged at a higher level.");
} else {
String opName = req.getParameter("operation");
AxisOperation op = service.getOperation(new QName(opName));
op.disengageModule(module);
req.getSession()
.setAttribute("status", "Module " + moduleName + " was disengaged from " +
"operation " + opName + " in service " + serviceName + ".");
}
} else {
if (axisConfiguration.isEngaged(module.getName())) {
req.getSession()
.setAttribute("status", "Can not disengage module " + moduleName + ". " +
"This module is engaged at a higher level.");
} else {
service.disengageModule(axisConfiguration.getModule(moduleName));
req.getSession()
.setAttribute("status", "Module " + moduleName + " was disengaged from" +
" service " + serviceName + ".");
}
}
renderView("disengage.jsp", req, res);
}
protected void processSelectService(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
populateSessionInformation(req);
req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "VIEW");
renderView(SELECT_SERVICE_JSP_NAME, req, res);
}
private boolean authorizationRequired
(HttpServletRequest
httpServletRequest) {
return httpServletRequest.getSession().getAttribute(Constants.LOGGED) == null &&
!httpServletRequest.getRequestURI().endsWith("login");
}
private boolean axisSecurityEnabled
() {
Parameter parameter = configContext.getAxisConfiguration()
.getParameter(Constants.ADMIN_SECURITY_DISABLED);
return parameter == null || !"true".equals(parameter.getValue());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?