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:edu.umass.cs.gnsserver.gnsapp.clientCommandProcessor.commandSupport.FieldAccess.java

/**
 *
 * @param header//from  ww  w .j  a  va 2 s.  c  om
 * @param commandPacket
 * @param guid
 * @param field
 * @param fields
 * @param reader
 * @param signature
 * @param message
 * @param timestamp
 * @param app
 * @param skipSigCheck
 * @return the ResponseCode
 */
public static ResponseCode signatureAndACLCheckForRead(InternalRequestHeader header,
        CommandPacket commandPacket, String guid, String field, List<String> fields, String reader,
        String signature, String message, Date timestamp, GNSApplicationInterface<String> app,
        boolean skipSigCheck) {
    ResponseCode errorCode = ResponseCode.NO_ERROR;
    LOGGER.log(Level.FINE, "signatureAndACLCheckForRead guid: {0} field: {1} reader: {2}",
            new Object[] { guid, field, reader });
    try {
        assert (header != null);

        // note: reader can also be null here
        if (!header.verifyInternal() && !commandPacket.getCommandType().isMutualAuth()
                && (field != null || fields != null)) {
            errorCode = NSAuthentication.signatureAndACLCheck(header, guid, field, fields, reader, signature,
                    message, MetaDataTypeName.READ_WHITELIST, app, skipSigCheck);
        } else {
            LOGGER.log(Level.FINEST, "reader={0}; internal={1} field={2}; fields={3};",
                    new Object[] { reader, header.verifyInternal(), field, fields });

            // internal and mutual auth commands don't need ACL checks
            if ((header.verifyInternal() && (GNSProtocol.INTERNAL_QUERIER.toString().equals(reader)))
                    || commandPacket.getCommandType().isMutualAuth()) {
                return ResponseCode.NO_ERROR;
            }
            //Fixme: I'm guessing this case is for active code only.
            if (field != null) {
                errorCode = NSAuthentication.aclCheck(header, guid, field, header.getQueryingGUID(),
                        MetaDataTypeName.READ_WHITELIST, app).getResponseCode();
            } else if (fields != null) {
                for (String aField : fields) {
                    AclCheckResult aclResult = NSAuthentication.aclCheck(header, guid, aField,
                            header.getQueryingGUID(), MetaDataTypeName.READ_WHITELIST, app);
                    if (aclResult.getResponseCode().isExceptionOrError()) {
                        errorCode = aclResult.getResponseCode();
                    }
                }
            }
        }
        // Check for stale commands.
        if (timestamp != null) {
            if (timestamp.before(DateUtils.addMinutes(new Date(),
                    -Config.getGlobalInt(GNSConfig.GNSC.STALE_COMMAND_INTERVAL_IN_MINUTES)))) {
                errorCode = ResponseCode.STALE_COMMAND_VALUE;
            }
        }
    } catch (InvalidKeyException | InvalidKeySpecException | SignatureException | NoSuchAlgorithmException
            | FailedDBOperationException | UnsupportedEncodingException e) {
        errorCode = ResponseCode.SIGNATURE_ERROR;
    }
    return errorCode;
}

From source file:edu.umass.cs.gigapaxos.PaxosManager.java

private void enqueueRequest(PaxosPacket pp) {
    PaxosPacketType type = pp.getType();
    Level level = Level.FINEST;
    if ((type.equals(PaxosPacketType.REQUEST) || type.equals(PaxosPacketType.PROPOSAL))
            && RequestBatcher.shouldEnqueue() && !((RequestPacket) pp).isBroadcasted()) {
        if (pp.getPaxosID() != null) {
            log.log(level, "{0} enqueueing request {1}",
                    new Object[] { this, pp.getSummary(log.isLoggable(level)) });
            this.requestBatcher.enqueue(((RequestPacket) pp));
        } else//from w w  w .j av  a2  s. com
            error((RequestPacket) pp);
    } else {
        log.log(level, "{0} handling paxos packet {1} directly without enqueueuing",
                new Object[] { this, pp.getSummary(log.isLoggable(level)) });
        this.handlePaxosPacket(pp);
    }
}

From source file:edu.umass.cs.gigapaxos.PaxosManager.java

