cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomek...@apache.org
Subject svn commit: r1023577 - in /cxf/sandbox/logbrowser: distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/ rt/management-web/ rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/browser/ rt/mana...
Date Sun, 17 Oct 2010 20:52:51 GMT
Author: tomekopo
Date: Sun Oct 17 20:52:51 2010
New Revision: 1023577

URL: http://svn.apache.org/viewvc?rev=1023577&view=rev
Log:
Minor code style improvements

Modified:
    cxf/sandbox/logbrowser/distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/App.java
    cxf/sandbox/logbrowser/rt/management-web/README.txt
    cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/browser/Entry.java
    cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/settings/Credentials.java
    cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java
    cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java

Modified: cxf/sandbox/logbrowser/distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/App.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/App.java?rev=1023577&r1=1023576&r2=1023577&view=diff
==============================================================================
--- cxf/sandbox/logbrowser/distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/App.java
(original)
+++ cxf/sandbox/logbrowser/distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/App.java
Sun Oct 17 20:52:51 2010
@@ -35,32 +35,6 @@ import org.apache.cxf.management.web.log
 
 @Provider
 public class App extends Application {
-    private static final AtomPullServer LOGS;
-
-    static {
-        LOGS = new AtomPullServer();
-        LOGS.setLoggers("demo.logbrowser:DEBUG,org.apache.cxf.interceptor:INFO");
-        LOGS.init();
-    }
-
-    private static final AtomFeedProvider FEED = new AtomFeedProvider();
-    private static final AtomEntryProvider ENTRY = new AtomEntryProvider();
-
-    private static final BootstrapStorage BOOTSTRAP_STORAGE =
-        new BootstrapStorage(new SimpleXMLSettingsStorage());
-
-    private static final SimpleAuthenticationFilter AUTHENTICATION =
-        new SimpleAuthenticationFilter(new HashMap<String, String>() {
-            {
-                put("admin", "admin");
-            }
-        });
-
-    private static final BootstrapStorage.StaticFileProvider STATIC_FILE =
-        new BootstrapStorage.StaticFileProvider();
-
-    private static final BootstrapStorage.SettingsProvider SETTINGS =
-        new BootstrapStorage.SettingsProvider();
 
     @Override
     public Set<Class<?>> getClasses() {
@@ -70,13 +44,23 @@ public class App extends Application {
     @Override
     public Set<Object> getSingletons() {
         Set<Object> classes = new HashSet<Object>();
-        classes.add(LOGS);
-        classes.add(FEED);
-        classes.add(ENTRY);
-        classes.add(BOOTSTRAP_STORAGE);
-        classes.add(AUTHENTICATION);
-        classes.add(STATIC_FILE);
-        classes.add(SETTINGS);
+
+        AtomPullServer aps = new AtomPullServer();
+        aps.setLoggers("demo.logbrowser:DEBUG,org.apache.cxf.interceptor:INFO");
+        aps.init();
+        classes.add(aps);
+
+        classes.add(new AtomFeedProvider());
+        classes.add(new AtomEntryProvider());
+        classes.add(new BootstrapStorage(new SimpleXMLSettingsStorage()));
+        classes.add(new SimpleAuthenticationFilter(new HashMap<String, String>() {
+            {
+                put("admin", "admin");
+            }
+        }));
+        classes.add(new BootstrapStorage.StaticFileProvider());
+        classes.add(new BootstrapStorage.SettingsProvider());
+
         return classes;
     }
 }
\ No newline at end of file

Modified: cxf/sandbox/logbrowser/rt/management-web/README.txt
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/README.txt?rev=1023577&r1=1023576&r2=1023577&view=diff
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/README.txt (original)
+++ cxf/sandbox/logbrowser/rt/management-web/README.txt Sun Oct 17 20:52:51 2010
@@ -1,7 +1,19 @@
 Debug mode
 ----------
 
+Run application:
+
 1) To run LogBorwser in the debug mode, you must type in the terminal:
     mvn clean gwt:run -Pdev
 2) Open new browser's window and go to: 
-    http://127.0.0.1:8888/logbrowser/LogBrowser.html?gwt.codesvr=127.0.0.1:9997
\ No newline at end of file
+    http://127.0.0.1:8888/logbrowser/LogBrowser.html?gwt.codesvr=127.0.0.1:9997
+3) Use "admin", as login and password, to sign in.
+
+Configure settings:
+
+4) Add new endpoint with URL:
+    http://127.0.0.1:8888/log/logs
+5) Generate entry logs by interacting with URL:
+    http://127.0.0.1:8888/generate.html
+
+Enjoy!
\ No newline at end of file

Modified: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/browser/Entry.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/browser/Entry.java?rev=1023577&r1=1023576&r2=1023577&view=diff
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/browser/Entry.java
(original)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/browser/Entry.java
Sun Oct 17 20:52:51 2010
@@ -20,7 +20,6 @@
 package org.apache.cxf.management.web.logging.logbrowser.client.service.browser;
 
 import java.util.Date;
-
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
@@ -28,22 +27,63 @@ import com.google.gwt.i18n.client.DateTi
 import com.google.gwt.xml.client.Element;
 import com.google.gwt.xml.client.Node;
 import com.google.gwt.xml.client.NodeList;
+
 import static com.google.gwt.xml.client.Node.*;
 
