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:jenkins.plugins.openstack.compute.SlaveOptionsDescriptor.java

@Restricted(DoNotUse.class)
@InjectOsAuth/*w  w  w. j  a v a 2  s .  c om*/
public ListBoxModel doFillFloatingIpPoolItems(@QueryParameter String floatingIpPool,
        @QueryParameter String endPointUrl, @QueryParameter String identity, @QueryParameter String credential,
        @QueryParameter String zone) {
    ListBoxModel m = new ListBoxModel();
    m.add("None specified", "");

    try {
        final Openstack openstack = Openstack.Factory.get(endPointUrl, identity, credential, zone);
        for (String p : openstack.getSortedIpPools()) {
            m.add(p);
        }
        return m;
    } catch (AuthenticationException | FormValidation | ConnectionException ex) {
        LOGGER.log(Level.FINEST, "Openstack call failed", ex);
    } catch (Exception ex) {
        LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
    }

    if (Util.fixEmpty(floatingIpPool) != null) {
        m.add(floatingIpPool);
    }

    return m;
}

From source file:edu.umass.cs.nio.JSONMessenger.java

/**
 * Send returns void because it is the "ultimate" send. It will retransmit
 * if necessary. It is inconvenient for senders to worry about
 * retransmission anyway. We may need to retransmit despite using TCP-based
 * NIO because NIO is designed to be non-blocking, so it may sometimes drop
 * messages when asked to send but the channel is congested. We use the
 * return value of NIO send to decide whether to retransmit.
 *///from   w  w w.j  a v  a2  s.c  o  m
protected void send(GenericMessagingTask<NodeIDType, ?> mtask, boolean useWorkers)
        throws IOException, JSONException {
    if (mtask == null || mtask.recipients == null || mtask.msgs == null) {
        return;
    }
    IOException thrown = null;
    for (Object msg : mtask.msgs) {
        if (msg == null) {
            assert (false);
            continue;
        }
        String message = null;
        try {
            if (msg instanceof JSONObject) {
                message = ((JSONObject) (msg)).toString();
            } else if (!(msg instanceof byte[] && msg instanceof Byteable))
                // we no longer require msg to be JSON at all
                message = msg.toString();
        } catch (Exception je) {
            log.severe("JSONMessenger" + getMyID() + " incurred exception while decoding: " + msg);
            throw (je);
        }
        byte[] msgBytes = msg instanceof byte[] ? (byte[]) msg
                : msg instanceof Byteable ? ((Byteable) msg).toBytes()
                        : message.getBytes(MessageNIOTransport.NIO_CHARSET_ENCODING);
        for (int r = 0; r < mtask.recipients.length; r++) {

            int sent = -1;
            try {
                // special case provision for InetSocketAddress
                sent = this.specialCaseSend(mtask.recipients[r], msgBytes, useWorkers);
            } catch (IOException e) {
                if ((e instanceof ClosedByInterruptException))
                    throw e;
                e.printStackTrace();
                thrown = e;
                continue; // remaining sends might succeed
            }

            // check success or failure and react accordingly
            if (sent > 0) {
                log.log(Level.FINEST, "{0}->{1}:[{2}] ",
                        new Object[] { this, mtask.recipients[r], message != null ? message
                                : log.isLoggable(Level.FINEST) ? new Stringer(msgBytes) : msgBytes });
            } else if (sent == 0) {
                log.log(Level.INFO, "{0} experiencing congestion; this is not disastrous (yet)",
                        new Object[] { this });
                Retransmitter rtxTask = new Retransmitter((mtask.recipients[r]), msgBytes, RTX_DELAY,
                        useWorkers);
                // can't block here, so have to ignore returned future
                execpool.schedule(rtxTask, RTX_DELAY, TimeUnit.MILLISECONDS);
            } else {
                assert (sent == -1) : sent;
                log.warning("Node " + this.nioTransport.getMyID() + " failed to send message to node "
                        + mtask.recipients[r] + ": " + msg);
            }
        }
    }
    if (thrown != null)
        throw thrown;
}

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

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

    if (stage == STAGE.BIOGRAPHIC) {
        String data = getCDATA().trim();
        if (discreteValues.containsKey(localName))
            discreteValues.put(localName, data);
        resetCDATA();//from ww  w .  ja v a2 s  .c  o m
    } else if (stage == STAGE.BIOMETRIC_PICTURE) {
        String data = getCDATA().trim();
        if (localName.equalsIgnoreCase("data"))
            pictureData = Base64.decodeBase64(data.getBytes());
        resetCDATA();
    } else if (stage == STAGE.CRYPTOGRAPHIC) {
        if (localName.equalsIgnoreCase("label")) {
            certLabel = getCDATA().trim();
        } else if (localName.equalsIgnoreCase("data")) {
            if (certLabel.equals("RRN")) {
                rrnCert = certificateFromBase64Data(getCDATA(), certLabel);
            } else if (certLabel.equals("Authentication")) {
                authenticationCert = certificateFromBase64Data(getCDATA(), certLabel);
            } else if (certLabel.equals("Signature")) {
                signingCert = certificateFromBase64Data(getCDATA(), certLabel);
            } else if (certLabel.equals("CA")) {
                citizenCert = certificateFromBase64Data(getCDATA(), certLabel);
            } else if (certLabel.equals("Root")) {
                rootCert = certificateFromBase64Data(getCDATA(), certLabel);
            }
        }
        resetCDATA();
    }
}

