001    // Copyright 2008 Thiago H. de Paula Figueiredo
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package br.com.arsmachina.authentication.controller.impl;
016    
017    import br.com.arsmachina.authentication.controller.PermissionGroupController;
018    import br.com.arsmachina.authentication.dao.PermissionGroupDAO;
019    import br.com.arsmachina.authentication.entity.PermissionGroup;
020    import br.com.arsmachina.controller.impl.SpringControllerImpl;
021    
022    /**
023     * {@link PermissionGroupController} implementation.
024     * 
025     * @author Thiago H. de Paula Figueiredo
026     */
027    public class PermissionGroupControllerImpl extends SpringControllerImpl<PermissionGroup, Integer>
028                    implements PermissionGroupController {
029    
030            private PermissionGroupDAO dao;
031    
032            /**
033             * Single constructor of this class.
034             * 
035             * @param dao an {@link PermissionGroupDAO}. It cannot be <code>null</code>.
036             */
037            public PermissionGroupControllerImpl(PermissionGroupDAO dao) {
038                    super(dao);
039                    this.dao = dao;
040            }
041    
042            /**
043             * Invokes <code>dao.findByName()<code>.
044             * @param name a {@link String}.
045             * @return a {@link PermissionGroup} or <code>null</code>.
046             * @see br.com.arsmachina.authentication.dao.PermissionGroupDAO#findByName(java.lang.String)
047             */
048            public PermissionGroup findByName(String name) {
049                    return dao.findByName(name);
050            }
051    
052    }