Example usage for java.util.logging Level FINE

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

Introduction

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

Prototype

Level FINE

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

Click Source Link

Document

FINE is a message level providing tracing information.

Usage

From source file:com.joyfulmongo.db.javadriver.JFDBCollection.java

private void recordWriteResult(String msg, WriteResult result) {
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.log(Level.FINE, msg + " Write result is " + result);
    }/*from  w  w w.  j a  va2s .  c om*/
}

From source file:org.gvnix.service.roo.addon.addon.ws.importt.WSImportMetadata.java

public WSImportMetadata(String identifier, JavaType aspectName,
        PhysicalTypeMetadata governorPhysicalTypeMetadata, SecurityService secuirityService) {

    super(identifier, aspectName, governorPhysicalTypeMetadata);

    this.securityService = secuirityService;

    Validate.isTrue(isValid(identifier),
            "Metadata identification string '" + identifier + "' does not appear to be valid");

    if (!isValid()) {
        return;//from   w  ww.  j  a v  a  2  s  . c  o m
    }

    // Create the metadata.
    AnnotationMetadata annotationMetadata = governorTypeDetails
            .getTypeAnnotation(new JavaType(GvNIXWebServiceProxy.class.getName()));

    if (annotationMetadata != null) {

        // Populate wsdlLocation property class from annotation attribute
        AutoPopulationUtils.populate(this, annotationMetadata);
        LOGGER.log(Level.FINE, "Wsdl location = " + wsdlLocation);

        try {

            // Check URL connection and WSDL format
            Element root = securityService.getWsdl(wsdlLocation).getDocumentElement();

            // Create Aspect methods related to this wsdl location
            if (WsdlParserUtils.isRpcEncoded(root)) {

                createAspectMethods(root, WsType.IMPORT_RPC_ENCODED);
            } else {

                createAspectMethods(root, WsType.IMPORT);
            }

        } catch (IOException e) {
            LOGGER.log(Level.SEVERE, "Web service has been imported", e);
            throw new IllegalStateException("Error accessing generated web service sources");

        } catch (ParseException e) {
            LOGGER.log(Level.SEVERE, "Web service has been imported", e);
            throw new IllegalStateException("Error parsing generated web service sources");
        }

        LOGGER.log(Level.FINE, "Web service has been imported");
    }

    // Create a representation of the desired output ITD
    itdTypeDetails = builder.build();
}

From source file:de.theit.jenkins.crowd.CrowdConfigurationService.java

/**
 * Creates a new Crowd configuration object.
 * //from  w  w  w .  j  av  a  2s.  c om
 * @param pGroupNames
 *            The group names to use when authenticating Crowd users. May
 *            not be <code>null</code>.
 * @param pNestedGroups
 *            Specifies whether nested groups should be used when validating
 *            users against a group name.
 */
public CrowdConfigurationService(String pGroupNames, boolean pNestedGroups) {
    if (0 == pGroupNames.length()) {
        throw new IllegalArgumentException(specifyGroup());
    }

    if (LOG.isLoggable(Level.INFO)) {
        LOG.info("Groups given for Crowd configuration service: " + pGroupNames);
    }
    this.allowedGroupNames = new ArrayList<String>();
    for (String group : pGroupNames.split("[,\\s]")) {
        if (null != group && group.trim().length() > 0) {
            if (LOG.isLoggable(Level.FINE)) {
                LOG.fine("-> adding allowed group name: " + group);
            }
            this.allowedGroupNames.add(group);
        }
    }

    if (this.allowedGroupNames.isEmpty()) {
        throw new IllegalArgumentException(specifyGroup());
    }

    this.nestedGroups = pNestedGroups;
}

From source file:com.ovea.facebook.client.DefaultFacebookClient.java

@Override
public FacebookToken accessToken(String verificationCode) throws FacebookException {
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    qparams.add(new BasicNameValuePair("client_id", clientId));
    qparams.add(new BasicNameValuePair("client_secret", clientSecret));
    qparams.add(new BasicNameValuePair("code", verificationCode));
    qparams.add(new BasicNameValuePair("redirect_uri", redirectUri));
    JSONType result = get("https", "graph.facebook.com", "/oauth/access_token", qparams);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("accessToken for code " + verificationCode + " = " + result);
    }/*from  w w  w.ja v  a2 s  .  c  o m*/
    checkErrorOn(result);
    LOGGER.info("verification code : " + verificationCode + " / Response : " + result);
    String[] split = result.asObject().getString("data").split("&");
    return new FacebookToken(split[0].split("=")[1], Integer.parseInt(split[1].split("=")[1]));
}