From source file:com.pivotal.gemfire.tools.pulse.internal.log.PulseLogWriter.java

@Override
public void finest(String msg, Throwable ex) {
    logger.logp(Level.FINEST, "", "", msg, ex);
}

From source file:com.ibm.sbt.security.authentication.oauth.consumer.OAuth2Handler.java

/**
 ** Authorization: OAuth /* www.  j  a  va 2  s  . c  o m*/
 *                callback_uri="<callback_uri>", 
 *                client_secret="<client_secret>",
 *                client_id="<client_id>", 
 *                grant_type="authorization_code", 
 *                code="<authorization_code>"
 * 
 * Calls the server URL with Authorization header and gets back following values:
 *    access_token, refresh_token, issued_on expires_in, token_type.
 * 
 * @throws Exception
 */
public void getAccessTokenForAuthorizedUser() throws Exception {
    if (logger.isLoggable(Level.FINEST)) {
        logger.entering(sourceClass, "getAccessTokenForAuthorizedUser", new Object[] {});
    }
    HttpGet method = null;
    int responseCode = HttpStatus.SC_OK;
    String responseBody = null;
    InputStream content = null;
    try {
        HttpClient client = new DefaultHttpClient();
        if (forceTrustSSLCertificate)
            client = (DefaultHttpClient) SSLUtil.wrapHttpClient((DefaultHttpClient) client);
        StringBuffer url = new StringBuffer(2048);
        url.append(getAccessTokenURL()).append("?");
        url.append(Configuration.OAUTH2_CALLBACK_URI).append('=')
                .append(URLEncoder.encode(client_uri, "UTF-8"));
        url.append('&');
        url.append(Configuration.OAUTH2_CLIENT_ID).append('=').append(URLEncoder.encode(consumerKey, "UTF-8"));
        url.append('&');
        url.append(Configuration.OAUTH2_CLIENT_SECRET).append('=')
                .append(URLEncoder.encode(consumerSecret, "UTF-8"));
        url.append('&');
        url.append(Configuration.OAUTH2_GRANT_TYPE).append('=').append(Configuration.OAUTH2_AUTHORIZATION_CODE);
        url.append('&');
        url.append(Configuration.OAUTH2_CODE).append('=')
                .append(URLEncoder.encode(authorization_code, "UTF-8"));
        method = new HttpGet(url.toString());
        HttpResponse httpResponse = client.execute(method);
        responseCode = httpResponse.getStatusLine().getStatusCode();
        if (logger.isLoggable(Level.FINEST)) {
            logger.log(Level.FINEST, "OAuth2.0 network call to fetch token :" + url, responseCode);
        }
        content = httpResponse.getEntity().getContent();
        BufferedReader reader = new BufferedReader(new InputStreamReader(content));
        try {
            responseBody = StreamUtil.readString(reader);
        } finally {
            StreamUtil.close(reader);
        }
    } catch (Exception e) {
        throw new OAuthException(e, "getAccessToken failed with Exception: <br>" + e);
    } finally {
        if (content != null) {
            content.close();
        }
    }
    if (responseCode != HttpStatus.SC_OK) {
        getAccessTokenForAuthorizedUsingPOST();
        return;
        //         if (responseCode == HttpStatus.SC_UNAUTHORIZED) {
        //            throw new Exception("getAccessToken failed with Response Code: Unauthorized (401),<br>Msg: " + responseBody);
        //         } else if (responseCode == HttpStatus.SC_BAD_REQUEST) {
        //            throw new Exception("getAccessToken failed with Response Code: Bad Request (400),<br>Msg: " + responseBody);
        //         } else if (responseCode == HttpStatus.SC_INTERNAL_SERVER_ERROR) {
        //            throw new Exception("getAccessToken failed with Response Code: Internal Server error (500),<br>Msg: " + responseBody);
        //         } else {
        //            throw new Exception("getAccessToken failed with Response Code: (" + responseCode + "),<br>Msg: " + responseBody);
        //         }
    } else {
        setOAuthData(responseBody); //save the returned data
    }

}

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

