Example usage for java.util.logging Level INFO

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

Introduction

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

Prototype

Level INFO

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

Click Source Link

Document

INFO is a message level for informational messages.

Usage

From source file:com.lecaddyfute.utils.security.AESCrypto.java

public static Key generateKey() throws Exception {

    String cle = CLE;/*from   ww w.j  a va2 s  . c o m*/
    try {
        if (cle.isEmpty()) {
            InetAddress adrLocale;
            adrLocale = InetAddress.getLocalHost();
            cle = adrLocale.getHostName();
        }
        if (cle.length() > 16) {
            cle = cle.substring(0, 16);
        }
        if (cle.length() < 16) {
            int chartocomplete = 16 - cle.length();
            for (int i = 0; i < chartocomplete; i++) {
                cle = cle + i;
            }
        }
        logger.log(Level.INFO, "cle par defaut {0}", cle);
        keyValue = cle.getBytes();
    } catch (Exception e) {
        e.printStackTrace();

    }
    Key key = new SecretKeySpec(keyValue, ALGO);
    return key;
}

From source file:ca.sfu.federation.Application.java

/**
 * Start the application./*  www. j  a  va  2 s .  c om*/
 */
@Override
public void run() {
    logger.log(Level.INFO, "Starting application");
    // set the look and feel options
    try {
        logger.log(Level.FINE, "Setting look and feel options");
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);
        LookAndFeelUtil.removeAllSplitPaneBorders();
    } catch (Exception e) {
        String stack = ExceptionUtils.getFullStackTrace(e);
        logger.log(Level.WARNING, "Could not set look and feel options\n\n{0}", stack);
    }
    // create the main application frame 
    logger.log(Level.FINE, "Creating main application frame");
    frame = new ApplicationFrame();
    // show the application
    frame.setVisible(true);
}

From source file:eu.ascetic.zabbixdatalogger.datasource.hostvmfilter.NameEndsFilter.java

/**
 * This creates a name filter that checks to see if the end of a host name
 * matches particular criteria or not. if it does then it will indicate accordingly
 * that the "Zabbix JSON API host" is a host or VM.
 *//*from  w  w  w  . ja v a2  s.c o m*/
public NameEndsFilter() {
    try {
        PropertiesConfiguration config;
        if (new File(CONFIG_FILE).exists()) {
            config = new PropertiesConfiguration(CONFIG_FILE);
        } else {
            config = new PropertiesConfiguration();
            config.setFile(new File(CONFIG_FILE));
        }
        config.setAutoSave(true); //This will save the configuration file back to disk. In case the defaults need setting.
        ends = config.getString("data.logger.filter.begins", ends);
        config.setProperty("data.logger.filter.begins", ends);
        isHost = config.getBoolean("data.logger.filter.isHost", isHost);
        config.setProperty("data.logger.filter.isHost", isHost);
    } catch (ConfigurationException ex) {
        Logger.getLogger(NameBeginsFilter.class.getName()).log(Level.INFO,
                "Error loading the configuration of the name ends filter");
    }
}

From source file:cn.org.once.cstack.cli.utils.UserUtils.java

public String changePassword() {

    String oldPassword, newPassword, newPassword2 = "";

    if (authentificationUtils.getMap().isEmpty()) {
        log.log(Level.SEVERE, "You are not connected to CloudUnit host! Please use connect command");
        statusCommand.setExitStatut(1);/*ww w .j  a  v a  2  s . c  o  m*/
        return null;
    }
    if (fileUtils.isInFileExplorer()) {
        log.log(Level.SEVERE,
                "You are currently in a container file explorer. Please exit it with close-explorer command");
        statusCommand.setExitStatut(1);
        return null;
    }
    try {
        log.log(Level.INFO, "Enter your old password : ");
        oldPassword = new ConsoleReader().readLine(new Character('*'));
        log.log(Level.INFO, "Enter your new password : ");
        newPassword = new ConsoleReader().readLine(new Character('*'));
        log.log(Level.INFO, "Please confirm your new password : ");
        newPassword2 = new ConsoleReader().readLine(new Character('*'));

        if (!newPassword2.equalsIgnoreCase(newPassword)) {
            log.log(Level.SEVERE, "The password confirmation is incorrect! Please retry!");
            return null;
        }

        Map<String, String> parameters = new HashMap<>();

        parameters.put("password", oldPassword);
        parameters.put("newPassword", newPassword);
        restUtils.sendPutCommand(authentificationUtils.finalHost + "/user/change-password",
                authentificationUtils.getMap(), parameters);
        log.log(Level.INFO, "Your password was successfully changed");

        statusCommand.setExitStatut(0);
    } catch (ResourceAccessException e) {
        log.log(Level.SEVERE,
                "The CLI can't etablished connexion with host servers. Please try later or contact an admin");
        statusCommand.setExitStatut(1);
        return null;
    } catch (Exception e) {
        statusCommand.setExitStatut(1);
        return null;
    }
    return null;
}

From source file:com.jsmartframework.web.manager.AuthEncrypter.java