@SuppressWarnings("unchecked")
private void handlePaxosPacket(PaxosPacket request) {
    if (this.isClosed())
        return;/*from   w w w.jav a2s  .  co m*/
    else if (emulateUnreplicated(request) || this.emulateLazyPropagation(request))
        return; // testing
    else
        setProcessing(true);

    Level level = Level.FINEST;
    PaxosPacketType paxosPacketType;
    try {
        // will throw exception if no PAXOS_PACKET_TYPE
        paxosPacketType = request.getType();
        switch (paxosPacketType) {
        case FAILURE_DETECT:
            processFailureDetection((FailureDetectionPacket<NodeIDType>) request);
            break;
        case FIND_REPLICA_GROUP:
            processFindReplicaGroup((FindReplicaGroupPacket) request);
            break;
        default: // paxos protocol messages

            assert (request.getPaxosID() != null) : request.toJSONSmart().toString();
            if (request instanceof RequestPacket) // base and super types
                ((RequestPacket) request).addDebugInfo("i", myID);

            PaxosInstanceStateMachine pism = this.getInstance(request.getPaxosID());

            log.log(level, "{0} received paxos message for {1} : {2}", new Object[] { this,
                    pism != null ? pism : "non-existent instance", request.getSummary(log.isLoggable(level)) });
            if ((pism != null) && (pism.getVersion() == request.getVersion()) && (!pism.isStopped()))
                pism.handlePaxosMessage(request);
            else
                // for recovering group created while crashed
                this.findPaxosInstance(request);
            break;
        }
    } catch (JSONException je) {
        log.severe("Node" + this.myID + " received bad JSON message: " + request);
        je.printStackTrace();
    } finally {
        setProcessing(false);
    }
}

From source file:edu.emory.cci.aiw.umls.UMLSDatabaseConnection.java

@Override
public int getDistBF(ConceptUID cui1, ConceptUID cui2, String rela, SAB sab, int maxR)
        throws UMLSQueryException {
    Queue<ConceptUID> cuiQue = new LinkedList<ConceptUID>();
    Set<ConceptUID> visited = new HashSet<ConceptUID>();
    Map<Integer, Integer> radiusIdx = new HashMap<Integer, Integer>();
    int queIdx = 0;
    int r = 0;/*from www. j a  va  2 s. com*/
    radiusIdx.put(r, 0);

    if (maxR <= 0) {
        maxR = 3;
    }

    try {
        setupConn();
        cuiQue.add(cui1);
        visited.add(cui1);

        List<UMLSQuerySearchUID> params = new ArrayList<UMLSQuerySearchUID>();
        StringBuilder sql = new StringBuilder(
                "select distinct(CUI2) from MRREL where CUI1 = ? and (rel='PAR' or rel='CHD')");
        params.add(ConceptUID.EMPTY_CUI);
        if (sab != null) {
            sql.append(" and SAB = ?");
            params.add(sab);
        }
        if (rela != null && !rela.equals("")) {
            sql.append(" and RELA = ?");
            params.add(UMLSQueryStringValue.fromString(rela));
        }

        while (!cuiQue.isEmpty()) {
            ConceptUID node = cuiQue.remove();
            params.set(0, node);
            if (node.equals(cui2)) {
                return r;
            }

            List<ConceptUID> adjNodes = new ArrayList<ConceptUID>();

            ResultSet rs = executeAndLogQuery(substParams(sql.toString(), params));
            while (rs.next()) {
                ConceptUID c2 = ConceptUID.fromString(rs.getString(1));
                if (!visited.contains(c2)) {
                    adjNodes.add(c2);
                }
            }

            if (!radiusIdx.containsKey(r + 1)) {
                radiusIdx.put(r + 1, queIdx + cuiQue.size());
            }
            radiusIdx.put(r + 1, adjNodes.size());

            if (queIdx == radiusIdx.get(r)) {
                r++;
            }
            queIdx++;

            for (ConceptUID c : adjNodes) {
                visited.add(c);
                cuiQue.add(c);
            }
            if (r > maxR) {
                return r;
            }
        }
    } catch (SQLException sqle) {
        throw new UMLSQueryException(sqle);
    } catch (MalformedUMLSUniqueIdentifierException muuie) {
        throw new UMLSQueryException(muuie);
    } finally {
        tearDownConn();
    }

    log(Level.FINEST, "Returning -1");
    return -1;
}

From source file:com.ibm.sbt.services.client.ClientService.java

/**
 * Process the specified response//w  ww  . ja  va2  s.c o  m
 * 
 * @param httpClient
 * @param httpRequestBase
 * @param httpResponse
 * @param args
 * @return
 * @throws ClientServicesException
 */
