001: /*
002: * $Header: /export/home/cvsroot/MyPersonalizerRepository/MyPersonalizer/Subsystems/Kernel/Sources/es/udc/mypersonalizer/kernel/model/editors/UserRegistrationInformationEditor.java,v 1.1.1.1 2004/03/25 12:08:37 fbellas Exp $
003: * $Revision: 1.1.1.1 $
004: * $Date: 2004/03/25 12:08:37 $
005: *
006: * =============================================================================
007: *
008: * Copyright (c) 2003, The MyPersonalizer Development Group
009: * (http://www.tic.udc.es/~fbellas/mypersonalizer/index.html) at
010: * University Of A Coruna
011: * All rights reserved.
012: *
013: * Redistribution and use in source and binary forms, with or without
014: * modification, are permitted provided that the following conditions are met:
015: *
016: * - Redistributions of source code must retain the above copyright notice,
017: * this list of conditions and the following disclaimer.
018: *
019: * - Redistributions in binary form must reproduce the above copyright notice,
020: * this list of conditions and the following disclaimer in the documentation
021: * and/or other materials provided with the distribution.
022: *
023: * - Neither the name of the University Of A Coruna nor the names of its
024: * contributors may be used to endorse or promote products derived from
025: * this software without specific prior written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
028: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
029: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
030: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
031: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
032: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
033: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
035: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
036: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
037: * POSSIBILITY OF SUCH DAMAGE.
038: *
039: */
040:
041: package es.udc.mypersonalizer.kernel.model.editors;
042:
043: import es.udc.mypersonalizer.kernel.model.properties.Property;
044: import es.udc.mypersonalizer.kernel.util.exceptions.InternalErrorException;
045: import java.util.*;
046:
047: /**
048: * This editor accesses the information stored in a UserRegistrationInformation
049: * property, knowing the internals of its structure and hiding them to the
050: * object which might use it.
051: *
052: * @author Daniel Fernandez
053: * @since 1.0
054: */
055: public interface UserRegistrationInformationEditor {
056: //TODO: Wouldn't it be useful to create a generic "getPropertyValue" and
057: // "getPropertyValueArray", for example, for ServiceModel's?
058:
059: /**
060: * Simple property name for the user's login name.
061: */
062: public static final String LOGIN_NAME = "loginName";
063:
064: /**
065: * Simple property name for the user's password.
066: */
067: public static final String PASSWORD = "password";
068:
069: /**
070: * Simple property name for the day of the user's registration date.
071: */
072: public static final String REGISTRATION_DATE_DAY = "registrationDateDay";
073:
074: /**
075: * Simple property name for the month of the user's registration date.
076: */
077: public static final String REGISTRATION_DATE_MONTH = "registrationDateMonth";
078:
079: /**
080: * Simple property name for the year of the user's registration date.
081: */
082: public static final String REGISTRATION_DATE_YEAR = "registrationDateYear";
083:
084: /**
085: * Simple property name for the day of the user's last sign-in date.
086: */
087: public static final String LAST_SIGN_IN_DATE_DAY = "lastSignInDateDay";
088:
089: /**
090: * Simple property name for the month of the user's last sign-in date.
091: */
092: public static final String LAST_SIGN_IN_DATE_MONTH = "lastSignInDateMonth";
093:
094: /**
095: * Simple property name for the year of the user's last sign-in date.
096: */
097: public static final String LAST_SIGN_IN_DATE_YEAR = "lastSignInDateYear";
098:
099: /**
100: * Simple property name for the property identifier of the user's desktop
101: * layout.
102: */
103: public static final String DESKTOP_LAYOUT_PROPERTY_IDENTIFIER = "dlPropId";
104:
105: /**
106: * Sets the property on which the editor will work.
107: *
108: * @param property the property.
109: */
110: public void setProperty(Property property);
111:
112: /**
113: * Returns the user's login name
114: *
115: * @throws InternalErrorException if any fatal errors happen
116: * @return a String with the user's login name
117: */
118: public String getLoginName() throws InternalErrorException;
119:
120: /**
121: * Sets the user's login name
122: *
123: * @param loginName the new login name
124: * @throws InternalErrorException if any fatal errors happen
125: */
126: public void setLoginName(String loginName)
127: throws InternalErrorException;
128:
129: /**
130: * Removes the user's login name property from the structure.
131: *
132: * @throws InternalErrorException if any fatal errors happen
133: */
134: public void removeLoginName() throws InternalErrorException;
135:
136: /**
137: * Returns the users's password as it is stored in the database, i.e.
138: * encrypted, usually.
139: *
140: * @throws InternalErrorException if any fatal errors happen
141: * @return a String with the user's password as it is stored in the DB.
142: */
143: public String getStoredPassword() throws InternalErrorException;
144:
145: /**
146: * Set's a new password for the user. This must be in a "storeable" form,
147: * this is, as it is suposed to reside in the DB. Usually this means the
148: * password should be encrypted.
149: *
150: * @param storedPassword the password to be stored
151: * @throws InternalErrorException if any fatal errors happen
152: */
153: public void setStoredPassword(String storedPassword)
154: throws InternalErrorException;
155:
156: /**
157: * Removes the user's password from the property structure.
158: *
159: * @throws InternalErrorException if any fatal errors happen
160: */
161: public void removeStoredPassword() throws InternalErrorException;
162:
163: /**
164: * Returns the user's registration date.
165: *
166: * @throws InternalErrorException if any fatal errors happen
167: * @return a Calendar with the user's registration date.
168: */
169: public Calendar getRegistrationDate() throws InternalErrorException;
170:
171: /**
172: * Sets the registration date for a user
173: *
174: * @param date the new registration date, in a Calendar.
175: * @throws InternalErrorException if any fatal errors happen
176: */
177: public void setRegistrationDate(Calendar date)
178: throws InternalErrorException;
179:
180: /**
181: * Removes the registration date property from the property structure.
182: *
183: * @throws InternalErrorException if any fatal errors happen
184: */
185: public void removeRegistrationDate() throws InternalErrorException;
186:
187: /**
188: * Returns the date in which the user last made sign in into the system.
189: *
190: * @throws InternalErrorException if any fatal errors happen
191: * @return a Calendar with the last sign in date.
192: */
193: public Calendar getLastSignInDate() throws InternalErrorException;
194:
195: /**
196: * Establishes the date in which the user last signed in.
197: *
198: * @param date the sign in data
199: * @throws InternalErrorException if any fatal errors happen
200: */
201: public void setLastSignInDate(Calendar date)
202: throws InternalErrorException;
203:
204: /**
205: * Removes the last sign in property from the structure.
206: *
207: * @throws InternalErrorException if any fatal errors happen
208: */
209: public void removeLastSignInDate() throws InternalErrorException;
210:
211: /**
212: * Returns the identifier for the Desktop Layout property that corresponds
213: * to this user.
214: *
215: * @throws InternalErrorException if any fatal errors happen
216: * @return a Long with the Desktop Layout property identifier.
217: */
218: public Long getDesktopLayoutPropertyIdentifier()
219: throws InternalErrorException;
220:
221: /**
222: * Sets the identifier of the Desktop Layout which corresponds to this user.
223: *
224: * @param identifier the Desktop Layout property identifier.
225: * @throws InternalErrorException if any fatal errors happen
226: */
227: public void setDesktopLayoutPropertyIdentifier(Long identifier)
228: throws InternalErrorException;
229:
230: /**
231: * Removes the Desktop Layout property identifier property from the
232: * property structure.
233: *
234: * @throws InternalErrorException if any fatal errors happen
235: */
236: public void removeDesktopLayoutPropertyIdentifier()
237: throws InternalErrorException;
238:
239: /**
240: * This method will ask the EmptyPropertyFactory to create a fresh empty
241: * Property suitable for User Registration Information. This will be used
242: * to fill in new data.
243: *
244: * @throws InternalErrorException if any fatal errors happen
245: * @return a Property with the adequate structure to handle the user
246: * registration information.
247: */
248: public Property createEmptyProperty() throws InternalErrorException;
249:
250: }
|