/**
 * NetworkService messaging rate benchmark.
 *//* w  w w  . j ava2s .  co m*/
@Test
public void testMessagingNetworkServiceRate() throws Exception {

    Assume.assumeFalse("Use log level INFO to run benchmarking", LOG.isLoggable(Level.FINEST));

    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[] messageSizes = { 1, 16, 32, 64, 512, 64 * 1024, 1024 * 1024 };

        for (final int size : messageSizes) {
            final int numMessages = 300000 / (Math.max(1, size / 512));
            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);
                final String message = StringUtils.repeat('1', size);

                final long start = System.currentTimeMillis();
                try (Connection<String> conn = ns1.newConnection(destId)) {
                    conn.open();
                    for (int i = 0; i < numMessages; i++) {
                        conn.write(message);
                    }
                    monitor.mwait();
                } catch (final NetworkException e) {
                    e.printStackTrace();
                    throw new RuntimeException(e);
                }
                final long end = System.currentTimeMillis();
                final double runtime = ((double) end - start) / 1000;
                LOG.log(Level.FINEST, "size: " + size + "; messages/s: " + numMessages / runtime
                        + " bandwidth(bytes/s): " + ((double) numMessages * 2 * size) / runtime); // x2 for unicode chars
            }
        }
    }
}

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

@Override
public int invoke(Msg msg, MsgContext ep) throws IOException {
    if (ep.isLogTimeEnabled()) {
        ep.setLong(MsgContext.TIMER_PRE_REQUEST, System.currentTimeMillis());
    }/*  w w w. jav a  2s  . c  om*/

    Request req = ep.getRequest();
    Response res = req.getResponse();

    if (LoggerUtils.getLogger().isLoggable(Level.FINEST)) {
        LoggerUtils.getLogger().log(Level.FINEST,
                "Invoke " + req + " " + res + " " + req.requestURI().toString());
    }

    res.setNote(epNote, ep);
    ep.setStatus(MsgContext.JK_STATUS_HEAD);
    RequestInfo rp = req.getRequestProcessor();
    rp.setStage(Constants.STAGE_SERVICE);
    try {
        adapter.service(req, res);
    } catch (Exception ex) {
        LoggerUtils.getLogger().log(Level.SEVERE, "Error servicing request " + req, ex);
    } finally {
        try {
            adapter.afterService(req, res);
        } catch (Exception ex) {
            LoggerUtils.getLogger().log(Level.SEVERE, "Error servicing request " + req, ex);
        }
    }
    if (ep.getStatus() != MsgContext.JK_STATUS_CLOSED) {
        res.finish();
    }

    req.recycle();
    req.updateCounters();
    res.recycle();
    ep.recycle();
    if (ep.getStatus() == MsgContext.JK_STATUS_ERROR) {
        return ERROR;
    }
    ep.setStatus(MsgContext.JK_STATUS_NEW);
    rp.setStage(Constants.STAGE_KEEPALIVE);
    return OK;
}

From source file:ffx.numerics.fft.Complex.java

/**
 * Factor the data length into preferred factors (those with special
 * methods), falling back to odd primes that the general routine must
 * handle./*from w w  w  . java  2s  .  c  o  m*/
 *
 * @return integer factors
 */
