www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
|
|
@ -0,0 +1,256 @@
|
|||
package it.acxent.brt.api;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import it.acxent.brt.api.json.PUSPudoPoint;
|
||||
import it.acxent.brt.api.json.PUSResponse;
|
||||
import it.acxent.brt.api.json.PudoAddress;
|
||||
import it.acxent.brt.api.json.PudoPoint;
|
||||
import it.acxent.common.Parm;
|
||||
import it.acxent.common.StatusMsg;
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class BrtApi {
|
||||
public static final String API_BRT_ENDPOINT = "https://api.brt.it";
|
||||
|
||||
public static final String P_BRT_API_USER = "BRT_API_USER";
|
||||
|
||||
public static final String P_BRT_API_PWD = "BRT_API_PWD";
|
||||
|
||||
public static final String P_BRT_X_API_Auth = "BRT_X_API_Auth";
|
||||
|
||||
private static final String URI_CMD_PUDO_LIST_BY_ADDRESS = "/pudo/v1/open/pickup/get-pudo-by-address/";
|
||||
|
||||
private static final String URI_CMD_PUDO_DETAIL = "/pudo/v1/open/pickup/get-pudo-details/";
|
||||
|
||||
private static final String PARM_ADDRESS = "address";
|
||||
|
||||
private static final String PARM_CITY = "city";
|
||||
|
||||
private static final String PARM_COUNTRY_CODE = "countryCode";
|
||||
|
||||
private static final String PARM_ZIP_CODE = "zipCode";
|
||||
|
||||
private static final String PARM_PUDO_ID = "pudoId";
|
||||
|
||||
private static final String HEADER_X_API_AUTH = "X-API-Auth";
|
||||
|
||||
private static boolean debug = false;
|
||||
|
||||
private ApplParmFull apFull = null;
|
||||
|
||||
private String apiUser;
|
||||
|
||||
private String apiPwd;
|
||||
|
||||
public BrtApi(ApplParmFull apFull) {
|
||||
this.apFull = apFull;
|
||||
}
|
||||
|
||||
public BrtApi(ApplParmFull apFull, String l_user, String l_pwd) {
|
||||
this.apFull = apFull;
|
||||
setApiUser(l_user);
|
||||
setApiPwd(l_pwd);
|
||||
}
|
||||
|
||||
public BrtApi() {}
|
||||
|
||||
public static void initApplicationParms(ApplParmFull ap) {
|
||||
if (ap != null) {
|
||||
DBAdapter.logDebug(true, "FACE initParms: start");
|
||||
String l_tipoParm = "BRT-API";
|
||||
Parm bean = new Parm(ap);
|
||||
StatusMsg.updateMsgByTag(ap, "INIT", l_tipoParm);
|
||||
bean.findByCodice("BRT_API_USER");
|
||||
bean.setFlgAdmin(1L);
|
||||
bean.setTipoParm(l_tipoParm);
|
||||
bean.setCodice("BRT_API_USER");
|
||||
bean.setDescrizione("BRT_API_USER");
|
||||
if (bean.getTesto().isEmpty())
|
||||
bean.setTesto("acolzi");
|
||||
bean.setNota("API USER ACCESSO A BRT - NON USATO PER ADESSO");
|
||||
bean.save();
|
||||
bean.findByCodice("BRT_API_PWD");
|
||||
bean.setFlgAdmin(1L);
|
||||
bean.setTipoParm(l_tipoParm);
|
||||
bean.setCodice("BRT_API_PWD");
|
||||
bean.setDescrizione("BRT_API_PWD");
|
||||
if (bean.getTesto().isEmpty())
|
||||
bean.setTesto("pio");
|
||||
bean.setNota("API PWD ACCESSO A BRT - NON USATO PER ADESSO");
|
||||
bean.save();
|
||||
bean.findByCodice("BRT_X_API_Auth");
|
||||
bean.setFlgAdmin(1L);
|
||||
bean.setTipoParm(l_tipoParm);
|
||||
bean.setCodice("BRT_X_API_Auth");
|
||||
bean.setDescrizione("BRT_X_API_Auth");
|
||||
if (bean.getTesto().isEmpty())
|
||||
bean.setTesto("34fcc468-ac08-4a70-8fc1-3da42938e0b3");
|
||||
bean.setNota("HEADER X-API-Auth PER API PUDO");
|
||||
bean.save();
|
||||
DBAdapter.logDebug(true, "FACE initParms: stop");
|
||||
StatusMsg.deleteMsgByTag(ap, "INIT");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String hostname = "localhost";
|
||||
String db = "tf19";
|
||||
ApplParmFull ap = new ApplParmFull(new ApplParm(17, "//" + hostname + "/" + db, db, "root", "root", 1, 10, 300));
|
||||
BrtApi brtapi = new BrtApi(ap);
|
||||
Vectumerator<PudoPoint> vecPudo = new Vectumerator();
|
||||
PudoAddress pa = new PudoAddress("via tobbianese 23/g", "59100", "Prato");
|
||||
vecPudo = brtapi.findPudoPointByPudoAddress(pa);
|
||||
while (vecPudo.hasMoreElements()) {
|
||||
PudoPoint pp = (PudoPoint)vecPudo.nextElement();
|
||||
System.out.println(pp.getDescrizione());
|
||||
}
|
||||
}
|
||||
|
||||
protected String getBase64BasicCredential() {
|
||||
String encoding = getApiBrtUser() + ":" + getApiBrtUser();
|
||||
return "Basic " + Base64.getEncoder().encodeToString(encoding.getBytes());
|
||||
}
|
||||
|
||||
public ApplParmFull getApFull() {
|
||||
return this.apFull;
|
||||
}
|
||||
|
||||
public void setApFull(ApplParmFull apFull) {
|
||||
this.apFull = apFull;
|
||||
}
|
||||
|
||||
private String getApiEndpoint() {
|
||||
return "https://api.brt.it";
|
||||
}
|
||||
|
||||
private String getApiBrtPwd() {
|
||||
if (this.apiPwd == null)
|
||||
return this.apFull.getParm("BRT_API_PWD").getTesto();
|
||||
return this.apiPwd.trim();
|
||||
}
|
||||
|
||||
private String getX_API_Auth() {
|
||||
return this.apFull.getParm("BRT_X_API_Auth").getTesto();
|
||||
}
|
||||
|
||||
public void setApiUser(String apiUser) {
|
||||
this.apiUser = apiUser;
|
||||
}
|
||||
|
||||
public void setApiPwd(String apiPwd) {
|
||||
this.apiPwd = apiPwd;
|
||||
}
|
||||
|
||||
public BrtApiResult _pudoByAddress(PudoAddress l_pudoAddress) {
|
||||
boolean debug = true;
|
||||
if (debug)
|
||||
DBAdapter.printDebug(debug, "1 ------------ BrtApi NO COOKIE OKHTTP");
|
||||
BrtApiResult resER = new BrtApiResult();
|
||||
String l_indirizzoCompleto = l_pudoAddress.getAddress() + " " + l_pudoAddress.getAddress() + " " + l_pudoAddress.getCity();
|
||||
DBAdapter.printDebug(debug, "2 BrtApi --> pudoaddress: " + l_indirizzoCompleto);
|
||||
try {
|
||||
OkHttpClient client = new OkHttpClient.Builder().connectionPool(new ConnectionPool(0, 1L, TimeUnit.NANOSECONDS))
|
||||
.followSslRedirects(false).build();
|
||||
String baseUrl = getApiEndpoint() + "/pudo/v1/open/pickup/get-pudo-by-address/";
|
||||
DBAdapter.printDebug(debug, "3 URI: " + baseUrl);
|
||||
DBAdapter.printDebug(debug, "3.1 getX_API_Auth: " + getX_API_Auth());
|
||||
HttpUrl url = HttpUrl.parse(baseUrl).newBuilder().addQueryParameter("address", l_pudoAddress.getAddress())
|
||||
.addQueryParameter("city", l_pudoAddress.getCity())
|
||||
.addQueryParameter("countryCode", l_pudoAddress.getCountryCode())
|
||||
.addQueryParameter("zipCode", l_pudoAddress.getZipCode()).build();
|
||||
Request request = new Request.Builder().url(url).get().addHeader("X-API-Auth", getX_API_Auth()).build();
|
||||
Response response = client.newCall(request).execute();
|
||||
String content = response.body().string();
|
||||
int statusCode = response.code();
|
||||
DBAdapter.printDebug(debug, "4Status Code: " + statusCode);
|
||||
DBAdapter.printDebug(debug, "4content = " + content);
|
||||
if (statusCode >= 400) {
|
||||
resER.setOk(false);
|
||||
resER.setMsg(content);
|
||||
resER.setResult(content);
|
||||
} else {
|
||||
Gson gson = new Gson();
|
||||
PUSResponse pusResponse = (PUSResponse)gson.fromJson(content, PUSResponse.class);
|
||||
resER.setMsg("Lista pudo trovata per: " + l_indirizzoCompleto);
|
||||
resER.setOk(true);
|
||||
resER.setResult(pusResponse);
|
||||
resER.setPusResponse(pusResponse);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
DBAdapter.printDebug(e.getMessage());
|
||||
e.printStackTrace();
|
||||
resER.setOk(false);
|
||||
resER.setMsg(e.getMessage());
|
||||
}
|
||||
return resER;
|
||||
}
|
||||
|
||||
public BrtApiResult _pudoDetail(String l_pudoId) {
|
||||
boolean debug = false;
|
||||
DBAdapter.printDebug(debug, "1 ------------ BrtApi NO COOKIE OKHTTP");
|
||||
BrtApiResult resER = new BrtApiResult();
|
||||
DBAdapter.printDebug(debug, "2 BrtApi --> pudoid: " + l_pudoId);
|
||||
try {
|
||||
OkHttpClient client = new OkHttpClient.Builder().connectionPool(new ConnectionPool(0, 1L, TimeUnit.NANOSECONDS))
|
||||
.followSslRedirects(false).build();
|
||||
String baseUrl = getApiEndpoint() + "/pudo/v1/open/pickup/get-pudo-details/";
|
||||
DBAdapter.printDebug(debug, " URI: " + baseUrl);
|
||||
HttpUrl url = HttpUrl.parse(baseUrl).newBuilder().addQueryParameter("pudoId", l_pudoId).build();
|
||||
Request request = new Request.Builder().url(url).get().build();
|
||||
Response response = client.newCall(request).execute();
|
||||
String content = response.body().string();
|
||||
int statusCode = response.code();
|
||||
DBAdapter.printDebug(debug, "4Status Code: " + statusCode);
|
||||
DBAdapter.printDebug(debug, "4content = " + content);
|
||||
if (statusCode >= 400) {
|
||||
resER.setOk(false);
|
||||
resER.setMsg(content);
|
||||
resER.setResult(content);
|
||||
} else {
|
||||
Gson gson = new Gson();
|
||||
PUSResponse pusResponse = (PUSResponse)gson.fromJson(content, PUSResponse.class);
|
||||
resER.setMsg("Dettaglio pudo trovato per pudoid: " + l_pudoId);
|
||||
resER.setOk(true);
|
||||
resER.setResult(pusResponse);
|
||||
resER.setPusResponse(pusResponse);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
DBAdapter.printDebug(e.getMessage());
|
||||
e.printStackTrace();
|
||||
resER.setOk(false);
|
||||
resER.setMsg(e.getMessage());
|
||||
}
|
||||
return resER;
|
||||
}
|
||||
|
||||
private String getApiBrtUser() {
|
||||
if (this.apiUser == null)
|
||||
return this.apFull.getParm("BRT_API_USER").getTesto();
|
||||
return this.apiUser.trim();
|
||||
}
|
||||
|
||||
public Vectumerator<PudoPoint> findPudoPointByPudoAddress(PudoAddress pa) {
|
||||
Vectumerator<PudoPoint> vecPudo = new Vectumerator();
|
||||
BrtApiResult resBrt = _pudoByAddress(pa);
|
||||
PUSResponse pusResponse = resBrt.getPusResponse();
|
||||
List<PUSPudoPoint> listPudo = pusResponse.getPudo();
|
||||
for (PUSPudoPoint pudoPoint : listPudo) {
|
||||
PUSPudoPoint ppp = new PUSPudoPoint(pudoPoint.getPudoId(), pudoPoint.getPointName(), pudoPoint.getStreet(),
|
||||
pudoPoint.getStreetNumber(), pudoPoint.getZipCode(), pudoPoint.getTown());
|
||||
PudoPoint pp = new PudoPoint(ppp);
|
||||
vecPudo.add(pp);
|
||||
}
|
||||
return vecPudo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package it.acxent.brt.api;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import it.acxent.brt.api.json.PUSPudoPoint;
|
||||
import it.acxent.brt.api.json.PUSResponse;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class BrtApiResult {
|
||||
private String msg;
|
||||
|
||||
public BrtApiResult(String msg, boolean status, Object result) {
|
||||
this.msg = msg;
|
||||
this.ok = status;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
private boolean ok = true;
|
||||
|
||||
private PUSResponse pusResponse;
|
||||
|
||||
private PUSPudoPoint pusPudoPoint;
|
||||
|
||||
private Object result;
|
||||
|
||||
public BrtApiResult() {}
|
||||
|
||||
public String getMsg() {
|
||||
return (this.msg == null) ? "" : this.msg.trim();
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public boolean isOk() {
|
||||
return this.ok;
|
||||
}
|
||||
|
||||
public void setOk(boolean status) {
|
||||
this.ok = status;
|
||||
}
|
||||
|
||||
public Object getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public JsonObject getJsonObjectResult() {
|
||||
return (JsonObject)getResult();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public JSONObject getJSONObjectResult() {
|
||||
return (JSONObject)getResult();
|
||||
}
|
||||
|
||||
public void setResult(Object result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public PUSResponse getPusResponse() {
|
||||
return this.pusResponse;
|
||||
}
|
||||
|
||||
public void setPusResponse(PUSResponse pusResponse) {
|
||||
this.pusResponse = pusResponse;
|
||||
}
|
||||
|
||||
public PUSPudoPoint getPusPudoPoint() {
|
||||
return this.pusPudoPoint;
|
||||
}
|
||||
|
||||
public void setPusPudoPoint(PUSPudoPoint pusPudoPoint) {
|
||||
this.pusPudoPoint = pusPudoPoint;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
||||
public class PUSPointHoliday {
|
||||
private String endDate;
|
||||
|
||||
private String startDate;
|
||||
|
||||
public String getEndDate() {
|
||||
return this.endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return this.startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
||||
public class PUSPointHour {
|
||||
private String closeTime;
|
||||
|
||||
private Integer dayOfWeek;
|
||||
|
||||
private String dayTime;
|
||||
|
||||
private String openTime;
|
||||
|
||||
public String getCloseTime() {
|
||||
return this.closeTime;
|
||||
}
|
||||
|
||||
public void setCloseTime(String closeTime) {
|
||||
this.closeTime = closeTime;
|
||||
}
|
||||
|
||||
public Integer getDayOfWeek() {
|
||||
return this.dayOfWeek;
|
||||
}
|
||||
|
||||
public void setDayOfWeek(Integer dayOfWeek) {
|
||||
this.dayOfWeek = dayOfWeek;
|
||||
}
|
||||
|
||||
public String getDayTime() {
|
||||
return this.dayTime;
|
||||
}
|
||||
|
||||
public void setDayTime(String dayTime) {
|
||||
this.dayTime = dayTime;
|
||||
}
|
||||
|
||||
public String getOpenTime() {
|
||||
return this.openTime;
|
||||
}
|
||||
|
||||
public void setOpenTime(String openTime) {
|
||||
this.openTime = openTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,396 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PUSPudoPoint {
|
||||
private Boolean available;
|
||||
|
||||
private String building;
|
||||
|
||||
private String carrierDepot;
|
||||
|
||||
private String carrierInfo;
|
||||
|
||||
private String carrierPudoId;
|
||||
|
||||
private String complementaryInfo;
|
||||
|
||||
private String complementaryServiceInfo;
|
||||
|
||||
private String contactName;
|
||||
|
||||
private String country;
|
||||
|
||||
private String department;
|
||||
|
||||
private Boolean disableAccess;
|
||||
|
||||
private Double distanceFromPoint;
|
||||
|
||||
private Boolean enabled;
|
||||
|
||||
private String floor;
|
||||
|
||||
private String fullAddress;
|
||||
|
||||
private List<PUSPointHoliday> holidays;
|
||||
|
||||
private List<PUSPointHour> hours;
|
||||
|
||||
private String language;
|
||||
|
||||
private String latitude;
|
||||
|
||||
private String localizationHint;
|
||||
|
||||
private String locationNumber;
|
||||
|
||||
private String longitude;
|
||||
|
||||
private Integer maxParcel;
|
||||
|
||||
private Double maxWeight;
|
||||
|
||||
private Boolean parking;
|
||||
|
||||
private String pointName;
|
||||
|
||||
private String pointName2;
|
||||
|
||||
private String pudoId;
|
||||
|
||||
private String service;
|
||||
|
||||
private String state;
|
||||
|
||||
private String street;
|
||||
|
||||
private String street2;
|
||||
|
||||
private String street3;
|
||||
|
||||
private String streetNumber;
|
||||
|
||||
private String subArea;
|
||||
|
||||
private String town;
|
||||
|
||||
private String type;
|
||||
|
||||
private String zipCode;
|
||||
|
||||
public PUSPudoPoint(String pudoId, String pointName, String street, String streetNumber, String town, String zipCode) {
|
||||
this.pudoId = pudoId;
|
||||
this.pointName = pointName;
|
||||
this.street = street;
|
||||
this.streetNumber = streetNumber;
|
||||
this.town = town;
|
||||
this.zipCode = zipCode;
|
||||
}
|
||||
|
||||
public PUSPudoPoint() {}
|
||||
|
||||
public Boolean getAvailable() {
|
||||
return this.available;
|
||||
}
|
||||
|
||||
public void setAvailable(Boolean available) {
|
||||
this.available = available;
|
||||
}
|
||||
|
||||
public String getBuilding() {
|
||||
return this.building;
|
||||
}
|
||||
|
||||
public void setBuilding(String building) {
|
||||
this.building = building;
|
||||
}
|
||||
|
||||
public String getCarrierDepot() {
|
||||
return this.carrierDepot;
|
||||
}
|
||||
|
||||
public void setCarrierDepot(String carrierDepot) {
|
||||
this.carrierDepot = carrierDepot;
|
||||
}
|
||||
|
||||
public String getCarrierInfo() {
|
||||
return this.carrierInfo;
|
||||
}
|
||||
|
||||
public void setCarrierInfo(String carrierInfo) {
|
||||
this.carrierInfo = carrierInfo;
|
||||
}
|
||||
|
||||
public String getCarrierPudoId() {
|
||||
return this.carrierPudoId;
|
||||
}
|
||||
|
||||
public void setCarrierPudoId(String carrierPudoId) {
|
||||
this.carrierPudoId = carrierPudoId;
|
||||
}
|
||||
|
||||
public String getComplementaryInfo() {
|
||||
return this.complementaryInfo;
|
||||
}
|
||||
|
||||
public void setComplementaryInfo(String complementaryInfo) {
|
||||
this.complementaryInfo = complementaryInfo;
|
||||
}
|
||||
|
||||
public String getComplementaryServiceInfo() {
|
||||
return this.complementaryServiceInfo;
|
||||
}
|
||||
|
||||
public void setComplementaryServiceInfo(String complementaryServiceInfo) {
|
||||
this.complementaryServiceInfo = complementaryServiceInfo;
|
||||
}
|
||||
|
||||
public String getContactName() {
|
||||
return this.contactName;
|
||||
}
|
||||
|
||||
public void setContactName(String contactName) {
|
||||
this.contactName = contactName;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return this.country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return this.department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public Boolean getDisableAccess() {
|
||||
return this.disableAccess;
|
||||
}
|
||||
|
||||
public void setDisableAccess(Boolean disableAccess) {
|
||||
this.disableAccess = disableAccess;
|
||||
}
|
||||
|
||||
public Double getDistanceFromPoint() {
|
||||
return this.distanceFromPoint;
|
||||
}
|
||||
|
||||
public void setDistanceFromPoint(Double distanceFromPoint) {
|
||||
this.distanceFromPoint = distanceFromPoint;
|
||||
}
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public String getFloor() {
|
||||
return this.floor;
|
||||
}
|
||||
|
||||
public void setFloor(String floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public String getFullAddress() {
|
||||
return this.fullAddress;
|
||||
}
|
||||
|
||||
public void setFullAddress(String fullAddress) {
|
||||
this.fullAddress = fullAddress;
|
||||
}
|
||||
|
||||
public List<PUSPointHoliday> getHolidays() {
|
||||
return this.holidays;
|
||||
}
|
||||
|
||||
public void setHolidays(List<PUSPointHoliday> holidays) {
|
||||
this.holidays = holidays;
|
||||
}
|
||||
|
||||
public List<PUSPointHour> getHours() {
|
||||
return this.hours;
|
||||
}
|
||||
|
||||
public void setHours(List<PUSPointHour> hours) {
|
||||
this.hours = hours;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
return this.language;
|
||||
}
|
||||
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return this.latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getLocalizationHint() {
|
||||
return this.localizationHint;
|
||||
}
|
||||
|
||||
public void setLocalizationHint(String localizationHint) {
|
||||
this.localizationHint = localizationHint;
|
||||
}
|
||||
|
||||
public String getLocationNumber() {
|
||||
return this.locationNumber;
|
||||
}
|
||||
|
||||
public void setLocationNumber(String locationNumber) {
|
||||
this.locationNumber = locationNumber;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return this.longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public Integer getMaxParcel() {
|
||||
return this.maxParcel;
|
||||
}
|
||||
|
||||
public void setMaxParcel(Integer maxParcel) {
|
||||
this.maxParcel = maxParcel;
|
||||
}
|
||||
|
||||
public Double getMaxWeight() {
|
||||
return this.maxWeight;
|
||||
}
|
||||
|
||||
public void setMaxWeight(Double maxWeight) {
|
||||
this.maxWeight = maxWeight;
|
||||
}
|
||||
|
||||
public Boolean getParking() {
|
||||
return this.parking;
|
||||
}
|
||||
|
||||
public void setParking(Boolean parking) {
|
||||
this.parking = parking;
|
||||
}
|
||||
|
||||
public String getPointName() {
|
||||
return this.pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName) {
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getPointName2() {
|
||||
return this.pointName2;
|
||||
}
|
||||
|
||||
public void setPointName2(String pointName2) {
|
||||
this.pointName2 = pointName2;
|
||||
}
|
||||
|
||||
public String getPudoId() {
|
||||
return this.pudoId;
|
||||
}
|
||||
|
||||
public void setPudoId(String pudoId) {
|
||||
this.pudoId = pudoId;
|
||||
}
|
||||
|
||||
public String getService() {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return this.street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getStreet2() {
|
||||
return this.street2;
|
||||
}
|
||||
|
||||
public void setStreet2(String street2) {
|
||||
this.street2 = street2;
|
||||
}
|
||||
|
||||
public String getStreet3() {
|
||||
return this.street3;
|
||||
}
|
||||
|
||||
public void setStreet3(String street3) {
|
||||
this.street3 = street3;
|
||||
}
|
||||
|
||||
public String getStreetNumber() {
|
||||
return this.streetNumber;
|
||||
}
|
||||
|
||||
public void setStreetNumber(String streetNumber) {
|
||||
this.streetNumber = streetNumber;
|
||||
}
|
||||
|
||||
public String getSubArea() {
|
||||
return this.subArea;
|
||||
}
|
||||
|
||||
public void setSubArea(String subArea) {
|
||||
this.subArea = subArea;
|
||||
}
|
||||
|
||||
public String getTown() {
|
||||
return this.town;
|
||||
}
|
||||
|
||||
public void setTown(String town) {
|
||||
this.town = town;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getZipCode() {
|
||||
return this.zipCode;
|
||||
}
|
||||
|
||||
public void setZipCode(String zipCode) {
|
||||
this.zipCode = zipCode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PUSResponse {
|
||||
private List<PUSPudoPoint> pudo;
|
||||
|
||||
private String requestId;
|
||||
|
||||
private String timestamp;
|
||||
|
||||
public List<PUSPudoPoint> getPudo() {
|
||||
return this.pudo;
|
||||
}
|
||||
|
||||
public void setPudo(List<PUSPudoPoint> pudo) {
|
||||
this.pudo = pudo;
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
return this.requestId;
|
||||
}
|
||||
|
||||
public void setRequestId(String requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return this.timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
||||
public class PudoAddress {
|
||||
private String pudoId;
|
||||
|
||||
private String address;
|
||||
|
||||
private String city;
|
||||
|
||||
public PudoAddress(String address, String zipCode, String city) {
|
||||
this.address = address;
|
||||
this.zipCode = zipCode;
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
private String countryCode = "it";
|
||||
|
||||
private String zipCode;
|
||||
|
||||
private String pointName;
|
||||
|
||||
public PudoAddress() {}
|
||||
|
||||
public String getAddress() {
|
||||
return (this.address == null) ? "" : this.address.trim();
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return (this.city == null) ? "" : this.city.trim();
|
||||
}
|
||||
|
||||
public void setCity(String city) {}
|
||||
|
||||
public String getCountryCode() {
|
||||
return (this.countryCode == null) ? "" : this.countryCode.trim();
|
||||
}
|
||||
|
||||
public void setCountryCode(String countryCode) {
|
||||
this.countryCode = countryCode;
|
||||
}
|
||||
|
||||
public String getZipCode() {
|
||||
return this.zipCode;
|
||||
}
|
||||
|
||||
public void setZipCode(String zipCode) {
|
||||
this.zipCode = zipCode;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
||||
import it.acxent.db.DBAdapterNoDb;
|
||||
import java.util.List;
|
||||
|
||||
public class PudoPoint extends DBAdapterNoDb {
|
||||
private static final long serialVersionUID = 3483130980683823592L;
|
||||
|
||||
private PUSPudoPoint pusPudoPoint;
|
||||
|
||||
public PudoPoint(PUSPudoPoint pusPudoPoint) {
|
||||
this.pusPudoPoint = pusPudoPoint;
|
||||
}
|
||||
|
||||
public PudoPoint() {}
|
||||
|
||||
public String getDescrizione() {
|
||||
return getPudoId() + " - " + getPudoId() + " " + getPointName() + " " + getStreet() + " " + getStreetNumber() + " " + getZipCode();
|
||||
}
|
||||
|
||||
public PUSPudoPoint getPusPudoPoint() {
|
||||
return this.pusPudoPoint;
|
||||
}
|
||||
|
||||
public Boolean getAvailable() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getAvailable() : null;
|
||||
}
|
||||
|
||||
public String getBuilding() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getBuilding() : null;
|
||||
}
|
||||
|
||||
public String getCarrierDepot() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getCarrierDepot() : null;
|
||||
}
|
||||
|
||||
public String getCarrierInfo() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getCarrierInfo() : null;
|
||||
}
|
||||
|
||||
public String getCarrierPudoId() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getCarrierPudoId() : null;
|
||||
}
|
||||
|
||||
public String getComplementaryInfo() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getComplementaryInfo() : null;
|
||||
}
|
||||
|
||||
public String getComplementaryServiceInfo() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getComplementaryServiceInfo() : null;
|
||||
}
|
||||
|
||||
public String getContactName() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getContactName() : null;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getCountry() : null;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getDepartment() : null;
|
||||
}
|
||||
|
||||
public Boolean getDisableAccess() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getDisableAccess() : null;
|
||||
}
|
||||
|
||||
public Double getDistanceFromPoint() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getDistanceFromPoint() : null;
|
||||
}
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getEnabled() : null;
|
||||
}
|
||||
|
||||
public String getFloor() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getFloor() : null;
|
||||
}
|
||||
|
||||
public String getFullAddress() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getFullAddress() : null;
|
||||
}
|
||||
|
||||
public List<PUSPointHoliday> getHolidays() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getHolidays() : null;
|
||||
}
|
||||
|
||||
public List<PUSPointHour> getHours() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getHours() : null;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getLanguage() : null;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getLatitude() : null;
|
||||
}
|
||||
|
||||
public String getLocalizationHint() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getLocalizationHint() : null;
|
||||
}
|
||||
|
||||
public String getLocationNumber() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getLocationNumber() : null;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getLongitude() : null;
|
||||
}
|
||||
|
||||
public Integer getMaxParcel() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getMaxParcel() : null;
|
||||
}
|
||||
|
||||
public Double getMaxWeight() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getMaxWeight() : null;
|
||||
}
|
||||
|
||||
public Boolean getParking() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getParking() : null;
|
||||
}
|
||||
|
||||
public String getPointName() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getPointName() : null;
|
||||
}
|
||||
|
||||
public String getPointName2() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getPointName2() : null;
|
||||
}
|
||||
|
||||
public String getPudoId() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getPudoId() : null;
|
||||
}
|
||||
|
||||
public String getService() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getService() : null;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getState() : null;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getStreet() : null;
|
||||
}
|
||||
|
||||
public String getStreet2() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getStreet2() : null;
|
||||
}
|
||||
|
||||
public String getStreet3() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getStreet3() : null;
|
||||
}
|
||||
|
||||
public String getStreetNumber() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getStreetNumber() : null;
|
||||
}
|
||||
|
||||
public String getSubArea() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getSubArea() : null;
|
||||
}
|
||||
|
||||
public String getTown() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getTown() : null;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getType() : null;
|
||||
}
|
||||
|
||||
public String getZipCode() {
|
||||
return (this.pusPudoPoint != null) ? this.pusPudoPoint.getZipCode() : null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
package it.acxent.brt.api.json;
|
||||
|
|
@ -0,0 +1 @@
|
|||
package it.acxent.brt.api;
|
||||
Loading…
Add table
Add a link
Reference in a new issue