Revision 9875 org.gvsig.republicadominicana.catastro/trunk/org.gvsig.republicadominicana.catastro/org.gvsig.republicadominicana.catastro.lib/org.gvsig.republicadominicana.catastro.lib.impl/src/main/java/org/gvsig/republicadominicana/catastro/lib/impl/RDCatastroManagerImpl.java
RDCatastroManagerImpl.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.gvsig.republicadominicana.catastro.lib.impl; |
25 | 25 |
|
26 |
import java.net.MalformedURLException; |
|
27 |
import java.net.URL; |
|
28 |
import org.apache.commons.lang3.StringUtils; |
|
26 | 29 |
import org.gvsig.republicadominicana.catastro.lib.api.RDCatastroManager; |
27 | 30 |
import org.slf4j.Logger; |
28 | 31 |
import org.slf4j.LoggerFactory; |
29 | 32 |
|
30 | 33 |
@SuppressWarnings("UseSpecificCatch") |
31 | 34 |
public class RDCatastroManagerImpl implements RDCatastroManager { |
32 |
|
|
35 |
|
|
33 | 36 |
private static final Logger LOGGER = LoggerFactory.getLogger(RDCatastroManagerImpl.class); |
34 | 37 |
|
38 |
public static String RDCATASTRO_CADASTRAL_REFERENCE_FIELD_NAME = "ic"; //crc"; |
|
39 |
|
|
40 |
private String cadastralReferenceFieldName; |
|
41 |
private String propertyInformationUrlTemplate; |
|
42 |
|
|
35 | 43 |
public RDCatastroManagerImpl() { |
44 |
cadastralReferenceFieldName = RDCATASTRO_CADASTRAL_REFERENCE_FIELD_NAME; |
|
45 |
propertyInformationUrlTemplate = "https://keycloak.gvsig-services.com/realms/catastrord/protocol/openid-connect/auth?response_type=code&client_id=gvsigolfrontend&redirect_uri=https://catastrord.gvsig-services.com/spa/inmuebles/${CRC}&scope=openid"; |
|
36 | 46 |
} |
37 | 47 |
|
48 |
/** |
|
49 |
* @return the cadastralReferenceFieldName |
|
50 |
*/ |
|
51 |
@Override |
|
52 |
public String getCadastralReferenceFieldName() { |
|
53 |
return cadastralReferenceFieldName; |
|
54 |
} |
|
55 |
|
|
56 |
/** |
|
57 |
* @param cadastralReferenceFieldName the cadastralReferenceFieldName to set |
|
58 |
*/ |
|
59 |
@Override |
|
60 |
public void setCadastralReferenceFieldName(String cadastralReferenceFieldName) { |
|
61 |
this.cadastralReferenceFieldName = cadastralReferenceFieldName; |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* @return the propertyInformationUrl |
|
66 |
*/ |
|
67 |
@Override |
|
68 |
public String getPropertyInformationUrlTemplate() { |
|
69 |
return propertyInformationUrlTemplate; |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* @param propertyInformationUrl the propertyInformationUrl to set |
|
74 |
*/ |
|
75 |
@Override |
|
76 |
public void setPropertyInformationUrlTemplate(String propertyInformationUrlTemplate) { |
|
77 |
this.propertyInformationUrlTemplate = propertyInformationUrlTemplate; |
|
78 |
} |
|
79 |
|
|
80 |
|
|
81 |
public URL getPropertyInformationUrl(String cadastralReference) { |
|
82 |
try { |
|
83 |
return new URL(StringUtils.replace(propertyInformationUrlTemplate, "${CRC}", cadastralReference)); |
|
84 |
} catch (MalformedURLException ex) { |
|
85 |
return null; |
|
86 |
} |
|
87 |
} |
|
88 |
|
|
38 | 89 |
} |
Also available in: Unified diff