2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shale.usecases.model;
19  
20  /***
21   * <p>Data Access Object (DAO) for accessing model data about registered
22   * users and their profile information.</p>
23   *
24   * $Id: UsersDAO.java 464373 2006-10-16 04:21:54Z rahul $
25   */
26  public interface UsersDAO {
27      
28  
29      /***
30       * <p>Create and return a {@link User} object that may be populated
31       * and then passed to <code>insertUser()</code> for persistence.</p>
32       */
33      public User createUser();
34  
35  
36      /***
37       * <p>Return the {@link User} for the corresponding user id, if any.
38       * Otherwise, return <code>null</code>.</p>
39       *
40       * @param id User id to look up
41       */
42      public User findUser(int id);
43  
44  
45      /***
46       * <p>Return the {@link User} for the corresponding username, if any.
47       * Otherwise, return <code>null</code>.</p>
48       *
49       * @param username Username to look up
50       */
51      public User findUser(String username);
52  
53  
54      /***
55       * <p>Insert a newly created {@link User} into persistent storage.</p>
56       *
57       * @param user Created {@link User} to be persisted
58       */
59      public void insertUser(User user);
60  
61  
62      /***
63       * <p>Update an existing {@link User} into persistent storage.</p>
64       *
65       * @param user Updated {@link User} to be persisted
66       */
67      public void updateUser(User user);
68  
69  
70  }