List of usage examples for java.util.logging Level INFO
Level INFO
To view the source code for java.util.logging Level INFO.
Click Source Link
From source file:com.minhthuong.pfi.controller.PFIEditController.java
protected void doHeaders(RenderRequest request, RenderResponse response) { log.log(Level.INFO, "doHeaders.START"); Element cssElement = response.createElement("link"); cssElement.setAttribute("href", response.encodeURL("http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css")); Element jsElement = response.createElement("script"); jsElement.setAttribute("src", response.encodeURL((request.getContextPath() + "/js/jquery.js"))); response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, jsElement); jsElement = response.createElement("script"); jsElement.setAttribute("src", response.encodeURL((request.getContextPath() + "/js/jquery.dataTables.js"))); response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, jsElement); }
From source file:maltcms.ui.fileHandles.properties.tools.PropertyLoader.java
/** * @param optionValues//w w w . j av a2s .com */ public static String[] getListServiceProviders(String optionValue) { List<String> ret = new ArrayList<>(); Class<?> c; try { c = Class.forName(optionValue); Logger.getLogger(PropertyLoader.class.getName()).log(Level.INFO, "Loading service: {0}", c.getName()); ServiceLoader<?> sl = ServiceLoader.load(c); for (Object o : sl) { if (o != null) { ret.add(o.getClass().getName()); } } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (Exception | Error e) { e.printStackTrace(); } if (ret.size() == 0) { return new String[] { "Can not find any Services for " + optionValue }; } else { return ret.toArray(new String[] {}); } }
From source file:hr.foi.sis.conf.PBKDF2AuthProvider.java
@Override public Authentication authenticate(Authentication a) throws AuthenticationException { String username = a.getName(); Logger.getLogger("Auth").log(Level.INFO, "POST on login username -- " + username); if (username == null) throw new BadCredentialsException("Username not found."); String password = (String) a.getCredentials(); Logger.getLogger("Auth").log(Level.INFO, "POST on password -- " + password); if (password == null) throw new BadCredentialsException("Password not found."); Logger.getLogger("Auth").log(Level.INFO, "Getting user from database"); UserSaltDetails user = userService.loadUserByUsername(username); Logger.getLogger("Auth").log(Level.INFO, "User get with username: " + user.getUsername()); Logger.getLogger("Auth").log(Level.INFO, "User get with password: " + user.getPassword()); String pw = user.getPassword(); Logger.getLogger("Auth").log(Level.INFO, "User get with salt : " + user.getUserSalt()); Logger.getLogger("Auth").log(Level.INFO, "User get with authorities : " + user.getAuthorities().toString()); boolean isAuthenticated = false; try {//www .ja v a 2 s. co m isAuthenticated = PBKDF2.authenticate(password, user.getPassword(), user.getUserSalt()); Logger.getLogger("Auth").log(Level.INFO, "Is true : " + isAuthenticated); } catch (NoSuchAlgorithmException ex) { Logger.getLogger(PBKDF2AuthProvider.class.getName()).log(Level.SEVERE, null, ex); } catch (InvalidKeySpecException ex) { Logger.getLogger(PBKDF2AuthProvider.class.getName()).log(Level.SEVERE, null, ex); } if (!isAuthenticated) throw new BadCredentialsException("Wrong password."); else Logger.getLogger("Auth").log(Level.INFO, "Authenticated"); return new UsernamePasswordAuthenticationToken(user, user.getPassword(), user.getAuthorities()); }
From source file:com.ChatEndpoint.java
@OnClose public void onClose(Session session) { String nick = (String) session.getUserProperties().get("nick"); ch.quitarUsuario(nick);/*w ww. ja va 2 s. c o m*/ log.log(Level.INFO, "conexion cerrada {0}", nick); }
From source file:cn.comgroup.tzmedia.server.util.mail.SendCloudMail.java
/** * Send email using SMTP server./*from ww w.j av a2 s. c o m*/ * * @param recipientEmail TO recipient * @param title title of the message * @param message message to be sent * connected state or if the message is not a MimeMessage */ public static void send(String recipientEmail, String title, String message) throws UnsupportedEncodingException, IOException { String url = "http://sendcloud.sohu.com/webapi/mail.send.json"; HttpClient httpclient = new DefaultHttpClient(); HttpPost httpost = new HttpPost(url); List nvps = new ArrayList(); // ??SendCloud????????????????? nvps.add(new BasicNameValuePair("api_user", "commobile_test_IxiZE1")); nvps.add(new BasicNameValuePair("api_key", "0tkHZ5vDdScYzRbn")); nvps.add(new BasicNameValuePair("from", "suport@tzzjmedia.net")); nvps.add(new BasicNameValuePair("to", recipientEmail)); nvps.add(new BasicNameValuePair("subject", title)); nvps.add(new BasicNameValuePair("html", message)); httpost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8")); // HttpResponse response = httpclient.execute(httpost); // ?? if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { // // ?xml String result = EntityUtils.toString(response.getEntity()); Logger.getLogger(SendCloudMail.class.getName()).log(Level.INFO, result); } else { System.err.println("error"); } }
From source file:edu.usu.sdl.openstorefront.service.manager.PluginManager.java
public static void init() { ServiceProxy service = ServiceProxy.getProxy(); //start any stopped bundles Bundle bundles[] = OsgiManager.getFelix().getBundleContext().getBundles(); for (Bundle bundle : bundles) { if (Bundle.INSTALLED == bundle.getState() || Bundle.RESOLVED == bundle.getState()) { log.log(Level.INFO, MessageFormat.format("Starting bundle: {0}", bundle.getLocation())); Plugin plugin = new Plugin(); plugin.setLocation(bundle.getLocation()); plugin = plugin.find();/* ww w .j a v a 2 s . c om*/ service.getPluginService().activatePlugin(plugin.getPluginId()); } } AddJobModel job = new AddJobModel(); job.setJobClass(PluginScanJob.class); job.setJobName(PluginScanJob.class.getSimpleName()); job.setDescription("Watch for plugin directory changes."); job.setSeconds(10); job.setRepeatForever(true); JobManager.addJob(job); }
From source file:com.elasticgrid.amazon.sdb.impl.SimpleDBImpl.java
public Domain createDomain(String name) throws SimpleDBException { try {//from ww w. j a v a 2 s . co m logger.log(Level.INFO, "Creating domain {0}", name); return new DomainImpl(sdb.createDomain(name)); } catch (SDBException e) { throw new SimpleDBException("Can't create domain " + name, e); } }
From source file:com.byraphaelmedeiros.autosubdown.AutoSubDown.java
/** * Efetua a leitura dos provedores e download dos arquivos *//*from ww w . j a v a2 s. com*/ public static void download() { LOGGER.log(Level.INFO, "Starting downloads..."); Config config = Config.getInstance(); config.load(); List<Provider> providers = config.getProviders(); if (!providers.isEmpty()) { LOGGER.log(Level.INFO, "Retrieving providers (twitter/rss)..."); Rule rule = null; for (Provider p : providers) { if (ProviderType.TWITTER.equals(p.getType())) { List<Tweet> userTimeline = TAPI.timelineOperations().getUserTimeline(p.getName()); if (userTimeline != null && !userTimeline.isEmpty()) { LOGGER.log(Level.INFO, "Recovering messages for " + StringUtils.capitalize(p.getName()) + "..."); String content = null; for (Tweet t : userTimeline) { content = t.getText(); //content = "Nova legenda disponivel: http://www.insubs.com/legendas/the.big.bang.theory.S02E09.DVDRip.xVid.InSubs.zip #AutoSubDown"; if (config.inRule(content)) { LOGGER.log(Level.INFO, "Valid message!"); rule = config.getRule(content); download(rule, content); if (rule.isTVShow()) { rule.addEpisodeDownloaded(rule.getEpisode(content)); config.save(); } } } } } else if (ProviderType.RSS.equals(p.getType())) { String title = null, link = null; try { ChannelIF rssChannel = FeedParser.parse(new ChannelBuilder(), new URL(p.getUrl())); Collection<ItemIF> items = rssChannel.getItems(); if (items != null && !items.isEmpty()) { LOGGER.log(Level.INFO, "Recovering messages for " + StringUtils.capitalize(p.getName()) + "..."); for (ItemIF item : items) { title = item.getTitle(); if (config.inRule(title)) { LOGGER.log(Level.INFO, "Valid message!"); rule = config.getRule(title); if (item.getLink() != null) { link = item.getLink().toString(); downloadTo(rule, link); extract(config, rule, link); if (rule.isTVShow()) { rule.addEpisodeDownloaded(rule.getEpisode(title)); config.save(); } } else { LOGGER.log(Level.INFO, "Invalid link!"); } } } } } catch (MalformedURLException e) { //e.printStackTrace(); LOGGER.log(Level.WARNING, "Invalid URL! (" + link + ")"); } catch (IOException e) { //e.printStackTrace(); LOGGER.log(Level.WARNING, "Invalid URL! (" + link + ")"); } catch (ParseException e) { //e.printStackTrace(); LOGGER.log(Level.WARNING, "Invalid URL! (" + link + ")"); } } } } /* List<SiteProvider> siteProviders = config.getSiteProviders(); if (!siteProviders.isEmpty()) { LOGGER.log(Level.INFO, "Retrieving site providers (websites)..."); try { Rule rule = null; HttpClient httpClient = new DefaultHttpClient(); HttpContext httpContext = new BasicHttpContext(); HttpPost httpPost = null; UrlEncodedFormEntity entityPost = null; HttpResponse httpResponse = null; HttpEntity entityResponse = null; String htmlContent = null; // action = login_verificar.php, txtLogin, txtSenha List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("param1", "value1")); params.add(new BasicNameValuePair("param2", "value2")); for (SiteProvider sp : siteProviders) { entityPost = new UrlEncodedFormEntity(params, "UTF-8"); httpPost = new HttpPost(sp.getUrlLoginAction()); httpPost.setEntity(entityPost); httpResponse = httpClient.execute(httpPost, httpContext); entityResponse = httpResponse.getEntity(); htmlContent = EntityUtils.toString(entityResponse); // pegar link do botao DOWNLOAD // executar link do botao DOWNLOAD e salvar o arquivo } } catch (UnsupportedEncodingException e) { e.printStackTrace(); //LOGGER.log(Level.WARNING, "Invalid URL! (" + link + ")"); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } */ LOGGER.log(Level.INFO, "Done!"); }
From source file:net.paulgray.bbrest.security.CourseFilter.java
private static String getCourseIdFromUrl(String url) { Integer beginCourseIndex = url.indexOf(COURSE_BEGIN_IDENTIFIER) + COURSE_BEGIN_IDENTIFIER.length(); Integer endCourseIndex = url.indexOf(COURSE_END_IDENTIFIER, beginCourseIndex); String id = url.substring(beginCourseIndex, endCourseIndex); Logger.getLogger(CourseFilter.class.getName()).log(Level.INFO, "got id: " + id + " from url: " + url); return id;//w w w .j a va 2s .c o m }
From source file:edu.uci.ics.asterix.test.runtime.ExecutionTest.java
@BeforeClass public static void setUp() throws Exception { System.out.println("Starting setup"); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Starting setup"); }//ww w . j a v a 2s. c o m System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME); File outdir = new File(PATH_ACTUAL); outdir.mkdirs(); AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor(); txnProperties = new AsterixTransactionProperties(apa); deleteTransactionLogs(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("initializing pseudo cluster"); } AsterixHyracksIntegrationUtil.init(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("initializing HDFS"); } HDFSCluster.getInstance().setup(); // Set the node resolver to be the identity resolver that expects node names // to be node controller ids; a valid assumption in test environment. System.setProperty(FileSystemBasedAdapter.NODE_RESOLVER_FACTORY_PROPERTY, IdentitiyResolverFactory.class.getName()); }