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.symbian.driver.remoting.master.QueuedExecutor.java
/** * /*w ww.ja v a 2 s .co m*/ * @see com.symbian.driver.remoting.master.Snapshotable#takeSnapshot() */ public void takeSnapshot() { try { // Snap a shot (photo) while object is posing. Snapshot snapshot = new QueuedExecutorSnapshot(new ArrayList<TestJob>(testJobQueue), runningTestJob); // File the shot (photo) using the superclass's persistant filing // method. serialize(snapshot, SNAPSHOT_STORE_FILE); } catch (IOException lE) { LOGGER.log(Level.FINE, "Could not take snapshot of Queued Executor." + lE.getMessage(), lE); } }
From source file:com.cedarsoft.couchdb.DesignDocumentsUpdater.java
/** * Uploads the given design documents to the database * * @param designDocuments the design documents * @throws IOException//ww w. ja va 2 s. c o m * @throws ActionFailedException */ public void update(@Nonnull Iterable<? extends DesignDocument> designDocuments) throws IOException, ActionFailedException { for (DesignDocument designDocument : designDocuments) { if (!designDocument.hasViews()) { continue; } if (LOG.isLoggable(Level.INFO)) { LOG.info("Updating document <" + designDocument.getId() + ">:"); } String path = designDocument.getDesignDocumentPath(); WebResource resource = database.getDbRoot().path(path); @Nullable Revision currentRevision = getRevision(resource); if (LOG.isLoggable(Level.FINE)) { LOG.fine("PUT: " + resource.toString()); } ClientResponse response = resource.put(ClientResponse.class, createJson(designDocument, currentRevision)); try { ActionResponseSerializer.verifyNoError(response); } finally { response.close(); } } }
From source file:com.ibm.ws.lars.rest.RepositoryRESTResource.java
@GET @Path("/assets") @Produces(MediaType.APPLICATION_JSON)/* w ww .j a v a 2 s .c om*/ public Response getAssets(@Context UriInfo info, @Context SecurityContext context) throws JsonProcessingException, InvalidParameterException { if (logger.isLoggable(Level.FINE)) { logger.fine("getAssets called with query parameters: " + info.getRequestUri().getRawQuery()); } AssetQueryParameters params = AssetQueryParameters.create(info); Collection<AssetFilter> filters = params.getFilters(); if (!context.isUserInRole(ADMIN_ROLE)) { filters.add(ASSET_IS_PUBLISHED); } AssetList assets = assetService.retrieveAllAssets(filters, params.getSearchTerm(), params.getPagination(), params.getSortOptions()); String json = assets.toJson(); return Response.ok(json).build(); }
From source file:org.archive.checkpointing.Checkpoint.java
public BufferedWriter saveWriter(String beanName, String extraName) throws IOException { try {//w w w . j ava 2 s.c o m File targetFile = new File(getCheckpointDir().getFile(), beanName + "-" + extraName); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("opening for writing: " + targetFile); } return new BufferedWriter(new FileWriter(targetFile)); } catch (IOException e) { LOGGER.log(Level.SEVERE, "unable to save checkpoint writer state " + extraName + " of " + beanName, e); setSuccess(false); throw e; } }
From source file:org.geonode.security.GeoNodeCookieProcessingFilter.java
private String getGeoNodeCookieValue(HttpServletRequest request) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Inspecting the http request looking for the GeoNode Session ID."); }/* w w w .ja va 2 s . c om*/ Cookie[] cookies = request.getCookies(); if (cookies != null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Found " + cookies.length + " cookies!"); } for (Cookie c : cookies) { if (GEONODE_COOKIE_NAME.equals(c.getName())) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Found GeoNode cookie: " + c.getValue()); } return c.getValue(); } } } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Found no cookies!"); } } return null; }
From source file:com.cyberway.issue.crawler.extractor.ExtractorImpliedURI.java
/** * Perform usual extraction on a CrawlURI * /*from ww w . ja va 2 s . com*/ * @param curi Crawl URI to process. */ public void extract(CrawlURI curi) { this.numberOfCURIsHandled++; // use array copy because discoveriess will add to outlinks Collection<Link> links = curi.getOutLinks(); Link[] sourceLinks = links.toArray(new Link[links.size()]); for (Link wref : sourceLinks) { String implied = extractImplied(wref.getDestination(), (String) getUncheckedAttribute(curi, ATTR_TRIGGER_REGEXP), (String) getUncheckedAttribute(curi, ATTR_BUILD_PATTERN)); if (implied != null) { try { curi.createAndAddLink(implied, Link.SPECULATIVE_MISC, Link.SPECULATIVE_HOP); numberOfLinksExtracted++; final boolean removeTriggerURI = ((Boolean) getUncheckedAttribute(curi, ATTR_REMOVE_TRIGGER_URIS)).booleanValue(); // remove trigger URI from the outlinks if configured so. if (removeTriggerURI) { if (curi.getOutLinks().remove(wref)) { LOGGER.log(Level.FINE, wref.getDestination() + " has been removed from " + wref.getSource() + " outlinks list."); numberOfLinksExtracted--; } else { LOGGER.log(Level.FINE, "Failed to remove " + wref.getDestination() + " from " + wref.getSource() + " outlinks list."); } } } catch (URIException e) { LOGGER.log(Level.FINE, "bad URI", e); } } } }
From source file:com.ibm.liberty.starter.ProjectConstructor.java
private void addDynamicPackages() throws IOException { log.log(Level.FINE, "Entering method ProjectConstructor.addDynamicPackages()"); if (inputData.workspaceDirectory == null || inputData.workspaceDirectory.isEmpty() || !(new File(inputData.workspaceDirectory).exists())) { log.log(Level.FINE,/*w w w . ja va2 s . com*/ "No dynamic packages to add since workspace doesn't exist : " + inputData.workspaceDirectory); return; } for (Service service : inputData.services.getServices()) { String serviceId = service.getId(); String packageLocation = inputData.workspaceDirectory + "/" + serviceId + "/" + StarterUtil.PACKAGE_DIR; File packageDir = new File(packageLocation); if (packageDir.exists() && packageDir.isDirectory()) { log.log(Level.FINE, "Package directory for " + serviceId + " technology exists : " + packageLocation); List<File> filesListInDir = new ArrayList<File>(); StarterUtil.populateFilesList(packageDir, filesListInDir); for (File aFile : filesListInDir) { String path = aFile.getAbsolutePath().replace('\\', '/').replace(packageLocation, ""); if (path.startsWith("/")) { path = path.substring(1); } putFileInMap(path, FileUtils.readFileToByteArray(aFile)); log.log(Level.FINE, "Packaged file " + aFile.getAbsolutePath() + " to " + path); } } } log.log(Level.FINE, "Exiting method ProjectConstructor.addDynamicPackages()"); }
From source file:daylightchart.daylightchart.chart.DaylightChart.java
/** * Creates bands for the sunrise and sunset times for the whole year. *///w w w .j ava 2 s . co m private void createBandsInPlot(final XYPlot plot) { final List<DaylightBand> bands = riseSetData.getBands(); for (final DaylightBand band : bands) { final DaylightChartBand chartBand = new DaylightChartBand(band); LOGGER.log(Level.FINE, band.toString()); final int currentDatasetNumber = plot.getDatasetCount(); plot.setDataset(currentDatasetNumber, chartBand.getTimeSeriesCollection()); plot.setRenderer(currentDatasetNumber, chartBand.getRenderer()); } }
From source file:io.hops.hopsworks.common.serving.KafkaServingHelper.java
private ProjectTopics setupKafkaTopic(Project project, TfServingWrapper servingWrapper) throws KafkaException, ServiceException, UserException, ProjectException { try {/*from w ww . ja v a2 s . c o m*/ // Check that the user is not trying to create a topic with more replicas than brokers. if (servingWrapper.getKafkaTopicDTO().getNumOfReplicas() != null && (servingWrapper.getKafkaTopicDTO().getNumOfReplicas() <= 0 || servingWrapper .getKafkaTopicDTO().getNumOfReplicas() > settings.getBrokerEndpoints().size())) { throw new KafkaException(RESTCodes.KafkaErrorCode.TOPIC_REPLICATION_ERROR, Level.FINE); } else if (servingWrapper.getKafkaTopicDTO().getNumOfReplicas() == null) { // set default value servingWrapper.getKafkaTopicDTO().setNumOfReplicas(settings.getKafkaDefaultNumReplicas()); } } catch (IOException | KeeperException | InterruptedException e) { throw new KafkaException(RESTCodes.KafkaErrorCode.BROKER_METADATA_ERROR, Level.SEVERE, "", e.getMessage(), e); } // Check that the user is not trying to create a topic with negative partitions if (servingWrapper.getKafkaTopicDTO().getNumOfPartitions() != null && servingWrapper.getKafkaTopicDTO().getNumOfPartitions() <= 0) { throw new KafkaException(RESTCodes.KafkaErrorCode.BAD_NUM_PARTITION, Level.FINE, "less than 0"); } else if (servingWrapper.getKafkaTopicDTO().getNumOfPartitions() == null) { // set default value servingWrapper.getKafkaTopicDTO().setNumOfPartitions(settings.getKafkaDefaultNumPartitions()); } String servingTopicName = getServingTopicName(servingWrapper); TopicDTO topicDTO = new TopicDTO(servingTopicName, servingWrapper.getKafkaTopicDTO().getNumOfReplicas(), servingWrapper.getKafkaTopicDTO().getNumOfPartitions(), SCHEMANAME, SCHEMAVERSION); ProjectTopics pt = null; pt = kafkaFacade.createTopicInProject(project, topicDTO); // Add the ACLs for this topic. By default all users should be able to do everything AclDTO aclDto = new AclDTO(project.getName(), Settings.KAFKA_ACL_WILDCARD, "allow", Settings.KAFKA_ACL_WILDCARD, Settings.KAFKA_ACL_WILDCARD, Settings.KAFKA_ACL_WILDCARD); kafkaFacade.addAclsToTopic(topicDTO.getName(), project.getId(), aclDto); return pt; }
From source file:de.theit.jenkins.crowd.CrowdAuthenticationManager.java
/** * {@inheritDoc}// w w w .j ava 2 s . c o m * * @see org.springframework.security.AuthenticationManager#authenticate(org.springframework.security.Authentication) */ @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { String username = authentication.getPrincipal().toString(); // checking whether there's already a SSO token if (null == authentication.getCredentials() && authentication instanceof CrowdAuthenticationToken && null != ((CrowdAuthenticationToken) authentication).getSSOToken()) { // SSO token available => user already authenticated if (LOG.isLoggable(Level.FINER)) { LOG.finer("User '" + username + "' already authenticated"); } return authentication; } String password = authentication.getCredentials().toString(); // ensure that the group is available, active and that the user // is a member of it if (!this.configuration.isGroupMember(username)) { throw new InsufficientAuthenticationException( userNotValid(username, this.configuration.allowedGroupNames)); } String displayName = null; try { // authenticate user if (LOG.isLoggable(Level.FINE)) { LOG.fine("Authenticating user: " + username); } User user = this.configuration.crowdClient.authenticateUser(username, password); displayName = user.getDisplayName(); } catch (UserNotFoundException ex) { if (LOG.isLoggable(Level.INFO)) { LOG.info(userNotFound(username)); } throw new BadCredentialsException(userNotFound(username), ex); } catch (ExpiredCredentialException ex) { LOG.warning(expiredCredentials(username)); throw new CredentialsExpiredException(expiredCredentials(username), ex); } catch (InactiveAccountException ex) { LOG.warning(accountExpired(username)); throw new AccountExpiredException(accountExpired(username), ex); } catch (ApplicationPermissionException ex) { LOG.warning(applicationPermission()); throw new AuthenticationServiceException(applicationPermission(), ex); } catch (InvalidAuthenticationException ex) { LOG.warning(invalidAuthentication()); throw new AuthenticationServiceException(invalidAuthentication(), ex); } catch (OperationFailedException ex) { LOG.log(Level.SEVERE, operationFailed(), ex); throw new AuthenticationServiceException(operationFailed(), ex); } // user successfully authenticated // => retrieve the list of groups the user is a member of List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(); // add the "authenticated" authority to the list of granted // authorities... authorities.add(SecurityRealm.AUTHENTICATED_AUTHORITY); // ..and finally all authorities retrieved from the Crowd server authorities.addAll(this.configuration.getAuthoritiesForUser(username)); // user successfully authenticated => create authentication token if (LOG.isLoggable(Level.FINE)) { LOG.fine("User successfully authenticated; creating authentication token"); } return new CrowdAuthenticationToken(username, password, authorities, null, displayName); }