1 19 20 package com.sslexplorer.security; 21 22 import java.util.Iterator ; 23 import java.util.List ; 24 25 import javax.servlet.http.HttpServletRequest ; 26 27 import com.sslexplorer.core.CoreUtil; 28 import com.sslexplorer.policyframework.ResourceItem; 29 30 37 public class AuthenticationSchemeSequenceItem extends ResourceItem { 38 39 45 public AuthenticationSchemeSequenceItem(AuthenticationScheme sequence, List policies) { 46 super(sequence, policies); 47 } 48 49 54 public AuthenticationScheme getSequence() { 55 return (AuthenticationScheme) getResource(); 56 } 57 58 61 public String getSmallIconPath(HttpServletRequest request) { 62 return ((AuthenticationScheme) getResource()).getEnabled() ? CoreUtil.getThemePath(request.getSession()) 63 + "/images/actions/start.gif" : CoreUtil.getThemePath(request.getSession()) + "/images/actions/stop.gif"; 64 } 65 66 72 public boolean isCanMoveUp() { 73 AuthenticationScheme route = (AuthenticationScheme) getResource(); 74 return route.getPriorityInt() != 1; 75 } 76 77 82 public boolean isCanMoveDown() { 83 return true; 84 } 85 86 93 public String getDescription() { 94 StringBuffer buf = new StringBuffer (); 95 buf.append("Consists of "); 96 buf.append(getSequence().getModuleCount()); 97 if (getSequence().getModuleCount() == 1) { 98 buf.append(" module"); 99 } else { 100 buf.append(" modules"); 101 } 102 buf.append(".<br/>"); 103 for (Iterator i = getSequence().modules(); i.hasNext();) { 104 buf.append(" <b>"); 105 buf.append(i.next()); 106 buf.append("</b><br/>"); 107 } 108 return buf.toString(); 109 } 110 111 114 public Object getColumnValue(int col) { 115 switch (col) { 116 case 0: 117 return getSequence().getSchemeName(); 118 case 1: 119 return Boolean.valueOf(getSequence().getEnabled()); 120 default: 121 return new Integer (getSequence().getPriority()); 122 } 123 } 124 } 125 | Popular Tags |