Source Code Cross Referenced for LogService.java in  » Web-Services » restlet-1.0.8 » org » restlet » service » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » restlet 1.0.8 » org.restlet.service 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005-2007 Noelios Consulting.
003:         * 
004:         * The contents of this file are subject to the terms of the Common Development
005:         * and Distribution License (the "License"). You may not use this file except in
006:         * compliance with the License.
007:         * 
008:         * You can obtain a copy of the license at
009:         * http://www.opensource.org/licenses/cddl1.txt See the License for the specific
010:         * language governing permissions and limitations under the License.
011:         * 
012:         * When distributing Covered Code, include this CDDL HEADER in each file and
013:         * include the License file at http://www.opensource.org/licenses/cddl1.txt If
014:         * applicable, add the following below this CDDL HEADER, with the fields
015:         * enclosed by brackets "[]" replaced with your own identifying information:
016:         * Portions Copyright [yyyy] [name of copyright owner]
017:         */
018:
019:        package org.restlet.service;
020:
021:        /**
022:         * Service providing access logging service. The implementation is fully based
023:         * on the standard logging mechanism introduced in JDK 1.4.<br>
024:         * <br>
025:         * The default access log format follows the <a
026:         * href="http://www.w3.org/TR/WD-logfile.html"> W3C Extended Log File Format</a>
027:         * with the following fields used: <br/>
028:         * <ol>
029:         * <li>Date (YYYY-MM-DD)</li>
030:         * <li>Time (HH:MM:SS)</li>
031:         * <li>Client address (IP)</li>
032:         * <li>Remote user identifier (see RFC 1413)</li>
033:         * <li>Server address (IP)</li>
034:         * <li>Server port</li>
035:         * <li>Method (GET|POST|...)</li>
036:         * <li>Resource reference path (including the leading slash)</li>
037:         * <li>Resource reference query (excluding the leading question mark)</li>
038:         * <li>Response status code</li>
039:         * <li>Number of bytes sent</li>
040:         * <li>Number of bytes received</li>
041:         * <li>Time to serve the request (in milliseconds)</li>
042:         * <li>Host reference</li>
043:         * <li>Client agent name</li>
044:         * <li>Referrer reference</li>
045:         * </ol>
046:         * <br>
047:         * <br>
048:         * If you use <a href="http://www.analog.cx">Analog</a> to generate your log
049:         * reports, and if you use the default log format, then you can simply specify
050:         * this string as a value of the LOGFORMAT command:
051:         * (%Y-%m-%d\t%h:%n:%j\t%S\t%u\t%j\t%j\t%j\t%r\t%q\t%c\t%b\t%j\t%T\t%v\t%B\t%f)<br/>
052:         * <br>
053:         * For custom access log format, see the syntax to use and the list of available
054:         * variable names in {@link org.restlet.util.Template}. <br>
055:         * 
056:         * @see <a href="http://www.restlet.org/documentation/1.0/tutorial#part07">Tutorial: Access
057:         *      logging</a>
058:         * @see <a
059:         *      href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/package-summary.html">java.util.logging</a>
060:         * @author Jerome Louvel (contact@noelios.com)
061:         */
062:        public class LogService {
063:            /** Indicates if the service has been enabled. */
064:            private boolean enabled;
065:
066:            /** The access logger name. */
067:            private String loggerName;
068:
069:            /** The log entry format. */
070:            private String logFormat;
071:
072:            /** Indicates if the identity check (as specified by RFC1413) is enabled. */
073:            private boolean identityCheck;
074:
075:            /**
076:             * Constructor.
077:             * 
078:             * @param enabled
079:             *            True if the service has been enabled.
080:             */
081:            public LogService(boolean enabled) {
082:                this .loggerName = null;
083:                this .enabled = enabled;
084:                this .logFormat = null;
085:                this .identityCheck = false;
086:            }
087:
088:            /**
089:             * Returns the format used.
090:             * 
091:             * @return The format used, or null if the default one is used.
092:             * @see org.restlet.util.Template for format syntax and variables.
093:             */
094:            public String getLogFormat() {
095:                return this .logFormat;
096:            }
097:
098:            /**
099:             * Returns the name of the JDK's logger to use when logging calls.
100:             * 
101:             * @return The name of the JDK's logger to use when logging calls.
102:             */
103:            public String getLoggerName() {
104:                return this .loggerName;
105:            }
106:
107:            /**
108:             * Indicates if the service should be enabled.
109:             * 
110:             * @return True if the service should be enabled.
111:             */
112:            public boolean isEnabled() {
113:                return this .enabled;
114:            }
115:
116:            /**
117:             * Indicates if the identity check (as specified by RFC1413) is enabled.
118:             * Default value is false.
119:             * 
120:             * @return True if the identity check is enabled.
121:             */
122:            public boolean isIdentityCheck() {
123:                return this .identityCheck;
124:            }
125:
126:            /**
127:             * Sets the format to use when logging calls. The default format matches the
128:             * one of IIS 6.
129:             * 
130:             * @param format
131:             *            The format to use when loggin calls.
132:             * @see org.restlet.util.Template for format syntax and variables.
133:             */
134:            public void setLogFormat(String format) {
135:                this .logFormat = format;
136:            }
137:
138:            /**
139:             * Sets the name of the JDK's logger to use when logging calls.
140:             * 
141:             * @param name
142:             *            The name of the JDK's logger to use when logging calls.
143:             */
144:            public void setLoggerName(String name) {
145:                this .loggerName = name;
146:            }
147:
148:            /**
149:             * Indicates if the service should be enabled.
150:             * 
151:             * @param enabled
152:             *            True if the service should be enabled.
153:             */
154:            public void setEnabled(boolean enabled) {
155:                this .enabled = enabled;
156:            }
157:
158:            /**
159:             * Indicates if the identity check (as specified by RFC1413) is enabled.
160:             * 
161:             * @param enabled
162:             *            True if the identity check is enabled.
163:             */
164:            public void setIdentityCheck(boolean enabled) {
165:                this.identityCheck = enabled;
166:            }
167:
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.