Example usage for java.util.logging Level FINER

List of usage examples for java.util.logging Level FINER

Introduction

In this page you can find the example usage for java.util.logging Level FINER.

Prototype

Level FINER

To view the source code for java.util.logging Level FINER.

Click Source Link

Document

FINER indicates a fairly detailed tracing message.

Usage

From source file:org.geoserver.importer.format.GeoJSONFormat.java

String srs(CoordinateReferenceSystem crs) {
    Integer epsg = null;/*from  ww w .ja  v a 2s .com*/

    try {
        epsg = CRS.lookupEpsgCode(crs, false);
        if (epsg == null) {
            epsg = CRS.lookupEpsgCode(crs, true);
        }
    } catch (Exception e) {
        LOG.log(Level.FINER, "Error looking up epsg code", e);
    }
    return epsg != null ? "EPSG:" + epsg : null;
}

From source file:Peer.java

@Override
public String lookup(String word, Level logLevel) throws Exception {
    lg.log(Level.FINEST, "lookup Entry");

    // Get the hash for this word
    Key key = hasher.getHash(word);
    lg.log(Level.FINER, " Hashed word " + word + " has key " + key);

    // Get the max key value
    Key max = new Key(BigInteger.valueOf((int) Math.pow(2, hasher.getBitSize()))).pred();

    // If this peer knows the which peer that key belongs to ...
    if (/* w  w w .j  ava2s  . com*/
    // Normal ascending range
    pred == null || (key.compare(pred) > 0 && key.compare(nodeid) <= 0)
    // Modulor case
            || (pred.compare(nodeid) > 0 && (key.compare(pred) > 0 && key.compare(max) <= 0)
                    || (key.compare(nodeid) <= 0))) {
        lg.log(logLevel, "(lookup)Peer " + nodeid + " should have word " + word + " with key " + key);

        // Lookup keey 
        if (dict.get(word) != null) {
            lg.log(Level.FINEST, "lookup Exit");
            return dict.get(word);
        } else {
            lg.log(Level.FINEST, "lookup Exit");
            return "Meaning is not found";
        }
    }
    // ... else find next success through finger key.
    else {
        Key closestNode = ft.getClosestSuccessor(key);

        lg.log(logLevel, "(lookup)Peer " + nodeid + " should NOT have word " + word + " with key " + key
                + " ... calling insert on the best finger table match " + closestNode);
        PeerInterface peer = getPeer(closestNode);
        lg.log(Level.FINEST, "lookup Exit");
        return peer.lookup(word, logLevel);
    }
}

From source file:org.apache.river.container.deployer.FolderBasedAppRunner.java

private Map<String, DeploymentRecord> scanDeploymentArchives() throws FileSystemException {
    /*/*  www  .  j a  v  a 2  s .  c o m*/
     Go through the deployment directory looking for services to deploy.
     */
    Map<String, DeploymentRecord> deployDirListing = new HashMap<String, DeploymentRecord>();
    deploymentDirectoryFile.refresh();
    List<FileObject> serviceArchives = Utils.findChildrenWithSuffix(deploymentDirectoryFile,
            org.apache.river.container.Strings.JAR);
    if (serviceArchives != null) {
        log.log(Level.FINER, MessageNames.FOUND_SERVICE_ARCHIVES,
                new Object[] { serviceArchives.size(), deployDirectory });
        for (FileObject serviceArchive : serviceArchives) {
            DeploymentRecord rec = new DeploymentRecord();
            rec.fileObject = serviceArchive;
            rec.name = serviceArchive.getName().getBaseName();
            rec.updateTime = serviceArchive.getContent().getLastModifiedTime();
            deployDirListing.put(rec.name, rec);
        }
    }
    return deployDirListing;
}

From source file:org.b3log.solo.service.ArticleQueryService.java

