001    package org.LiveGraph.dataCache;
002    
003    import org.LiveGraph.events.EventType;
004    import org.LiveGraph.events.Validation;
005    
006    
007    /**
008     * Event types related to data updates.
009     * 
010     * <p style="font-size:smaller;">This product includes software developed by the
011     *    <strong>LiveGraph</strong> project and its contributors.<br />
012     *    (<a href="http://www.live-graph.org" target="_blank">http://www.live-graph.org</a>)<br />
013     *    Copyright (c) 2007-2008 G. Paperin.<br />
014     *    All rights reserved.
015     * </p>
016     * <p style="font-size:smaller;">File: UpdateInvokerObserver.java</p> 
017     * <p style="font-size:smaller;">Redistribution and use in source and binary forms, with or
018     *    without modification, are permitted provided that the following terms and conditions are met:
019     * </p>
020     * <p style="font-size:smaller;">1. Redistributions of source code must retain the above
021     *    acknowledgement of the LiveGraph project and its web-site, the above copyright notice,
022     *    this list of conditions and the following disclaimer.<br />
023     *    2. Redistributions in binary form must reproduce the above acknowledgement of the
024     *    LiveGraph project and its web-site, the above copyright notice, this list of conditions
025     *    and the following disclaimer in the documentation and/or other materials provided with
026     *    the distribution.<br />
027     *    3. All advertising materials mentioning features or use of this software or any derived
028     *    software must display the following acknowledgement:<br />
029     *    <em>This product includes software developed by the LiveGraph project and its
030     *    contributors.<br />(http://www.live-graph.org)</em><br />
031     *    4. All advertising materials distributed in form of HTML pages or any other technology
032     *    permitting active hyper-links that mention features or use of this software or any
033     *    derived software must display the acknowledgment specified in condition 3 of this
034     *    agreement, and in addition, include a visible and working hyper-link to the LiveGraph
035     *    homepage (http://www.live-graph.org).
036     * </p>
037     * <p style="font-size:smaller;">THIS SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY
038     *    OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
039     *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT SHALL
040     *    THE AUTHORS, CONTRIBUTORS OR COPYRIGHT  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
041     *    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  FROM, OUT OF OR
042     *    IN CONNECTION WITH THE SOFTWARE OR THE USE OR  OTHER DEALINGS IN THE SOFTWARE.
043     * </p>
044     * 
045     * @author Greg Paperin (<a href="http://www.paperin.org" target="_blank">http://www.paperin.org</a>)
046     * @version {@value org.LiveGraph.LiveGraph#version}
047     */
048    public enum DataUpdateEvent implements EventType {
049    
050    
051    /**
052     * <table>
053     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
054     * <tr><td>{@code getInfoBoolean()}</td>      <td>{@code true} if the {@code DataStreamReader} object
055     *                                                                                              should be closed at the end of the update,
056     *                                                                                              {@code false} if the {@code DataStreamReader} should
057     *                                                                                              not be closed at the end of the update</td></tr>
058     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
059     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
060     * <tr><td>{@code getInfoObject()}</td>               <td>The {@code DataStreamReader} object that
061     *                                                                                              is the source for the update.</td></tr>
062     * </table>
063     */
064    UPDIN_InitiateUpdate,
065    
066    /**
067     * <table>
068     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
069     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
070     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
071     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
072     * <tr><td>{@code getInfoObject()}</td>               <td>Error message ({@code String})</td></tr>
073     * </table>
074     */
075    UPDIN_CannotInitiateUpdate,
076    
077    
078    /**
079     * <table>
080     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
081     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
082     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
083     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
084     * <tr><td>{@code getInfoObject()}</td>               <td><em>unspecified</em></td></tr>
085     * </table>
086     */
087    UPDIN_TimerTick,
088    
089    /**
090     * Validated before actually starting an update, if validation fails the update is not started.
091     * <table>
092     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
093     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
094     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
095     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
096     * <tr><td>{@code getInfoObject()}</td>               <td><em>unspecified</em></td></tr>
097     * </table>
098     */
099    @Validation(Validation.Requirement.MUST_VALIDATE)
100    UPDIN_UpdateStart,
101    
102    /**
103     * Validated before switching into memory stream mode, if validation fails the switching is not performed;
104     * event is raised directly after switching to notify the application.
105     * <table>
106     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
107     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
108     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
109     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
110     * <tr><td>{@code getInfoObject()}</td>               <td><em>unspecified</em></td></tr>
111     * </table>
112     */
113    @Validation(Validation.Requirement.MUST_VALIDATE)
114    UPDIN_StartMemoryStreamMode,
115    
116    /**
117     * Validated before switching from memory stream mode into normal (data file) mode,
118     * if validation fails the switching is not performed;
119     * event is raised directly after switching to notify the application.
120     * <table>
121     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
122     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
123     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
124     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
125     * <tr><td>{@code getInfoObject()}</td>               <td><em>unspecified</em></td></tr>
126     * </table>
127     */
128    @Validation(Validation.Requirement.MUST_VALIDATE)
129    UPDIN_EndMemoryStreamMode,
130    
131    /**
132     * <table>
133     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
134     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
135     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
136     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
137     * <tr><td>{@code getInfoObject()}</td>               <td><em>unspecified</em></td></tr>
138     * </table>
139     */
140    UPDIN_UpdateFinishSuccess,
141    
142    /**
143     * <table>
144     * <tr><th>Info parameter</th>                                <th>Value</th></tr>
145     * <tr><td>{@code getInfoBoolean()}</td>      <td><em>unspecified</em></td></tr>
146     * <tr><td>{@code getInfoLong()}</td>         <td><em>unspecified</em></td></tr>
147     * <tr><td>{@code getInfoDouble()}</td>               <td><em>unspecified</em></td></tr>
148     * <tr><td>{@code getInfoObject()}</td>               <td>a {@code String} containg the error message</td></tr>
149     * </table>
150     */
151    UPDIN_UpdateFinishError
152    
153    }  // public enum DataUpdateEvent