static String decrypt(HttpServletRequest request, String key, Object value) {
    if (key != null && value != null) {
        try {// ww w  .  ja v a2 s .  com
            byte[] decoded = Base64.decodeBase64(value.toString());
            return new String(getDecryptCipher(request, key).doFinal(decoded), "UTF8");
        } catch (Exception ex) {
            LOGGER.log(Level.INFO, "Failed to decrypt value [" + value + "]: " + ex.getMessage());
        }
        return value.toString();
    }
    return null;
}

From source file:eu.edisonproject.classification.tfidf.mapreduce.TFIDFDriverImpl.java

/**
 *
 * @param inputPath/*from   w  w w.ja va2  s  .com*/
 */
public void executeTFIDF(String inputPath) {
    try {
        File items = new File(INPUT_ITEMSET);
        if (!items.exists()) {
            throw new IOException(items.getAbsoluteFile() + " not found");
        }

        String OUTPUT_PATH1 = System.currentTimeMillis() + "_" + UUID.randomUUID()
                + "-TFIDFDriverImpl-1-word-freq";

        if (items.length() < 200000000) {
            String AVRO_FILE = System.currentTimeMillis() + "_" + UUID.randomUUID() + "-TFIDFDriverImpl-avro";
            Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.INFO, "Starting text2Avro");
            text2Avro(inputPath, AVRO_FILE);

            Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.INFO,
                    "Starting WordFrequencyInDocDriver: {0},{1},{2},{3},{4}",
                    new Object[] { AVRO_FILE, OUTPUT_PATH1, INPUT_ITEMSET, NUM_OF_LINES, STOPWORDS_PATH });
            String[] args1 = { AVRO_FILE, OUTPUT_PATH1, INPUT_ITEMSET, STOPWORDS_PATH };
            ToolRunner.run(new WordFrequencyInDocDriver(), args1);
        } else {
            Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.INFO, "Starting TermWordFrequency");
            String[] args1 = { INPUT_ITEMSET, OUTPUT_PATH1, inputPath, STOPWORDS_PATH, NUM_OF_LINES };
            ToolRunner.run(new TermWordFrequency(), args1);
        }
        String OUTPUT_PATH2 = System.currentTimeMillis() + "_" + UUID.randomUUID()
                + "-TFIDFDriverImpl-2-word-counts";
        ;
        String[] args2 = { OUTPUT_PATH1, OUTPUT_PATH2 };
        ToolRunner.run(new WordCountsForDocsDriver(), args2);

        File docs = new File(inputPath);
        File[] files = docs.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.toLowerCase().endsWith(".txt");
            }
        });
        Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.INFO, "docs:{0}", docs.getAbsolutePath());
        int numberOfDocuments = files.length;
        String OUTPUT_PATH3 = System.currentTimeMillis() + "_" + UUID.randomUUID()
                + "-TFIDFDriverImpl-3-tf-idf";
        String[] args3 = { OUTPUT_PATH2, OUTPUT_PATH3, String.valueOf(numberOfDocuments) };
        ToolRunner.run(new WordsInCorpusTFIDFDriver(), args3);

        StringBuilder fileNames = new StringBuilder();
        String prefix = "";
        for (File name : files) {
            if (name.isFile() && FilenameUtils.getExtension(name.getName()).endsWith("txt")) {
                fileNames.append(prefix);
                prefix = ",";
                fileNames.append(FilenameUtils.removeExtension(name.getName()).replaceAll("_", ""));
            }
        }
        String OUTPUT_PATH4 = System.currentTimeMillis() + "_" + UUID.randomUUID()
                + "-TFIDFDriverImpl-4-distances";
        String[] args4 = { OUTPUT_PATH3, OUTPUT_PATH4, COMPETENCES_PATH, fileNames.toString() };
        Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.INFO, "args4:{0}", Arrays.toString(args4));
        ToolRunner.run(new CompetencesDistanceDriver(), args4);

        Configuration conf = new Configuration();
        FileSystem fs = FileSystem.get(conf);
        Path hdfsRes = new Path(OUTPUT_PATH4);
        FileStatus[] results = fs.listStatus(hdfsRes);
        for (FileStatus s : results) {
            Path dest = new Path(OUT + "/" + s.getPath().getName());
            Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.INFO, "Copy: {0} to: {1}",
                    new Object[] { s.getPath(), dest });
            fs.copyToLocalFile(s.getPath(), dest);
        }
        fs.delete(hdfsRes, true);

    } catch (Exception ex) {
        Logger.getLogger(TFIDFDriverImpl.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:neembuu.uploader.external.CheckMajorUpdate.java

/**
 * /*from   w w  w. j a v a 2  s  .co  m*/
 * @return whether the NeembuuUploader is uptodate or not. If not, launch Update Notification window..
 */
public boolean isCurrentVersion() {
    //Get the version.xml and read the version value.

    try {
        String respxml = local_version_xml;
        availablever = getVersionFromXML(respxml);
        notificationdate = notificationDate(respxml);
        NULogger.getLogger().log(Level.INFO, "Available version: {0}", availablever);
        NULogger.getLogger().log(Level.INFO, "Notification date : {0}", new Date(notificationdate));

        NULogger.getLogger().log(Level.INFO, "Current version: {0}", currentver);
        NULogger.getLogger().log(Level.INFO, "Current date : {0}", new Date(System.currentTimeMillis()));

        //Compare both
        if (availablever > currentver) {
            return false;
        }
    } catch (Exception ex) {
        NULogger.getLogger().log(Level.INFO, "Exception while checking update\n{0}", ex);
    }
    return true;
}

From source file:com.neophob.sematrix.core.output.ArtnetDevice.java

/**
 * /*from   w ww. j av a  2  s . c om*/
 * @param controller
 */
public ArtnetDevice(ApplicationConfigurationHelper ph, int nrOfScreens) {
    super(OutputDeviceEnum.ARTNET, ph, 8, nrOfScreens);

    this.displayOptions = ph.getArtNetDevice();

    //Get dmx specific config
    this.pixelsPerUniverse = ph.getArtNetPixelsPerUniverse();
    try {
        this.targetAdress = InetAddress.getByName(ph.getArtNetIp());
        this.firstUniverseId = ph.getArtNetStartUniverseId();
        calculateNrOfUniverse();

        this.artnet = new ArtNet();
        String broadcastAddr = ph.getArtNetBroadcastAddr();
        if (StringUtils.isBlank(broadcastAddr)) {
            broadcastAddr = ArtNetServer.DEFAULT_BROADCAST_IP;
        }

        LOG.log(Level.INFO, "Initialize ArtNet device IP: {0}, broadcast IP: {1}, Port: {2}",
                new Object[] { this.targetAdress.toString(), broadcastAddr, ArtNetServer.DEFAULT_PORT });

        this.artnet.init();
        this.artnet.setBroadCastAddress(broadcastAddr);
        this.artnet.start();
        this.artnet.getNodeDiscovery().addListener(this);
        this.artnet.startNodeDiscovery();

        this.initialized = true;
        LOG.log(Level.INFO, "ArtNet device initialized, use " + this.displayOptions.size() + " panels");

    } catch (BindException e) {
        LOG.log(Level.WARNING, "\nFailed to initialize ArtNet device:", e);
        LOG.log(Level.WARNING, "Make sure no ArtNet Tools like DMX-Workshop are running!\n\n");
    } catch (Exception e) {
        LOG.log(Level.WARNING, "Failed to initialize ArtNet device:", e);
    }
}

From source file:com.shin1ogawa.appengine.marketplace.controller.SetupForAdminController.java

@Override
protected Navigation setUp() {
    domain = asString("domain");
    callback = asString("callback");
    if (StringUtils.isEmpty(callback)) {
        callback = sessionScope("callback");
        removeSessionScope("callback");
    }// w  w w  .jav a2  s  . co  m
    if (StringUtils.isEmpty(callback)) {
        // from 'Addional Setup' in cpanel.
        callback = "https://www.google.com/a/cpanel/" + domain + "/PikeplaceAppSettings?appId="
                + Configuration.get().getMarketplaceAppId() + "&licenseNamespace=PACKAGE_GAIAID";
    }
    if (StringUtils.isEmpty(domain) || StringUtils.isEmpty(callback)) {
        return redirect(Configuration.get().getMarketplaceListingUrl());
    }
    UserService us = UserServiceFactory.getUserService();
    if (us.isUserLoggedIn() == false) {
        // if user had not been authenticated then send redirect to login url.
        String callbackURL = request.getRequestURL() + "?domain=" + domain;
        sessionScope("callback", callback);
        logger.log(Level.INFO, "had not been authenticated: callback=" + callbackURL);
        return redirect(us.createLoginURL(callbackURL, domain,
                "https://www.google.com/accounts/o8/site-xrds?hd=" + domain, null));
    }
    if (StringUtils.contains(us.getCurrentUser().getFederatedIdentity(), domain) == false) {
        // if user had been authenticated but invalid domain then send redirect to logout url.
        sessionScope("callback", callback);
        String callbackURL = request.getRequestURL() + "?domain=" + domain;
        logger.log(Level.INFO, "invalid domain: callback=" + callbackURL);
        return redirect(us.createLogoutURL(callbackURL, domain));
    }
    delegate = IncreaseURLFetchDeadlineDelegate.install();
    NamespaceManager.set(domain);
    return super.setUp();
}

From source file:com.google.enterprise.connector.salesforce.security.BaseAuthorizationManager.java

/**
 * Initialize the authentication manager and pass in the connector
 * that is in context//w  ww. j a v a 2  s  .  c  o m
 * @param connector the Connector object that is in context
 */
public BaseAuthorizationManager(BaseConnector connector) {
    logger = Logger.getLogger(this.getClass().getPackage().getName());
    logger.log(Level.INFO, " SalesForceAuthorizationManager initializing");
    this.connector = connector;
}