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:hudson.plugins.copyartifact.ParameterizedBuildSelector.java

/**
 * Expand the parameter and resolve it to a xstream expression.
 * <ol>/*  w w  w  .jav  a 2s.c  o  m*/
 *   <li>Considers an immediate value if contains '&lt;'.
 *       This is expected to be used in especially in workflow jobs.</li>
 *   <li>Otherwise, considers a variable expression if contains '$'.
 *       This is to keep the compatibility of usage between workflow jobs and non-workflow jobs.</li>
 *   <li>Otherwise, considers a variable name.</li>
 * </ol>
 * 
 * @param env
 * @return xstream expression.
 */
private String resolveParameter(EnvVars env) {
    if (StringUtils.isBlank(getParameterName())) {
        LOG.log(Level.WARNING, "Parameter name is not specified");
        return null;
    }
    if (getParameterName().contains("<")) {
        LOG.log(Level.FINEST, "{0} is considered a xstream expression", getParameterName());
        return getParameterName();
    }
    if (getParameterName().contains("$")) {
        LOG.log(Level.FINEST, "{0} is considered a variable expression", getParameterName());
        return env.expand(getParameterName());
    }
    String xml = env.get(getParameterName());
    if (xml == null) {
        LOG.log(Level.WARNING, "{0} is not defined", getParameterName());
    }
    return xml;
}

From source file:ca.inverse.sogo.security.SOGoOfficer.java

/**
 * /*from  w ww  . ja  va2  s . co  m*/
 */
public SOGoUser authenticateUser(Cred credential) {

    if (_log.isLoggable(Level.FINEST)) {
        _log.finest(" ExchangeOfficer authenticate() Start");
    }

    Configuration config = Configuration.getConfiguration();
    _ps = config.getStore();
    _userManager = config.getUserManager();
    String type = credential.getType();

    if ((Cred.AUTH_TYPE_BASIC).equals(type)) {
        return authenticateBasicCredential(credential);
    }
    return null;
}

From source file:com.gorsini.searcher.CanalplaySearcher.java