From source file:org.couch4j.http.DatabaseChangeNotificationService.java

private void receiveChangeNotifications() {
    if (receivingChangeNotifications) {
        return;// w  w  w . ja v a 2 s .co  m
    }
    logger.info("[" + Thread.currentThread().getName() + "] Start receiveChangeNotifications()...");

    receivingChangeNotifications = true;
    executor = Executors.newSingleThreadExecutor();
    Runnable r = new Runnable() {
        private void streamChanges(int updateSeq) {
            if (!receivingChangeNotifications) {
                return;
            }
            // Do we need the "heartbeat" param?
            HttpGet method = new HttpGet(urlResolver.urlForPath("_changes", map("feed", "continuous", "style",
                    "all_docs", "since", String.valueOf(updateSeq), "heartbeat", "5000")));

            HttpResponse response = null;
            HttpEntity entity = null;
            try {
                // int statusCode = client.executeMethod(method);
                response = client.execute(method);
                entity = response.getEntity();
                // Read the response body.
                Reader in = new InputStreamReader(entity.getContent(), EntityUtils.getContentCharSet(entity));

                Scanner s = new Scanner(in).useDelimiter("\n");
                String line;
                while (s.hasNext() && null != (line = s.next())) {
                    // dispatch change event
                    if (line.length() > 1 && JSONUtils.mayBeJSON(line)) {
                        JSONObject json = JSONObject.fromObject(line);
                        if (json.has("seq")) {
                            if (logger.isLoggable(Level.FINE)) {
                                logger.fine("Dispatch new change event: " + line);
                            }
                            dispatchEvent(new DatabaseChangeEvent(json));
                        } else if (json.has("last_seq")) {
                            if (logger.isLoggable(Level.FINE)) {
                                logger.fine("CouchDB server closed _changes connection. Reconnecting...");
                            }
                            streamChanges(json.getInt("last_seq"));
                        }
                    }
                }
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("[" + Thread.currentThread().getName() + "] Stop receiving changes...");
                }
            } catch (IOException e) {
                throw new Couch4JException(e);
            } finally {
                if (null != entity) {
                    try {
                        entity.consumeContent();
                    } catch (IOException e) {
                        // swallow
                    }
                }
            }
        }

        public void run() {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("[" + Thread.currentThread().getName() + "] Start receiving changes... ");
            }
            // Start with current udpate seq
            int updateSeq = database.getDatabaseInfo().getUpdateSeq();
            streamChanges(updateSeq);
        }
    };
    executor.submit(r);
}

From source file:com.urbanmania.spring.beans.factory.config.annotations.PropertyAnnotationAndPlaceholderConfigurer.java

private void processAnnotatedProperties(Properties properties, String name, MutablePropertyValues mpv,
        Class<?> clazz) {/*from  w w w. j a v a  2s .  c o m*/
    // TODO support proxies
    if (clazz != null && clazz.getPackage() != null) {
        if (basePackage != null && !clazz.getPackage().getName().startsWith(basePackage)) {
            return;
        }

        log.info("Configuring properties for bean=" + name + "[" + clazz + "]");

        for (PropertyDescriptor property : BeanUtils.getPropertyDescriptors(clazz)) {
            if (log.isLoggable(Level.FINE))
                log.fine("examining property=[" + clazz.getName() + "." + property.getName() + "]");
            Method setter = property.getWriteMethod();
            Method getter = property.getReadMethod();
            Property annotation = null;
            if (setter != null && setter.isAnnotationPresent(Property.class)) {
                annotation = setter.getAnnotation(Property.class);
            } else if (setter != null && getter != null && getter.isAnnotationPresent(Property.class)) {
                annotation = getter.getAnnotation(Property.class);
            } else if (setter == null && getter != null && getter.isAnnotationPresent(Property.class)) {
                throwBeanConfigurationException(clazz, property.getName());
            }
            if (annotation != null) {
                setProperty(properties, name, mpv, clazz, property, annotation);
            }
        }

        for (Field field : clazz.getDeclaredFields()) {
            if (log.isLoggable(Level.FINE))
                log.fine("examining field=[" + clazz.getName() + "." + field.getName() + "]");
            if (field.isAnnotationPresent(Property.class)) {
                Property annotation = field.getAnnotation(Property.class);
                PropertyDescriptor property = BeanUtils.getPropertyDescriptor(clazz, field.getName());

                if (property == null || property.getWriteMethod() == null) {
                    throwBeanConfigurationException(clazz, field.getName());
                }

                setProperty(properties, name, mpv, clazz, property, annotation);
            }
        }
    }
}

