/** * Create an instance of {@link Plugin } * */ public Plugin createPlugin() { return new Plugin(); }
/** * a convenience wrapper to create a new plugin instance * * @param classname * @param displayname * @param appliesto FEDERATION_PUBLISH,SLA_RULE,SLA_ACTION, LOGGER * @return */ public static Plugin newPlugin(String classname, String displayname, String appliesto) { Plugin p = new Plugin(); p.setClassname(classname); p.setDisplayname(displayname); p.setPlugintype(appliesto); return p; }
req.setGetPluginInformationRequestWrapper(new GetPluginInformationRequestWrapper()); req.getGetPluginInformationRequestWrapper().setClassification(c); req.getGetPluginInformationRequestWrapper().setPlugin(new Plugin());
/** * * @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."; }
/** * 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); }
/** * * @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()); }