List of usage examples for org.jfree.util Log debug
public static void debug(final Object message)
From source file:org.gaixie.micrite.car.action.CarfileAction.java
/** * ?/* w ww. j av a 2 s. com*/ * @return "success" */ public String getCheckByCar() { // if (isFirstSearch()) { // // ???? // Integer count = checkService.advancedFindCount(getQueryBean()); // setTotalCount(count); // } // Log.debug(licenseNumber); //? licenseNumber List<Check> Checks = checkService.advancedFindByPerPageByCar(paiSe, licenseNumber, this.getStart(), this.getLimit()); this.putResultList(Checks); return SUCCESS; }
From source file:net.sourceforge.subsonic.controller.AccessSettingsController.java
private String handleParameters(HttpServletRequest request) { List<AccessToken> accessToken = securityService.getAllAccessToken(); for (AccessToken Token : accessToken) { Integer id = Token.getId(); String name = Token.getName(); for (AccessRight AR : Token.getAccessRight()) { if (AR.getMusicfolder_enabled()) { boolean EnabledDB = AR.isEnabled(); int musicFolderIdDB = AR.getMusicfolder_id(); boolean Enabled = getParameter(request, "toggle", name, musicFolderIdDB) != null; if (Enabled != EnabledDB) { // Update Record Log.debug("Update AccessRight"); securityService.updateAccessRight(id, musicFolderIdDB, Enabled); }// w w w. j a va 2s . co m } } } return null; }
From source file:org.cgiar.ccafs.marlo.action.publications.PublicationAction.java
public void savePrograms() { Deliverable deliverableDB = deliverableManager.getDeliverableById(deliverableID); if (deliverable.getFlagshipValue() == null) { deliverable.setFlagshipValue(""); }/*from www . j a va2 s . c o m*/ if (deliverable.getRegionsValue() == null) { deliverable.setRegionsValue(""); } if (deliverable.getFlagshipValue() != null) { for (DeliverableProgram deliverableProgram : deliverableDB.getDeliverablePrograms().stream() .filter(c -> c.isActive() && c.getCrpProgram().getProgramType() == ProgramType.FLAGSHIP_PROGRAM_TYPE.getValue()) .collect(Collectors.toList())) { if (!deliverable.getFlagshipValue() .contains(deliverableProgram.getCrpProgram().getId().toString())) { deliverableProgramManager.deleteDeliverableProgram(deliverableProgram.getId()); } } for (String programID : deliverable.getFlagshipValue().trim().split(",")) { if (programID.length() > 0) { CrpProgram program = crpProgramManager.getCrpProgramById(Long.parseLong(programID.trim())); DeliverableProgram deliverableProgram = new DeliverableProgram(); deliverableProgram.setCrpProgram(program); deliverableProgram.setDeliverable(deliverable); deliverableProgram.setPhase(deliverable.getPhase()); if (deliverableDB.getDeliverablePrograms().stream() .filter(c -> c.isActive() && c.getCrpProgram().getId().longValue() == program.getId().longValue()) .collect(Collectors.toList()).isEmpty()) { deliverableProgramManager.saveDeliverableProgram(deliverableProgram); } } } } if (deliverable.getRegionsValue() != null) { for (DeliverableProgram deliverableProgram : deliverableDB.getDeliverablePrograms().stream() .filter(c -> c.isActive() && c.getCrpProgram().getProgramType() == ProgramType.REGIONAL_PROGRAM_TYPE.getValue()) .collect(Collectors.toList())) { if (!deliverable.getRegionsValue() .contains(deliverableProgram.getCrpProgram().getId().toString())) { deliverableProgramManager.deleteDeliverableProgram(deliverableProgram.getId()); } } for (String programID : deliverable.getRegionsValue().trim().split(",")) { if (programID.length() > 0) { CrpProgram program = crpProgramManager.getCrpProgramById(Long.parseLong(programID.trim())); DeliverableProgram deliverableProgram = new DeliverableProgram(); deliverableProgram.setCrpProgram(program); deliverableProgram.setDeliverable(deliverable); deliverableProgram.setPhase(deliverable.getPhase()); if (deliverableDB.getDeliverablePrograms().stream() .filter(c -> c.isActive() && c.getCrpProgram().getId().longValue() == program.getId().longValue()) .collect(Collectors.toList()).isEmpty()) { deliverableProgramManager.saveDeliverableProgram(deliverableProgram); } } else { Log.debug("No regional programs can be found in String : " + programID); } } } }
From source file:org.imos.abos.netcdf.NetCDFfile.java
public String getFileName(Instrument sourceInstrument, Timestamp dataStartTime, Timestamp dataEndTime, String table, String dataType, String instrument) { //SimpleDateFormat nameFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'"); SimpleDateFormat nameFormatter = new SimpleDateFormat("yyyyMMdd"); nameFormatter.setTimeZone(tz);//from ww w . j a v a2s.c o m String filename = "ABOS_NetCDF.nc"; String deployment = mooring.getMooringID(); String mooringName = deployment.substring(0, deployment.indexOf("-")); if (instrument != null) { deployment += "-" + instrument; } if (sourceInstrument != null) { String sn = sourceInstrument.getSerialNumber().replaceAll("[()_]", "").trim(); deployment += "-" + sourceInstrument.getModel().trim() + "-" + sn; String SQL = "SELECT depth FROM mooring_attached_instruments WHERE mooring_id = " + StringUtilities.quoteString(mooring.getMooringID()) + " AND instrument_id = " + sourceInstrument.getInstrumentID(); logger.debug("SQL : " + SQL); Connection conn = Common.getConnection(); Statement proc; double depth = Double.NaN; try { proc = conn.createStatement(); proc.execute(SQL); ResultSet results = (ResultSet) proc.getResultSet(); results.next(); logger.debug("instrument lookup " + results); depth = results.getBigDecimal(1).doubleValue(); //depth = 30; logger.info("depth from database " + depth); proc.close(); } catch (SQLException ex) { java.util.logging.Logger.getLogger(AbstractDataParser.class.getName()).log(Level.SEVERE, null, ex); } deployment += "-" + String.format("%-4.0f", Math.abs(depth)).trim() + "m"; } if (mooringName.startsWith("SAZ")) { addTimeBnds = true; } if (authority.equals("IMOS")) { // IMOS_<Facility-Code>_<Data-Code>_<Start-date>_<Platform-Code>_FV<File-Version>_<Product-Type>_END-<End-date>_C-<Creation_date>_<PARTX>.nc // IMOS_ABOS-SOTS_20110803T115900Z_PULSE_FV01_PULSE-8-2011_END-20120719T214600Z_C-20130724T051434Z.nc filename = //System.getProperty("user.home") //+ "/" "data/" + authority + "_" + facility + "_" + dataType + "_" + nameFormatter.format(dataStartTime) + "_" + mooringName; if (table.startsWith("raw")) { filename += "_FV01"; } else { filename += "_FV02"; // its a data product from the processed table } filename += "_" + deployment + "_END-" + nameFormatter.format(dataEndTime) + "_C-"; filename = filename.replaceAll("\\s+", "-"); // replace any spaces with a - character filename += nameFormatter.format(new Date(System.currentTimeMillis())); Log.debug("try file name " + filename); if (multiPart) { int n = 1; String fnNext = filename + String.format("_PART%02d.nc", n); File fn = new File(fnNext); while (fn.exists()) { Log.info("File exists " + fn); n++; fnNext = filename + String.format("_PART%02d.nc", n); fn = new File(fnNext); } filename = fnNext; } else { filename += ".nc"; } } else if (authority.equals("OS")) { filename = "OS" + "_" + facility + "_" + deployment + "_D" + ".nc"; } System.out.println("Next filename " + filename); return filename; }
From source file:org.intermine.webservice.server.JWTVerifier.java
private boolean canVerify(JSONObject header, JSONObject claims, String signed, byte[] toVerify) throws VerificationError { if (toVerify == null || toVerify.length == 0) { throw new VerificationError("Cannot verify an unsigned token"); }/*from w w w. java2s.c o m*/ String issuer, algorithm; try { issuer = claims.getString("iss"); algorithm = header.getString("alg"); } catch (JSONException e) { throw new VerificationError("Missing required property: " + e.getMessage()); } // algorithm should be something like "SHA256withRSA" if (!algorithm.endsWith("withRSA")) { throw new VerificationError("Unsupported signing algorithm: " + algorithm); } Log.debug("Verifying using " + strategy + " strategy"); try { if ("NAMED_ALIAS".equals(strategy)) { return verifyNamedAlias(signed, toVerify, issuer, algorithm); } else if ("ANY".equals(strategy)) { return verifyAnyAlias(signed, toVerify, algorithm); } else if ("WHITELIST".equals(strategy)) { return verifyWhitelistedAliases(signed, toVerify, algorithm); } else { throw new VerificationError("Unknown verification strategy: " + strategy); } } catch (KeySourceException e) { throw new VerificationError("Could not retrieve public key"); } }
From source file:org.intermine.webservice.server.JWTVerifier.java
private boolean verifyWhitelistedAliases(String signed, byte[] toVerify, String algorithm) throws VerificationError, KeySourceException { String[] names = options.getProperty(WHITELIST, "").split(","); Log.debug("Using any of " + StringUtils.join(names, ", ") + " to verify JWT"); for (PublicKey key : publicKeys.getSome(names)) { if (verifySignature(key, algorithm, signed, toVerify)) { return true; }/* w w w . ja v a 2 s . co m*/ } return false; }
From source file:org.intermine.webservice.server.JWTVerifier.java
private boolean verifyNamedAlias(String signed, byte[] toVerify, String issuer, String alg) throws VerificationError, KeySourceException { String keyAlias = getKeyAlias(issuer); if (StringUtils.isBlank(keyAlias)) { throw new VerificationError("Unknown identity issuer: " + issuer); }//from ww w . j a v a 2 s . c om Log.debug("Using key aliased as " + keyAlias + " to verify JWT"); return verifySignature(publicKeys.get(keyAlias), alg, signed, toVerify); }
From source file:org.sonar.plugins.php.phpunit.sensor.PhpUnitResultParser.java
/** * Gets the test suites./*from ww w . ja v a 2 s. co m*/ * * @param report * the report * @return the test suites */ private TestSuites getTestSuites(File report) { InputStream inputStream = null; try { XStream xstream = new XStream(); xstream.aliasSystemAttribute("className", "class"); xstream.processAnnotations(TestSuites.class); xstream.processAnnotations(TestSuite.class); xstream.processAnnotations(TestCase.class); inputStream = new FileInputStream(report); TestSuites testSuites = (TestSuites) xstream.fromXML(inputStream); Log.debug("Tests suites: " + testSuites); return testSuites; } catch (IOException e) { throw new SonarException("Can't read pUnit report : " + report.getName(), e); } finally { IOUtils.closeQuietly(inputStream); } }
From source file:org.sonar.plugins.xaml.XamlLineCouterSensor.java
private void addMeasures(SensorContext sensorContext, File file, org.sonar.api.resources.File xmlFile) { LineIterator iterator = null;/* w ww . j a v a 2 s . co m*/ int numLines = 0; int numEmptyLines = 0; try { iterator = FileUtils.lineIterator(file); while (iterator.hasNext()) { String line = iterator.nextLine(); numLines++; if (StringUtils.isEmpty(line)) { numEmptyLines++; } } } catch (IOException e) { LOG.warn(e.getMessage()); } finally { LineIterator.closeQuietly(iterator); } try { Log.debug("Count comment in " + file.getPath()); int numCommentLines = new XamlLineCountParser().countLinesOfComment(FileUtils.openInputStream(file)); sensorContext.saveMeasure(xmlFile, CoreMetrics.LINES, (double) numLines); sensorContext.saveMeasure(xmlFile, CoreMetrics.COMMENT_LINES, (double) numCommentLines); sensorContext.saveMeasure(xmlFile, CoreMetrics.NCLOC, (double) numLines - numEmptyLines - numCommentLines); } catch (Exception e) { LOG.debug("Fail to count lines in " + file.getPath(), e); } LOG.debug("LineCountSensor: " + xmlFile.getKey() + ":" + numLines + "," + numEmptyLines + "," + 0); }