View Javadoc

1   /*
2    * Copyright 2004-2005 OSOCO.org (Carsten Ziegeler)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.osoco.cowarp;
17  
18  
19  /***
20   * This class describes the current application. Inside Cocoon, you can have
21   * different applications running at the same time (a portal, a shop, a
22   * registration wizard etc.) Each of these applications might require their
23   * own login or have different settings. The application object helps in
24   * managing these things.
25   *
26   * @author <a href="mailto:cziegeler.at.osoco.org">Carsten Ziegeler</a>
27   * @version CVS $Id: Application.java,v 1.9 2005/02/22 18:39:00 cziegeler Exp $
28  */
29  public interface Application {
30  
31      /***
32       * Return the security handler of this application.
33       * @return The security handler
34       */
35      SecurityHandler getSecurityHandler();
36  
37      /***
38       * Return the application store for loading/saving user specific data.
39       * @return Return the application store or null.
40       */
41      ApplicationStore getApplicationStore();
42  
43      /***
44       * Notify the application about a successful login of a user.
45       * @param user The current user.
46       */
47      void userDidLogin(User user);
48  
49      /***
50       * Notify the application about a logout of a user.
51       * @param user The current user.
52       */
53      void userWillLogout(User user);
54  
55      /***
56       * Set an application attribute.
57       * @param key   The key of the attribute.
58       * @param value The value of the attribute.
59       */
60      void setAttribute(String key, Object value);
61  
62      /***
63       * Remove an application attribute.
64       * @param key The key of the attribute.
65       */
66      void removeAttribute(String key);
67  
68      /***
69       * Get the value of an application attribute.
70       * @param key The key of the attribute.
71       * @return The value of the attribute or null.
72       */
73      Object getAttribute(String key);
74  }