|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.service.Service
org.restlet.service.EncoderService
public class EncoderService
Application service automatically encoding or compressing request entities.
Field Summary | |
---|---|
static int |
ANY_SIZE
Indicates if the encoding should always occur, regardless of the size. |
static int |
DEFAULT_MINIMUM_SIZE
Indicates if the default minimum size for encoding to occur. |
Constructor Summary | |
---|---|
EncoderService()
Constructor. |
|
EncoderService(boolean enabled)
Constructor. |
Method Summary | |
---|---|
boolean |
canEncode(Representation representation)
Indicates if a representation can be encoded. |
Filter |
createInboundFilter(Context context)
Create the filter that should be invoked for incoming calls. |
Filter |
createOutboundFilter(Context context)
Create the filter that should be invoked for outgoing calls. |
List<MediaType> |
getAcceptedMediaTypes()
Returns the media types that should be encoded. |
static List<MediaType> |
getDefaultAcceptedMediaTypes()
Returns the list of default encoded media types. |
static List<MediaType> |
getDefaultIgnoredMediaTypes()
Returns the list of default ignored media types. |
List<MediaType> |
getIgnoredMediaTypes()
Returns the media types that should be ignored. |
long |
getMinimumSize()
Returns the minimum size a representation must have before compression is done. |
void |
setMinimumSize(long mininumSize)
Sets the minimum size a representation must have before compression is done. |
Methods inherited from class org.restlet.service.Service |
---|
getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ANY_SIZE
public static final int DEFAULT_MINIMUM_SIZE
Constructor Detail |
---|
public EncoderService()
public EncoderService(boolean enabled)
enabled
- True if the service has been enabled.Method Detail |
---|
public static List<MediaType> getDefaultAcceptedMediaTypes()
public static List<MediaType> getDefaultIgnoredMediaTypes()
public boolean canEncode(Representation representation)
representation
- The representation to test.
public Filter createInboundFilter(Context context)
Service
createInboundFilter
in class Service
context
- The current context.
public Filter createOutboundFilter(Context context)
Service
createOutboundFilter
in class Service
context
- The current context.
Context.getClientDispatcher()
public List<MediaType> getAcceptedMediaTypes()
public List<MediaType> getIgnoredMediaTypes()
public long getMinimumSize()
public void setMinimumSize(long mininumSize)
mininumSize
- The minimum size a representation must have before compression
is done.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |