View Javadoc
1   package fr.paris.lutece.plugins.aot.modules.declarationimmat.service;
2   
3   import fr.paris.lutece.plugins.aot.modules.declarationimmat.business.Authorization;
4   
5   public class SNDIServiceHome
6   {
7   
8       // Static variable pointed at the DAO instance
9       private static SNDIService     _service = new SNDIService( );
10  
11      private static SNDIServiceHome _instance;
12  
13      // Empty constructor
14      private SNDIServiceHome( )
15      {
16      }
17  
18      /**
19       * Register an authorization
20       * 
21       * @param token
22       *            the authentication token
23       * @param authorization
24       *            the authorization to create
25       * @return the authorization
26       * @throws Exception
27       *             One of those following exceptions
28       *             <ul>
29       *             <li><b>UnauthorizedAccessException</b> : not authorized or forbidden</li>
30       *             <li><b>UnvalidParkingRightException</b> : not found or existing (conflict)</li>
31       *             <li><b>Exception</b> : general server error</li>
32       *             </ul>
33       */
34      public Authorization create( Authorization authorization ) throws Exception
35      {
36          return _service.create( authorization );
37      }
38  
39      /**
40       * cancel an authorization
41       * 
42       * @param token
43       *            the authentication token
44       * @param authorization
45       *            the authorization to cancel
46       * @throws Exception
47       *             One of those following exceptions
48       *             <ul>
49       *             <li><b>UnauthorizedAccessException</b> : not authorized or forbidden</li>
50       *             <li><b>UnvalidAuthorizationException</b> : not found or existing (conflict)</li>
51       *             <li><b>Exception</b> : general server error</li>
52       *             </ul>
53       */
54      public Authorization cancel( Authorization authorization ) throws Exception
55      {
56          return _service.cancel( authorization );
57      }
58  
59      /**
60       * Get singleton
61       */
62      public static SNDIServiceHome getInstance( )
63      {
64          if ( _instance == null )
65          {
66              _instance = new SNDIServiceHome( );
67          }
68          return _instance;
69      }
70  
71  }