cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > LogBrowser - System architectural design
Date Sun, 22 Aug 2010 18:04:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF20DOC/LogBrowser+-+System+architectural+design">LogBrowser
- System architectural design</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~tomekopo">Tomasz
Oponowicz</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="LogBrowser-Systemarchitecturaldesign-Systemarchitecturaldesign"></a>System
architectural design</h1>

<h2><a name="LogBrowser-Systemarchitecturaldesign-Definitions"></a>Definitions</h2>

<ul>
	<li><b>BootstrapStorage</b> is service that provide list of user's subscribed
feeds;</li>
	<li><b>LogsServer</b> is independent application, which publishes <tt>AtomPullServer</tt>
and <tt>BootstrapStorage</tt> endpoints. It contains web server that delivers
content, such as HTML, JS or CSS files;</li>
</ul>


<h2><a name="LogBrowser-Systemarchitecturaldesign-ChosenSystemArchitecture"></a>Chosen
System Architecture</h2>

<p>There is only one application, which publishes <tt>AtomPullServer</tt>
and <tt>BootstrapStorage</tt> endpoints in intranet – application has “administrative
roles”. This application has to include web server for serving content. If you want add
logging for another application in intranet, you must define <tt>AtomPushBean</tt>
in this application. <tt>AtomPushBean</tt> will send events to <tt>AtomPullServer</tt>.
User mange list of feeds by himself – he must know URL of endpoint to add new feed. </p>

<p><span class="error">Unable to render embedded object: File (centralisedStructure.png)
not found.</span></p>

<p><b>Advantages</b></p>

<ul>
	<li>Natural solution;</li>
	<li>New features can be easily added;</li>
	<li>User's settings are stored remotely;</li>
</ul>


<p><b>Disadvantages</b></p>

<ul>
	<li>Application with “administrative roles” executes additional task - worse performance;</li>
</ul>


<h2><a name="LogBrowser-Systemarchitecturaldesign-DiscussionofAlternativeDesigns"></a>Discussion
of Alternative Designs</h2>

<h3><a name="LogBrowser-Systemarchitecturaldesign-Centralizedstructurewithlogsserver"></a>Centralized
structure with logs server</h3>

<p>It is extension of previous concept. <tt>AtomPullServer</tt> and <tt>BootstrapStorage</tt>
has been moved to  independent application, LogsServer. Additionally LogsServer include web
server. All applications communicate with LogsServer through <tt>AtomPushBean</tt>.
This can be easily done by adding new module to CXF project, which will use <tt>AtomPullServer</tt>
and <tt>BootstrapStorage</tt> and will compile to WAR package.</p>


<p><span class="error">Unable to render embedded object: File (centralisedStructureWithLogServer.png)
not found.</span></p>

<p><b>Advantages</b></p>

<ul>
	<li>Natural solution;</li>
	<li>New features can be easily added;</li>
	<li>User's settings are stored remotely;</li>
	<li>Applications don't execute additional task;</li>
	<li>LogsServer can be easily updated to new version;</li>
</ul>


<p><b>Disadvantages</b></p>

<ul>
	<li>User must configure and deploy LogsServer (however it isn't a big deal, but it
is an additional step)</li>
</ul>


<h3><a name="LogBrowser-Systemarchitecturaldesign-Decentralizedstructurewithlogsbrowserbasedonstandaloneapplication"></a>Decentralized
structure with logs browser based on standalone application</h3>

<p>Logs browser is implemented using Swing library. User mange list of feeds by himself
– he must know URL of endpoint to add new feed. </p>

<p><span class="error">Unable to render embedded object: File (decentralisedStructure.png)
not found.</span></p>

<p><b>Advantages</b></p>

<ul>
	<li>Logs browser can work offline;</li>
	<li>Subscribed feeds and user credentials can be stored locally;</li>
	<li>A load is evenly distributed;</li>
</ul>


<p><b>Disadvantages</b></p>

<ul>
	<li>It is hard to distribute and update application (logs browser);</li>
	<li>Java Runtime Environment has to be installed;</li>
</ul>


<h3><a name="LogBrowser-Systemarchitecturaldesign-Decentralizedstructurewithlogsbrowserbasedonwebapplication"></a>Decentralized
structure with logs browser based on web application</h3>

<p>User mange list of feeds by himself – he must know URL of endpoint to add new feed.
Required files (HTML, JS and CSS) are retrieved from any available web server.</p>

<p><span class="error">Unable to render embedded object: File (decentralisedStructure.png)
not found.</span></p>