protected Response processResponse(HttpClient httpClient, HttpRequestBase httpRequestBase,
        HttpResponse httpResponse, Args args) throws ClientServicesException {
    if (logger.isLoggable(Level.FINEST)) {
        logger.entering(sourceClass, "processResponse",
                new Object[] { httpRequestBase.getURI(), httpResponse.getStatusLine() });
    }

    int statusCode = httpResponse.getStatusLine().getStatusCode();
    String reasonPhrase = httpResponse.getStatusLine().getReasonPhrase();
    if (!checkStatus(statusCode)) {
        if (SbtCoreLogger.SBT.isErrorEnabled()) {
            // Do not throw an exception here as some of the non OK responses are not error cases.
            String msg = "Client service request to: {0} did not return OK status. Status returned: {1}, reason: {2}, expected: {3}";
            msg = StringUtil.format(msg, httpRequestBase.getURI(), statusCode, reasonPhrase, HttpStatus.SC_OK);
            SbtCoreLogger.SBT.traceDebugp(this, "processResponse", msg);
        }
    }

    if (isResponseRequireAuthentication(httpResponse)) {
        forceAuthentication(args);
        throw new ClientServicesException(new AuthenticationException());
    }

    Handler format = findHandler(httpRequestBase, httpResponse, args.handler);

    Response response = new Response(httpClient, httpResponse, httpRequestBase, args, format);

    if (logger.isLoggable(Level.FINEST)) {
        logger.exiting(sourceClass, "processResponse", response);
    }
    return response;
}

From source file:fr.ortolang.diffusion.core.CoreServiceBean.java

@Override
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public String resolveWorkspacePath(String wskey, String root, String path)
        throws CoreServiceException, InvalidPathException, PathNotFoundException {
    LOGGER.log(Level.FINE,/*w  w  w  . j ava  2  s  .  c o  m*/
            "resolving into workspace [" + wskey + "] and root [" + root + "] path [" + path + "]");
    try {
        PathBuilder npath = PathBuilder.fromPath(path);
        PathBuilder ppath = npath.clone().parent();

        OrtolangObjectIdentifier wsidentifier = registry.lookup(wskey);
        checkObjectType(wsidentifier, Workspace.OBJECT_TYPE);
        LOGGER.log(Level.FINEST, "workspace with key [" + wskey + "] exists");

        Workspace ws = em.find(Workspace.class, wsidentifier.getId());
        if (ws == null) {
            throw new CoreServiceException(
                    "unable to load workspace with id [" + wsidentifier.getId() + "] from storage");
        }
        ws.setKey(wskey);
        LOGGER.log(Level.FINEST, "workspace loaded");

        String rroot = ws.getHead();
        if (root != null && root.length() > 0 && !root.equals(Workspace.HEAD)) {
            String snapshot = root;
            TagElement tag = ws.findTagByName(root);
            if (tag != null) {
                LOGGER.log(Level.FINEST, "root is a tag, resolving tag snapshot");
                snapshot = tag.getSnapshot();
            }
            SnapshotElement element = ws.findSnapshotByName(snapshot);
            if (element == null) {
                throw new RootNotFoundException(root);
            } else {
                rroot = element.getKey();
            }
        }

        if (npath.isRoot()) {
            return rroot;
        }

        Collection parent = readCollectionAtPath(rroot, ppath);
        LOGGER.log(Level.FINEST, "parent collection loaded for path " + ppath.build());

        CollectionElement element = parent.findElementByName(npath.part());
        if (element == null) {
            throw new PathNotFoundException(npath.build());
        }
        return element.getKey();
    } catch (KeyNotFoundException | RegistryServiceException e) {
        LOGGER.log(Level.SEVERE, "unexpected error occurred during resolving path", e);
        throw new CoreServiceException("unable to resolve into workspace [" + wskey + "] path [" + path + "]",
                e);
    }
}

From source file:com.prowidesoftware.swift.model.SwiftMessage.java

/**
 * Gets a proprietary XML representation of this message.<br />
  * Notice: it is neither a standard nor the MX version of this MT.
 * @see XMLWriterVisitor// w  w  w.  j a  v a2  s . co m
 * @see XMLParser
 * @return the MT message serialized into the proprietary XML
 * @since 7.8.4
 */
public final String toXml() {
    final StringWriter w = new StringWriter();
    visit(new XMLWriterVisitor(w, true));
    final String xml = w.getBuffer().toString();
    if (log.isLoggable(Level.FINEST)) {
        log.finest("xml: " + xml);
    }
    return xml;
}

From source file:com.newrelic.agent.transport.DataSenderImpl.java

private ReadResult send(String method, String encoding, String uri, JSONStreamAware params,
        int timeoutInMillis)/* 857:    */ throws Exception
