List of usage examples for java.util.logging Level FINEST
Level FINEST
To view the source code for java.util.logging Level FINEST.
Click Source Link
From source file:ke.go.moh.oec.mpi.match.NameMatch.java
/** * Finds the score for a match between two names. * //from w w w. j a v a2 s. co m * @param s The Scorecard in which to add the score. * @param other The other name to match against. */ public void score(Scorecard s, NameMatch other) { if (getOriginal() == null) { s.addScore(Scorecard.SEARCH_TERM_MISSING_WEIGHT, 0, Scorecard.SearchTerm.MISSING); } else if (other.getOriginal() == null) { s.addScore(Scorecard.MPI_VALUE_MISSING_WEIGHT, 0); } else { Double score = computeScore(this, other); if (score != null) { double weight = Scorecard.OTHER_MATCH_WEIGHT; if (score == 0) { weight = Scorecard.OTHER_MISS_WEIGHT; } s.addScore(weight, score); if (Mediator.testLoggerLevel(Level.FINEST)) { Mediator.getLogger(NameMatch.class.getName()).log(Level.FINEST, "Score {0},{1} total {2},{3},{4} comparing {5} with {6}", new Object[] { score, weight, s.getTotalScore(), s.getTotalWeight(), s.getSearchTermScore(), getOriginal(), other.getOriginal() }); } } } }
From source file:org.gameontext.map.auth.PlayerClient.java
/** * Obtain sharedSecret for player id./* w ww.ja va 2 s . c om*/ * * @param playerId * The player id * @return The apiKey for the player */ private String getPlayerSecret(String playerId) throws WebApplicationException { try { String jwt = buildClientJwtForId(playerId); return new GetPlayerSecretCommand(jwt, playerId, playerLocation).execute(); } catch (HystrixRuntimeException e) { //unwrap hysterix exceptions.. Throwable cause = e.getCause(); if (cause instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) cause; throw wae; } else { throw new WebApplicationException("Unknown error during communication with player service", cause); } } catch (HystrixBadRequestException e) { throw new WebApplicationException("Internal issue communicating with player service", e); } catch (IOException io) { Log.log(Level.FINEST, this, "Unexpected exception getting token for playerService: {0}", io); throw new WebApplicationException("Token Error communicating with Player service", Response.Status.INTERNAL_SERVER_ERROR); } }
From source file:de.mendelson.comm.as2.client.AS2Gui.java
/** * Creates new form NewJFrame/*w w w.j a va 2 s .co m*/ */ public AS2Gui(Splash splash, String host) { this.host = host; //Set System default look and feel try { //support the command line option -Dswing.defaultlaf=... if (System.getProperty("swing.defaultlaf") == null) { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } } catch (Exception e) { this.logger.warning(this.getClass().getName() + ":" + e.getMessage()); } //load resource bundle try { this.rb = (MecResourceBundle) ResourceBundle.getBundle(ResourceBundleAS2Gui.class.getName()); } catch (MissingResourceException e) { throw new RuntimeException("Oops..resource bundle " + e.getClassName() + " not found."); } initComponents(); this.jButtonNewVersion.setVisible(false); this.jPanelRefreshWarning.setVisible(false); //set preference values to the GUI this.setBounds(this.clientPreferences.getInt(PreferencesAS2.FRAME_X), this.clientPreferences.getInt(PreferencesAS2.FRAME_Y), this.clientPreferences.getInt(PreferencesAS2.FRAME_WIDTH), this.clientPreferences.getInt(PreferencesAS2.FRAME_HEIGHT)); //ensure to display all messages this.getLogger().setLevel(Level.ALL); LogConsolePanel consolePanel = new LogConsolePanel(this.getLogger()); //define the colors for the log levels consolePanel.setColor(Level.SEVERE, LogConsolePanel.COLOR_BROWN); consolePanel.setColor(Level.WARNING, LogConsolePanel.COLOR_BLUE); consolePanel.setColor(Level.INFO, LogConsolePanel.COLOR_BLACK); consolePanel.setColor(Level.CONFIG, LogConsolePanel.COLOR_DARK_GREEN); consolePanel.setColor(Level.FINE, LogConsolePanel.COLOR_DARK_GREEN); consolePanel.setColor(Level.FINER, LogConsolePanel.COLOR_DARK_GREEN); consolePanel.setColor(Level.FINEST, LogConsolePanel.COLOR_DARK_GREEN); this.jPanelServerLog.add(consolePanel); this.setTitle(AS2ServerVersion.getProductName() + " " + AS2ServerVersion.getVersion()); //initialize the help system if available this.initializeJavaHelp(); this.jTableMessageOverview.getSelectionModel().addListSelectionListener(this); this.jTableMessageOverview.getTableHeader().setReorderingAllowed(false); //icon columns TableColumn column = this.jTableMessageOverview.getColumnModel().getColumn(0); column.setMaxWidth(20); column.setResizable(false); column = this.jTableMessageOverview.getColumnModel().getColumn(1); column.setMaxWidth(20); column.setResizable(false); this.jTableMessageOverview.setDefaultRenderer(Date.class, new TableCellRendererDate(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT))); //add row sorter RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(this.jTableMessageOverview.getModel()); jTableMessageOverview.setRowSorter(sorter); sorter.addRowSorterListener(this); this.jPanelFilterOverview.setVisible(this.showFilterPanel); this.jMenuItemHelpForum.setEnabled(Desktop.isDesktopSupported()); //destroy splash, possible login screen for the client should come up if (splash != null) { splash.destroy(); } this.setButtonState(); this.jTableMessageOverview.addMouseListener(this); //popup menu issues this.jPopupMenu.setInvoker(this.jScrollPaneMessageOverview); this.jPopupMenu.addPopupMenuListener(this); super.addMessageProcessor(this); //perform the connection to the server //warning! this works for localhost only so far int clientServerCommPort = this.clientPreferences.getInt(PreferencesAS2.CLIENTSERVER_COMM_PORT); if (splash != null) { splash.destroy(); } this.browserLinkedPanel.cyleText(new String[] { "For additional EDI software to convert and process your data please contact <a href='http://www.mendelson-e-c.com'>mendelson-e-commerce GmbH</a>", "To buy a commercial license please visit the <a href='http://shop.mendelson-e-c.com/'>mendelson online shop</a>", "Most trading partners demand a trusted certificate - Order yours at the <a href='http://ca.mendelson-e-c.com'>mendelson CA</a> now!", "Looking for additional secure data transmission software? Try the <a href='http://oftp2.mendelson-e-c.com'>mendelson OFTP2</a> solution!", "You want to send EDIFACT data from your SAP system? Ask <a href='mailto:info@mendelson.de?subject=Please%20inform%20me%20about%20your%20SAP%20integration%20solutions'>mendelson-e-commerce GmbH</a> for a solution.", "You need a secure FTP solution? <a href='mailto:info@mendelson.de?subject=Please%20inform%20me%20about%20your%20SFTP%20solution'>Ask us</a> for the mendelson SFTP software.", "Convert flat files, EDIFACT, SAP IDos, VDA, inhouse formats? <a href='mailto:info@mendelson.de?subject=Please%20inform%20me%20about%20your%20converter%20solution'>Ask us</a> for the mendelson EDI converter.", "For commercial support of this software please buy a license at <a href='http://as2.mendelson-e-c.com'>the mendelson AS2</a> website.", "Have a look at the <a href='http://www.mendelson-e-c.com/products_mbi.php'>mendelson business integration</a> for a powerful EDI solution.", "The <a href='mailto:info@mendelson.de?subject=Please%20inform%20me%20about%20your%20RosettaNet%20solution'>mendelson RosettaNet solution</a> supports RNIF 1.1 and RNIF 2.0.", "The <a href='http://www.mendelson-e-c.com/products_ide.php'>mendelson converter IDE</a> is the graphical mapper for the mendelson converter.", "To process any XML data and convert it to EDIFACT, VDA, flat files, IDocs and inhouse formats use <a href='http://www.mendelson-e-c.com/products_converter.php'>the mendelson converter</a>.", "To transmit your EDI data via HTTP/S please <a href='mailto:info@mendelson.de?subject=Please%20inform%20me%20about%20your%20HTTPS%20solution'>ask us</a> for the mendelson HTTPS solution.", "If you have questions regarding this product please refer to the <a href='http://community.mendelson-e-c.com/'>mendelson community</a>.", }); this.connect(new InetSocketAddress(host, clientServerCommPort), 5000); Runnable dailyNewsThread = new Runnable() { @Override public void run() { while (true) { long lastUpdateCheck = Long.valueOf(clientPreferences.get(PreferencesAS2.LAST_UPDATE_CHECK)); //check only once a day even if the system is started n times a day if (lastUpdateCheck < (System.currentTimeMillis() - TimeUnit.HOURS.toMillis(23))) { clientPreferences.put(PreferencesAS2.LAST_UPDATE_CHECK, String.valueOf(System.currentTimeMillis())); jButtonNewVersion.setVisible(false); String version = (AS2ServerVersion.getVersion() + " " + AS2ServerVersion.getBuild()) .replace(' ', '+'); Header[] header = htmlPanel.setURL( "http://www.mendelson.de/en/mecas2/client_welcome.php?version=" + version, AS2ServerVersion.getProductName() + " " + AS2ServerVersion.getVersion(), new File("start/client_welcome.html")); if (header != null) { String downloadURL = null; String actualBuild = null; for (Header singleHeader : header) { if (singleHeader.getName().equals("x-actual-build")) { actualBuild = singleHeader.getValue().trim(); } if (singleHeader.getName().equals("x-download-url")) { downloadURL = singleHeader.getValue().trim(); } } if (downloadURL != null && actualBuild != null) { try { int thisBuild = AS2ServerVersion.getBuildNo(); int availableBuild = Integer.valueOf(actualBuild); if (thisBuild < availableBuild) { jButtonNewVersion.setVisible(true); } downloadURLNewVersion = downloadURL; } catch (Exception e) { //nop } } } } else { htmlPanel.setPage(new File("start/client_welcome.html")); } try { //check once a day for new update Thread.sleep(TimeUnit.DAYS.toMillis(1)); } catch (InterruptedException e) { //nop } } } }; Executors.newSingleThreadExecutor().submit(dailyNewsThread); this.as2StatusBar.setConnectedHost(this.host); }
From source file:com.moesol.geoserver.sync.client.AbstractClientSynchronizer.java
/** * @param roundNumber round number// w ww . ja v a2 s . c o m * @return true when synchronized * @throws java.io.IOException * @throws javax.xml.parsers.ParserConfigurationException * @throws org.xml.sax.SAXException */ private boolean processRound(int roundNumber) throws IOException, SAXException, ParserConfigurationException { m_roundListener.beforeRound(roundNumber); long s = System.currentTimeMillis(); try { Sha1SyncJson localSyncState = (roundNumber == 0) ? computeLevelZero() : computeNextLevel(); Response response = post(localSyncState); return processResponse(response); } finally { m_numRounds++; LOGGER.log(Level.FINEST, "ms({0}), server.level({1})", new Object[] { System.currentTimeMillis() - s, m_server != null ? m_server.level() : "server=null?" }); m_roundListener.afterRound(roundNumber); } }
From source file:edu.memphis.ccrg.lida.framework.gui.panels.ActivationChartPanel.java
private void updateWithLearnable(Learnable learnable) { if (learnable != null) { //Remove oldest if display interval is reached if (series2.getItemCount() >= tickDisplayInterval) { series1.remove(0);//from ww w.j av a 2s. c o m series2.remove(0); series3.remove(0); } //add a new x,y entry to each of the 3 series long currentTick = TaskManager.getCurrentTick(); series1.add(currentTick, learnable.getBaseLevelActivation()); series2.add(currentTick, learnable.getActivation()); series3.add(currentTick, learnable.getTotalActivation()); } else { logger.log(Level.FINEST, "null learnable", TaskManager.getCurrentTick()); } }
From source file:io.github.agentsoz.abmjadex.super_central.ABMSimStarter.java
private static void parsingArguments(String[] args, Options options) { //flags// w ww .jav a 2 s .co m boolean isRunningCO = true; boolean isForced = false; //Overwrite any existing CO xml file boolean isRunningSC = true; boolean isLogToConsole = false; Level logLevel = Level.INFO; Properties prop = null; CommandLine line = null; BasicParser parser = new BasicParser(); ArrayList<String> argsList = new ArrayList<String>(); //Initialize argsList with args for (int i = 0; i < args.length; i++) { argsList.add(args[i]); } //Update 04/17/2013 String[] specificArgs = packageOptionSpecific(args); try { // parse the command line arguments //line = parser.parse(options, args ); //Update 04/17/2013 line = parser.parse(options, specificArgs); //Commandline required -prop argument to be filled with valid properties file location if (line.hasOption(HELP)) { //Remove app specific arguments from total arguments int helpIndex = argsList.indexOf("-" + HELP); if (helpIndex == -1) helpIndex = argsList.indexOf("-" + HELP_LONG); argsList.remove(helpIndex); HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("Jadex-ABMS", options); } if (line.hasOption(PROP)) { //Remove app specific arguments from total arguments int propIndex = argsList.indexOf("-" + PROP); if (propIndex == -1) propIndex = argsList.indexOf("-" + PROP_LONG); argsList.remove(propIndex + 1); argsList.remove(propIndex); String propertiesLoc = line.getOptionValue(PROP).replace("\\", "/").replace("\\\\", "/"); prop = new Properties(); try { prop.load(new FileInputStream(propertiesLoc)); //Parsing options value into local flags------------------------ if (line.hasOption(MODE)) { String mode = line.getOptionValue(MODE); if (mode.equalsIgnoreCase(CO_ONLY)) { isRunningSC = false; } else if (mode.equalsIgnoreCase(SC_CO)) { //Default value is to run an SC and a CO } else if (mode.equalsIgnoreCase(SC_ONLY)) { isRunningCO = false; } else { throw new ParseException("Wrong argument for -mode."); } //Remove app specific arguments from total arguments int modeIndex = argsList.indexOf("-" + MODE); argsList.remove(modeIndex + 1); argsList.remove(modeIndex); } if (line.hasOption(FORCED)) { isForced = true; //Remove app specific arguments from total arguments int modeIndex = argsList.indexOf("-" + FORCED); if (modeIndex == -1) modeIndex = argsList.indexOf("-" + FORCED_LONG); argsList.remove(modeIndex); } if (line.hasOption(GUI)) { String guiMode = line.getOptionValue(GUI); if (!guiMode.equalsIgnoreCase("true") && !guiMode.equalsIgnoreCase("false")) throw new ParseException("Wrong argument for -gui."); } else { argsList.add("-" + GUI); int guiIndex = argsList.indexOf("-" + GUI); argsList.add(guiIndex + 1, "false"); } if (line.hasOption(LOG_CONSOLE)) { isLogToConsole = true; //Remove app specific arguments from total arguments int logCIndex = argsList.indexOf("-" + LOG_CONSOLE); argsList.remove(logCIndex); } if (line.hasOption(LOG_LVL)) { String level = line.getOptionValue(LOG_LVL); if (level.equalsIgnoreCase("INFO")) { logLevel = Level.INFO; } else if (level.equalsIgnoreCase("ALL")) { logLevel = Level.ALL; } else if (level.equalsIgnoreCase("CONFIG")) { logLevel = Level.CONFIG; } else if (level.equalsIgnoreCase("FINE")) { logLevel = Level.FINE; } else if (level.equalsIgnoreCase("FINER")) { logLevel = Level.FINER; } else if (level.equalsIgnoreCase("FINEST")) { logLevel = Level.FINEST; } else if (level.equalsIgnoreCase("OFF")) { logLevel = Level.OFF; } else if (level.equalsIgnoreCase("SEVERE")) { logLevel = Level.SEVERE; } else if (level.equalsIgnoreCase("WARNING")) { logLevel = Level.WARNING; } else { throw new ParseException("argument for loglvl unknown"); } //Remove app specific arguments from total arguments int logLvlIndex = argsList.indexOf("-" + LOG_LVL); argsList.remove(logLvlIndex + 1); argsList.remove(logLvlIndex); } //Setup logger try { ABMBDILoggerSetter.initialized(prop, isLogToConsole, logLevel); ABMBDILoggerSetter.setup(LOGGER); } catch (IOException e) { e.printStackTrace(); LOGGER.severe(e.getMessage()); throw new RuntimeException("Problems with creating logfile"); } //Translate argsList into array------------------------------ String[] newargs = new String[argsList.size()]; for (int i = 0; i < argsList.size(); i++) { newargs[i] = argsList.get(i); } //Running the system---------------------------------------- if (isRunningSC == true) { runSC(prop); } if (isRunningCO == true) { runCO(prop, newargs, isForced); } } catch (IOException e) { e.printStackTrace(); LOGGER.severe(e.getMessage()); } } else { throw new ParseException("-prop <properties_location> is a required option"); } } catch (ParseException exp) { LOGGER.severe("Unexpected exception:" + exp.getMessage()); //If its not working print out help info HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("Jadex-ABMS", options); } }
From source file:com.cyberway.issue.crawler.postprocessor.LinksScoper.java
/** * Determine scheduling for the <code>curi</code>. * As with the LinksScoper in general, this only handles extracted links, * seeds do not pass through here, but are given MEDIUM priority. * Imports into the frontier similarly do not pass through here, * but are given NORMAL priority.// w w w . ja v a 2s . co m */ protected int getSchedulingFor(final CrawlURI curi, final Link wref, final int preferenceDepthHops) { final char c = wref.getHopType(); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest(curi + " with path=" + curi.getPathFromSeed() + " isSeed=" + curi.isSeed() + " with fetchStatus=" + curi.getFetchStatus() + " -> " + wref.getDestination() + " type " + c + " with context=" + wref.getContext()); } switch (c) { case Link.REFER_HOP: // Treat redirects somewhat urgently // This also ensures seed redirects remain seed priority return (preferenceDepthHops >= 0 ? CandidateURI.HIGH : CandidateURI.MEDIUM); default: if (preferenceDepthHops == 0) return CandidateURI.HIGH; // this implies seed redirects are treated as path // length 1, which I belive is standard. // curi.getPathFromSeed() can never be null here, because // we're processing a link extracted from curi if (preferenceDepthHops > 0 && curi.getPathFromSeed().length() + 1 <= preferenceDepthHops) return CandidateURI.HIGH; // Everything else normal (at least for now) return CandidateURI.NORMAL; } }
From source file:com.sun.grizzly.http.jk.common.JniHandler.java
/** send and get the response in the same buffer. This calls the * method on the wrapped jk_bean object. *///from w ww .j av a 2s . co m protected int nativeDispatch(Msg msg, MsgContext ep, int code, int raw) throws IOException { if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) { LoggerUtils.getLogger().log(Level.FINEST, "Sending packet " + code + " " + raw); } if (raw == 0) { msg.end(); } // Create ( or reuse ) the jk_endpoint ( the native pair of // MsgContext ) long xEnv = ep.getJniEnv(); long nativeContext = ep.getJniContext(); if (nativeContext == 0 || xEnv == 0) { setNativeEndpoint(ep); xEnv = ep.getJniEnv(); nativeContext = ep.getJniContext(); } if (xEnv == 0 || nativeContext == 0 || nativeJkHandlerP == 0) { LoggerUtils.getLogger().log(Level.SEVERE, "invokeNative: Null pointer "); return -1; } // Will process the message in the current thread. // No wait needed to receive the response, if any int status = AprImpl.jkInvoke(xEnv, nativeJkHandlerP, nativeContext, code, msg.getBuffer(), 0, msg.getLen(), raw); if (status != 0 && status != 2) { LoggerUtils.getLogger().log(Level.SEVERE, "nativeDispatch: error " + status, new Throwable()); } if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) { LoggerUtils.getLogger().log(Level.FINEST, "Sending packet - done " + status); } return status; }
From source file:com.esri.gpt.agp.ags.Ags2AgpCopy.java
private void execPublishItem(AgpItem sourceItem, AgpItem destItem) throws Exception { AgpDestination dest = this.destination; String sDestId = destItem != null ? destItem.getProperties().getValue("id") : null; String sTitle = sourceItem.getProperties().getValue("title"); LOGGER.finer("Publishing item: " + sTitle); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest(sourceItem.getProperties().toString()); }// w w w . j a v a 2 s . co m // make the URL boolean bInsert = true; String sUrl = dest.getConnection().makeSharingUrl(); sUrl += "/content/users"; sUrl += "/" + AgpUtil.encodeURIComponent(dest.getDestinationOwner()); sUrl += "/" + AgpUtil.encodeURIComponent(dest.getDestinationFolderID()); if (sDestId == null) { sUrl += "/addItem"; } else { bInsert = false; sUrl += "/items"; sUrl += "/" + AgpUtil.encodeURIComponent(sDestId); sUrl += "/update"; } // make the content provider, add thumb-nail and data parts MultipartProvider provider = new MultipartProvider(); provider.add("f", "json"); provider.add("token", destination.getConnection().getToken().getTokenString()); provider.add("overwrite", "true"); for (AgpProperty destProp : sourceItem.getProperties().values()) { provider.add(destProp.getName(), destProp.getValue()); } //this.partHelper.addThumbnailPart(provider,src,sourceItem,dest,destItem); //this.partHelper.addDataPart(provider,src,sourceItem,dest,destItem); // execute AgpProperties hdr = dest.getConnection().makeRequestHeaderProperties(); AgpClient client = dest.getConnection().ensureClient(); JSONObject jso = client.executeJsonRequest(sUrl, hdr, provider); if (jso.has("id") && jso.has("success") && jso.getString("success").equals("true")) { if (sDestId == null) { sDestId = jso.getString("id"); sourceItem.getProperties().add(new AgpProperty("id", sDestId)); } /* if (bInsert) { this.numItemsInserted++; LOGGER.finer("Item inserted: "+sUrl); } else { this.numItemsUpdated++; LOGGER.finer("Item updated: "+sUrl); } */ } else { LOGGER.finer("Publish item FAILED for: " + sUrl); // TODO: throw exception here?? } }
From source file:edu.umass.cs.nio.MessageExtractor.java
private boolean callDemultiplexerHandler(NIOHeader header, byte[] message, AbstractPacketDemultiplexer<?> pd) { try {// w w w . j a va 2 s. c o m Level level = Level.FINEST; log.log(level, "{0} calling {1}.handleMessageSuper({2}:{3})", new Object[] { this, pd, header, log.isLoggable(level) ? new Stringer(message) : message }); // the handler turns true if it handled the message if (pd.handleMessageSuper(message, header)) return true; } catch (JSONException je) { je.printStackTrace(); } return false; }