source: tapas/service/implementation/com/ether/EtherServiceImpl.java @ 376

Last change on this file since 376 was 376, checked in by rboipsl, 12 years ago

Creation projet tapas

File size: 2.2 KB
Line 
1package com.ether;
2
3import com.ether.dao.ParameterDAO;
4import com.ether.dao.PlateformDAO;
5import org.apache.commons.logging.Log;
6import org.apache.commons.logging.LogFactory;
7import org.jetbrains.annotations.NotNull;
8import org.jetbrains.annotations.Nullable;
9import org.springframework.beans.factory.annotation.Required;
10import org.springframework.transaction.annotation.Transactional;
11
12import java.util.List;
13
14/**
15 * @author vmipsl
16 * @date 07 mar 2011
17 */
18public class EtherServiceImpl
19        implements EtherService
20{
21    @Nullable
22    @Transactional(readOnly = true)
23    public List<Plateform> getAllPlateforms()
24            throws ServiceException
25    {
26        try
27        {
28            return _plateformDAO.getAllPlateforms();
29        }
30        catch( PersistenceException e )
31        {
32            throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e );
33        }
34    }
35
36    @Nullable
37    @Transactional(readOnly = true)
38    public Plateform getPlateformById( @Nullable final Integer plateformId )
39            throws ServiceException
40    {
41        if( null == plateformId )
42            return null;
43        try
44        {
45            return _plateformDAO.getPlateformById( plateformId );
46        }
47        catch( PersistenceException e )
48        {
49            throw new ServiceException( ServiceException.ServiceCode.PLATEFORM_NOT_FOUND, e );
50        }
51    }
52
53    @Nullable
54    @Transactional(readOnly = true)
55    public List<Parameter> getAllParametersByPlateformId( @NotNull final Integer plateformId )
56            throws ServiceException
57    {
58        try
59        {
60            return _parameterDAO.getAllParametersByPlateformId( plateformId );
61        }
62        catch( PersistenceException e )
63        {
64            throw new ServiceException( ServiceException.ServiceCode.PARAMETER_NOT_FOUND, e );
65        }
66    }
67
68    @Required
69    public void setPlateformDAO( final PlateformDAO plateformDAO )
70    {
71        _plateformDAO = plateformDAO;
72    }
73
74    @Required
75    public void setParameterDAO( final ParameterDAO parameterDAO )
76    {
77        _parameterDAO = parameterDAO;
78    }
79
80    private static final Log LOGGER = LogFactory.getLog( EtherServiceImpl.class );
81
82
83    private PlateformDAO _plateformDAO;
84    private ParameterDAO _parameterDAO;
85}
Note: See TracBrowser for help on using the repository browser.