View Javadoc
1   /*
2    * Copyright (c) 2002-2021, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.address.service;
35  
36  import fr.paris.lutece.plugins.address.business.jaxb.Adresse;
37  import fr.paris.lutece.portal.service.spring.SpringContextService;
38  import fr.paris.lutece.util.ReferenceList;
39  
40  import java.rmi.RemoteException;
41  
42  import javax.servlet.http.HttpServletRequest;
43  
44  /**
45   *
46   */
47  public final class AddressServiceProvider
48  {
49      private static IAddressService/../../fr/paris/lutece/plugins/address/service/IAddressService.html#IAddressService">IAddressService _service = (IAddressService) SpringContextService.getBean( "adresseService" );
50  
51      /**
52       *
53       *
54       */
55      private AddressServiceProvider( )
56      {
57      }
58  
59      /**
60       * @throws RemoteException
61       *             the RemoteExecption
62       * @param request
63       *            Request
64       * @param labeladresse
65       *            the label adress
66       * @return the XML flux of all adress corresponding
67       *
68       */
69      public static ReferenceList searchAddress( HttpServletRequest request, String labeladresse ) throws RemoteException
70      {
71          return _service.searchAddress( request, labeladresse );
72      }
73  
74      /**
75       * @throws RemoteException
76       *             the RemoteExecption
77       * @param request
78       *            Request
79       * @param labeladresse
80       *            the label adress
81       * @param strArrondissement
82       *            Arrondissement
83       * @return the XML flux of all adress corresponding
84       *
85       */
86      public static ReferenceList searchAddress( HttpServletRequest request, String labeladresse, String strArrondissement ) throws RemoteException
87      {
88          return _service.searchAddress( request, labeladresse, strArrondissement );
89      }
90  
91      /**
92       * @throws RemoteException
93       *             the RemoteExecption
94       * @param request
95       *            Request
96       * @param id
97       *            the adress id
98       * @param bIsTest
99       *            if true test connect at web service, if false search an adress
100      * @return the XML flux of an adress
101      *
102      */
103     public static Adresse getAdresseInfo( HttpServletRequest request, long id, boolean bIsTest ) throws RemoteException
104     {
105         return _service.getAdresseInfo( request, id, bIsTest );
106     }
107 
108     /**
109      * @throws RemoteException
110      *             the RemoteExecption
111      * @param request
112      *            Request
113      * @param bIsTest
114      *            if true test connect at web service, if false search an adress
115      * @return the XML flux of an adress
116      *
117      */
118     public static Adresse getGeolocalisation( HttpServletRequest request, String strAddress, String strDate, boolean bIsTest ) throws RemoteException
119     {
120         return _service.getGeolocalisation( request, strAddress, strDate, bIsTest );
121     }
122 
123     /**
124      * @throws RemoteException
125      *             the RemoteExecption
126      * @param request
127      *            Request
128      * @param id
129      *            the RSID
130      * @param bIsTest
131      *            if true test connect at web service, if false search an adress
132      * @return the XML flux of an adress
133      *
134      */
135     public static Adresse getGeolocalisation( HttpServletRequest request, long id, String strAddress, String strDate, boolean bIsTest ) throws RemoteException
136     {
137         return _service.getGeolocalisation( request, id, strAddress, strDate, bIsTest );
138     }
139 
140     /**
141      * returns the class of instanciated address service provider
142      * 
143      * @return the simple name of the class
144      */
145     public static String getInstanceClass( )
146     {
147         return _service.getClass( ).getSimpleName( );
148     }
149 }