View Javadoc
1   package org.apache.fulcrum.security.torque.peer;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  import java.sql.Connection;
21  
22  import org.apache.fulcrum.security.entity.Permission;
23  import org.apache.fulcrum.security.entity.Role;
24  import org.apache.fulcrum.security.model.turbine.entity.TurbinePermission;
25  import org.apache.torque.TorqueException;
26  
27  /**
28   * This extension to the marker interface {@linkplain Peer} is to allow for swappable Peer implementations 
29   * in Turbine Torque Manager Implementations.  
30   * 
31   * 
32   * @author <a href="mailto:gk@apache.org">Georg Kallidis</a>
33   * @version $Id$
34   */
35  public interface TurbineRolePermissionPeerMapper
36  
37  {
38  	
39      /**
40       * Returns the associated TurbineRole object.
41       * If it was not retrieved before, the object is retrieved from
42       * the database
43       *
44       * @return the associated TurbineRole object
45       * @throws TorqueException  if any database error occurs when reading from the database fails.
46       */
47      Role getTurbineRole()
48          throws TorqueException;
49  
50      /**
51       * Return the associated TurbineRole object
52       * If it was not retrieved before, the object is retrieved from
53       * the database using the passed connection
54       *
55       * @param connection the connection used to retrieve the associated object
56       *        from the database, if it was not retrieved before
57       * @return the associated TurbineRole object
58       * @throws TorqueException  if any database error occurs
59       */
60      Role getTurbineRole( Connection connection )
61          throws TorqueException;
62  
63      /**
64       * Returns the associated TurbinePermission object.
65       * If it was not retrieved before, the object is retrieved from
66       * the database
67       *
68       * @return the associated TurbinePermission object
69       * @throws TorqueException when reading from the database fails.
70       */
71      Permission getTurbinePermission() throws TorqueException;
72      
73      /**
74       * Return the associated TurbinePermission object
75       * If it was not retrieved before, the object is retrieved from
76       * the database using the passed connection
77       *
78       * @param connection the connection used to retrieve the associated object
79       *        from the database, if it was not retrieved before
80       * @return the associated TurbinePermission object
81       * @throws TorqueException If a problem occurs with the get[$filedType] method.
82       */
83      public TurbinePermission getTurbinePermission(Connection connection)
84          throws TorqueException;
85  
86  }