public static SecurityWrapper GetCurrentSecurityLevel(ProxyLoader pl, ServletContext app, HttpServletRequest request, HttpServletResponse response) throws Exception { if (pl == null) { pl = ProxyLoader.getInstance(app); } PCS pcs = pl.GetPCS(app, request, response); GetGlobalPolicyResponseMsg globalPolicy = pcs.getGlobalPolicy(new GetGlobalPolicyRequestMsg()); return globalPolicy.getClassification(); }
ServicePolicyResponseMsg servicePolicy = cfg.pcsport.getServicePolicy(req); cfg.classlevel = servicePolicy.getClassification(); return servicePolicy.getPolicy(); ServicePolicyResponseMsg servicePolicy = cfg.pcsport.getServicePolicy(req); cfg.classlevel = servicePolicy.getClassification(); return servicePolicy.getPolicy();
if (res == null) { try { res = pcsport.getProcessesListByMachine(req); } catch (AccessDeniedException ex) { LogHelper.getLog().log(Level.WARN, null, ex);
res.setClassification(c); res.setURI(urls[i]); servicePolicy = pcs.getServicePolicy(res); pcs.setServicePolicy(req); ret += "Service Policy Updated for <a href=\"manage.jsp?url=" + URLEncoder.encode(urls[i]) + "\">" + StringEscapeUtils.escapeHtml4(urls[i]) + "</a>. Don't forget to select what kind of data you want to be published!<br>"; } catch (AccessDeniedException ex) {
r.setRequest(req); try { GetPluginInformationResponse pluginInformation = pcs.getPluginInformation(r);
SetProcessListByMachineResponseMsg servicePolicy = cfg.pcsport.setProcessListByMachine(req); cfg.classlevel = servicePolicy.getClassification(); return servicePolicy; System.setProperty("javax.net.ssl.trustStore", Utility.DE(cfg.getJavaxtruststore())); SetProcessListByMachineResponseMsg servicePolicy = cfg.pcsport.setProcessListByMachine(req); cfg.classlevel = servicePolicy.getClassification(); return servicePolicy;
public static List<Plugin> GetPluginList(PCS pcs, SecurityWrapper c, String item_type, PolicyType pt) { if (item_type == null) { return Collections.EMPTY_LIST; } GetPluginListRequestMsg req = new GetPluginListRequestMsg(); req.setClassification(c); req.setPlugintype(item_type); req.setOptionalPolicyTypeFilter(pt); GetPluginList r = new GetPluginList(); r.setRequest(req); try { GetPluginListResponse pluginList = pcs.getPluginList(r); return pluginList.getResponse().getPlugins(); } catch (Exception ex) { LogHelper.getLog().error(ex); } return Collections.EMPTY_LIST; }
/** * * @param action * @param pcs * @param c * @param item_type FEDERATION_PUBLISH,SLA_RULE,SLA_ACTION * @return */ public static String GetPluginHelp(SLAAction action, PCS pcs, SecurityWrapper c, String item_type) { if (action == null) { return "Null Action"; } GetPluginInformationRequestMsg req = new GetPluginInformationRequestMsg(); req.setGetPluginInformationRequestWrapper(new GetPluginInformationRequestWrapper()); req.getGetPluginInformationRequestWrapper().setClassification(c); req.getGetPluginInformationRequestWrapper().setPlugin(new Plugin()); req.getGetPluginInformationRequestWrapper().getPlugin().setClassname(action.getImplementingClassName()); req.getGetPluginInformationRequestWrapper().getPlugin().setPlugintype(item_type); GetPluginInformation r = new GetPluginInformation(); r.setRequest(req); try { GetPluginInformationResponse pluginInformation = pcs.getPluginInformation(r); return pluginInformation.getResponse().getHelp(); } catch (Exception ex) { LogHelper.getLog().error(ex); } return "No help information could be found."; }
GetGlobalPolicyResponseMsg servicePolicy = cfg.pcsport.getGlobalPolicy(req); GetGlobalPolicyResponseMsg servicePolicy = cfg.pcsport.getGlobalPolicy(req);
request.setMachine(new URL(url).getHost()); ServicePolicyResponseMsg result = cfg.pcsport.getServicePolicy(request); request.setMachine(new URL(url).getHost()); ServicePolicyResponseMsg result = cfg.pcsport.getServicePolicy(request); result.getPolicy(); ok = true;
/** * report type to a friendly name for report types * * @param r * @return */ public static String ToFriendlyName(String action, PCS pcs, SecurityWrapper c) { if (action == null) { return "Null classname"; } GetPluginInformationRequestMsg req = new GetPluginInformationRequestMsg(); req.setGetPluginInformationRequestWrapper(new GetPluginInformationRequestWrapper()); req.getGetPluginInformationRequestWrapper().setClassification(c); req.getGetPluginInformationRequestWrapper().setPlugin(new Plugin()); req.getGetPluginInformationRequestWrapper().getPlugin().setClassname(action); req.getGetPluginInformationRequestWrapper().getPlugin().setPlugintype("REPORTING"); GetPluginInformation r = new GetPluginInformation(); r.setRequest(req); try { GetPluginInformationResponse pluginInformation = pcs.getPluginInformation(r); return Utility.encodeHTML(pluginInformation.getResponse().getDisplayName()); } catch (Exception ex) { LogHelper.getLog().error(ex); } return "Unrecognized report type " + Utility.encodeHTML(action); }
public String GetPartitionNamesAsHtmlListboxForThroughput(String url, String domain, String machine, PCS pcsport, SecurityWrapper c, List<String> existingItems) { GetProcessesListByMachineRequestMsg req = new GetProcessesListByMachineRequestMsg(); req.setClassification(c); req.setHostname(machine); StringBuilder s = new StringBuilder(); if (res == null) { try { res = pcsport.getProcessesListByMachine(req); } catch (AccessDeniedException ex) { LogHelper.getLog().log(Level.WARN, null, ex); } catch (ServiceUnavailableException ex) { LogHelper.getLog().log(Level.WARN, null, ex); } } if (res != null && res.getMachineInformation() != null) { s = s.append("<select name=\"recorddiskusage\" id=\"recorddiskusage\" multiple=\"multiple\" >"); for (int i = 0; i < res.getMachineInformation().getDriveInformation().size(); i++) { s = s.append(" <option value=\"").append(Utility.encodeHTML(res.getMachineInformation().getDriveInformation().get(i).getSystemid())).append("\""); if (isIn(res.getMachineInformation().getDriveInformation().get(i).getSystemid(), existingItems)) { s = s.append(" selected "); } s = s.append(" >"). append(Utility.encodeHTML(res.getMachineInformation().getDriveInformation().get(i).getSystemid())).append("</option>"); } s = s.append("</select>"); } else { s = s.append("<input type=text name=\"recorddiskusage\" value=\"").append(Utility.encodeHTML(Utility.listStringtoString(existingItems))).append("\" >"); } return s.toString(); }
/** * * @param action * @param pcs * @param c * @param item_type FEDERATION_PUBLISH,SLA_RULE,SLA_ACTION * @return html escaped friendly name of the plugin */ public static String ToFriendlyName(SLAAction action, PCS pcs, SecurityWrapper c) { if (action == null) { return "Null Action"; } GetPluginInformationRequestMsg req = new GetPluginInformationRequestMsg(); req.setGetPluginInformationRequestWrapper(new GetPluginInformationRequestWrapper()); req.getGetPluginInformationRequestWrapper().setClassification(c); req.getGetPluginInformationRequestWrapper().setPlugin(new Plugin()); req.getGetPluginInformationRequestWrapper().getPlugin().setClassname(action.getImplementingClassName()); req.getGetPluginInformationRequestWrapper().getPlugin().setPlugintype("SLA_ACTION"); GetPluginInformation r = new GetPluginInformation(); r.setRequest(req); try { GetPluginInformationResponse pluginInformation = pcs.getPluginInformation(r); return Utility.encodeHTML(pluginInformation.getResponse().getDisplayName()); } catch (Exception ex) { LogHelper.getLog().error(ex); } return "Unrecognized action, " + Utility.encodeHTML(action.getImplementingClassName()); }
if (res == null) { try { res = pcsport.getProcessesListByMachine(req); } catch (AccessDeniedException ex) { LogHelper.getLog().log(Level.WARN, null, ex);