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:Peer.java

/**
* Used with trying to get a remote object to a peer.
* It will check a local cache for a the object and if it does exist
* it will ask the super peer for the location of the peer and store it.
* @return PeerInterface or null if some error occurs.
*//*from  w w w  .j av  a  2 s .  c o  m*/
private PeerInterface getPeer(Key node) throws Exception {
    lg.log(Level.FINEST, "getPeer Entry");
    PeerInterface peer = peercache.get(node);
    try {
        if (peer == null) {
            lg.log(Level.FINER, "Peer " + node + " not found in cache asking superpeer.");
            String addy = superpeer.getAddress(node);
            lg.log(Level.FINER, "//" + addy + "/" + node.toString());
            if (addy != null) {
                peer = (PeerInterface) Naming.lookup("//" + addy + "/" + node.toString());

                peercache.put(node, peer);
            }

        } else
            lg.log(Level.FINER, "Peer " + node + " found in cache.");

    } catch (Exception e) {
        e.printStackTrace();
    }
    if (peer == null)
        lg.log(Level.WARNING, "getPeer attempt on " + node + " unsuccessful.");

    lg.log(Level.FINEST, "getPeer Exit");
    return peer;
}

From source file:be.fedict.eidviewer.lib.file.imports.EidQuickKeyXMLFile.java

@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
    logger.log(Level.FINEST, "</{0}>", localName);

    if (localName.equalsIgnoreCase("fileData")) {
        byte[] data = Base64.decodeBase64(getCDATA().trim().getBytes());
        logger.finest("Base64 Data Decoded");

        switch (stage) {
        case IDFILE: {
            logger.fine("Setting Identity");
            Identity identity = TlvParser.parse(data, Identity.class);
            TextFormatHelper.setFirstNamesFromStrings(identity, identity.getFirstName(),
                    identity.getMiddleName());
            eidData.setIdentity(identity);
        }//w ww .  jav  a2  s  . c o m
            break;

        case ADDRFILE:
            logger.fine("Setting Address");
            eidData.setAddress(TlvParser.parse(data, Address.class));
            break;

        case PHOTOFILE:
            logger.fine("Setting Photo");
            eidData.setPhoto(data);
            break;

        case AUTHCERT:
            logger.finer("Gathering Authentication Certificate");
            authenticationCert = certificateFromBase64Data(data, "Authentication");
            break;

        case SIGNCERT:
            logger.finer("Gathering Signing Certificate");
            signingCert = certificateFromBase64Data(data, "Signature");
            break;

        case CACERT:
            logger.finer("Gathering Citizen CA Certificate");
            citizenCert = certificateFromBase64Data(data, "CA");
            break;

        case ROOTCERT:
            logger.finer("Gathering Root Certificate");
            rootCert = certificateFromBase64Data(data, "Root");
            break;

        case RRNCERT:
            logger.finer("Gathering RRN Certificate");
            rrnCert = certificateFromBase64Data(data, "RRN");
            break;

        }
    } else {
        stage = STAGE.NONE;
    }

    resetCDATA();
}

From source file:io.stallion.services.Log.java

public static void finest(String message, Object... args) {
    if (getLogLevel().intValue() > Level.FINEST.intValue()) {
        return;/* w w  w.ja  v  a 2  s . c om*/
    }
    //System.out.println(message);
    Throwable t = new Throwable();
    t.getStackTrace()[2].toString();
    String clz = t.getStackTrace()[2].getClassName().replace("io.stallion.", "");
    String method = t.getStackTrace()[2].getMethodName();
    logger.logp(Level.FINEST, clz, method, message, args);

}

From source file:fr.cnes.sitools.security.filter.SecurityFilter.java

/**
 * Method executed before the request is handled. It checks if the address of the request is compatible with the
 * intranet parameters//from w  ww  .  java2s. com
 * 
 * @param request
 *          the request
 * @param response
 *          the response
 * @return CONTINUE if the address is from the intranet, STOP otherwise
 */
