001/** 002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 003 * 004 * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved 005 * 006 * The contents of this file are subject to the terms 007 * of the Common Development and Distribution License 008 * (the License). You may not use this file except in 009 * compliance with the License. 010 * 011 * You can obtain a copy of the License at 012 * https://opensso.dev.java.net/public/CDDLv1.0.html or 013 * opensso/legal/CDDLv1.0.txt 014 * See the License for the specific language governing 015 * permission and limitations under the License. 016 * 017 * When distributing Covered Code, include this CDDL 018 * Header Notice in each file and include the License file 019 * at opensso/legal/CDDLv1.0.txt. 020 * If applicable, add the following below the CDDL Header, 021 * with the fields enclosed by brackets [] replaced by 022 * your own identifying information: 023 * "Portions Copyrighted [year] [name of copyright owner]" 024 * 025 * $Id: PagePropertiesCallback.java,v 1.2 2008/06/25 05:42:06 qcheng Exp $ 026 * 027 */ 028 029/* 030 * Portions Copyrighted 2011-2012 ForgeRock AS 031 */ 032 033package com.sun.identity.authentication.spi; 034 035import java.util.List; 036 037import javax.security.auth.callback.Callback; 038 039/** 040 * <code>PagePropertiesCallback</code> class implements 041 * <code>Callback</code> and used for exchanging all UI related attributes 042 * information such as template name, <code>errorState</code> to indicate 043 * whether a template is an error page, page header, image name , page timeout 044 * value, name of module. 045 * 046 * @supported.all.api 047 */ 048public class PagePropertiesCallback implements Callback { 049 private String image=null; 050 private int timeOut=60; 051 private String templateName=null; 052 private String moduleName=null; 053 private String header=null; 054 private boolean error=false; 055 private List attribute; 056 private List require; 057 private List<String> infoText; 058 private String page_state=null; 059 060 /** 061 * Creates a <code>PagePropertiesCallback</code> for a given module 062 * name, header string, page image, page time out, JSP template name, 063 * error state and page state. 064 * 065 * @param name Name of the authentication module. 066 * @param header Header string for the authentication module display page. 067 * @param image Image for the authentication module display page. 068 * @param timeOut Time out value for the authentication module display page. 069 * @param templateName JSP page name for the authentication module display. 070 * @param error Error state for the authentication module. 071 * @param page_state State of the authentication module display page. 072 */ 073 public PagePropertiesCallback( 074 String name, 075 String header, 076 String image, 077 int timeOut, 078 String templateName, 079 boolean error, 080 String page_state) { 081 this.image = image; 082 if (timeOut!=0) { 083 this.timeOut = timeOut; 084 } 085 this.templateName = templateName; 086 this.moduleName = name; 087 this.header = header; 088 this.error = error; 089 this.page_state = page_state; 090 } 091 092 /** 093 * Returns the authentication module display page image. 094 * 095 * @return the image for the authentication module display page. 096 */ 097 public String getImage() { 098 return image; 099 } 100 101 /** 102 * Returns the authentication module display page time out value. 103 * 104 * @return the time out value for the authentication module display page. 105 */ 106 public int getTimeOutValue() { 107 return timeOut; 108 } 109 110 /** 111 * Returns the authentication module display page state. 112 * 113 * @return the state for the authentication module display page. 114 */ 115 public String getPageState() { 116 return page_state; 117 } 118 119 /** 120 * Returns the authentication module display page template name. 121 * 122 * @return the JSP page template of the authentication module display. 123 */ 124 public String getTemplateName() { 125 return templateName; 126 } 127 128 /** 129 * Returns the authentication module name. 130 * 131 * @return the name of the authentication module. 132 */ 133 public String getModuleName() { 134 return moduleName; 135 } 136 137 /** 138 * Returns the authentication module header string display. 139 * 140 * @return the header string display for the authentication module page. 141 */ 142 public String getHeader() { 143 return header; 144 } 145 146 /** 147 * Returns the authentication module error state. 148 * 149 * @return the error state for the authentication module page. 150 */ 151 public boolean getErrorState() { 152 return error; 153 } 154 155 /** 156 * Returns the list of authentication module data store specific attributes. 157 * 158 * @return the list of authentication module data store specific attributes. 159 */ 160 public List getAttribute() { 161 return attribute; 162 } 163 164 /** 165 * Returns the list of authentication module display attributes which are 166 * required to be entered by the end user. 167 * 168 * @return the list of authentication module display attributes which are 169 * required to be entered by the end user. 170 */ 171 public List getRequire() { 172 return require; 173 } 174 175 /** 176 * Returns the list of infoText elements to display alongside the authentication 177 * module display attributes. 178 * @return the list of infoText elements 179 */ 180 public List<String> getInfoText() { 181 return infoText; 182 } 183 184 /** 185 * Sets the authentication module header string display. 186 * 187 * @param header Header string display for the authentication module page. 188 */ 189 public void setHeader(String header) { 190 this.header = header; 191 } 192 193 /** 194 * Sets the list of authentication module data store specific attributes. 195 * 196 * @param attribute the list of authentication module data store specific 197 * attributes. 198 */ 199 public void setAttribute(List attribute) { 200 this.attribute = attribute; 201 } 202 203 /** 204 * Sets the list of authentication module display attributes which are 205 * required to be entered by the end user. 206 * 207 * @param require the list of authentication module display attributes which 208 * are required to be entered by the end user. 209 */ 210 public void setRequire(List require) { 211 this.require = require; 212 } 213 214 public void setInfoText(List<String> infoText) { 215 this.infoText = infoText; 216 } 217 218 /** 219 * Sets the authentication module display page state. 220 * 221 * @param page_state the state for the authentication module display page. 222 */ 223 public void setPageState(String page_state) { 224 this.page_state = page_state; 225 } 226}
Copyright © 2010-2017, ForgeRock All Rights Reserved.