58 *
59 * @param loginModuleName String representing the class name of the
60 * {@code LoginModule} configured for the
61 * specified application.
62 *
63 * @param controlFlag either REQUIRED, REQUISITE, SUFFICIENT,
64 * or OPTIONAL.
65 *
66 * @param options the options configured for this {@code LoginModule}.
67 *
68 * @exception IllegalArgumentException if {@code loginModuleName}
69 * is null, if {@code LoginModuleName}
70 * has a length of 0, if {@code controlFlag}
71 * is not either REQUIRED, REQUISITE, SUFFICIENT
72 * or OPTIONAL, or if {@code options} is null.
73 */
74 public AppConfigurationEntry(String loginModuleName,
75 LoginModuleControlFlag controlFlag,
76 Map<String,?> options)
77 {
78 if (loginModuleName == null || loginModuleName.length() == 0 ||
79 (controlFlag != LoginModuleControlFlag.REQUIRED &&
80 controlFlag != LoginModuleControlFlag.REQUISITE &&
81 controlFlag != LoginModuleControlFlag.SUFFICIENT &&
82 controlFlag != LoginModuleControlFlag.OPTIONAL) ||
83 options == null)
84 throw new IllegalArgumentException();
85
86 this.loginModuleName = loginModuleName;
87 this.controlFlag = controlFlag;
88 this.options = Collections.unmodifiableMap(options);
89 }
90
91 /**
92 * Get the class name of the configured {@code LoginModule}.
93 *
94 * @return the class name of the configured {@code LoginModule} as
95 * a String.
96 */
97 public String getLoginModuleName() {
98 return loginModuleName;
|
58 *
59 * @param loginModuleName String representing the class name of the
60 * {@code LoginModule} configured for the
61 * specified application.
62 *
63 * @param controlFlag either REQUIRED, REQUISITE, SUFFICIENT,
64 * or OPTIONAL.
65 *
66 * @param options the options configured for this {@code LoginModule}.
67 *
68 * @exception IllegalArgumentException if {@code loginModuleName}
69 * is null, if {@code LoginModuleName}
70 * has a length of 0, if {@code controlFlag}
71 * is not either REQUIRED, REQUISITE, SUFFICIENT
72 * or OPTIONAL, or if {@code options} is null.
73 */
74 public AppConfigurationEntry(String loginModuleName,
75 LoginModuleControlFlag controlFlag,
76 Map<String,?> options)
77 {
78 if (loginModuleName == null || loginModuleName.isEmpty() ||
79 (controlFlag != LoginModuleControlFlag.REQUIRED &&
80 controlFlag != LoginModuleControlFlag.REQUISITE &&
81 controlFlag != LoginModuleControlFlag.SUFFICIENT &&
82 controlFlag != LoginModuleControlFlag.OPTIONAL) ||
83 options == null)
84 throw new IllegalArgumentException();
85
86 this.loginModuleName = loginModuleName;
87 this.controlFlag = controlFlag;
88 this.options = Collections.unmodifiableMap(options);
89 }
90
91 /**
92 * Get the class name of the configured {@code LoginModule}.
93 *
94 * @return the class name of the configured {@code LoginModule} as
95 * a String.
96 */
97 public String getLoginModuleName() {
98 return loginModuleName;
|