/**
 * Gets an article by the specified article id.
 * /* ww  w  .  ja v  a2s  .c  om*/
 * <p>
 *   <b>Note</b>: The article content and abstract is raw (no editor type processing).
 * </p>
 *
 * @param articleId the specified article id
 * @return for example,
 * <pre>
 * {
 *     "article": {
 *         "oId": "",
 *         "articleTitle": "",
 *         "articleAbstract": "",
 *         "articleContent": "",
 *         "articlePermalink": "",
 *         "articleHadBeenPublished": boolean,
 *         "articleCreateDate": java.util.Date,
 *         "articleTags": [{
 *             "oId": "",
 *             "tagTitle": ""
 *         }, ....],
 *         "articleSignId": "",
 *         "articleViewPwd": "",
 *         "articleEditorType": "",
 *         "signs": [{
 *             "oId": "",
 *             "signHTML": ""
 *         }, ....]
 *     }
 * }
 * </pre>, returns {@code null} if not found
 * @throws ServiceException service exception
 */
public JSONObject getArticle(final String articleId) throws ServiceException {
    try {
        final JSONObject ret = new JSONObject();

        final JSONObject article = articleRepository.get(articleId);

        if (null == article) {
            return null;
        }

        ret.put(ARTICLE, article);

        // Tags
        final JSONArray tags = new JSONArray();
        final List<JSONObject> tagArticleRelations = tagArticleRepository.getByArticleId(articleId);
        for (int i = 0; i < tagArticleRelations.size(); i++) {
            final JSONObject tagArticleRelation = tagArticleRelations.get(i);
            final String tagId = tagArticleRelation.getString(Tag.TAG + "_" + Keys.OBJECT_ID);
            final JSONObject tag = tagRepository.get(tagId);

            tags.put(tag);
        }
        article.put(ARTICLE_TAGS_REF, tags);

        // Signs
        final JSONObject preference = preferenceQueryService.getPreference();
        article.put(Sign.SIGNS, new JSONArray(preference.getString(Preference.SIGNS)));

        // Remove unused properties
        article.remove(ARTICLE_AUTHOR_EMAIL);
        article.remove(ARTICLE_COMMENT_COUNT);
        article.remove(ARTICLE_IS_PUBLISHED);
        article.remove(ARTICLE_PUT_TOP);
        article.remove(ARTICLE_UPDATE_DATE);
        article.remove(ARTICLE_VIEW_COUNT);
        article.remove(ARTICLE_RANDOM_DOUBLE);

        LOGGER.log(Level.FINER, "Got an article[id={0}]", articleId);

        return ret;
    } catch (final Exception e) {
        LOGGER.log(Level.SEVERE, "Gets an article failed", e);
        throw new ServiceException(e);
    }
}

From source file:com.stratuscom.harvester.deployer.FolderBasedAppRunner.java

private Map<String, DeploymentRecord> scanDeploymentArchives() throws FileSystemException {
    /*/*  ww  w.j a  va2  s . c  om*/
     Go through the deployment directory looking for services to deploy.
     */
    Map<String, DeploymentRecord> deployDirListing = new HashMap<String, DeploymentRecord>();
    deploymentDirectoryFile.refresh();
    List<FileObject> serviceArchives = Utils.findChildrenWithSuffix(deploymentDirectoryFile,
            com.stratuscom.harvester.Strings.JAR);
    if (serviceArchives != null) {
        log.log(Level.FINER, MessageNames.FOUND_SERVICE_ARCHIVES,
                new Object[] { serviceArchives.size(), deployDirectory });
        for (FileObject serviceArchive : serviceArchives) {
            DeploymentRecord rec = new DeploymentRecord();
            rec.fileObject = serviceArchive;
            rec.name = serviceArchive.getName().getBaseName();
            rec.updateTime = serviceArchive.getContent().getLastModifiedTime();
            deployDirListing.put(rec.name, rec);
        }
    }
    return deployDirListing;
}

From source file:com.github.mike10004.jenkinsbbhook.WebhookHandler.java