@Override
protected int beforeHandle(Request request, Response response) {
    int status = STOP;
    String ip = getIpAddress(request);
    if (isIntranet(request)) {
        status = CONTINUE;
        request.getAttributes().put("Sitools.intranet", true);
        // FIXME It is used to create url for notifications
        // remove it when all notifications urls are in RIAP
        request.getAttributes().put(ContextAttributes.PUBLIC_HOST_NAME, settings.getPublicHostDomain());
    } else {
        request.getAttributes().put("Sitools.intranet", false);
        request.getAttributes().put(ContextAttributes.PUBLIC_HOST_NAME, settings.getPublicHostDomain());
    }

    if (doFilter && status == STOP) {
        response.setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Your IP address was blocked");
        log(request, response, ip);
    } else {
        status = CONTINUE;
        getLogger().log(Level.FINEST, "Request from " + ip + " OK = " + status);
    }

    return status;
}

From source file:com.cloudant.http.internal.interceptors.CookieInterceptor.java

@Override
public HttpConnectionInterceptorContext interceptRequest(HttpConnectionInterceptorContext context) {

    HttpURLConnection connection = context.connection.getConnection();

    // First time we will have no cookies
    if (cookieManager.getCookieStore().getCookies().isEmpty() && shouldAttemptCookieRequest.get()) {
        if (!requestCookie(context)) {
            // Requesting a cookie failed, set a flag if we failed so we won't try again
            shouldAttemptCookieRequest.set(false);
        }//from   w w  w .  j  a v  a  2s .  c  o m
    }

    if (shouldAttemptCookieRequest.get()) {

        // Debug logging
        if (logger.isLoggable(Level.FINEST)) {
            logger.finest("Attempt to add cookie to request.");
            logger.finest("Cookies are stored for URIs: " + cookieManager.getCookieStore().getURIs());
        }

        // Apply any saved cookies to the request
        try {
            Map<String, List<String>> requestCookieHeaders = cookieManager.get(connection.getURL().toURI(),
                    connection.getRequestProperties());
            for (Map.Entry<String, List<String>> requestCookieHeader : requestCookieHeaders.entrySet()) {
                List<String> cookies = requestCookieHeader.getValue();
                if (cookies != null && !cookies.isEmpty()) {
                    connection.setRequestProperty(requestCookieHeader.getKey(),
                            listToSemicolonSeparatedString(cookies));
                } else {
                    logger.finest("No cookie values to set.");
                }
            }
        } catch (IOException e) {
            logger.log(Level.SEVERE, "Failed to read request properties", e);
        } catch (URISyntaxException e) {
            logger.log(Level.SEVERE, "Failed to convert request URL to URI for cookie " + "retrieval.");
        }
    }
    return context;
}

From source file:org.hawkular.apm.server.jms.AbstractPublisherJMS.java

/**
 * This method publishes the supplied items.
 *
 * @param tenantId The tenant id// ww w  .  java 2s .  c o m
 * @param items The items
 * @param subscriber The optional subscriber name
 * @param retryCount The retry count
 * @param delay The delay
 * @throws Exception Failed to publish
 */
protected void doPublish(String tenantId, List<T> items, String subscriber, int retryCount, long delay)
        throws Exception {
    String data = mapper.writeValueAsString(items);

    TextMessage tm = session.createTextMessage(data);

    if (tenantId != null) {
        tm.setStringProperty("tenant", tenantId);
    }

    if (subscriber != null) {
        tm.setStringProperty("subscriber", subscriber);
    }

    tm.setIntProperty("retryCount", retryCount);

    if (delay > 0) {
        tm.setLongProperty("_AMQ_SCHED_DELIVERY", System.currentTimeMillis() + delay);
    }

    if (log.isLoggable(Level.FINEST)) {
        log.finest("Publish: " + tm);
    }

    producer.send(tm);
}

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

/** Pass config info
 *///from w w w. j  a  va 2 s .  c o m
public void setAttribute(String name, Object value) {
    if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) {
        LoggerUtils.getLogger().log(Level.FINEST, "setAttribute " + name + " " + value);
    }
    if (value instanceof String) {
        this.setProperty(name, (String) value);
    }
}

From source file:com.microsoft.azure.util.TokenCache.java

public final void clear() {
    LOGGER.log(Level.FINEST, "TokenCache: clear: Remove cache file {0}", path);
    FileUtils.deleteQuietly(new File(path));
}

From source file:com.sun.grizzly.http.jk.common.ChannelUn.java

