blob: 55213db4680d5fd24538c89934c72d7cedcea1ea [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<link type="text/css" rel="stylesheet" href="/resources/site.css">
<script src='/resources/space.js'></script>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
<meta name="description" content="Apache CXF, Services Framework - LogBrowser - System architectural design">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
<script src='/resources/highlighter/scripts/shCore.js'></script>
<script src='/resources/highlighter/scripts/shBrushBash.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
<title>
Apache CXF -- LogBrowser - System architectural design
</title>
</head>
<body onload="init()">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td id="cell-0-0" colspan="2">&nbsp;</td>
<td id="cell-0-1">&nbsp;</td>
<td id="cell-0-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-1-0">&nbsp;</td>
<td id="cell-1-1">&nbsp;</td>
<td id="cell-1-2">
<!-- Banner -->
<div class="banner" id="banner"><div><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
</td><td align="right" colspan="1" nowrap>
<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
</td></tr></table></div></div>
<!-- Banner -->
<div id="top-menu">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td>
<div align="left">
<!-- Breadcrumbs -->
<a href="logbrowser.html">LogBrowser</a>&nbsp;&gt;&nbsp;<a href="logbrowser-system-architectural-design.html">LogBrowser - System architectural design</a>
<!-- Breadcrumbs -->
</div>
</td>
<td>
<div align="right">
<!-- Quicklinks -->
<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a> | <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
<!-- Quicklinks -->
</div>
</td>
</tr>
</table>
</div>
</td>
<td id="cell-1-3">&nbsp;</td>
<td id="cell-1-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-2-0" colspan="2">&nbsp;</td>
<td id="cell-2-1">
<table>
<tr valign="top">
<td height="100%">
<div id="wrapper-menu-page-right">
<div id="wrapper-menu-page-top">
<div id="wrapper-menu-page-bottom">
<div id="menu-page">
<!-- NavigationBar -->
<div id="navigation"><ul class="alternate"><li><a shape="rect" href="overview.html">Overview</a></li><li><a shape="rect" href="how-tos.html">How-Tos</a></li><li><a shape="rect" href="frontends.html">Frontends</a></li><li><a shape="rect" href="databindings.html">DataBindings</a></li><li><a shape="rect" href="transports.html">Transports</a></li><li><a shape="rect" href="configuration.html">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html">Debugging and Logging</a></li><li><a shape="rect" href="tools.html">Tools</a></li><li><a shape="rect" href="restful-services.html">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html">Service Routing</a></li><li><a shape="rect" href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html">Advanced Integration</a></li><li><a shape="rect" href="deployment.html">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html">Use of Schemas and Namespaces</a></li></ul><hr><ul class="alternate"><li><p>Search</p></li></ul><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
<div>
<input type="hidden" name="cx" value="002890367768291051730:o99qiwa09y4">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" size="21">
<input type="submit" name="sa" value="Search">
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script><hr><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API 3.2.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul><p>&#160;</p><p><a shape="rect" class="external-link" href="http://www.apache.org/events/current-event.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.apache.org/events/current-event-125x125.png" data-image-src="http://www.apache.org/events/current-event-125x125.png"></span></a></p></div>
<!-- NavigationBar -->
</div>
</div>
</div>
</div>
</td>
<td height="100%">
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><h1 id="LogBrowserSystemarchitecturaldesign-Systemarchitecturaldesign">System architectural design</h1>
<h2 id="LogBrowserSystemarchitecturaldesign-Definitions">Definitions</h2>
<ul><li><strong>BootstrapStorage</strong> is service that provide list of user's subscribed feeds;</li><li><strong>LogsServer</strong> is independent application, which publishes <code>AtomPullServer</code> and <code>BootstrapStorage</code> endpoints. It contains web server that delivers content, such as HTML, JS or CSS files;</li></ul>
<h2 id="LogBrowserSystemarchitecturaldesign-ChosenSystemArchitecture">Chosen System Architecture</h2>
<p>There is only one application, which publishes <code>AtomPullServer</code> and <code>BootstrapStorage</code> endpoints in intranet &#8211; application has &#8220;administrative roles&#8221;. This application has to include web server for serving content. If you want add logging for another application in intranet, you must define <code>AtomPushBean</code> in this application. <code>AtomPushBean</code> will send events to <code>AtomPullServer</code>. User mange list of feeds by himself &#8211; he must know URL of endpoint to add new feed. </p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/centralisedStructure.png"></span></p>
<p><strong>Advantages</strong></p>
<ul><li>Natural solution;</li><li>New features can be easily added;</li><li>User's settings are stored remotely;</li></ul>
<p><strong>Disadvantages</strong></p>
<ul><li>Application with &#8220;administrative roles&#8221; executes additional task - worse performance;</li></ul>
<h2 id="LogBrowserSystemarchitecturaldesign-DiscussionofAlternativeDesigns">Discussion of Alternative Designs</h2>
<h3 id="LogBrowserSystemarchitecturaldesign-Centralizedstructurewithlogsserver">Centralized structure with logs server</h3>
<p>It is extension of previous concept. <code>AtomPullServer</code> and <code>BootstrapStorage</code> has been moved to independent application, LogsServer. Additionally LogsServer include web server. All applications communicate with LogsServer through <code>AtomPushBean</code>. This can be easily done by adding new module to CXF project, which will use <code>AtomPullServer</code> and <code>BootstrapStorage</code> and will compile to WAR package.</p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/centralisedStructureWithLogServer.png"></span></p>
<p><strong>Advantages</strong></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><strong>Disadvantages</strong></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 id="LogBrowserSystemarchitecturaldesign-Decentralizedstructurewithlogsbrowserbasedonstandaloneapplication">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 &#8211; he must know URL of endpoint to add new feed. </p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/decentralisedStructure.png"></span></p>
<p><strong>Advantages</strong></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><strong>Disadvantages</strong></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 id="LogBrowserSystemarchitecturaldesign-Decentralizedstructurewithlogsbrowserbasedonwebapplication">Decentralized structure with logs browser based on web application</h3>
<p>User mange list of feeds by himself &#8211; 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="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/decentralisedStructure.png"></span></p>
<p><strong>Advantages</strong></p>
<ul><li>Logs browser can work offline;</li><li>A load is evenly distributed;</li></ul>
<p><strong>Disadvantages</strong></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 id="LogBrowserSystemarchitecturaldesign-Detaildescriptionofcomponents">Detail description of components</h1>
<h2 id="LogBrowserSystemarchitecturaldesign-LogBrowser">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 <code>AtomPullServer</code> 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 <code>BootstrapStorage</code> 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 id="LogBrowserSystemarchitecturaldesign-Technology">Technology</h3>
<p>The component will be implemented based on <a shape="rect" class="external-link" href="http://code.google.com/webtoolkit/" rel="nofollow">Google Web Toolkit</a> (GWT) library. Initially we planned to implement component using <a shape="rect" class="external-link" href="http://jquery.com/" rel="nofollow">JQuery</a> and <a shape="rect" class="external-link" href="http://jqueryui.com/" 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 shape="rect" class="external-link" href="http://code.google.com/webtoolkit/doc/latest/DevGuideOptimizing.html" 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 shape="rect" class="external-link" href="http://code.google.com/webtoolkit/doc/latest/RefWidgetGallery.html" rel="nofollow">widgets</a>. There is no need to create own custom widgets.</li><li>Build in support for internationalization.</li></ul>
<h3 id="LogBrowserSystemarchitecturaldesign-Storingsettings">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 shape="rect" class="external-link" href="http://www.dojotoolkit.org/" rel="nofollow">DojoCore</a>. More precisely, we will use <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Dojo_Toolkit#Client-side_data_storage" 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 shape="rect" class="external-link" href="http://www.adobe.com/products/player_census/flashplayer/version_penetration.html" 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 <code>BootstrapStorage</code> component.</p>
<p>Following diagrams show loading and modifying settings algorithm.</p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/loadingSettings.png"></span></p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/modifyingSettings.png"></span></p>
<h3 id="LogBrowserSystemarchitecturaldesign-Accesscontrol">Access control</h3>
<p><code>AtomPullServer</code> and <code>BootstrapStorage</code> components publish their API through RESTful web services. Access control for <code>AtomPullServer</code> is optional. However access control for <code>BootstrapStorage</code> 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 shape="rect" class="external-link" href="http://www.xml.com/pub/a/2003/12/17/dive.html" rel="nofollow">HTTP header</a>, for example:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
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"
</pre>
</div></div>
<p>When authorization fail, web service will response like this:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">
HTTP/1.1 401 Unauthorized
WWW-Authenticate: WSSE realm="foo", profile="UsernameToken"
</pre>
</div></div>
<p>Authorization process use UsernameTokenInterceptor.</p>
<p>Following diagrams show executed operation during access control for <code>AtomPullServer</code> and <code>BootstrapStorage</code> components.</p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/aps_accessControl.png"></span></p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/bs_accessControl.png"></span></p>
<h3 id="LogBrowserSystemarchitecturaldesign-Browsing,searchinglogentries">Browsing, searching log entries</h3>
<p>Following diagrams show executed operation during browsing and searching log entries.</p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/browsingLogEntries.png"></span></p>
<p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-thumbnail confluence-content-image-border" src="logbrowser-system-architectural-design.data/searchingLogEntries.png"></span></p>
<h2 id="LogBrowserSystemarchitecturaldesign-AtomPullServer">AtomPullServer</h2>
<p>The <code>AtomPullServer</code> component manage log entries. The component catch new log entries through registered interceptor. There can be defined many <code>AtomPullServer</code> 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 <code>AtomPullServer</code> 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><strong>getXmlFeedWithPage</strong> - 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><strong>getNumberOfAvailableRecords</strong> - 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><strong>getEntry</strong> - Operation return single log entry. Operation will support XML and JSON MIME type.</li></ul>
<h2 id="LogBrowserSystemarchitecturaldesign-BootstrapStorage">BootstrapStorage</h2>
<p>The <code>BootstrapStorage</code> 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 <code>BootstrapStorage</code> 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 <code>BootstrapStorage</code> in your application.</p>
<p>The component's RESTful web service will contain operations like this:</p>
<ul><li><strong>setSettings</strong> - Operation will save user's settings to external data source. Operation will support JSON MIME type.</li><li><strong>getSettings</strong> - Operation will load user's settings from external data source. Operation will support JSON MIME type.</li></ul></div>
</div>
<!-- Content -->
</td>
</tr>
</table>
</td>
<td id="cell-2-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-3-0">&nbsp;</td>
<td id="cell-3-1">&nbsp;</td>
<td id="cell-3-2">
<div id="footer">
<!-- Footer -->
<div id="site-footer">
<a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a> -
(<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=23335743">edit page</a>)
(<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=23335743&amp;showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)<br>
Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
All other marks mentioned may be trademarks or registered trademarks of their respective owners.
</div>
<!-- Footer -->
</div>
</td>
<td id="cell-3-3">&nbsp;</td>
<td id="cell-3-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-4-0" colspan="2">&nbsp;</td>
<td id="cell-4-1">&nbsp;</td>
<td id="cell-4-2" colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4458903-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>