From source file:com.marvelution.hudson.plugins.apiv2.APIv2Plugin.java

/**
 * {@inheritDoc}//from  ww  w  .  j  a  va2 s .  c o m
 */
public void stop() throws Exception {
    LOGGER.log(Level.FINE, "Removing the APIv2 Filters");
    for (Filter filter : filters) {
        PluginServletFilter.removeFilter(filter);
    }
    filters.clear();
    LOGGER.log(Level.FINE, "Storing the Activity Cache");
    XSTREAM.toXML(activitiesCache, new FileOutputStream(getFile(ACTIVITIES_CACHE_FILE)));
    LOGGER.log(Level.FINE, "Storing the Issue Cache");
    XSTREAM.toXML(issuesCache, new FileOutputStream(getFile(ISSUES_CACHE_FILE)));
    save();
    plugin = null;
}

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

private void tearDownConn() throws UMLSQueryException {
    if (conn != null) {
        log(Level.FINE, "Attempting to disconnect from the database...");
        try {/*from   w ww . j  a v  a 2s .  co  m*/
            conn.close();
            log(Level.FINE, "Disconnected from database " + url);
        } catch (SQLException sqle) {
            throw new UMLSQueryException(sqle);
        }
    }
}

From source file:com.ibm.ws.lars.rest.RepositoryRESTResourceLoggingTest.java

@Test
public void testDeleteAssets(@Mocked final Logger logger)
        throws InvalidIdException, NonExistentArtefactException {

    new Expectations() {
        {/*from  w w w. j a v  a2 s.  co m*/
            logger.isLoggable(Level.FINE);
            result = true;

            logger.fine("deleteAsset called with id of " + NON_EXISTENT_ID);
        }
    };

    getRestResource().deleteAsset(NON_EXISTENT_ID);
}

From source file:eu.edisonproject.training.wsd.WikipediaOnline.java

@Override
public Set<Term> getCandidates(String lemma) throws MalformedURLException, IOException, ParseException,
        UnsupportedEncodingException, InterruptedException, ExecutionException {

    Set<String> jsonTerms = getPossibleTermsFromDB(lemma, new URL(PAGE).getHost());

    if (jsonTerms != null && !jsonTerms.isEmpty()) {
        Set<Term> terms = TermFactory.create(jsonTerms);
        return terms;
        //            Set<Term> wikiTerms = new HashSet<>();

        //            for (Term t : terms) {
        //                if (t.getUrl().toString().contains(new URL(PAGE).getHost())) {
        //                    wikiTerms.add(t);
        //                }
        //            }
        //            if (!wikiTerms.isEmpty()) {
        //                return wikiTerms;
        //            }
    }/*ww w. j  a  v a 2s . c  o m*/

    URL url;
    String jsonString;

    Set<String> titlesList = getTitles(lemma);

    StringBuilder titles = new StringBuilder();

    Iterator<String> it = titlesList.iterator();
    int i = 0;
    Set<Term> terms = new HashSet<>();
    while (it.hasNext()) {
        String t = it.next();
        t = URLEncoder.encode(t, "UTF-8");
        titles.append(t).append("|");
        if ((i % 20 == 0 && i > 0) || i >= titlesList.size() - 1) {
            titles.deleteCharAt(titles.length() - 1);
            titles.setLength(titles.length());
            jsonString = null;
            if (jsonString == null) {
                url = new URL(PAGE
                        + "?format=json&redirects&action=query&prop=extracts&exlimit=max&explaintext&exintro&titles="
                        + titles.toString());
                LOGGER.log(Level.FINE, url.toString());
                jsonString = IOUtils.toString(url);
                titles = new StringBuilder();
            }
            terms.addAll(queryTerms(jsonString, lemma));
        }
        i++;
    }
    addPossibleTermsToDB(lemma, terms);
    return terms;
}