/** * returns a live copy of the select nvp if it exists, or null * * @param set * @param name * @return */ public static NameValuePair getNameValuePairByName(List<NameValuePair> set, String name) { if (set == null) { return null; } for (int i = 0; i < set.size(); i++) { if (set.get(i).getName().equalsIgnoreCase(name)) { return set.get(i); } } return null; }
public static String GetPluginParameterValue(List<NameValuePair> params, String parameterName) { if (params == null) { return ""; } for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals(parameterName)) { return params.get(i).getValue(); } } return ""; }
/** * returns "checked=checked" if the selected parameter exists and it's * already encrypted * * @param params * @param parameterName * @return */ public static String GetPluginParameterIsEncrypted(List<NameValuePair> params, String parameterName) { if (params == null) { return ""; } for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals(parameterName) && params.get(i).isEncrypted()) { return "checked=checked"; } } return ""; }
@Override public boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError, ServicePolicy policy) { if (outError == null) { outError = new AtomicReference<String>(); } if (params == null || params.isEmpty()) { outError.set("The parameter 'value' is required. " + outError.get()); } if (!(policy instanceof TransactionalWebServicePolicy)) { outError.set("This rule only applies to Transactional Service Policies. " + outError.get()); } boolean foundLogger = false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { outError.set("A value must be specified for the parameter 'value'. " + outError.get()); } } } if (!foundLogger) { outError.set("The parameter 'value' is required. " + outError.get()); } if (Utility.stringIsNullOrEmpty(outError.get())) { return true; } else { return false; } }
@Override public boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError, ServicePolicy sp) { if (outError == null) { outError = new AtomicReference<String>(); } if (params == null || params.isEmpty()) { outError.set("The parameter 'value' is required. " + outError.get()); } if (!(sp instanceof TransactionalWebServicePolicy)) { outError.set("This rule only applies to Transactional Service Policies. " + outError.get()); } boolean foundLogger = false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { outError.set("A value must be specified for the parameter 'value'. " + outError.get()); } } } if (!foundLogger) { outError.set("The parameter 'value' is required. " + outError.get()); } if (Utility.stringIsNullOrEmpty(outError.get())) { return true; } else { return false; } }
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
@Override public boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError) { if (outError == null) { outError = new AtomicReference<String>(); } if (params == null || params.isEmpty()) { outError.set("The parameter 'Logger' is required for action " + this.GetDisplayName() +". " + outError.get()); } boolean foundLogger=false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("Logger")) { foundLogger=true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { outError.set("A value must be specified for the parameter 'Logger'. " + outError.get()); } } } if (!foundLogger) outError.set("The parameter 'Logger' is required. " + outError.get()); if (Utility.stringIsNullOrEmpty(outError.get())) { return true; } else { return false; } }
@Override public boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError,ServicePolicy policy) { if (outError == null) { outError = new AtomicReference<String>(); } if (!(policy instanceof TransactionalWebServicePolicy)) { outError.set("This rule only applies to Transactional Service Policies. " + outError.get()); } if (params == null || params.isEmpty()) { outError.set("The parameter 'value' is required. " + outError.get()); } boolean foundLogger = false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { outError.set("A value must be specified for the parameter 'value'. " + outError.get()); } } } if (!foundLogger) { outError.set("The parameter 'value' is required. " + outError.get()); } if (Utility.stringIsNullOrEmpty(outError.get())) { return true; } else { return false; } } @Override
@Override public boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError,ServicePolicy policy) { if (outError == null) { outError = new AtomicReference<String>(); } if (params == null || params.isEmpty()) { outError.set("The parameter 'value' is required. " + outError.get()); } if (!(policy instanceof TransactionalWebServicePolicy)) { outError.set("This rule only applies to Transactional Service Policies. " + outError.get()); } boolean foundLogger = false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { outError.set("A value must be specified for the parameter 'value'. " + outError.get()); } } } if (!foundLogger) { outError.set("The parameter 'value' is required. " + outError.get()); } if (Utility.stringIsNullOrEmpty(outError.get())) { return true; } else { return false; } } @Override
boolean foundBody=false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("Subject")) { foundSubject=true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { if (params.get(i).getName().equals("Body")) { foundBody=true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("duration")) { foundduration = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) {
public static String PluginToReadonlyHtmlString(FederationPolicy fp, int index, HttpServletRequest request) { StringBuilder out = new StringBuilder(); out.append("<table border=1><tr><th>Key</th><th>Value</th></tr>"); out.append("<tr><td >Policy Id " + (index) + "</td><td>"); out.append("<input type=button value=\"Edit\" name=\"EditFedPol" + index + "\" " + " onclick=\"javascript:postBackReRender('EditFedPol" + index + "','profile/getPolicy.jsp?url=" + URLEncoder.encode(request.getParameter("url")) + "','tab1');\">" + "<input type=button value=Remove name=\"RemoveFedPol" + index + "\" onclick=\"javascript:postBackReRender('RemoveFedPol" + index + "','profile/getPolicy.jsp?url=" + URLEncoder.encode(request.getParameter("url")) + "','tab1');\"></td></tr>"); out.append("<tr><td>Plugin</td><td>" + Utility.encodeHTML(fp.getImplementingClassName()) + "</td></tr>"); for (int i = 0; i < fp.getParameterNameValue().size(); i++) { out.append("<tr><td>").append(Utility.encodeHTML(fp.getParameterNameValue().get(i).getName())).append("</td><td>"); if (fp.getParameterNameValue().get(i).isEncrypted()) { out.append("ENCRYPTED"); } else { out.append(Utility.encodeHTML(fp.getParameterNameValue().get(i).getValue())); } out.append("</td></tr>"); } out.append("</td></tr>"); //end federation tab out.append("</table>"); return out.toString(); }
public static String federationPluginEditableHtml(FederationPolicy fp, int index, HttpServletRequest request) { StringBuilder out = new StringBuilder(); out.append("<table class=\"table table-hover\"><tr><th>Key</th><th>Value</th></tr>"); out.append("<tr><td >Policy Id " + (index) + "</td><td>"); out.append("<input type=button value=\"Edit\" name=\"EditFedPol" + index + "\" " + " onclick=\"javascript:postBackReRender('EditFedPol" + index + "','profile/getPolicy.jsp?url=" + URLEncoder.encode(request.getParameter("url")) + "','tab1');\">" + "<input type=button value=Remove name=\"RemoveFedPol" + index + "\" onclick=\"javascript:postBackReRender('RemoveFedPol" + index + "','profile/getPolicy.jsp?url=" + URLEncoder.encode(request.getParameter("url")) + "','tab1');\"></td></tr>"); out.append("<tr><td>Plugin</td><td>" + Utility.encodeHTML(fp.getImplementingClassName()) + "</td></tr>"); for (int i = 0; i < fp.getParameterNameValue().size(); i++) { out.append("<tr><td>").append(Utility.encodeHTML(fp.getParameterNameValue().get(i).getName())).append("</td><td>"); if (fp.getParameterNameValue().get(i).isEncrypted()) { out.append("ENCRYPTED"); } else { out.append(Utility.encodeHTML(fp.getParameterNameValue().get(i).getValue())); } out.append("</td></tr>"); } out.append("</td></tr>"); //end federation tab out.append("</table>"); return out.toString(); }
@Override public boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError, ServicePolicy policy) { if (outError == null) { outError = new AtomicReference<String>(); } if (params == null || params.isEmpty()) { outError.set("The parameter 'value' is required for rule " + this.GetDisplayName() +". " + outError.get()); } if (!(policy instanceof TransactionalWebServicePolicy)) { outError.set("This rule only applies to Transactional Service Policies. " + outError.get()); } boolean foundLogger = false; for (int i = 0; i < params.size(); i++) { if (params.get(i).getName().equals("value")) { foundLogger = true; if (Utility.stringIsNullOrEmpty(params.get(i).getValue())) { outError.set("A value must be specified for the parameter 'value' for rule " + this.GetDisplayName() +". " + outError.get()); } } } if (!foundLogger) { outError.set("The parameter 'value' is required " + this.GetDisplayName() +". " + outError.get()); } if (Utility.stringIsNullOrEmpty(outError.get())) { return true; } else { return false; } }