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:com.krminc.phr.security.PHRRealm.java
public void init(Properties props) throws BadRealmException, NoSuchRealmException { super.init(props); /*/* w ww. j a v a2 s. co m*/ * Set the jaas context, otherwise server doesn't indentify the login module. * jaas-context is the property specified in domain.xml and * is the name corresponding to LoginModule * config/login.conf */ String jaasCtx = props.getProperty(AppservRealm.JAAS_CONTEXT_PARAM); this.setProperty(AppservRealm.JAAS_CONTEXT_PARAM, jaasCtx); /* * Get any other interested properties from configuration file - domain.xml * */ String authTypeProp = props.getProperty(AUTH_TYPE_PARAM); this.authType = (authTypeProp != null) ? authTypeProp : AUTH_TYPE; String failedAttemptsProp = props.getProperty(FAILED_ATTEMPTS_PARAM); this.failedAttempts = Integer.valueOf((failedAttemptsProp != null) ? failedAttemptsProp : FAILED_ATTEMPTS); String lockedRoleProp = props.getProperty(LOCKED_ROLE_PARAM); this.lockedRole = (lockedRoleProp != null) ? lockedRoleProp : LOCKED_ROLE; String resetRoleProp = props.getProperty(RESET_ROLE_PARAM); this.resetRole = (resetRoleProp != null) ? resetRoleProp : RESET_ROLE; String jdbcResourceProp = props.getProperty(JDBC_RESOURCE_PARAM); this.jdbcResource = (jdbcResourceProp != null) ? jdbcResourceProp : JDBC_RESOURCE; String logLevelParam = props.getProperty(LOG_LEVEL_PARAM); logLevelParam = (logLevelParam != null) ? logLevelParam : LOG_LEVEL; if (logLevelParam.equalsIgnoreCase("INFO")) { this.logLevel = Level.INFO; } else if (logLevelParam.equalsIgnoreCase("SEVERE")) { this.logLevel = Level.SEVERE; } else if (logLevelParam.equalsIgnoreCase("WARNING")) { this.logLevel = Level.WARNING; } else if (logLevelParam.equalsIgnoreCase("OFF")) { this.logLevel = Level.OFF; } else if (logLevelParam.equalsIgnoreCase("FINEST")) { this.logLevel = Level.FINEST; } log("Initialized PHR Custom Realm"); }
From source file:be.fedict.eidviewer.lib.file.imports.EidQuickKeyXMLFile.java
@Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { logger.log(Level.FINEST, "<{0}>", localName); if (localName.equalsIgnoreCase(STAGE.IDFILE.getState())) { stage = STAGE.IDFILE;// w w w. j a v a 2 s. c o m logger.finest("Expecting Identity File Data"); } else if (localName.equalsIgnoreCase(STAGE.ADDRFILE.getState())) { stage = STAGE.ADDRFILE; logger.finest("Expecting Address File Data"); } else if (localName.equalsIgnoreCase(STAGE.PHOTOFILE.getState())) { stage = STAGE.PHOTOFILE; logger.finest("Expecting JPEG Photo Data"); } else if (localName.equalsIgnoreCase(STAGE.AUTHCERT.getState())) { stage = STAGE.AUTHCERT; logger.finest("Expecting Authentication Certificate"); } else if (localName.equalsIgnoreCase(STAGE.SIGNCERT.getState())) { stage = STAGE.SIGNCERT; logger.finest("Expecting Signing Certificate"); } else if (localName.equalsIgnoreCase(STAGE.CACERT.getState())) { stage = STAGE.CACERT; logger.finest("Expecting Citizen CA Certificate"); } else if (localName.equalsIgnoreCase(STAGE.ROOTCERT.getState())) { stage = STAGE.ROOTCERT; logger.finest("Expecting Belgian root Certificate"); } else if (localName.equalsIgnoreCase(STAGE.RRNCERT.getState())) { stage = STAGE.RRNCERT; logger.finest("Expecting RRN Certificate"); } }
From source file:org.keycloak.adapters.cloned.SniSSLSocketFactory.java
private Socket applySNI(final Socket socket, String hostname) { if (socket instanceof SSLSocket) { try {// w w w . jav a 2s. co m Method setHostMethod = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() { @Override public Method run() throws NoSuchMethodException { return socket.getClass().getMethod("setHost", String.class); } }); setHostMethod.invoke(socket, hostname); LOG.log(Level.FINEST, "Applied SNI to socket for host {0}", hostname); } catch (PrivilegedActionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { LOG.log(Level.WARNING, "Failed to apply SNI to SSLSocket", e); } } return socket; }
From source file:com.microsoft.azure.util.TokenCache.java
private AccessToken getNewToken() throws AzureCloudException { LOGGER.log(Level.FINEST, "TokenCache: getNewToken: Retrieve new access token"); AuthenticationResult authres = null; try {//from w ww . j ava 2s. co m LOGGER.log(Level.FINEST, "TokenCache: getNewToken: Aquiring access token:"); final ClientCredential credential = new ClientCredential(credentials.clientId.getPlainText(), credentials.clientSecret.getPlainText()); final Future<AuthenticationResult> future = new AuthenticationContext( credentials.oauth2TokenEndpoint.getPlainText(), false, AzureVMCloud.getThreadPool()) .acquireToken(credentials.serviceManagementURL, credential, null); authres = future.get(); } catch (MalformedURLException e) { throw new AzureCloudException("Authentication error", e); } catch (InterruptedException e) { throw new AzureCloudException("Authentication interrupted", e); } catch (ExecutionException e) { throw new AzureCloudException("Authentication execution failed", e); } if (authres == null) { throw new AzureCloudException("Authentication result was null"); } final AccessToken token = new AccessToken(credentials.subscriptionId.getPlainText(), credentials.serviceManagementURL, authres); writeTokenFile(token); return token; }
From source file:com.ibm.liberty.starter.api.v1.LibertyFileUploader.java
private static String getSubmittedFileName(Part part) { for (String cd : part.getHeader("content-disposition").split(";")) { if (cd.trim().startsWith("filename")) { String fileName = cd.substring(cd.indexOf('=') + 1).trim().replace("\"", ""); log.log(Level.FINEST, "fileName=" + fileName + " : part=" + part); return fileName.substring(fileName.lastIndexOf('/') + 1).substring(fileName.lastIndexOf('\\') + 1); }// w w w . j a va 2 s . c om } log.log(Level.FINE, "File name was not retrieved : part=" + part); return null; }
From source file:org.apache.reef.io.network.NetworkConnectionServiceTest.java
/** * Test NetworkService registering multiple connection factories. *//*from www. j a va2s. c o m*/ @Test public void testMultipleConnectionFactoriesTest() throws Exception { LOG.log(Level.FINEST, name.getMethodName()); runNetworkConnServiceWithMultipleConnFactories(new StringCodec(), new ObjectSerializableCodec<Integer>()); }
From source file:org.syncany.connection.plugins.webdav.WebdavTransferManager.java
@Override public <T extends RemoteFile> Map<String, T> list(Class<T> remoteFileClass) throws StorageException { connect();// w w w .j a va 2 s . c o m try { // List folder String remoteFileUrl = getRemoteFilePath(remoteFileClass); logger.log(Level.INFO, "WebDAV: Listing objects in " + remoteFileUrl + " ..."); List<DavResource> resources = sardine.list(remoteFileUrl); // Create RemoteFile objects String rootPath = repoPath.substring(0, repoPath.length() - new URI(repoPath).getRawPath().length()); Map<String, T> remoteFiles = new HashMap<String, T>(); for (DavResource res : resources) { // WebDAV returns the parent resource itself; ignore it String fullResourceUrl = rootPath + res.getPath().replaceAll("/$", "") + "/"; boolean isParentResource = remoteFileUrl.equals(fullResourceUrl.toString()); if (!isParentResource) { try { T remoteFile = RemoteFile.createRemoteFile(res.getName(), remoteFileClass); remoteFiles.put(res.getName(), remoteFile); logger.log(Level.FINE, "WebDAV: Matching WebDAV resource: " + res); } catch (Exception e) { logger.log(Level.FINEST, "Cannot create instance of " + remoteFileClass.getSimpleName() + " for object " + res.getName() + "; maybe invalid file name pattern. Ignoring file."); } } } return remoteFiles; } catch (Exception ex) { logger.log(Level.SEVERE, "WebDAV: Unable to list WebDAV directory.", ex); throw new StorageException(ex); } }
From source file:edu.harvard.iq.safe.lockss.impl.DaemonStatusDataUtil.java
/** * * @param timeStamp//from www .j av a 2s. c om * @return */ /* @Deprecated public static long stringToEpocTime(String timeStamp) { long epocTime = 0L; DateFormat formater = null; if (timeStamp.equals("never") || StringUtils.isEmpty(timeStamp)) { return epocTime; } try { formater = new SimpleDateFormat("HH:mm:ss MM/dd/yy"); //logger.log(Level.INFO, "timeStamp=" + timeStamp); epocTime = ((Date) formater.parse(timeStamp)).getTime();//date.getTime(); //logger.log(Level.INFO, "AuLastCrawl in long=" + epocTime); } catch (java.text.ParseException ex) { epocTime = -1L; logger.log(Level.SEVERE, "date/time-string parsing error", ex); } catch (Exception ex) { epocTime = -1L; logger.log(Level.SEVERE, "non-parsing error", ex); } return epocTime; } */ public static long getEpocTimeFromString(String timestamp, String timezoneOffset) { long epocTime = 0L; String timestampWithTimezone = null; //FastDateFormat formater = null; if (StringUtils.isEmpty(timestamp) || timestamp.equals("never")) { return epocTime; } try { // timezoneOffset is externally given, box-wise // attach its timezone offset token (e.g., -0500) // to a timestamp to be evaluated so that it is correctly // converted at its correct timezone. if (StringUtils.isBlank(timezoneOffset)) { timestampWithTimezone = timestamp + getJVMTimezoneOffset(); logger.log(Level.WARNING, "timezoneOffset is not available: use the JVM timezone={0}", timestampWithTimezone); } else { timestampWithTimezone = timestamp + timezoneOffset; } logger.log(Level.FINEST, "After the timezone offset is attached to the timestamp={0}", timestampWithTimezone); // attach the Z format-token to // the default lockssbox timestamp pattern String formatPatternForLockssTmstmpWTz = FORMAT_PATTERN_FOR_LOCKSSBOX_TMSTMP + " Z"; epocTime = DateUtils.parseDateStrictly(timestampWithTimezone, formatPatternForLockssTmstmpWTz) .getTime(); logger.log(Level.FINEST, "epoch time={0}", epocTime); } catch (java.text.ParseException ex) { epocTime = -1L; logger.log(Level.SEVERE, "date/time-string parsing error", ex); } catch (Exception ex) { epocTime = -1L; logger.log(Level.SEVERE, "non-parsing error", ex); } return epocTime; }
From source file:fr.ortolang.diffusion.indexing.elastic.ElasticSearchServiceBean.java
@Override public void index(String key) throws ElasticSearchServiceException { try {//from w w w . j a va2s . c o m LOGGER.log(Level.FINEST, "Starting to index key [" + key + "]"); if (client == null || client.connectedNodes().isEmpty()) { return; } OrtolangObjectIdentifier identifier = registry.lookup(key); OrtolangIndexableService service = OrtolangServiceLocator.findIndexableService(identifier.getService()); List<OrtolangIndexableContent> indexableContents = service.getIndexableContent(key); for (OrtolangIndexableContent indexableContent : indexableContents) { LOGGER.log(Level.FINEST, "Start to index key [" + indexableContent.getId() + "] of type [" + indexableContent.getType() + "] in index [" + indexableContent.getIndex() + "]"); if (!indexableContent.isEmpty()) { try { IndicesAdminClient adminClient = client.admin().indices(); if (!indices.containsKey(indexableContent.getIndex())) { // Check if index exists and create it if not if (adminClient.prepareExists(indexableContent.getIndex()).get().isExists()) { indices.put(indexableContent.getIndex(), new HashSet<>()); checkType(indexableContent, adminClient); } else { LOGGER.log(Level.FINE, "Creating index [" + indexableContent.getIndex() + "] and add mapping for type [" + indexableContent.getType() + "]"); CreateIndexRequestBuilder requestBuilder = adminClient .prepareCreate(indexableContent.getIndex()); InputStream settings = this.getClass().getResourceAsStream( PATH_TO_SETTINGS + indexableContent.getIndex() + EXTENSION_MAPPING); if (settings != null) { String settingsAsString = StreamUtils.getContent(settings); if (settingsAsString != null) { requestBuilder.setSettings(settingsAsString); } else { LOGGER.log(Level.SEVERE, "Unable to set configuration : cannot read file : " + PATH_TO_SETTINGS + indexableContent.getIndex() + EXTENSION_MAPPING); } } else { LOGGER.log(Level.WARNING, "Unable to set configuration : file not found : " + PATH_TO_SETTINGS + indexableContent.getIndex() + EXTENSION_MAPPING); } InputStream mapping = this.getClass().getResourceAsStream( PATH_TO_MAPPINGS + indexableContent.getType() + EXTENSION_MAPPING); if (mapping != null) { String mappingAsString = StreamUtils.getContent(mapping); if (mappingAsString != null) { requestBuilder.addMapping(indexableContent.getType(), mappingAsString); } else { LOGGER.log(Level.SEVERE, "Unable to put mapping : cannot read file : " + PATH_TO_MAPPINGS + indexableContent.getType() + EXTENSION_MAPPING); } } else { LOGGER.log(Level.WARNING, "Unable to put mapping : file not found : " + PATH_TO_MAPPINGS + indexableContent.getType() + EXTENSION_MAPPING); } requestBuilder.get(); HashSet<String> types = new HashSet<>(); types.add(indexableContent.getType()); indices.put(indexableContent.getIndex(), types); } } else { checkType(indexableContent, adminClient); } if (indexableContent.isUpdate()) { LOGGER.log(Level.FINE, "Updating key [" + indexableContent.getId() + "] in index [" + indexableContent.getIndex() + "] with type [" + indexableContent.getType() + "]"); Script script = new Script(ScriptType.INLINE, DEFAULT_SCRIPT_LANG, scripts.get(indexableContent.getScript()), indexableContent.getScriptParams()); client.prepareUpdate(indexableContent.getIndex(), indexableContent.getType(), indexableContent.getId()).setScript(script).get(); } else { LOGGER.log(Level.FINE, "Indexing key [" + indexableContent.getId() + "] in index [" + indexableContent.getIndex() + "] with type [" + indexableContent.getType() + "]"); client.prepareIndex(indexableContent.getIndex(), indexableContent.getType(), indexableContent.getId()).setSource(indexableContent.getContent()).get(); } } catch (IndexNotFoundException e) { LOGGER.log(Level.INFO, "Index not found: removing it from registry and re-trying to index key [" + key + "]"); indices.remove(indexableContent.getIndex()); index(key); return; } catch (IllegalArgumentException e) { LOGGER.log(Level.WARNING, "IllegalArgumentException for key [" + indexableContent.getId() + "] with type [" + indexableContent.getType() + "] in index [" + indexableContent.getIndex() + "]", e); return; } catch (DocumentMissingException e) { LOGGER.log(Level.WARNING, "Document missing for key [" + indexableContent.getId() + "] with type [" + indexableContent.getType() + "] in index [" + indexableContent.getIndex() + "] " + e.getMessage()); } catch (MapperParsingException e) { LOGGER.log(Level.WARNING, "MapperParsingException for key [" + indexableContent.getId() + "] with type [" + indexableContent.getType() + "] in index [" + indexableContent.getIndex() + "]", e); throw new ElasticSearchServiceException(e.getMessage(), e); } catch (Exception e) { LOGGER.log(Level.SEVERE, "An unexpected error happened while indexing key [" + indexableContent.getId() + "]", e); // TODO throw exception ??? return; } } } } catch (OrtolangException | KeyNotFoundException | RegistryServiceException | IndexingServiceException e) { throw new ElasticSearchServiceException("An unexpected error happened while indexing key [" + key + "]", e); } }
From source file:com.docdoku.server.export.ExcelGenerator.java
public File generateXLSResponse(QueryResult queryResult, Locale locale, String baseURL) { File excelFile = new File("export_parts.xls"); //Blank workbook XSSFWorkbook workbook = new XSSFWorkbook(); //Create a blank sheet XSSFSheet sheet = workbook.createSheet("Parts Data"); String header = StringUtils.join(queryResult.getQuery().getSelects(), ";"); String[] columns = header.split(";"); Map<Integer, String[]> data = new HashMap<>(); String[] headerFormatted = createXLSHeaderRow(header, columns, locale); data.put(1, headerFormatted);//w ww . j av a2s . c om Map<Integer, String[]> commentsData = new HashMap<>(); String[] headerComments = createXLSHeaderRowComments(header, columns); commentsData.put(1, headerComments); List<String> selects = queryResult.getQuery().getSelects(); int i = 1; for (QueryResultRow row : queryResult.getRows()) { i++; data.put(i, createXLSRow(selects, row, baseURL)); commentsData.put(i, createXLSRowComments(selects, row)); } //Iterate over data and write to sheet Set<Integer> keyset = data.keySet(); int rownum = 0; for (Integer key : keyset) { Row row = sheet.createRow(rownum++); String[] objArr = data.get(key); int cellnum = 0; for (String obj : objArr) { Cell cell = row.createCell(cellnum++); cell.setCellValue(obj); } CreationHelper factory = workbook.getCreationHelper(); Drawing drawing = sheet.createDrawingPatriarch(); String[] commentsObjArr = commentsData.get(key); cellnum = 0; for (String commentsObj : commentsObjArr) { if (commentsObj.length() > 0) { Cell cell = row.getCell(cellnum) != null ? row.getCell(cellnum) : row.createCell(cellnum); // When the comment box is visible, have it show in a 1x3 space ClientAnchor anchor = factory.createClientAnchor(); anchor.setCol1(cell.getColumnIndex()); anchor.setCol2(cell.getColumnIndex() + 1); anchor.setRow1(row.getRowNum()); anchor.setRow2(row.getRowNum() + 1); Comment comment = drawing.createCellComment(anchor); RichTextString str = factory.createRichTextString(commentsObj); comment.setString(str); // Assign the comment to the cell cell.setCellComment(comment); } cellnum++; } } // Define header style Font headerFont = workbook.createFont(); headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD); headerFont.setFontHeightInPoints((short) 10); headerFont.setFontName("Courier New"); headerFont.setItalic(true); headerFont.setColor(IndexedColors.WHITE.getIndex()); CellStyle headerStyle = workbook.createCellStyle(); headerStyle.setFont(headerFont); headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); headerStyle.setFillPattern(CellStyle.SOLID_FOREGROUND); // Set header style for (int j = 0; j < columns.length; j++) { Cell cell = sheet.getRow(0).getCell(j); cell.setCellStyle(headerStyle); if (cell.getCellComment() != null) { String comment = cell.getCellComment().getString().toString(); if (comment.equals(QueryField.CTX_PRODUCT_ID) || comment.equals(QueryField.CTX_SERIAL_NUMBER) || comment.equals(QueryField.PART_MASTER_NUMBER)) { for (int k = 0; k < queryResult.getRows().size(); k++) { Cell grayCell = sheet.getRow(k + 1).getCell(j) != null ? sheet.getRow(k + 1).getCell(j) : sheet.getRow(k + 1).createCell(j); grayCell.setCellStyle(headerStyle); } } } } try { //Write the workbook in file system FileOutputStream out = new FileOutputStream(excelFile); workbook.write(out); out.close(); } catch (Exception e) { LOGGER.log(Level.FINEST, null, e); } return excelFile; }