001 package hirondelle.web4j;
002
003 import hirondelle.web4j.model.DateTime;
004
005 /**
006 Static, descriptive information for a web application.
007
008 <P>Implemenations of this interface are usually quite simple.
009 Here is the
010 <a href="http://www.javapractices.com/apps/fish/javadoc/src-html/hirondelle/web4j/config/AppInfo.html">implementation</a>
011 used in the WEB4J example application.
012
013 <P>See {@link hirondelle.web4j.BuildImpl} for important information on how this item is configured.
014 {@link hirondelle.web4j.BuildImpl#forApplicationInfo()}
015 returns the configured implementation of this interface.
016
017 <P>Upon startup, WEB4J creates an object which implements this interface,
018 and places it into application scope under a {@link ApplicationInfo#KEY},
019 where it is accessible to response pages.
020 (For example, it may be referenced in a footer.)
021 For access in code, the caller can simply refer directly to
022 {@link hirondelle.web4j.BuildImpl#forApplicationInfo()}.
023 In addition, this data is logged during startup, and contributes to
024 the content of {@link hirondelle.web4j.webmaster.TroubleTicket} emails.
025
026 <P>No method in this interface returns a <tt>null</tt> object reference.
027 */
028 public interface ApplicationInfo {
029
030 /**
031 The name of this web application.
032 */
033 String getName();
034
035 /**
036 The version of this web application.
037
038 <P>The content is arbitrary, and make take any desired form. Examples :
039 "<tt>1.2.3</tt>", "<tt>Build 1426</tt>".
040 */
041 String getVersion();
042
043 /**
044 The author of this web application.
045 */
046 String getAuthor();
047
048 /**
049 The date which this binary version of the web application was built.
050 */
051 DateTime getBuildDate();
052
053 /**
054 URL for more information regarding this application.
055 */
056 String getLink();
057
058 /**
059 A general message of arbitrary content.
060 */
061 String getMessage();
062
063 /**
064 Key for the <tt>ApplicationInfo</tt> object placed in application scope.
065 */
066 public static final String KEY = "web4j_key_for_app_info";
067 }