<p><b>Advantages</b></p>

<ul>
	<li>Logs browser can work offline;</li>
	<li>A load is evenly distributed;</li>
</ul>


<p><b>Disadvantages</b></p>

<ul>
	<li>Internet browsers block connection to different host than host specified in address
bar;</li>
	<li>Local storage function, introduced in HTML 5, isn't adopt by all internet browser
(ex. Internet Explorer);</li>
</ul>


<h1><a name="LogBrowser-Systemarchitecturaldesign-Detaildescriptionofcomponents"></a>Detail
description of components</h1>

<h2><a name="LogBrowser-Systemarchitecturaldesign-LogBrowser"></a>LogBrowser</h2>

<p>The LogBrowser component is rich internet applications (RIAs). It will have complex
graphical user interface with the possibility of adapting to the user's requirements. The
LogBrowser component will be made using HTML, CSS and JavaScript for fully compatible with
all leading web browsers.</p>

<p>Main feature of the LogBrowser component is browsing log entries, which are published
by <tt>AtomPullServer</tt> components. Searching log entries is extension to browsing.
It is done by building proper request, which is compatible with FIQL format. Additionally
user's settings are saving (or optionally recovering) using the <tt>BootstrapStorage</tt>
component. </p>

<p>Communication between components will be done with RESTful web services. Data exchange
will be asynchronous - without blocking user' actions.</p>

<p>The LogBrowser component will support internationalization.</p>

<h3><a name="LogBrowser-Systemarchitecturaldesign-Technology"></a>Technology</h3>

<p>The component will be implemented based on <a href="http://code.google.com/webtoolkit/"
class="external-link" rel="nofollow">Google Web Toolkit</a> (GWT) library. Initially
we planned to implement component using <a href="http://jquery.com/" class="external-link"
rel="nofollow">JQuery</a> and <a href="http://jqueryui.com/" class="external-link"
rel="nofollow">JQuery UI</a> library, but after analyzing complexity of the project
and needs of the Apache CXF community, we decided to use GWT library. This decision has a
couple of advantages:</p>

<ul>
	<li>Component will be implemented using Java language. Next GWT will translate it into
JavaScript language. It is the most important feature for Apache CXF community, that main
programming language is Java. Additionally translated code is <a href="http://code.google.com/webtoolkit/doc/latest/DevGuideOptimizing.html"
class="external-link" rel="nofollow">optimized for better performance</a>.</li>
	<li>Unit tests for presentation layer are created using JUnit library. In the case
of JQuery library, unit tests are created using QUnit library and JavaScript language. There
are also problems with execute them (result depending on web browser).</li>
	<li>Big group of ready to use <a href="http://code.google.com/webtoolkit/doc/latest/RefWidgetGallery.html"
class="external-link" rel="nofollow">widgets</a>. There is no need to create own
custom widgets.</li>
	<li>Build in support for internationalization.</li>
</ul>


<h3><a name="LogBrowser-Systemarchitecturaldesign-Storingsettings"></a>Storing
settings</h3>

<p>One of the feature of the LogBrowser component is to store locally user's settings
(endpoint configuration, user credentials etc.). Unfortunately GWT doesn't support local storage.
For this reason we will use <a href="http://www.dojotoolkit.org/" class="external-link"
rel="nofollow">DojoCore</a>. More precisely, we will use <a href="http://en.wikipedia.org/wiki/Dojo_Toolkit#Client-side_data_storage"
class="external-link" rel="nofollow">DojoStorage</a> module, which is part of DojoCore.</p>

<p>Dojo Storage allows web applications to store data on the client-side, persistently
and securely and with a user's permission. It works across existing web browsers, including
Internet Explorer, Firefox, and Safari. When included in a web page, Dojo Storage determines
the best method for persistently storing information. On Firefox 2, it uses native browser
persistence; on other browsers it uses a hidden Flash applet. With Flash 6+ being installed
<a href="http://www.adobe.com/products/player_census/flashplayer/version_penetration.html"
class="external-link" rel="nofollow">on about 95%</a> of computers connected to the
web, this makes the storage mechanism accessible for much of the web's installed base.</p>

<p>If web browser doesn't support any local storage solution, the LogBrowser component
will store settings in operating memory. Settings will be available all the time during application
life. If user close web browser and run application again, settings will be restored from
the <tt>BootstrapStorage</tt> component.</p>

<p>Following diagrams show loading and modifying settings algorithm.</p>


<p><span class="error">Unable to render embedded object: File (loadingSettings.png)
not found.</span></p>