public void init() throws IOException {
    if (file == null) {
        LoggerUtils.getLogger().log(Level.FINEST, "No file, disabling unix channel");
        return;//w w  w  . j a  v a 2s .c  o m
        //throw new IOException( "No file for the unix socket channel");
    }
    if (wEnv != null && wEnv.getLocalId() != 0) {
        localId = wEnv.getLocalId();
    }

    if (localId != 0) {
        file = file + localId;
    }
    File socketFile = new File(file);
    if (!socketFile.isAbsolute()) {
        String home = wEnv.getJkHome();
        if (home == null) {
            LoggerUtils.getLogger().log(Level.FINEST, "No jkhome");
        } else {
            File homef = new File(home);
            socketFile = new File(homef, file);
            LoggerUtils.getLogger().log(Level.FINEST, "Making the file absolute " + socketFile);
        }
    }

    if (!socketFile.exists()) {
        try {
            FileOutputStream fos = new FileOutputStream(socketFile);
            fos.write(1);
            fos.close();
        } catch (Throwable t) {
            LoggerUtils.getLogger().log(Level.SEVERE,
                    "Attempting to create the file failed, disabling channel" + socketFile);
            return;
        }
    }
    // The socket file cannot be removed ...
    if (!socketFile.delete()) {
        LoggerUtils.getLogger().log(Level.SEVERE, "Can't remove socket file " + socketFile);
        return;
    }

    super.initNative("channel.un:" + file);

    if (apr == null || !apr.isLoaded()) {
        LoggerUtils.getLogger().log(Level.FINEST, "Apr is not available, disabling unix channel ");
        apr = null;
        return;
    }

    // Set properties and call init.
    setNativeAttribute("file", file);
    // unixListenSocket=apr.unSocketListen( file, 10 );

    setNativeAttribute("listen", "10");
    // setNativeAttribute( "debug", "10" );

    // Initialize the thread pool and execution chain
    if (next == null && wEnv != null) {
        if (nextName != null) {
            setNext(wEnv.getHandler(nextName));
        }
        if (next == null) {
            next = wEnv.getHandler("dispatch");
        }
        if (next == null) {
            next = wEnv.getHandler("request");
        }
    }

    super.initJkComponent();
    JMXRequestNote = wEnv.getNoteId(WorkerEnv.ENDPOINT_NOTE, "requestNote");
    // Run a thread that will accept connections.
    if (this.domain != null) {
        try {
            tpOName = new ObjectName(domain + ":type=ThreadPool,name=" + getChannelName());

            Registry.getRegistry(null, null).registerComponent(tp, tpOName, null);

            rgOName = new ObjectName(domain + ":type=GlobalRequestProcessor,name=" + getChannelName());
            Registry.getRegistry(null, null).registerComponent(global, rgOName, null);
        } catch (Exception e) {
            LoggerUtils.getLogger().log(Level.SEVERE, "Can't register threadpool");
        }
    }
    tp.start();
    AprAcceptor acceptAjp = new AprAcceptor(this);
    tp.runIt(acceptAjp);
    LoggerUtils.getLogger().info("JK: listening on unix socket: " + file);

}

From source file:de.hofuniversity.iisys.neo4j.websock.query.encoding.safe.TSafeDeflateJsonQueryHandler.java

@Override
public ByteBuffer encode(final WebsockQuery query) throws EncodeException {
    ByteBuffer result = null;//w ww .j  a  va  2  s.c  o  m

    try {
        final JSONObject obj = JsonConverter.toJson(query);
        byte[] data = obj.toString().getBytes();

        //compress
        final Deflater deflater = new Deflater(fCompression, true);
        deflater.setInput(data);

        int read = 0;
        int totalSize = 0;
        final List<byte[]> buffers = new LinkedList<byte[]>();

        final byte[] buffer = new byte[BUFFER_SIZE];
        read = deflater.deflate(buffer, 0, BUFFER_SIZE, Deflater.SYNC_FLUSH);
        while (read > 0) {
            totalSize += read;
            buffers.add(Arrays.copyOf(buffer, read));
            read = deflater.deflate(buffer, 0, BUFFER_SIZE, Deflater.SYNC_FLUSH);
        }

        result = fuse(buffers, totalSize);

        if (fDebug) {
            fTotalBytesOut += totalSize;
            fLogger.log(Level.FINEST, "encoded compressed JSON message: " + totalSize + " bytes\n"
                    + "total bytes sent: " + fTotalBytesOut);
        }
    } catch (JSONException e) {
        e.printStackTrace();
        throw new EncodeException(query, "failed to encode JSON", e);
    }

    return result;
}