/* 858:    */ {/*from  www  . jav a 2  s. co m*/
    /* 859:    */ try
    /* 860:    */ {
        /* 861:653 */ return connectAndSend(method, encoding, uri, params, timeoutInMillis);
        /* 862:    */ }
    /* 863:    */ catch (MalformedURLException e)
    /* 864:    */ {
        /* 865:655 */ Agent.LOG.log(Level.SEVERE,
                "You have requested a connection to New Relic via a protocol which is unavailable in your runtime: {0}",
                new Object[] { e.toString() });
        /* 866:    */
        /* 867:    */
        /* 868:    */
        /* 869:659 */ throw new ForceDisconnectException(e.toString());
        /* 870:    */ }
    /* 871:    */ catch (SocketException e)
    /* 872:    */ {
        /* 873:661 */ if ((e.getCause() instanceof NoSuchAlgorithmException))
        /* 874:    */ {
            /* 875:662 */ String msg = MessageFormat.format(
                    "You have requested a connection to New Relic via an algorithm which is unavailable in your runtime: {0}  This may also be indicative of a corrupted keystore or trust store on your server.",
                    new Object[] { e.getCause().toString() });
            /* 876:    */
            /* 877:    */
            /* 878:665 */ Agent.LOG.error(msg);
            /* 879:    */ }
        /* 880:    */ else
        /* 881:    */ {
            /* 882:668 */ Agent.LOG.log(Level.INFO,
                    "A socket exception was encountered while sending data to New Relic ({0}).  Please check your network / proxy settings.",
                    new Object[] { e.toString() });
            /* 883:672 */ if (Agent.LOG.isLoggable(Level.FINE)) {
                /* 884:673 */ Agent.LOG.log(Level.FINE, "Error sending JSON({0}): {1}",
                        new Object[] { method, DataSenderWriter.toJSONString(params) });
                /* 885:    */ }
            /* 886:676 */ Agent.LOG.log(Level.FINEST, e, e.toString(), new Object[0]);
            /* 887:    */ }
        /* 888:678 */ throw e;
        /* 889:    */ }
    /* 890:    */ catch (HttpError e)
    /* 891:    */ {
        /* 892:707 */ throw e;
        /* 893:    */ }
    /* 894:    */ catch (Exception e)
    /* 895:    */ {
        /* 896:709 */ Agent.LOG.log(Level.INFO, "Remote {0} call failed : {1}.",
                new Object[] { method, e.toString() });
        /* 897:710 */ if (Agent.LOG.isLoggable(Level.FINE)) {
            /* 898:711 */ Agent.LOG.log(Level.FINE, "Error sending JSON({0}): {1}",
                    new Object[] { method, DataSenderWriter.toJSONString(params) });
            /* 899:    */ }
        /* 900:713 */ Agent.LOG.log(Level.FINEST, e, e.toString(), new Object[0]);
        /* 901:714 */ throw e;
        /* 902:    */ }
    /* 903:    */ }

From source file:com.npower.dm.server.session.ManagementSessionHandler.java

/**
 * Makes a state transition. Very simple implementation at the moment: it
 * changes the value of <i>currentState</i> to the given value.
 *
 * @param state the new state/*from   ww w .j  av a 2s.co m*/
 */
private void moveTo(int state) {
    if (log.isLoggable(Level.FINEST)) {
        log.finest("moving to state " + getStateName(state));
    }
    currentState = state;
}

From source file:com.ibm.sbt.services.client.ClientService.java

/**
 * Find the handler for the specified response
 * /* w w  w .  j av a 2 s .com*/
 * @param request
 * @param response
 * @param DateFormat
 * @return
 * @throws ClientServicesException
 */
protected Handler findHandler(HttpRequestBase request, HttpResponse response, Handler handler)
        throws ClientServicesException {
    if (logger.isLoggable(Level.FINEST)) {
        logger.entering(sourceClass, "findHandler",
                new Object[] { request.getURI(), response.getStatusLine(), handler });
    }

    try {
        int statusCode = response.getStatusLine().getStatusCode();
        if (response.getStatusLine().getStatusCode() == HttpServletResponse.SC_INTERNAL_SERVER_ERROR) {
            handler = findErrorHandler(request, response);
        }

        // Connections Delete API returns SC_NO_CONTENT for successful deletion.
        if (isErrorStatusCode(statusCode)) {
            handler = findErrorHandler(request, response);
        }

        if (handler == null) {
            handler = findSuccessHandler(request, response);
        }

        // SBT doesn't have a JS interpreter...
        if (handler == null) {
            handler = new HandlerRaw();
        }
    } catch (Exception ex) {
        if (ex instanceof ClientServicesException) {
            throw (ClientServicesException) ex;
        }
        throw new ClientServicesException(ex, "Error while parsing the REST service results");
    }

    if (logger.isLoggable(Level.FINEST)) {
        logger.exiting(sourceClass, "findHandler", handler);
    }
    return handler;
}