<p><span class="error">Unable to render embedded object: File (modifyingSettings.png)
not found.</span></p>

<h3><a name="LogBrowser-Systemarchitecturaldesign-Accesscontrol"></a>Access
control</h3>

<p><tt>AtomPullServer</tt> and <tt>BootstrapStorage</tt> components
publish their API through RESTful web services. Access control for <tt>AtomPullServer</tt>
is optional. However access control for <tt>BootstrapStorage</tt> is required.
On the other hand access control for these components will be implemented in the same way
- using WSSE UsernameToken.</p>

<p>Data required for authorization will be send through <a href="http://www.xml.com/pub/a/2003/12/17/dive.html"
class="external-link" rel="nofollow">HTTP header</a>, for example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Default; brush: java; gutter:
false"><![CDATA[
POST /atom.cgi HTTP/1.1
Host: bob.example.com
Content-Type: application/atom+xml
Authorization: WSSE profile="UsernameToken"
X-WSSE: UsernameToken Username="bob", PasswordDigest="quR/EWLAV4xLf9Zqyw4pDmfV9OY=", 
Nonce="d36e316282959a9ed4c89851497a717f", Created="2003-12-15T14:43:07Z"
]]></script>
</div></div>

<p>When authorization fail, web service will response like this:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Default; brush: java; gutter:
false"><![CDATA[
HTTP/1.1 401 Unauthorized
WWW-Authenticate: WSSE realm="foo", profile="UsernameToken"
]]></script>
</div></div>

<p>Authorization process use UsernameTokenInterceptor.</p>

<p>Following diagrams show executed operation during access control for <tt>AtomPullServer</tt>
and <tt>BootstrapStorage</tt> components.</p>

<p><span class="error">Unable to render embedded object: File (aps_accessControl.png)
not found.</span></p>

<p><span class="error">Unable to render embedded object: File (bs_accessControl.png)
not found.</span></p>

<h3><a name="LogBrowser-Systemarchitecturaldesign-Browsing%2Csearchinglogentries"></a>Browsing,
searching log entries</h3>

<p>Following diagrams show executed operation during browsing and searching log entries.</p>


<p><span class="error">Unable to render embedded object: File (browsingLogEntries.png)
not found.</span></p>

<p><span class="error">Unable to render embedded object: File (searchingLogEntries.png)
not found.</span></p>

<h2><a name="LogBrowser-Systemarchitecturaldesign-AtomPullServer"></a>AtomPullServer</h2>

<p>The <tt>AtomPullServer</tt> component manage log entries. The component
catch new log entries through registered interceptor. There can be defined many <tt>AtomPullServer</tt>
in your application - each one catching different kind of log entry. Communication with the
component is done through RESTful web service. </p>

<p>Currently the <tt>AtomPullServer</tt> component support only XML MIME
type. JSON type support have to be added. Additionally FIQL format support have to be added
for selected operations. </p>

<p>The component's RESTful web service contains operations like this:</p>

<ul>
	<li><b>getXmlFeedWithPage</b> - Operation return list of log entries. Results
are paging. If request is in FIQL format, operation will return list of log entries, which
matching to arguments. Operation will support XML and JSON MIME type.</li>
	<li><b>getNumberOfAvailableRecords</b> - Operation return count of all
log entries. If request is in FIQL format, operation will return count of log entries, which
matching to arguments. Operation will support XML and JSON MIME type.</li>
	<li><b>getEntry</b> - Operation return single log entry. Operation will
support XML and JSON MIME type.</li>
</ul>


<h2><a name="LogBrowser-Systemarchitecturaldesign-BootstrapStorage"></a>BootstrapStorage</h2>

<p>The <tt>BootstrapStorage</tt> store user's settings. It is required to
define access control for this component. Settings will be stored in external data source.
We will deliver basic implementation for storing settings in XML file - user name must be
unique, because it will be key. The <tt>BootstrapStorage</tt> component will not
store user credentials, because of security issues. Communication with the component will
be done through RESTful web service. There can be defined only one <tt>BootstrapStorage</tt>
in your application.</p>

<p>The component's RESTful web service will contain operations like this:</p>

<ul>
	<li><b>setSettings</b> - Operation will save user's settings to external
data source. Operation will support JSON MIME type.</li>
	<li><b>getSettings</b> - Operation will load user's settings from external
data source. Operation will support JSON MIME type.</li>
</ul>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/LogBrowser+-+System+architectural+design">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/LogBrowser+-+System+architectural+design?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message