1 7 8 package javax.security.auth.login; 9 10 import java.util.Map ; 11 import java.util.Collections ; 12 13 27 public class AppConfigurationEntry { 28 29 private String loginModuleName; 30 private LoginModuleControlFlag controlFlag; 31 private Map options; 32 33 56 public AppConfigurationEntry(String loginModuleName, 57 LoginModuleControlFlag controlFlag, 58 Map <String ,?> options) 59 { 60 if (loginModuleName == null || loginModuleName.length() == 0 || 61 (controlFlag != LoginModuleControlFlag.REQUIRED && 62 controlFlag != LoginModuleControlFlag.REQUISITE && 63 controlFlag != LoginModuleControlFlag.SUFFICIENT && 64 controlFlag != LoginModuleControlFlag.OPTIONAL) || 65 options == null) 66 throw new IllegalArgumentException (); 67 68 this.loginModuleName = loginModuleName; 69 this.controlFlag = controlFlag; 70 this.options = Collections.unmodifiableMap(options); 71 } 72 73 79 public String getLoginModuleName() { 80 return loginModuleName; 81 } 82 83 92 public LoginModuleControlFlag getControlFlag() { 93 return controlFlag; 94 } 95 96 102 public Map <String ,?> getOptions() { 103 return options; 104 } 105 106 110 public static class LoginModuleControlFlag { 111 112 private String controlFlag; 113 114 117 public static final LoginModuleControlFlag REQUIRED = 118 new LoginModuleControlFlag("required"); 119 120 123 public static final LoginModuleControlFlag REQUISITE = 124 new LoginModuleControlFlag("requisite"); 125 126 129 public static final LoginModuleControlFlag SUFFICIENT = 130 new LoginModuleControlFlag("sufficient"); 131 132 135 public static final LoginModuleControlFlag OPTIONAL = 136 new LoginModuleControlFlag("optional"); 137 138 private LoginModuleControlFlag(String controlFlag) { 139 this.controlFlag = controlFlag; 140 } 141 142 147 public String toString() { 148 return (sun.security.util.ResourcesMgr.getString 149 ("LoginModuleControlFlag: ") + controlFlag); 150 } 151 } 152 } 153 | Popular Tags |