Example usage for java.util.logging Level FINEST

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

Introduction

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

Prototype

Level FINEST

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

Click Source Link

Document

FINEST indicates a highly detailed tracing message.

Usage

From source file:com.clothcat.hpoolauto.model.Model.java

public void setTransactionDone(String txid) {
    HLogger.log(Level.FINEST, "in setTransactionDone()");
    transactions.getTxids().add(txid);// w  w  w  .j  a  v  a  2  s .  c  om
    transactions.saveTransactions();
    HLogger.log(Level.FINEST, "marked txid " + txid + " done");
}

From source file:com.cyberway.issue.crawler.extractor.ExtractorHTML.java

/**
 * Handle generic HREF cases./*from w  w  w  . j a  va  2  s  .c o  m*/
 * 
 * @param curi
 * @param value
 * @param context
 */
protected void processLink(CrawlURI curi, final CharSequence value, CharSequence context) {
    if (TextUtils.matches(JAVASCRIPT, value) || TextUtils.matches(JAVASCRIPT2, value)) {
        processScriptCode(curi, value.subSequence(11, value.length()));
    } else {
        if (logger.isLoggable(Level.FINEST)) {
            logger.finest("link: " + value.toString() + " from " + curi);
        }
        addLinkFromString(curi, (value instanceof String) ? (String) value : value.toString(), context,
                Link.NAVLINK_HOP);
        this.numberOfLinksExtracted++;
    }
}

From source file:ffx.potential.nonbonded.SpatialDensityRegion.java

/**
 * Assign asymmetric and symmetry mate atoms to cells. This is very fast;
 * there is little to be gained from parallelizing it at this point.
 *//*from  w  w w .  j  ava  2  s.  c  om*/
public void assignAtomsToCells() {
    // Call the selectAtoms method of subclasses.
    selectAtoms();

    for (int iSymm = 0; iSymm < nSymm; iSymm++) {
        final int cellIndexs[] = cellIndex[iSymm];
        final int cellCounts[] = cellCount[iSymm];
        final int cellStarts[] = cellStart[iSymm];
        final int cellLists[] = cellList[iSymm];
        final int cellOffsets[] = cellOffset[iSymm];
        final boolean selected[] = select[iSymm];

        // Zero out the cell counts.
        for (int i = 0; i < nCells; i++) {
            cellCounts[i] = 0;
        }

        // Convert to fractional coordinates.
        final double xyz[][] = coordinates[iSymm];
        final double x[] = xyz[0];
        final double y[] = xyz[1];
        final double z[] = xyz[2];
        crystal.toFractionalCoordinates(nAtoms, x, y, z, xf, yf, zf);

        // Assign each atom to a cell using fractional coordinates.
        for (int i = 0; i < nAtoms; i++) {
            if (!selected[i]) {
                continue;
            }

            double xu = xf[i];
            double yu = yf[i];
            double zu = zf[i];

            // Move the atom into the range 0.0 <= x < 1.0
            while (xu >= 1.0) {
                xu -= 1.0;
            }
            while (xu < 0.0) {
                xu += 1.0;
            }
            while (yu >= 1.0) {
                yu -= 1.0;
            }
            while (yu < 0.0) {
                yu += 1.0;
            }
            while (zu >= 1.0) {
                zu -= 1.0;
            }
            while (zu < 0.0) {
                zu += 1.0;
            }

            // The cell indices of this atom.
            int a = (int) floor(xu * nA);
            int b = (int) floor(yu * nB);
            int c = (int) floor(zu * nC);

            // Check to make sure a, b and c are less than nA, nB and nC, respectively.
            if (a >= nA) {
                a = nA - 1;
            }
            if (b >= nB) {
                b = nB - 1;
            }
            if (c >= nC) {
                c = nC - 1;
            }

            // The cell index of this atom.
            final int index = a + b * nA + c * nAB;
            cellIndexs[i] = index;

            // The offset of this atom from the beginning of the cell.
            cellOffsets[i] = cellCounts[index]++;
        }

        // Define the starting indices.
        cellStarts[0] = 0;
        for (int i = 1; i < nCells; i++) {
            final int i1 = i - 1;
            cellStarts[i] = cellStarts[i1] + cellCounts[i1];
        }

        // Move atom locations into a list ordered by cell.
        for (int i = 0; i < nAtoms; i++) {
            if (!selected[i]) {
                continue;
            }
            final int index = cellIndexs[i];
            cellLists[cellStarts[index]++] = i;
        }

        // Redefine the starting indices again.
        cellStarts[0] = 0;
        for (int i = 1; i < nCells; i++) {
            final int i1 = i - 1;
            cellStarts[i] = cellStarts[i1] + cellCounts[i1];
        }
    }

    // Loop over work chunks and get rid of empty chunks.
    actualWork = 0;
    int totalAtoms = 0;
    for (int icell = 0; icell < nWork; icell++) {
        int ia = workA[icell];
        int ib = workB[icell];
        int ic = workC[icell];
        int ii = count(ia, ib, ic);
        // Fractional chunks along the C-axis.
        if (nC > 1) {
            ii += count(ia, ib, ic + 1);
            // Fractional chunks along the B-axis.
            if (nB > 1) {
                ii += count(ia, ib + 1, ic);
                ii += count(ia, ib + 1, ic + 1);
                // Fractional chunks along the A-axis.
                if (nA > 1) {
                    ii += count(ia + 1, ib, ic);
                    ii += count(ia + 1, ib, ic + 1);
                    ii += count(ia + 1, ib + 1, ic);
                    ii += count(ia + 1, ib + 1, ic + 1);
                }
            }
        }

        // If there is work in this chunk, include it.
        if (ii > 0) {
            actualA[actualWork] = ia;
            actualB[actualWork] = ib;
            actualC[actualWork] = ic;
            actualCount[actualWork++] = ii;
            totalAtoms += ii;
        }
    }

    if (logger.isLoggable(Level.FINEST)) {
        logger.finest(String.format(" Empty chunks: %d out of %d.", nWork - actualWork, nWork));
    }
}