protected AppParams loadAppParams() {
    log.log(Level.FINER, "loading app params; defined: {0}",
            Iterators.toString(Iterators.forEnumeration(context.getInitParameterNames())));
    return new ContextAppParams(new ServletInitParamValueProvider(context));
}

From source file:org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginH2Dao.java

@Override
public void deleteJob(String jobFullName) {
    LOGGER.log(Level.FINER, "deleteJob({0})", new Object[] { jobFullName });
    try (Connection cnn = jdbcConnectionPool.getConnection()) {
        cnn.setAutoCommit(false);//from   w  w w.ja v a  2  s. c o  m
        try (PreparedStatement stmt = cnn.prepareStatement("DELETE FROM JENKINS_JOB WHERE FULL_NAME = ?")) {
            stmt.setString(1, jobFullName);
            int count = stmt.executeUpdate();
            LOGGER.log(Level.FINE, "deleteJob({0}): {1}", new Object[] { jobFullName, count });
        }
        cnn.commit();
    } catch (SQLException e) {
        throw new RuntimeSqlException(e);
    }
}

From source file:org.apache.cxf.sts.claims.LdapGroupClaimsHandler.java

public ProcessedClaimCollection retrieveClaimValues(ClaimCollection claims, ClaimsParameters parameters) {

    boolean found = false;
    for (Claim claim : claims) {
        if (claim.getClaimType().toString().equals(this.groupURI)) {
            found = true;//from w  ww .  j av a  2  s. co  m
            break;
        }
    }
    if (!found) {
        return new ProcessedClaimCollection();
    }

    String user = null;

    Principal principal = parameters.getPrincipal();
    if (principal instanceof KerberosPrincipal) {
        KerberosPrincipal kp = (KerberosPrincipal) principal;
        StringTokenizer st = new StringTokenizer(kp.getName(), "@");
        user = st.nextToken();
    } else if (principal instanceof X500Principal) {
        X500Principal x500p = (X500Principal) principal;
        LOG.warning("Unsupported principal type X500: " + x500p.getName());
    } else if (principal != null) {
        user = principal.getName();
        if (user == null) {
            LOG.warning("Principal name must not be null");
        }
    } else {
        LOG.warning("Principal is null");
    }
    if (user == null) {
        return new ProcessedClaimCollection();
    }

    if (!LdapUtils.isDN(user)) {
        Name dn = LdapUtils.getDnOfEntry(ldap, this.userBaseDn, this.getUserObjectClass(),
                this.getUserNameAttribute(), user);
        if (dn != null) {
            user = dn.toString();
            LOG.fine("DN for (" + this.getUserNameAttribute() + "=" + user + ") found: " + user);
        } else {
            LOG.warning("DN not found for user '" + user + "'");
            return new ProcessedClaimCollection();
        }
    }

    if (LOG.isLoggable(Level.FINER)) {
        LOG.finer("Retrieve groups for user " + user);
    }

    List<String> groups = null;
    groups = LdapUtils.getAttributeOfEntries(ldap, this.groupBaseDn, this.getGroupObjectClass(),
            this.groupMemberAttribute, user, "cn");

    if (groups == null || groups.size() == 0) {
        if (LOG.isLoggable(Level.INFO)) {
            LOG.info("No groups found for user '" + user + "'");
        }
        return new ProcessedClaimCollection();
    }

    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Groups for user '" + parameters.getPrincipal().getName() + "': " + groups);
    }

    String scope = null;
    if (getAppliesToScopeMapping() != null && getAppliesToScopeMapping().size() > 0
            && parameters.getAppliesToAddress() != null) {
        scope = getAppliesToScopeMapping().get(parameters.getAppliesToAddress());
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("AppliesTo matchs with scope: " + scope);
        }
    }

    String regex = this.groupNameGlobalFilter;
    regex = regex.replaceAll(ROLE, ".*");
    Pattern globalPattern = Pattern.compile(regex);

    //If AppliesTo value can be mapped to a Scope Name
    //ex. https://localhost/doubleit/services/doubleittransport  -> Demo
    Pattern scopePattern = null;
    if (scope != null) {
        regex = this.groupNameScopedFilter;
        regex = regex.replaceAll(SCOPE, scope).replaceAll(ROLE, ".*");
        scopePattern = Pattern.compile(regex);
    }

    List<String> filteredGroups = new ArrayList<String>();
    for (String group : groups) {
        if (scopePattern != null && scopePattern.matcher(group).matches()) {
            //Group matches the scoped filter
            //ex. (default groupNameScopeFilter)
            //  Demo_User -> Role=User
            //  Demo_Admin -> Role=Admin
            String filter = this.groupNameScopedFilter;
            String role = null;
            if (isUseFullGroupNameAsValue()) {
                role = group;
            } else {
                role = parseRole(group, filter.replaceAll(SCOPE, scope));
            }
            filteredGroups.add(role);
        } else {
            if (globalPattern.matcher(group).matches()) {
                //Group matches the global filter
                //ex. (default groupNameGlobalFilter)
                //  User -> Role=User
                //  Admin -> Role=Admin
                String role = null;
                if (isUseFullGroupNameAsValue()) {
                    role = group;
                } else {
                    role = parseRole(group, this.groupNameGlobalFilter);
                }
                filteredGroups.add(role);
            } else {
                LOG.finer("Group '" + group + "' doesn't match scoped and global group filter");
            }
        }
    }

    LOG.info("Filtered groups: " + filteredGroups);
    if (filteredGroups.size() == 0) {
        LOG.info("No matching groups found for user '" + principal + "'");
        return new ProcessedClaimCollection();
    }

    ProcessedClaimCollection claimsColl = new ProcessedClaimCollection();
    ProcessedClaim c = new ProcessedClaim();
    c.setClaimType(URI.create(this.groupURI));
    c.setPrincipal(principal);
    c.setValues(new ArrayList<Object>(filteredGroups));
    // c.setIssuer(issuer);
    // c.setOriginalIssuer(originalIssuer);
    // c.setNamespace(namespace);
    claimsColl.add(c);

    return claimsColl;
}