private int[] factor() {
    if (n < 2) {
        return null;
    }
    Vector<Integer> v = new Vector<>();
    int ntest = n;
    int factor;
    /**
     * Use the preferred factors first
     */
    for (int i = 0; i < availableFactors.length; i++) {
        factor = availableFactors[i];
        while ((ntest % factor) == 0) {
            ntest /= factor;
            v.add(factor);
        }
    }
    /**
     * Unavailable odd prime factors.
     */
    factor = firstUnavailablePrime;
    while (ntest > 1) {
        while ((ntest % factor) != 0) {
            factor += 2;
        }
        ntest /= factor;
        v.add(factor);
    }
    int product = 1;
    int nf = v.size();
    int ret[] = new int[nf];
    for (int i = 0; i < nf; i++) {
        ret[i] = v.get(i);
        product *= ret[i];
    }
    /**
     * Report a failed factorization.
     */
    if (product != n) {
        StringBuilder sb = new StringBuilder(" FFT factorization failed for " + n + "\n");
        for (int i = 0; i < nf; i++) {
            sb.append(" ");
            sb.append(ret[i]);
        }
        sb.append("\n");
        sb.append(" Factor product = ");
        sb.append(product);
        sb.append("\n");
        logger.severe(sb.toString());
        System.exit(-1);
    } else {
        if (logger.isLoggable(Level.FINEST)) {
            StringBuilder sb = new StringBuilder(" FFT factorization for " + n + " = ");
            for (int i = 0; i < nf - 1; i++) {
                sb.append(ret[i]);
                sb.append(" * ");
            }
            sb.append(ret[nf - 1]);
            logger.fine(sb.toString());
        }
    }
    return ret;
}

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

@HandlesEvent("Login")
public Resolution login() {
    Map<String, String> errors = new HashMap<>();

    org.apache.shiro.mgt.SecurityManager securityManager = SecurityUtils.getSecurityManager();
    if (securityManager instanceof DefaultWebSecurityManager) {
        DefaultWebSecurityManager webSecurityManager = (DefaultWebSecurityManager) securityManager;
        for (Realm realm : webSecurityManager.getRealms()) {
            if (realm instanceof HeaderRealm) {
                return handleLoginRedirect();
            }/* ww w . j a va 2 s. c o  m*/
        }
    }

    Subject currentUser = SecurityUtils.getSubject();
    UsernamePasswordToken token = new UsernamePasswordToken(username, password);
    try {
        currentUser.login(token);
        UserProfile userProfile = new UserProfile();
        userProfile.setUsername(username);
        service.getUserService().handleLogin(userProfile, getContext().getRequest(), null);
        String startPage = startPage();
        if (startPage.toLowerCase().startsWith("http") == false) {
            startPage = getContext().getServletContext().getContextPath() + startPage;
        }
        JsonResponse jsonResponse = new JsonResponse();
        jsonResponse.setMessage(startPage);
        return streamResults(jsonResponse);
    } catch (AuthenticationException uea) {
        log.log(Level.WARNING, MessageFormat.format("{0} Failed to login.", username));
        log.log(Level.FINEST, "Failed to login Details: ", uea);
        errors.put("username", "Unable to login. Check username and password.");
    }
    return streamErrorResponse(errors);
}

From source file:org.activiti.cycle.impl.connector.signavio.SignavioConnector.java

public boolean registerUserWithSignavio(String firstname, String lastname, String email, String password) {
    Client client = initClient();/*w  ww.j  a va  2  s  .  c  o m*/

    Reference registrationRef = new Reference(conf.getRegistrationUrl());

    // Create the Post Parameters for registering a new user
    Form registrationForm = new Form();
    registrationForm.add("mode", "external");
    registrationForm.add("firstName", firstname);
    registrationForm.add("lastName", lastname);
    registrationForm.add("mail", email);
    registrationForm.add("password", password);
    registrationForm.add("serverSecurityId", SERVER_SECURITY_ID);
    Representation registrationRep = registrationForm.getWebRepresentation();

    Request registrationRequest = new Request(Method.POST, registrationRef, registrationRep);
    // registrationRequest.getClientInfo().getAcceptedMediaTypes().add(new
    // Preference<MediaType>(MediaType.APPLICATION_JSON));
    Response registrationResponse = client.handle(registrationRequest);

    if (log.isLoggable(Level.FINEST)) {
        SignavioLogHelper.logCookieAndBody(log, registrationResponse);
    }

    if (registrationResponse.getStatus().equals(Status.SUCCESS_CREATED)) {
        return true;
    } else {
        return false;
    }
}