From source file:com.willwinder.universalgcodesender.model.GUIBackend.java

@Override
public File getGcodeFile() {
    logger.log(Level.FINEST, "Getting gcode file.");
    return this.gcodeFile;
}

From source file:hudson.plugins.jobConfigHistory.FileHistoryDao.java

@Override
public boolean isCreatedEntry(File historyDir) {
    final XmlFile historyXml = getHistoryXmlFile(historyDir);
    try {/*  ww  w.  ja  v  a 2 s  . c  o m*/
        final HistoryDescr histDescr = (HistoryDescr) historyXml.read();
        LOG.log(Level.FINEST, "historyDir: {0}", historyDir);
        LOG.log(Level.FINEST, "histDescr.getOperation(): {0}", histDescr.getOperation());
        if ("Created".equals(histDescr.getOperation())) {
            return true;
        }
    } catch (IOException ex) {
        LOG.log(Level.FINEST, "Unable to retrieve history file for {0}", historyDir);
    }
    return false;
}

From source file:com.sun.grizzly.http.jk.server.JkMain.java

private void processProperty(String name, String propValue) {
    String type = name;//  ww  w .  j av  a2s .  co m
    String fullName = name;
    String localName = "";
    String propName = "";
    // ignore
    if (name.startsWith("key.")) {
        return;
    }

    int dot = name.indexOf(".");
    int lastDot = name.lastIndexOf(".");
    if (dot > 0) {
        type = name.substring(0, dot);
        if (dot != lastDot) {
            localName = name.substring(dot + 1, lastDot);
            fullName = type + "." + localName;
        } else {
            fullName = type;
        }
        propName = name.substring(lastDot + 1);
    } else {
        return;
    }

    if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) {
        LoggerUtils.getLogger().log(Level.FINEST,
                "Processing " + type + ":" + localName + ":" + fullName + " " + propName);
    }
    if ("class".equals(type) || "handler".equals(type)) {
        return;
    }

    JkHandler comp = getWorkerEnv().getHandler(fullName);
    if (comp == null) {
        comp = newHandler(type, localName, fullName);
    }
    if (comp == null) {
        return;
    }

    if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) {
        LoggerUtils.getLogger().log(Level.FINEST, "Setting " + propName + " on " + fullName + " " + comp);
    }
    this.setBeanProperty(comp, propName, propValue);
}

From source file:de.fosd.jdime.artifact.Artifact.java

/**
 * Logs (if FINEST is enabled) what matchings exist for this {@link Artifact} in the given {@link Revision}.
 *
 * @param rev//  ww w .j a va  2s  . c  o  m
 *         the opposite {@link Revision}
 */
private void logMatchings(Revision rev) {
    if (LOG.isLoggable(Level.FINEST)) {
        LOG.finest("Checking for matchings for " + getId() + " in revision " + rev + ".");

        if (matches.isEmpty()) {
            LOG.finest("No matchings for " + getId() + " in revision " + rev + ".");
        } else {

            for (Entry<Revision, Matching<T>> entry : matches.entrySet()) {
                Revision otherRev = entry.getKey();
                T matchedArtifact = entry.getValue().getMatchingArtifact(this);
                LOG.finest("Matching found for revision " + otherRev + " is " + matchedArtifact.getId());
            }
        }
    }
}