+/**
+ * The class represents log record, which is parsed from DOM representation of {@link LogRecord}.
+ * <p/>
+ * Log record is single piece of information log by logger. For example:
+ * <code>
+ * <p/>
+ * </code>
+ *
+ * @see FeedProxy
+ */
 public class Entry {
+
+    /**
+     * short message
+     */
     private String title;
+
+    /**
+     * long message
+     */
     private String message;
+
+    /**
+     * level: 'DEBUG', 'INFO', 'WARN', 'ERROR'
+     */
     private String level;
+
+    /**
+     * error message and stack trace related with occured exception
+     */
     private String throwable;
+
+    /**
+     * date of occured
+     */
     private Date eventTimestamp;
 
     @Nonnull
     private final LazyXmlParser xmlParser;
 
+    /**
+     * Constructs a new <code>Entry</code> by convert DOM representation.
+     *
+     * @param entryNode XML node which represent entry (nonnull);
+     */
     public Entry(@Nonnull final Node entryNode) {
         xmlParser = new LazyXmlParser(entryNode);
     }
 
+    /**
+     * Returns short message of the log record.
+     *
+     * @return short message (nonull)
+     */
     @Nonnull
     public String getTitle() {
         if (title == null) {
@@ -52,6 +92,11 @@ public class Entry {
         return title;
     }
 
+    /**
+     * Returns long message of the log record.
+     *
+     * @return long message (nonull)
+     */
     @Nonnull
     public String getMessage() {
         if (message == null) {
@@ -60,14 +105,25 @@ public class Entry {
         return message;
     }
 
+    /**
+     * Returns level of the log record. Possible values: 'DEBUG', 'INFO', 'WARN', 'ERROR'.
+     *
+     * @return level (nonull)
+     */
     @Nonnull
     public String getLevel() {
         if (level == null) {
             level = avoidNull(xmlParser.getLevel());
         }
+
         return level;
     }
 
+    /**
+     * Returns error message and stack trace related with occured exception.
+     *
+     * @return error message and stack trace (nonull)
+     */
     @Nonnull
     public String getThrowable() {
         if (throwable == null) {
@@ -81,7 +137,7 @@ public class Entry {
         if (eventTimestamp == null) {
             eventTimestamp = xmlParser.getEventTimestamp();
         }
-        return eventTimestamp != null ? (Date) eventTimestamp.clone() : null;
+        return eventTimestamp != null ? (Date)eventTimestamp.clone() : null;
     }
 
     @Nonnull
@@ -118,14 +174,14 @@ public class Entry {
 
         @Nullable
         private Node getUniqueElementByTagName(@Nonnull final String tagName) {
-            NodeList nodes = ((Element) entryNode).getElementsByTagName(tagName);
+            NodeList nodes = ((Element)entryNode).getElementsByTagName(tagName);
             return nodes.getLength() == 1 ? nodes.item(0) : null;
         }
 
         @Nullable
         private String getTextValue(@Nonnull final Node node) {
             Node child = node.getFirstChild();
-            
+
             if (child != null && child.getNodeType() == TEXT_NODE) {
                 return child.getNodeValue();
             }

Modified: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/settings/Credentials.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/settings/Credentials.java?rev=1023577&r1=1023576&r2=1023577&view=diff
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/settings/Credentials.java
(original)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/service/settings/Credentials.java
Sun Oct 17 20:52:51 2010
@@ -49,9 +49,4 @@ public class Credentials {
     public String getPassword() {
         return password;
     }
-
-    // TODO remove if useless
-//    public boolean isEmpty() {
-//        return this == EMPTY;
-//    }
 }

Modified: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java?rev=1023577&r1=1023576&r2=1023577&view=diff
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java
(original)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java
Sun Oct 17 20:52:51 2010
@@ -31,7 +31,6 @@ import org.apache.cxf.management.web.log
 import org.apache.cxf.management.web.logging.logbrowser.client.event.SignOutEvent;
 import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Feed;
 import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.FeedProxyImpl;
-import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Links;
 import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.SettingsFacade;
 import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
 import org.apache.cxf.management.web.logging.logbrowser.client.ui.BasePresenter;
@@ -39,12 +38,15 @@ import org.apache.cxf.management.web.log
 import org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources;
 
 public class BrowsePresenter extends BasePresenter implements BrowseView.Presenter {
+
+    @Nonnull
     private final BrowseView view;
+
+    @Nonnull
     private final FeedProxyImpl proxy;
-    private final SettingsFacade settingsManager;
 
-    private Subscription selectedSubscription;
-    private Feed feed;
+    @Nonnull
+    private final SettingsFacade settingsManager;
 
     private List<Subscription> subscriptions;
 
@@ -54,6 +56,9 @@ public class BrowsePresenter extends Bas
     @Nonnull
     private final LogBrowserResources resources;
 
+    @Nonnull
+    private Feed feed;
+
     @Inject
     public BrowsePresenter(@Nonnull final EventBus eventBus,
                            @Nonnull final BrowseView view,
@@ -70,8 +75,8 @@ public class BrowsePresenter extends Bas
         this.resources = resources;
 
         this.view.setPresenter(this);
-        this.view.setLinks(Links.EMPTY);
-
+        
+        setFeed(Feed.EMPTY);
         updateSubscriptions();
     }
 
@@ -91,7 +96,7 @@ public class BrowsePresenter extends Bas
 
     public void onSubcriptionItemClicked(final int row) {
         assert row >= 0 && row < subscriptions.size();
-        selectedSubscription = subscriptions.get(row);
+        Subscription selectedSubscription = subscriptions.get(row);
         getFeed(selectedSubscription.getUrl());
     }
 

Modified: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java?rev=1023577&r1=1023576&r2=1023577&view=diff
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java
(original)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java
Sun Oct 17 20:52:51 2010
@@ -30,7 +30,7 @@ import com.google.gwt.user.client.ui.Com
 import com.google.gwt.user.client.ui.Widget;
 
 /**
- * A simple widget representing prev/next page navigation.
+ * A simple widget representing first, previous, refresh, next and last navigation links.
  */
 class NavigationLinks extends Composite {
 



Mime
View raw message