private String makeURL(String titleToSearch) {
    try {//from   w ww  .j  a  v  a  2 s.  co m
        String searchTitre = URLEncoder.encode(titleToSearch, "UTF-8").replaceAll("\\+", "%20");
        LOG.log(Level.FINEST, "titre recherch : {0}", searchTitre);
        String result = CANALPLAY_URL + "search=" + searchTitre;
        return result;
    } catch (UnsupportedEncodingException ex) {
        LOG.log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:org.apache.reef.io.network.NetworkServiceTest.java

/**
 * NetworkService messaging test.//from   w w w. java 2 s  .  co  m
 */
@Test
public void testMessagingNetworkService() throws Exception {
    LOG.log(Level.FINEST, name.getMethodName());

    final IdentifierFactory factory = new StringIdentifierFactory();

    final Injector injector = Tang.Factory.getTang().newInjector();
    injector.bindVolatileParameter(NameServerParameters.NameServerIdentifierFactory.class, factory);
    injector.bindVolatileInstance(LocalAddressProvider.class, this.localAddressProvider);

    try (final NameServer server = injector.getInstance(NameServer.class)) {
        final int nameServerPort = server.getPort();

        final int numMessages = 10;
        final Monitor monitor = new Monitor();

        // network service
        final String name2 = "task2";
        final String name1 = "task1";
        final Configuration nameResolverConf = Tang.Factory.getTang()
                .newConfigurationBuilder(NameResolverConfiguration.CONF
                        .set(NameResolverConfiguration.NAME_SERVER_HOSTNAME, this.localAddress)
                        .set(NameResolverConfiguration.NAME_SERVICE_PORT, nameServerPort).build())
                .build();

        final Injector injector2 = Tang.Factory.getTang().newInjector(nameResolverConf);

        LOG.log(Level.FINEST, "=== Test network service receiver start");
        LOG.log(Level.FINEST, "=== Test network service sender start");
        try (final NameResolver nameResolver = injector2.getInstance(NameResolver.class)) {
            injector2.bindVolatileParameter(NetworkServiceParameters.NetworkServiceIdentifierFactory.class,
                    factory);
            injector2.bindVolatileInstance(NameResolver.class, nameResolver);
            injector2.bindVolatileParameter(NetworkServiceParameters.NetworkServiceCodec.class,
                    new StringCodec());
            injector2.bindVolatileParameter(NetworkServiceParameters.NetworkServiceTransportFactory.class,
                    injector.getInstance(MessagingTransportFactory.class));
            injector2.bindVolatileParameter(NetworkServiceParameters.NetworkServiceExceptionHandler.class,
                    new ExceptionHandler());

            final Injector injectorNs2 = injector2.forkInjector();
            injectorNs2.bindVolatileParameter(NetworkServiceParameters.NetworkServiceHandler.class,
                    new MessageHandler<String>(name2, monitor, numMessages));
            final NetworkService<String> ns2 = injectorNs2.getInstance(NetworkService.class);

            final Injector injectorNs1 = injector2.forkInjector();
            injectorNs1.bindVolatileParameter(NetworkServiceParameters.NetworkServiceHandler.class,
                    new MessageHandler<String>(name1, null, 0));
            final NetworkService<String> ns1 = injectorNs1.getInstance(NetworkService.class);

            ns2.registerId(factory.getNewInstance(name2));
            final int port2 = ns2.getTransport().getListeningPort();
            server.register(factory.getNewInstance("task2"), new InetSocketAddress(this.localAddress, port2));

            ns1.registerId(factory.getNewInstance(name1));
            final int port1 = ns1.getTransport().getListeningPort();
            server.register(factory.getNewInstance("task1"), new InetSocketAddress(this.localAddress, port1));

            final Identifier destId = factory.getNewInstance(name2);

            try (final Connection<String> conn = ns1.newConnection(destId)) {
                conn.open();
                for (int count = 0; count < numMessages; ++count) {
                    conn.write("hello! " + count);
                }
                monitor.mwait();

            } catch (final NetworkException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
    }
}

From source file:nl.talsmasoftware.enumerables.support.json.jackson2.Compatibility.java

/**
 * Attempts to call <code>DeserializationContext.getContextualType()</code>.
 * However, this method was only added in Jackson version 2.5,
 * so it may not be possible to call it before then.
 * Therefore we anticipate this method not being available.
 *
 * @param ctxt The deserialization context to call <code>getContextualType()</code> on.
 * @return The result of the call, or <code>null</code> if the method was not yet defined.
 *///  ww w.ja va 2  s. c  om
static JavaType getContextualType(DeserializationContext ctxt) {
    if (ctxt != null)
        try {
            return call(ctxt, "getContextualType");
        } catch (NoSuchMethodException nsme) {
            LOGGER.log(Level.FINEST, "No getContextualType() method; is Jackson version less than 2.5 ?", nsme);
        }
    return null;
}

From source file:com.elasticgrid.examples.video.MencoderEncoder.java

public File convertVideo(File original, String destName, String format, int width, int height, Integer start,
        Integer end, int vbr, int abr, int fps) throws VideoConversionException, InterruptedException {
    File videoConverted = new File(original.getParent(), destName);

    logger.log(Level.FINE, "Converting video {0} into {1} as {2} format...",
            new Object[] { original, videoConverted, format });

    String command = String.format("%s %s -ofps %d -of lavf"
            + " -ovc lavc -lavcopts vcodec=%s:vbitrate=%d:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=%d:%d"
            + " -oac mp3lame -lameopts cbr:br=%d -srate 22050 -o %s", encoderLocation,
            original.getAbsolutePath(), fps, format, vbr, width, height, abr, videoConverted.getAbsolutePath());
    if (start != null && end != null)
        command = String.format("%s -ss %d -endpos %d", command, start, end);

    logger.info("Command is: " + command);

    // run the external conversion program
    File log = new File(videoConverted.getParent(), videoConverted.getName().replace(format, "log"));
    logger.info("Writing output into " + log.getAbsolutePath());
    FileWriter fileWriter = null;
    try {/*from ww  w .j  a v a 2s  .c o  m*/
        fileWriter = enableLog ? new FileWriter(log) : null;
        logger.log(Level.FINEST, "Created log file in {0}", log);
    } catch (IOException e) {
        logger.log(Level.WARNING, "Can't open log file. Skipping...", e);
        fileWriter = null;
    }
    try {
        logger.finest(command);
        final Writer logWriter = enableLog ? new BufferedWriter(fileWriter) : null;
        final Process process = Runtime.getRuntime().exec(command);
        new Thread(new Runnable() {
            public void run() {
                try {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                    String line;
                    try {
                        while ((line = reader.readLine()) != null) {
                            if (enableLog)
                                IOUtils.write(line, logWriter);
                        }
                    } finally {
                        reader.close();
                    }
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                }
            }
        }).start();
        new Thread(new Runnable() {
            public void run() {
                try {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
                    String line;
                    try {
                        while ((line = reader.readLine()) != null) {
                            if (enableLog)
                                IOUtils.write(line, logWriter);
                        }
                    } finally {
                        reader.close();
                    }
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                }
            }
        }).start();
        process.waitFor();
        return videoConverted;
    } catch (IOException e) {
        throw new VideoConversionException("Can't run video conversion software", e);
    } finally {
        if (enableLog)
            IOUtils.closeQuietly(fileWriter);
    }
}

From source file:com.gorsini.searcher.SearcherT411.java

private String makeURL(String titleToSearch) {
    try {/*from  ww w . j av  a 2s. com*/
        String searchTitre = URLEncoder.encode(titleToSearch, "UTF-8");
        LOG.log(Level.FINEST, "titre recherch : {0}", searchTitre);
        String result = CANALPLAY_URL.replaceAll("TOTO", searchTitre);
        return result;
    } catch (UnsupportedEncodingException ex) {
        LOG.log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:fedroot.dacs.swingdemo.DacsSwingDemo.java

/**
 * /* w  w w . ja  v  a 2 s. c om*/
 * @param title the title of the top level window
 * @param sessionManager a DACS aware session manager for login, logout, making HTTP requests, saving session state
 * @throws java.lang.Exception 
 */
public DacsSwingDemo(String title, final SessionManager sessionManager) {

    logger.log(Level.FINEST, "Launching MainFrame ");

    mainFrame = new JFrame(title);
    Dimension minSize = new Dimension(600, 400);
    mainFrame.setMinimumSize(minSize);
    mainFrame.setLocationRelativeTo(null);
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    this.sessionManager = sessionManager;

    loginDialog = new DacsLoginDialog(mainFrame, "Login", sessionManager);

    DacsEventNotifier.Listener dacsEventListener = new DacsEventNotifier.Listener() {

        @Override
        public void status(Status status) {
            // TODO replace this with updates to the status line text at the bottom of the frame
            switch (status) {
            case signon:
                btnLOGIN.setEnabled(false);
                btnLOGOUT.setEnabled(true);
                break;
            case signout:
                btnLOGIN.setEnabled(true);
                btnLOGOUT.setEnabled(false);
                break;
            }
        }

        @Override
        public void notify(DacsException ex, DacsCheckRequest checkRequest) {
            switch (ex.getStatusCode()) {
            case 900:
                JOptionPane.showMessageDialog(mainFrame, ex.getMessage(), "900 Error",
                        JOptionPane.WARNING_MESSAGE);
                break;
            case 901:
                JOptionPane.showMessageDialog(mainFrame, ex.getMessage(), "901 Error",
                        JOptionPane.WARNING_MESSAGE);
                break;
            case 902:
                //                        JOptionPane.showMessageDialog(mainFrame, ex.getMessage(), "902 Error", JOptionPane.WARNING_MESSAGE );
                if (loginDialog.showDialog()) {
                    // login successful - try the request again
                    loadPage("text/html", testURLs[actionsComboBox.getSelectedIndex()]);
                }
                break;
            case 903:
                JOptionPane.showMessageDialog(mainFrame, ex.getMessage(), "903 Error",
                        JOptionPane.WARNING_MESSAGE);
                break;
            case 904:
                JOptionPane.showMessageDialog(mainFrame, ex.getMessage(), "904 Error",
                        JOptionPane.WARNING_MESSAGE);
                break;
            }

        }
    };

    sessionManager.addDacsEventListener(dacsEventListener);

    init(mainFrame);

}

From source file:SuperPeer.java

@Override
public synchronized Key getPredecessor(Key nodeid) throws Exception {
    lg.log(Level.FINEST, "getPredecessor Entry.");
    Iterator<PeerInfo> it = peertable.iterator();
    Iterator<PeerInfo> it2 = peertable.iterator();
    PeerInfo fe = null;/*from w  ww  . ja  v a2s  . c  om*/
    PeerInfo pfe = it2.next();

    while (it.hasNext()) {
        fe = it.next();
        if (fe.getNodeId().compare(nodeid) >= 0)
            break;
        pfe = fe;
        fe = null;
    }
    Key rv = pfe.getNodeId();
    lg.log(Level.FINEST, "getPredecessor Exit.");
    if (pfe.getNodeId().equals(nodeid))
        return peertable.last().getNodeId();
    else
        return rv;
}

From source file:edu.usu.sdl.openstorefront.web.action.resolution.RangeResolution.java

@Override
protected void stream(HttpServletResponse response) throws Exception {
    int bufferLength;
    if (in != null && totalLength >= 0) {
        byte[] buffer = new byte[512];
        long count = 0;

        try {/*from   w  w w . ja  va  2s .  c o  m*/
            ServletOutputStream out = response.getOutputStream();

            List<Range<Long>> byteRanges = parseRangeHeader(request.getHeader("Range"));
            if (byteRanges == null) {
                while ((bufferLength = in.read(buffer)) != -1) {
                    out.write(buffer, 0, bufferLength);
                }
            } else {
                for (Range<Long> byteRange : byteRanges) {
                    // See RFC 2616 section 14.16
                    if (byteRanges.size() > 1) {
                        out.print("--" + MULTIPART_BOUNDARY + "\r\n");
                        out.print("Content-Type: " + contentType + "\r\n");
                        out.print("Content-Range: bytes " + byteRange.getStart() + "-" + byteRange.getEnd()
                                + "/" + totalLength + "\r\n");
                        out.print("\r\n");
                    }
                    if (count < byteRange.getStart()) {
                        long skip;

                        skip = byteRange.getStart() - count;
                        long actualbytesSkiped = in.skip(skip);
                        log.log(Level.FINEST, MessageFormat.format("Actual Bytes Skipped from range: {0}",
                                actualbytesSkiped));
                        count += skip;
                    }
                    while ((bufferLength = in.read(buffer, 0,
                            (int) Math.min(buffer.length, byteRange.getEnd() + 1 - count))) != -1) {
                        try {
                            out.write(buffer, 0, bufferLength);
                        } catch (IOException io) {
                            //Client Abort
                            break;
                        }
                        count += bufferLength;
                        if (byteRange.getEnd() + 1 == count) {
                            break;
                        }
                    }
                    if (byteRanges.size() > 1) {
                        out.print("\r\n");
                    }
                }
                if (byteRanges.size() > 1) {
                    out.print("--" + MULTIPART_BOUNDARY + "--\r\n");
                }
            }
        } catch (IOException io) {
            //Ignore Client Abort
            log.log(Level.FINEST, "Range Resolution Error ", io);
        } finally {
            try {
                in.close();
            } catch (Exception e) {
                log.log(Level.WARNING, "Error closing input stream", e);
            }
        }
    }

}