List of usage examples for java.util.logging Level FINE
Level FINE
To view the source code for java.util.logging Level FINE.
Click Source Link
From source file:com.rapidminer.tools.XmlRpcHandler.java
/** * Handles the login to a given BugZilla XmlRpc server. * //from w ww . j a v a 2 s . c o m * @param serverURL * the URL to the server, e.g. "http://my.bug-server.com" * @param login * the BugZilla login * @param password * the BugZilla password * @return the logged in XmlRpcClient instance * @throws MalformedURLException * @throws XmlRpcException */ public static synchronized XmlRpcClient login(String serverURL, String login, char[] password) throws MalformedURLException, XmlRpcException { String server; if (serverURL.endsWith("/")) { server = serverURL + BUGZILLA_APPENDIX; } else { server = serverURL + "/" + BUGZILLA_APPENDIX; } HttpClient httpClient = new HttpClient(); XmlRpcClient rpcClient = new XmlRpcClient(); XmlRpcCommonsTransportFactory factory = new XmlRpcCommonsTransportFactory(rpcClient); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); factory.setHttpClient(httpClient); rpcClient.setTransportFactory(factory); config.setServerURL(new URL(server)); rpcClient.setConfig(config); // map of the login data Map<String, String> loginMap = new HashMap<String, String>(); loginMap.put("login", login); loginMap.put("password", new String(password)); loginMap.put("rememberlogin", "true"); Map resultMap = (Map) rpcClient.execute("User.login", new Object[] { loginMap }); // LogService.getRoot().fine("Logged into BugZilla at '" + serverURL + "' as user '" + // resultMap.get("id") + "'."); LogService.getRoot().log(Level.FINE, "com.rapidminer.tools.XmlRpcHandler.logged_into_bugzilla", new Object[] { serverURL, resultMap.get("id") }); for (int i = 0; i < password.length; i++) { password[i] = 0; } return rpcClient; }
From source file:modmanager.backend.ModificationOption.java
private void load(File path) { logger.log(Level.FINE, "Modification option requested for {0}", path.getAbsolutePath()); /**/* w w w. j a v a 2s.c om*/ * Set name */ name = path.getName(); /** * Make compatible */ makeUnixCompatible(path); /** * Declare if data rooted or main dir rooted */ if ((new File(path, "Data")).exists()) { rootDirectory = ""; } else { rootDirectory = "Data"; } /** * Look in files */ for (File file : FileUtils.listFiles(path, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE)) { if (!file.isDirectory()) { if (file.getParentFile().getName().equalsIgnoreCase("fomod")) { continue; } else if (FilenameUtils.wildcardMatch(file.getName(), "*.txt", IOCase.INSENSITIVE)) { continue; } else if (FilenameUtils.wildcardMatch(file.getName(), "*.rtf", IOCase.INSENSITIVE)) { continue; } else if (FilenameUtils.wildcardMatch(file.getName(), "*.pdf", IOCase.INSENSITIVE)) { continue; } else if (FilenameUtils.wildcardMatch(file.getName(), "*.jskmm_status", IOCase.INSENSITIVE)) { continue; } getFiles().add(file); logger.log(Level.FINE, "... added {0} to option", Util.relativePath(path, file)); } } }
From source file:org.deviceconnect.message.intent.impl.io.IntentHttpMessageParser.java
@Override public HttpMessage parse() throws IOException, HttpException { long parseStart = System.currentTimeMillis(); // wait for response, or response timeout // if SoTimeout is 0, infinite wait while (mResponseList.size() == 0 && (mSoTimeout == 0 || mSoTimeout > System.currentTimeMillis() - parseStart)) { try {/* w ww . j a v a2 s .co m*/ Thread.sleep(WAIT_TIME); } catch (InterruptedException e) { mLogger.log(Level.FINE, e.toString(), e); throw new IOException(e); } } if (mResponseList.size() <= 0 && mSoTimeout <= System.currentTimeMillis() - parseStart) { throw new IOException("response timeout"); } Intent intent = mResponseList.remove(0); DConnectMessage dmessage = IntentMessageFactory.getMessageFactory().newDConnectMessage(intent); HttpMessage message = HttpMessageFactory.getMessageFactory().newPackagedMessage(dmessage); HttpResponse response = (HttpResponse) message; return response; }
From source file:de.jackwhite20.japs.server.network.Connection.java
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { server.removeClient(this); LOGGER.log(Level.FINE, "[{0}] Connection closed", remoteAddress.toString()); }
From source file:net.chrissearle.flickrvote.flickr.impl.FlickrJImageTagSearchDAO.java
public FlickrImages searchTag(String tag, Date earliestDate) { if (logger.isLoggable(Level.FINE)) { logger.fine("Searching for " + tag + " and date " + earliestDate); }//from w w w. j a v a 2s.c o m if (earliestDate == null) { throw new FlickrServiceException("Earliest date cannot be null"); } List<FlickrImage> imageList = new ArrayList<FlickrImage>(); for (FlickrImage image : searchTag(tag).getImages()) { if (image.getTakenDate() == null || image.getTakenDate().getTime() >= earliestDate.getTime()) { imageList.add(image); } } return new FlickrImages(imageList); }
From source file:net.chrissearle.flickrvote.web.common.VotingChallengeBlockAction.java
@Override public String execute() throws Exception { Set<ChallengeSummary> challenges = challengeService.getChallengesByType(ChallengeType.VOTING); if (challenges.size() == 0) { return "empty"; }// ww w. j a v a2 s.c o m // Front end assumes one voting challenge challenge = new DisplayChallengeSummary(challenges.iterator().next()); if (logger.isLoggable(Level.FINE)) { logger.fine("Voting challenge: " + challenge); } if (session.containsKey(FlickrVoteWebConstants.FLICKR_USER_SESSION_KEY)) { Photographer photographer = (Photographer) session.get(FlickrVoteWebConstants.FLICKR_USER_SESSION_KEY); voted = challengeService.hasVoted(photographer.getPhotographerId()); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting voted to " + voted); } } return SUCCESS; }
From source file:com.aliyun.odps.account.AliyunRequestSigner.java
public String getSignature(String resource, Request req) { try {/*w ww .ja v a 2s .c o m*/ resource = URLDecoder.decode(resource, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } String strToSign = SecurityUtils.buildCanonicalString(resource, req, "x-odps-"); if (log.isLoggable(Level.FINE)) { log.fine("String to sign: " + strToSign); } byte[] crypto = new byte[0]; try { crypto = SecurityUtils.hmacsha1Signature(strToSign.getBytes("UTF-8"), accessKey.getBytes()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e.getMessage(), e); } String signature = Base64.encodeBase64String(crypto).trim(); return "ODPS " + accessId + ":" + signature; }
From source file:com.joyfulmongo.db.javadriver.JFDBCollection.java
public void update(JSONObject query, JSONObject updates) { JSONObject extraInstruction = null;/* www .j a v a 2 s . co m*/ List<String> modifiers = findModifiers(updates); for (String modifier : modifiers) { if (extraInstruction == null) { extraInstruction = new JSONObject(); } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("UPDATE modifier=" + modifier + " " + extraInstruction); } Object o = updates.get(modifier); extraInstruction.put(modifier, o); } for (String modifier : modifiers) { updates.remove(modifier); } this.ensure2DIndexIfExist(updates); JFDBObject queryObj = new JFDBObject(colName, query); DBObject queryDBObject = queryObj.getDBObject(); WriteResult result = null; { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("UPDATE =" + " " + updates); } JSONObject updateInstruction = new JSONObject(); updateInstruction.put("$set", updates); JFDBObject jfObj = new JFDBObject(colName, updateInstruction); DBObject updateDBObject = jfObj.getDBObject(); result = dbCollection.update(queryDBObject, updateDBObject, false, false, WriteConcern.SAFE); } if (extraInstruction != null) { JFDBObject jfObj = new JFDBObject(colName, extraInstruction); DBObject updateInstructionObject = jfObj.getDBObject(); result = dbCollection.update(queryDBObject, updateInstructionObject, false, false, WriteConcern.SAFE); } recordWriteResult("update", result); }
From source file:net.chrissearle.flickrvote.service.DaoTagSearchService.java
public ImageItems searchByTagAndDate(String tag, Date earliestDate) { if (logger.isLoggable(Level.FINE)) { logger.fine("Searching for Tag: " + tag + " with date " + earliestDate); }/*from ww w. j ava2 s . co m*/ FlickrImages images = flickrImageTagSearchDao.searchTag(tag, earliestDate); List<ImageItem> items = new ArrayList<ImageItem>(); for (FlickrImage flickrImage : images.getImages()) { Photographer photographer = retrievePhotographer(flickrImage.getPhotographer().getFlickrId()); ImageItem item = new ImageItemInstance( new FlickrImage(flickrImage, convertPhotographerToFlickrPhotographer(photographer)), photographer); items.add(item); } return new ImageItems(items); }
From source file:eu.trentorise.opendata.commons.test.jackson.OdtJacksonTester.java
/** * Tests that the provided object can be converted to json and * reconstructed. Also logs the json with the provided logger at FINE * level.//from w ww .ja v a 2s. c om * * @return the reconstructed object */ public static <T> T testJsonConv(ObjectMapper om, Logger logger, @Nullable T obj) { checkNotNull(om); checkNotNull(logger); T recObj; try { String json = om.writeValueAsString(obj); logger.log(Level.FINE, "json = {0}", json); Object ret = om.readValue(json, obj.getClass()); recObj = (T) ret; } catch (Exception ex) { throw new RuntimeException(ex); } assertEquals(obj, recObj); return recObj; }