From source file:com.granule.json.utils.internal.JSONObject.java

/**
 * Internal method to write out a proper JSON attribute string.
 * @param writer The writer to use while serializing
 * @param name The attribute name to use.
 * @param value The value to assign to the attribute.
 * @param depth How far to indent the JSON text.
 * @param compact Flag to denote whether or not to use pretty indention, or compact format, when writing.
 * @throws IOException Trhown if an error occurs on write.
 *///w  w  w.j  av a2 s  .co  m
private void writeAttribute(Writer writer, String name, String value, int depth, boolean compact)
        throws IOException {
    if (logger.isLoggable(Level.FINER))
        logger.entering(className, "writeAttribute(Writer, String, String, int)");

    if (!compact) {
        writeIndention(writer, depth);
    }

    try {
        if (!compact) {
            writer.write("\"" + name + "\"" + " : " + "\"" + escapeStringSpecialCharacters(value) + "\"");
        } else {
            writer.write("\"" + name + "\"" + ":" + "\"" + escapeStringSpecialCharacters(value) + "\"");
        }
    } catch (Exception ex) {
        IOException iox = new IOException("Error occurred on serialization of JSON text.");
        iox.initCause(ex);
        throw iox;
    }

    if (logger.isLoggable(Level.FINER))
        logger.exiting(className, "writeAttribute(Writer, String, String, int)");
}

From source file:com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder.java

@Override
public boolean handles(String mid, IResource resource) {
    final String sourceMethod = "handles"; //$NON-NLS-1$
    final boolean isTraceLogging = log.isLoggable(Level.FINER);
    if (isTraceLogging) {
        log.entering(sourceClass, sourceMethod, new Object[] { mid, resource });
    }//from   ww  w  . j  av a 2s  . c  om
    boolean result = HANDLES_PATTERN.matcher(mid).find();
    if (isTraceLogging) {
        log.exiting(sourceMethod, sourceMethod, result);
    }
    return result;
}