From source file:com.cyberway.issue.crawler.extractor.ExtractorHTML.java

protected void processEmbed(CrawlURI curi, final CharSequence value, CharSequence context, char hopType) {
    if (logger.isLoggable(Level.FINEST)) {
        logger.finest("embed (" + hopType + "): " + value.toString() + " from " + curi);
    }//  w  w w .  j a v a2s . c o m
    addLinkFromString(curi, (value instanceof String) ? (String) value : value.toString(), context, hopType);
    this.numberOfLinksExtracted++;
}

From source file:hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.java

/**
 * Authenticates and retrieves the user by using the given list of available AD LDAP servers.
 * /*from w  w  w  . ja va2s  .  co m*/
 * @param password
 *      If this is {@link #NO_AUTHENTICATION}, the authentication is not performed, and just the retrieval
 *      would happen.
 * @throws UsernameNotFoundException
 *      The user didn't exist.
 * @return never null
 */
@SuppressFBWarnings(value = "ES_COMPARING_PARAMETER_STRING_WITH_EQ", justification = "Intentional instance check.")
public UserDetails retrieveUser(final String username, final String password,
        final ActiveDirectoryDomain domain, final List<SocketInfo> ldapServers) {
    UserDetails userDetails;
    String hashKey = username + "@@" + DigestUtils.sha1Hex(password);
    final String bindName = domain.getBindName();
    final String bindPassword = Secret.toString(domain.getBindPassword());
    try {
        final ActiveDirectoryUserDetail[] cacheMiss = new ActiveDirectoryUserDetail[1];
        userDetails = userCache.get(hashKey, new Callable<UserDetails>() {
            public UserDetails call() throws AuthenticationException {
                DirContext context;
                boolean anonymousBind = false; // did we bind anonymously?

                // LDAP treats empty password as anonymous bind, so we need to reject it
                if (StringUtils.isEmpty(password)) {
                    throw new BadCredentialsException("Empty password");
                }

                String userPrincipalName = getPrincipalName(username, domain.getName());
                String samAccountName = userPrincipalName.substring(0, userPrincipalName.indexOf('@'));

                if (bindName != null) {
                    // two step approach. Use a special credential to obtain DN for the
                    // user trying to login, then authenticate.
                    try {
                        context = descriptor.bind(bindName, bindPassword, ldapServers, props);
                        anonymousBind = false;
                    } catch (BadCredentialsException e) {
                        throw new AuthenticationServiceException(
                                "Failed to bind to LDAP server with the bind name/password", e);
                    }
                } else {
                    if (password.equals(NO_AUTHENTICATION)) {
                        anonymousBind = true;
                    }

                    try {
                        // if we are just retrieving the user, try using anonymous bind by empty password (see RFC 2829 5.1)
                        // but if that fails, that's not BadCredentialException but UserMayOrMayNotExistException
                        context = descriptor.bind(userPrincipalName, anonymousBind ? "" : password, ldapServers,
                                props);
                    } catch (BadCredentialsException e) {
                        if (anonymousBind)
                            // in my observation, if we attempt an anonymous bind and AD doesn't allow it, it still passes the bind method
                            // and only fail later when we actually do a query. So perhaps this is a dead path, but I'm leaving it here
                            // anyway as a precaution.
                            throw new UserMayOrMayNotExistException(
                                    "Unable to retrieve the user information without bind DN/password configured");
                        throw e;
                    }
                }

                try {
                    // locate this user's record
                    final String domainDN = toDC(domain.getName());

                    Attributes user = new LDAPSearchBuilder(context, domainDN).subTreeScope()
                            .searchOne("(& (userPrincipalName={0})(objectCategory=user))", userPrincipalName);
                    if (user == null) {
                        // failed to find it. Fall back to sAMAccountName.
                        // see http://www.nabble.com/Re%3A-Hudson-AD-plug-in-td21428668.html
                        LOGGER.log(Level.FINE, "Failed to find {0} in userPrincipalName. Trying sAMAccountName",
                                userPrincipalName);
                        user = new LDAPSearchBuilder(context, domainDN).subTreeScope()
                                .searchOne("(& (sAMAccountName={0})(objectCategory=user))", samAccountName);
                        if (user == null) {
                            throw new UsernameNotFoundException(
                                    "Authentication was successful but cannot locate the user information for "
                                            + username);
                        }
                    }
                    LOGGER.fine("Found user " + username + " : " + user);

                    Object dnObject = user.get(DN_FORMATTED).get();
                    if (dnObject == null) {
                        throw new AuthenticationServiceException("No distinguished name for " + username);
                    }

                    String dn = dnObject.toString();
                    LdapName ldapName = new LdapName(dn);
                    String dnFormatted = ldapName.toString();

                    if (bindName != null && !password.equals(NO_AUTHENTICATION)) {
                        // if we've used the credential specifically for the bind, we
                        // need to verify the provided password to do authentication
                        LOGGER.log(Level.FINE, "Attempting to validate password for DN={0}", dn);
                        DirContext test = descriptor.bind(dnFormatted, password, ldapServers, props);
                        // Binding alone is not enough to test the credential. Need to actually perform some query operation.
                        // but if the authentication fails this throws an exception
                        try {
                            new LDAPSearchBuilder(test, domainDN).searchOne(
                                    "(& (userPrincipalName={0})(objectCategory=user))", userPrincipalName);
                        } finally {
                            closeQuietly(test);
                        }
                    }

                    Set<GrantedAuthority> groups = resolveGroups(domainDN, dnFormatted, context);
                    groups.add(SecurityRealm.AUTHENTICATED_AUTHORITY);

                    cacheMiss[0] = new ActiveDirectoryUserDetail(username, password, true, true, true, true,
                            groups.toArray(new GrantedAuthority[groups.size()]),
                            getStringAttribute(user, "displayName"), getStringAttribute(user, "mail"),
                            getStringAttribute(user, "telephoneNumber"));
                    return cacheMiss[0];
                } catch (NamingException e) {
                    if (anonymousBind && e.getMessage().contains("successful bind must be completed")
                            && e.getMessage().contains("000004DC")) {
                        // sometimes (or always?) anonymous bind itself will succeed but the actual query will fail.
                        // see JENKINS-12619. On my AD the error code is DSID-0C0906DC
                        throw new UserMayOrMayNotExistException(
                                "Unable to retrieve the user information without bind DN/password configured");
                    }

                    LOGGER.log(Level.WARNING,
                            String.format("Failed to retrieve user information for %s", username), e);
                    throw new BadCredentialsException("Failed to retrieve user information for " + username, e);
                } finally {
                    closeQuietly(context);
                }
            }
        });
        if (cacheMiss[0] != null) {
            threadPoolExecutor.execute(new Runnable() {
                @Override
                public void run() {
                    final String threadName = Thread.currentThread().getName();
                    Thread.currentThread()
                            .setName(threadName + " updating-cache-for-user-" + cacheMiss[0].getUsername());
                    LOGGER.log(Level.FINEST, "Starting the cache update {0}", new Date());
                    try {
                        long t0 = System.currentTimeMillis();
                        cacheMiss[0].updateUserInfo();
                        LOGGER.log(Level.FINEST, "Finished the cache update {0}", new Date());
                        long t1 = System.currentTimeMillis();
                        LOGGER.log(Level.FINE, "The cache for user {0} took {1} msec",
                                new Object[] { cacheMiss[0].getUsername(), String.valueOf(t1 - t0) });
                    } finally {
                        Thread.currentThread().setName(threadName);
                    }
                }
            });

        }
    } catch (UncheckedExecutionException e) {
        Throwable t = e.getCause();
        if (t instanceof AuthenticationException) {
            AuthenticationException authenticationException = (AuthenticationException) t;
            throw authenticationException;
        } else {
            throw new CacheAuthenticationException(
                    "Authentication failed because there was a problem caching user " + username, e);
        }
    } catch (ExecutionException e) {
        LOGGER.log(Level.SEVERE, "There was a problem caching user " + username, e);
        throw new CacheAuthenticationException(
                "Authentication failed because there was a problem caching user " + username, e);
    }
    // We need to check the password when the user is cached so it doesn't get automatically authenticated
    // without verifying the credentials
    if (password != null && !password.equals(NO_AUTHENTICATION) && userDetails != null
            && !password.equals(userDetails.getPassword())) {
        throw new BadCredentialsException("Failed to retrieve user information from the cache for " + username);
    }
    return userDetails;
}

From source file:com.willwinder.universalgcodesender.model.GUIBackend.java

@Override
public long getNumRows() {
    logger.log(Level.FINEST, "Getting number of rows.");
    return this.controller.rowsInSend();
}