Java Doc for Encoder.java in  » Web-Services » restlet-1.0.8 » com » noelios » restlet » application » 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 » com.noelios.restlet.application 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.restlet.Filter
   com.noelios.restlet.application.Encoder

Encoder
public class Encoder extends Filter (Code)
Filter compressing entities. The best encoding is automatically selected based on the preferences of the client and on the encoding supported by NRE: GZip, Zip and Deflate.
If the org.restlet.resource.Representation has an unknown size, it will always be a candidate for encoding. Candidate representations need to respect media type criteria by the lists of accepted and ignored media types.
author:
   Lars Heuer (heuer[at]semagia.com) author:
   href="http://semagia.com/">Semagia
author:
   Jerome Louvel (contact@noelios.com) author:
   href="http://www.noelios.com">Noelios Consulting


Field Summary
final public static  intENCODE_ALL_SIZES
     Indicates if the encoding should always occur, regardless of the size.

Constructor Summary
public  Encoder(Context context)
     Constructor using the default media types and with Encoder.ENCODE_ALL_SIZES setting.
public  Encoder(Context context, boolean encodeInput, boolean encodeOutput, long minimumSize, List<MediaType> acceptedMediaTypes, List<MediaType> ignoredMediaTypes)
     Constructor.

Method Summary
public  voidafterHandle(Request request, Response response)
     Allows filtering after its handling by the target Restlet.
public  voidbeforeHandle(Request request, Response response)
     Allows filtering before its handling by the target Restlet.
public  booleancanEncode(Representation representation)
     Indicates if a representation can be encoded.
Parameters:
  representation - The representation to test.
public  Representationencode(ClientInfo client, Representation representation)
     Encodes a given representation if an encoding is supported by the client.
Parameters:
  client - The client preferences to use.
Parameters:
  representation - The representation to encode.
public  List<MediaType>getAcceptedMediaTypes()
     Returns the media types that should be encoded.
public  EncodinggetBestEncoding(ClientInfo client)
     Returns the best supported encoding for a given client.
Parameters:
  client - The client preferences to use.
public static  List<MediaType>getDefaultAcceptedMediaTypes()
     Returns the list of default encoded media types.
public static  List<MediaType>getDefaultIgnoredMediaTypes()
     Returns the list of default ignored media types.
public  List<MediaType>getIgnoredMediaTypes()
     Returns the media types that should be ignored.
public  longgetMinimumSize()
     Returns the minimum size a representation must have before compression is done.
public  booleanisEncodeRequest()
     Indicates if the request entity should be encoded.
public  booleanisEncodeResponse()
     Indicates if the response entity should be encoded.
public  voidsetEncodeRequest(boolean encodeRequest)
     Indicates if the request entity should be encoded.
public  voidsetEncodeResponse(boolean encodeResponse)
     Indicates if the response entity should be encoded.
public  voidsetMinimumSize(long mininumSize)
     Sets the minimum size a representation must have before compression is done.

Field Detail
ENCODE_ALL_SIZES
final public static int ENCODE_ALL_SIZES(Code)
Indicates if the encoding should always occur, regardless of the size.




Constructor Detail
Encoder
public Encoder(Context context)(Code)
Constructor using the default media types and with Encoder.ENCODE_ALL_SIZES setting. This constructor will only encode response entities after call handling.
Parameters:
  context - The context.



Encoder
public Encoder(Context context, boolean encodeInput, boolean encodeOutput, long minimumSize, List<MediaType> acceptedMediaTypes, List<MediaType> ignoredMediaTypes)(Code)
Constructor.
Parameters:
  context - The context.
Parameters:
  encodeInput - Indicates if the request entities should be encoded.
Parameters:
  encodeOutput - Indicates if the response entities should be encoded.
Parameters:
  minimumSize - The minimal size of the representation where compressionshould be used.
Parameters:
  acceptedMediaTypes - The media types that should be encoded.
Parameters:
  ignoredMediaTypes - The media types that should be ignored.




Method Detail
afterHandle
public void afterHandle(Request request, Response response)(Code)
Allows filtering after its handling by the target Restlet. Does nothing by default.
Parameters:
  request - The request to filter.
Parameters:
  response - The response to filter.



beforeHandle
public void beforeHandle(Request request, Response response)(Code)
Allows filtering before its handling by the target Restlet. Does nothing by default.
Parameters:
  request - The request to filter.
Parameters:
  response - The response to filter.



canEncode
public boolean canEncode(Representation representation)(Code)
Indicates if a representation can be encoded.
Parameters:
  representation - The representation to test. True if the call can be encoded.



encode
public Representation encode(ClientInfo client, Representation representation)(Code)
Encodes a given representation if an encoding is supported by the client.
Parameters:
  client - The client preferences to use.
Parameters:
  representation - The representation to encode. The encoded representation or the original one if no encodingsupported by the client.



getAcceptedMediaTypes
public List<MediaType> getAcceptedMediaTypes()(Code)
Returns the media types that should be encoded. The media types that should be encoded.



getBestEncoding
public Encoding getBestEncoding(ClientInfo client)(Code)
Returns the best supported encoding for a given client.
Parameters:
  client - The client preferences to use. The best supported encoding for the given call.



getDefaultAcceptedMediaTypes
public static List<MediaType> getDefaultAcceptedMediaTypes()(Code)
Returns the list of default encoded media types. This can be overriden by subclasses. By default, all media types are encoded (except those explicitely ignored). The list of default encoded media types.



getDefaultIgnoredMediaTypes
public static List<MediaType> getDefaultIgnoredMediaTypes()(Code)
Returns the list of default ignored media types. This can be overriden by subclasses. By default, all archive, audio, image and video media types are ignored. The list of default ignored media types.



getIgnoredMediaTypes
public List<MediaType> getIgnoredMediaTypes()(Code)
Returns the media types that should be ignored. The media types that should be ignored.



getMinimumSize
public long getMinimumSize()(Code)
Returns the minimum size a representation must have before compression is done. The minimum size a representation must have before compression isdone.



isEncodeRequest
public boolean isEncodeRequest()(Code)
Indicates if the request entity should be encoded. True if the request entity should be encoded.



isEncodeResponse
public boolean isEncodeResponse()(Code)
Indicates if the response entity should be encoded. True if the response entity should be encoded.



setEncodeRequest
public void setEncodeRequest(boolean encodeRequest)(Code)
Indicates if the request entity should be encoded.
Parameters:
  encodeRequest - True if the request entity should be encoded.



setEncodeResponse
public void setEncodeResponse(boolean encodeResponse)(Code)
Indicates if the response entity should be encoded.
Parameters:
  encodeResponse - True if the response entity should be encoded.



setMinimumSize
public void setMinimumSize(long mininumSize)(Code)
Sets the minimum size a representation must have before compression is done.
Parameters:
  mininumSize - The minimum size a representation must have before compressionis done.



Methods inherited from org.restlet.Filter
protected void afterHandle(Request request, Response response)(Code)(Java Doc)
protected void beforeHandle(Request request, Response response)(Code)(Java Doc)
protected void doHandle(Request request, Response response)(Code)(Java Doc)
public Restlet getNext()(Code)(Java Doc)
final public void handle(Request request, Response response)(Code)(Java Doc)
public boolean hasNext()(Code)(Java Doc)
public void setNext(Restlet next)(Code)(Java Doc)
public void setNext(Class<? extends Resource> targetClass)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.