View Javadoc

1   /*
2    * WebFlow Navigation Manager: webflow definiton, server side navigation history and automatic session cleaning.
3    * Distributed under LGPL license at web site http://wfnm.sourceforge.net .
4    */
5   package net.sf.wfnm;
6   
7   import java.io.Serializable;
8   
9   import java.util.Set;
10  import java.util.Stack;
11  
12  
13  /***
14   * The Navigation Manager interface.<br>
15   * Concrete implementations of this interface contain the internal status of the framework such as:
16   * 
17   * <ul>
18   * <li>
19   * the stack of visited webflows
20   * </li>
21   * <li>
22   * the stack of visited pages for each webflow
23   * </li>
24   * <li>
25   * ownership defined for single objects
26   * </li>
27   * <li>
28   * a lock that allow to avoid multiple cuncurrent requests
29   * </li>
30   * <li>
31   * listeners for page changed and webflow changed
32   * </li>
33   * </ul>
34   * 
35   *
36   * @author <a href="mailto:malbari@users.sourceforge.net">Maurizio Albari</a>
37   * @version 1.0.6
38   */
39  public interface NavigationManager extends Serializable, OwnershipConst {
40      /***
41       * Gets the url of the current page.
42       *
43       * @return the url of the current page (null=no visited page)
44       */
45      String getCurrentPage();
46  
47      /***
48       * Gets the current webflow name.
49       *
50       * @return the current webflow name (null=no webflow visited)
51       */
52      String getCurrentWebflow();
53  
54      /***
55       * Sets the synchronization lock.
56       *
57       * @param lock the synchronization lock
58       */
59      void setLock(Object lock);
60  
61      /***
62       * Gets the synchronization lock.
63       *
64       * @return the synchronization lock
65       */
66      Object getLock();
67  
68      /***
69       * Sets the object owner.
70       *
71       * @param objectKey the object key
72       * @param objectOwnership the object ownership
73       */
74      void setObjectOwnership(String objectKey, int objectOwnership);
75  
76      /***
77       * Sets the page changed listener.
78       *
79       * @param pageChangedListener the page changed listener
80       */
81      void setPageChangedListener(PageChangedListener pageChangedListener);
82  
83      /***
84       * Returns true if the page has been visited.
85       *
86       * @param url the url of the page
87       *
88       * @return true if the page has been visited
89       */
90      boolean isPageVisited(String url);
91  
92      /***
93       * Gets the url of the previous page.
94       *
95       * @return the url of the previous page (null=no previous page)
96       */
97      String getPreviousPage();
98  
99      /***
100      * Gets the url of the previous webflow top page.
101      *
102      * @return the url of the previous webflow top page (null=no previous webflow top page)
103      */
104     String getPreviousWebflow();
105 
106     /***
107      * Gets the url of a webflow top page.
108      *
109      * @param webflow the webflow name
110      *
111      * @return the url of a webflow top page (null=no visited pages in the specified webflow)
112      */
113     String getPreviousWebflow(String webflow);
114 
115     /***
116      * Sets the webflow changed listener.
117      *
118      * @param webflowChangedListener the webflow changed listener
119      */
120     void setWebflowChangedListener(WebflowChangedListener webflowChangedListener);
121 
122     /***
123      * Returns the webflow stack.
124      *
125      * @return the webflow stack
126      */
127     Stack getWebflowStack();
128 
129     /***
130      * Returns true if the webflow has been visited.
131      *
132      * @param webflowName the webflow name
133      *
134      * @return true if the webflow has been visited
135      */
136     boolean isWebflowVisited(String webflowName);
137 
138     /***
139      * Notify that the navigation has reached a page of a specified webflow.
140      *
141      * @param container the attribute container
142      * @param url the url of the page
143      * @param webflowName the webflow name
144      * @param defaultWebflowOwnership the default webflow ownership
145      * @param addedObjectSet the added object set
146      * @param removedObjectSet the removed object set
147      */
148     void notifyPage(AttributeContainer container, String url, String webflowName, int defaultWebflowOwnership,
149         Set addedObjectSet, Set removedObjectSet);
150 
151     /***
152      * Notify that the navigation has reached a page.
153      *
154      * @param container the attribute container
155      * @param url the url of the page
156      * @param addedObjectSet the added object set
157      * @param removedObjectSet the removed object set
158      */
159     void notifyPage(AttributeContainer container, String url, Set addedObjectSet, Set removedObjectSet);
160 
161     /***
162      * Reset the navigation manager.
163      *
164      * @param container the attribute container
165      */
166     void resetFramework(AttributeContainer container);
167 }