List of usage examples for java.rmi RemoteException printStackTrace
public void printStackTrace()
From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.DOFWSClientRealWebservice.java
public AflamarkTypeUser[] getCatchQuota(String personalID, String period) { Map cache = getCache(GUMBO_COMPANY_CATCH_QUOTA_CACHE, 60 * 60 * 24l); if (cache != null && !cache.isEmpty()) { if (cache.containsKey(personalID + "_" + period)) { return (AflamarkTypeUser[]) cache.get(personalID + "_" + period); }/* w w w .j a va 2s. c o m*/ } try { GetaflamarksumbyutgerdElement parameter = new GetaflamarksumbyutgerdElement(personalID, period); AflamarkTypeUser[] quota = getCatchQuotaPort().getaflamarksumbyutgerd(parameter); if (cache != null) { cache.put(personalID + "_" + period, quota); } return quota; } catch (RemoteException e) { e.printStackTrace(); } return null; }
From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.DOFWSClientRealWebservice.java
public SkipInfoTypeUser[] getShipInfoByCompanySSN(String companySSN) { /*//from w w w .j a v a2 s . c om * Map cache = getCache(GUMBO_COMPANY_SHIPS_CACHE, 60 * 60 * 24l); if * (cache != null && !cache.isEmpty()) { if * (cache.containsKey(companySSN)) { return (SkipInfoTypeUser[]) * cache.get(companySSN); } * * } */ try { GetskipinfobyutgerdElement parameter = new GetskipinfobyutgerdElement(companySSN); SkipInfoTypeUser[] ships = getShipPort().getskipinfobyutgerd(parameter); /* * if (cache != null) { cache.put(companySSN, ships); } */ return ships; } catch (RemoteException e) { e.printStackTrace(); } return null; }
From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.DOFWSClientRealWebservice.java
public SkipInfoTypeUser getShipInfo(String shipID) { /*//www .ja v a 2s . c o m * Map cache = getCache(GUMBO_SHIP_INFO_CACHE, 60 * 60 * 24l); if (cache * != null && !cache.isEmpty()) { if (cache.containsKey(shipID)) { * return (SkipInfoTypeUser) cache.get(shipID); } * * } */ GetskipinfoElement parameter = new GetskipinfoElement(new BigDecimal(shipID)); try { GetskipinfoResponseElement res = getShipPort().getskipinfo(parameter); SkipInfoTypeUser ship = res.getResult(); /* * if (cache != null) { cache.put(shipID, ship); } */ return ship; } catch (RemoteException e) { e.printStackTrace(); } return null; }
From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.DOFWSClientRealWebservice.java
public LondunTypeUser[] getLatestCatchInfo(String personalID, int numberOfResults) { Map cache = getCache(GUMBO_COMPANY_LATEST_CATCHES_CACHE, 60 * 60 * 24l); if (cache != null && !cache.isEmpty()) { if (cache.containsKey(personalID)) { return (LondunTypeUser[]) cache.get(personalID); }/*from ww w . ja v a 2 s. co m*/ } try { GetlastlandanirbyutgerdElement parameter = new GetlastlandanirbyutgerdElement(personalID, new BigDecimal(numberOfResults)); LondunTypeUser[] catches = getCatchPort().getlastlandanirbyutgerd(parameter); if (cache != null) { cache.put(personalID, catches); } return catches; } catch (RemoteException re) { re.printStackTrace(); } return null; }
From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.DOFWSClientRealWebservice.java
private Map<BigDecimal, VeidileyfagerdTypeUser> getFishingAreasByType(String type, String period) { Map cache = getCache(GUMBO_FISHING_AREAS_CACHE, 60 * 60 * 24l); if (cache != null && !cache.isEmpty()) { if (cache.containsKey(type + "_" + period)) { return (Map<BigDecimal, VeidileyfagerdTypeUser>) cache.get(type + "_" + period); }// w ww. jav a 2 s. co m } GetveidileyfagerdElement parameters = new GetveidileyfagerdElement(type, period); try { Map<BigDecimal, VeidileyfagerdTypeUser> map = new LinkedHashMap<BigDecimal, VeidileyfagerdTypeUser>(); VeidileyfagerdTypeUser[] ret = getLicensePort().getveidileyfagerd(parameters); if (ret != null && ret.length > 0) { for (VeidileyfagerdTypeUser veidileyfagerdTypeUser : ret) { map.put(veidileyfagerdTypeUser.getVlyfId(), veidileyfagerdTypeUser); } if (cache != null) { cache.put(type + "_" + period, map); } } return map; } catch (RemoteException e) { e.printStackTrace(); } return null; }
From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.DOFWSClientRealWebservice.java
public LicenseCheckContainer getHasValidFishingLicense(String shipID, String licenseType, Calendar date) { if (shipID == null || shipID.length() == 0) { return new LicenseCheckContainer(false, "Ship not selected"); }/* w w w.j a v a 2 s . c om*/ if (licenseType == null || licenseType.length() == 0) { return new LicenseCheckContainer(false, "License type not selected"); } else if (licenseType.equals(FishingLicenseType.CATCH_QUOTA.toString())) { GeterskipflokkuraflamarkElement parameters = new GeterskipflokkuraflamarkElement(new BigDecimal(shipID), date); try { GeterskipflokkuraflamarkResponseElement res = getLicensePort().geterskipflokkuraflamark(parameters); LicenseCheckContainer ret = null; if (res.getResult().getIsok().intValue() > 0) { ret = new LicenseCheckContainer(true, res.getResult().getMessage()); } else { ret = new LicenseCheckContainer(false, res.getResult().getMessage()); } return ret; } catch (RemoteException e) { e.printStackTrace(); } } else if (licenseType.equals(FishingLicenseType.HOOK_CATCH_QUOTA.toString())) { GeterskipflokkurkrokaflamarkElement parameters = new GeterskipflokkurkrokaflamarkElement( new BigDecimal(shipID), date); try { GeterskipflokkurkrokaflamarkResponseElement res = getLicensePort() .geterskipflokkurkrokaflamark(parameters); LicenseCheckContainer ret = null; if (res.getResult().getIsok().intValue() > 0) { ret = new LicenseCheckContainer(true, res.getResult().getMessage()); } else { ret = new LicenseCheckContainer(false, res.getResult().getMessage()); } return ret; } catch (RemoteException e) { e.printStackTrace(); } } return new LicenseCheckContainer(false, "error_from_web_service"); }
From source file:net.i2cat.csade.life2.backoffice.bl.StatisticsManager.java
/*************************** UTILIDADES ***************************/ public String getDataPromoter(String strPromoter) { ObjStats[] st = null;/*from w w w . j a va 2s . co m*/ ArrayList<Pair> datos = new ArrayList<Pair>(); String result = null; try { int idPromoter = Integer.parseInt(strPromoter); String sql = "SELECT User_id as idStat,Role as Event,Login as user_Login,Last_loc_timestamp as dTime,0 as duration,\"\" as lat,\"\" as lon,Name as device,Name as query,0 as lng FROM user_profile WHERE User_id=" + idPromoter; st = sd.listStatsSQL(sql); } catch (RemoteException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } catch (NumberFormatException e) { e.printStackTrace(); } if (st != null && st.length > 0) { result = st[0].getUser_Login(); if (st[0].getQuery() != null) result = result + " (" + StringEscapeUtils.escapeHtml(st[0].getQuery()) + ")"; } else { result = "(Not available)"; } return result; }
From source file:net.i2cat.csade.life2.backoffice.bl.StatisticsManager.java
/** * Returns the number of logins in the last xx days, grouped by day * @param days/*from w ww . ja v a 2 s . co m*/ * @return */ public String getDatosConexionesDia(int days, int role, String lng) { ObjStats[] st = null; String sql; ArrayList<Pair> datos = new ArrayList<Pair>(); Pair p; try { if (role >= 0 && !"all".equals(lng)) sql = "SELECT 0 as idStat,count(*) as Event,\"\" as User_login,DATE(dTime) as dTime,0 as duration,\"\" as lat,\"\" as lon,\"\" as device,\"\" as query,0 as lng FROM (SELECT * FROM `Stat` INNER JOIN user_profile ON user_profile.Login=`Stat`.User_login AND user_profile.Role=" + role + " AND user_profile.Language like '" + lng + "' WHERE event=" + StatsDAO.LOGIN_EVENT + " and DATE(dTime)<=CURDATE() and (DATE(dTime)>DATE_ADD(CURDATE(), INTERVAL -" + days + " DAY)) ) AS t2 GROUP BY DATE(dTime)"; else if (role >= 0) sql = "SELECT 0 as idStat,count(*) as Event,\"\" as User_login,DATE(dTime) as dTime,0 as duration,\"\" as lat,\"\" as lon,\"\" as device,\"\" as query,0 as lng FROM (SELECT * FROM `Stat` INNER JOIN user_profile ON user_profile.Login=`Stat`.User_login AND user_profile.Role=" + role + " WHERE event=" + StatsDAO.LOGIN_EVENT + " and DATE(dTime)<=CURDATE() and (DATE(dTime)>DATE_ADD(CURDATE(), INTERVAL -" + days + " DAY)) ) AS t2 GROUP BY DATE(dTime)"; else if (!"all".equals(lng)) sql = "SELECT 0 as idStat,count(*) as Event,\"\" as User_login,DATE(dTime) as dTime,0 as duration,\"\" as lat,\"\" as lon,\"\" as device,\"\" as query,0 as lng FROM (SELECT * FROM `Stat` INNER JOIN user_profile ON user_profile.Login=`Stat`.User_login AND user_profile.Language like '" + lng + "' WHERE event=" + StatsDAO.LOGIN_EVENT + " and DATE(dTime)<=CURDATE() and (DATE(dTime)>DATE_ADD(CURDATE(), INTERVAL -" + days + " DAY)) ) AS t2 GROUP BY DATE(dTime)"; else sql = "SELECT 0 as idStat,count(*) as Event,\"\" as User_login,DATE(dTime) as dTime,0 as duration,\"\" as lat,\"\" as lon,\"\" as device,\"\" as query,0 as lng FROM (SELECT * FROM `Stat` WHERE event=" + StatsDAO.LOGIN_EVENT + " and DATE(dTime)<=CURDATE() and (DATE(dTime)>DATE_ADD(CURDATE(), INTERVAL -" + days + " DAY)) ) AS t2 GROUP BY DATE(dTime)"; st = sd.listStatsSQL(sql); } catch (RemoteException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } for (int i = 0; i < st.length; i++) { datos.add(new Pair(this.weDontSpeakAmericano(st[i].getDTime()), st[i].getIEvent())); } return datos.toString(); }
From source file:junk.gui.HazardSpectrumApplication.java
/** * Handle the Eqk Forecast List./*from w w w. j av a 2 s . c o m*/ * @param site : Selected site * @param imr : selected IMR * @param eqkRupForecast : List of Eqk Rup forecasts */ private void handleForecastList(Site site, ScalarIntensityMeasureRelationshipAPI imr, EqkRupForecastBaseAPI eqkRupForecast, double imlProbValue, boolean imlAtProb, boolean probAtIML) { ERF_EpistemicList erfList = (ERF_EpistemicList) eqkRupForecast; //checks how many SA Periods has been completed this.numSA_PeriodValDone = 0; int numERFs = erfList.getNumERFs(); // get the num of ERFs in the list // clear the function list totalProbFuncs.clear(); // calculate the hazard curve try { if (distanceControlPanel != null) calc.setMaxSourceDistance(distanceControlPanel.getDistance()); } catch (RemoteException e) { e.printStackTrace(); } // do not show progress bar if not desired by user //calc.showProgressBar(this.progressCheckBox.isSelected()); //check if the curves are to shown in the same black color for each erf. this.isEqkList = true; // set the flag to indicate thatwe are dealing with Eqk list // calculate hazard curve for each ERF within the list if (!this.progressCheckBox.isSelected()) this.isIndividualCurves = false; else this.isIndividualCurves = true; //fixing the value for the Y Axis if (probAtIML) totalProbFuncs.setYAxisName(this.PROB_AT_EXCEED); else totalProbFuncs.setYAxisName(this.IML); for (int i = 0; i < numERFs; ++i) { ArbitrarilyDiscretizedFunc hazFunction = new ArbitrarilyDiscretizedFunc(); ArbitrarilyDiscretizedFunc tempHazFunction = new ArbitrarilyDiscretizedFunc(); if (this.progressCheckBox.isSelected()) while (isIndividualCurves) ; // intialize the hazard function initX_Values(tempHazFunction, imlProbValue, imlAtProb, probAtIML); try { //iterating over all the SA Periods for the IMR's for (int j = 0; j < this.numSA_PeriodVals; ++j) { double saPeriodVal = ((Double) this.saPeriodVector.get(j)).doubleValue(); imr.getParameter(this.SA_PERIOD).setValue(this.saPeriodVector.get(j)); try { // calculate the hazard curve for each SA Period calc.getHazardCurve(tempHazFunction, site, imr, erfList.getERF(i)); } catch (RemoteException e) { e.printStackTrace(); } //number of SA Periods for which we have ran the Hazard Curve this.numSA_PeriodValDone = j; hazFunction.setInfo("\n" + getCurveParametersInfo() + "\n"); double val = getHazFuncIML_ProbValues(tempHazFunction, imlProbValue, imlAtProb, probAtIML); hazFunction.set(saPeriodVal, val); } } catch (RuntimeException e) { JOptionPane.showMessageDialog(this, e.getMessage(), "Parameters Invalid", JOptionPane.INFORMATION_MESSAGE); e.printStackTrace(); return; } totalProbFuncs.add(hazFunction); this.isIndividualCurves = true; } // if fractile or average needs to be calculated if (!this.fractileOption.equalsIgnoreCase(ERF_EpistemicListControlPanel.NO_PERCENTILE) || this.avgSelected) { // set the function list and weights in the calculator /*if (fractileCalc==null) fractileCalc = new FractileCurveCalculator(totalProbFuncs, erfList.getRelativeWeightsList()); else fractileCalc.set(totalProbFuncs, erfList.getRelativeWeightsList());*/ } if (!isAllCurves) totalProbFuncs.clear(); //if all curves are not needed to be drawn // if 5th, 50 and 95th percetile need to be plotted /*if(this.fractileOption.equalsIgnoreCase (ERF_EpistemicListControlPanel.FIVE_50_95_PERCENTILE)) { totalProbFuncs.add(fractileCalc.getFractile(.05)); // 5th fractile totalProbFuncs.add(fractileCalc.getFractile(.5)); // 50th fractile totalProbFuncs.add(fractileCalc.getFractile(.95)); // 95th fractile } else if(this.fractileOption.equalsIgnoreCase // for custom fractile (ERF_EpistemicListControlPanel.CUSTOM_PERCENTILE )) { double fractile = this.epistemicControlPanel.getCustomFractileValue(); totalProbFuncs.add(fractileCalc.getFractile(fractile/100)); }*/ // calculate average //if(this.avgSelected) totalProbFuncs.add(fractileCalc.getMeanCurve()); // set the X-axis label totalProbFuncs.setXAxisName(X_AXIS_LABEL); isIndividualCurves = false; }
From source file:net.i2cat.csade.life2.backoffice.bl.StatisticsManager.java
/** * Returns number of connections thru different hours in one day * @return/*from w ww .jav a 2s .co m*/ */ public String getDatosConexiones() { ObjStats[] st = null; ArrayList<Pair> datos = new ArrayList<Pair>(); try { String sql = "SELECT Hour(t2.dTime) as idStat,count(*) as Event,\"\" as User_login,\"\" as dTime,0 as duration,\"\" as lat,\"\" as lon,\"\" as device,\"\" as query,0 as lng FROM (SELECT * FROM `Stat` WHERE event=" + StatsDAO.LOGIN_EVENT + ") AS t2 GROUP BY Hour(t2.dTime) ORDER BY Hour(t2.dTime)"; st = sd.listStatsSQL(sql); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); } for (int i = 0; i < st.length; i++) { datos.add(new Pair("" + st[i].getIdStat(), st[i].getIEvent())); } return datos.toString(); }