org.jboss.netty.handler.codec.http2
Class DefaultHttpDataFactory

java.lang.Object
  extended by org.jboss.netty.handler.codec.http2.DefaultHttpDataFactory
All Implemented Interfaces:
HttpDataFactory

public class DefaultHttpDataFactory
extends Object
implements HttpDataFactory

Default factory giving Attribute and FileUpload according to constructor Attribute and FileUpload could be :
- MemoryAttribute, DiskAttribute or MixedAttribute
- MemoryFileUpload, DiskFileUpload or MixedFileUpload
according to the constructor.

Author:
The Netty Project, Andy Taylor (andy.taylor@jboss.org), Trustin Lee, Frederic Bregier

Field Summary
static long MINSIZE
          Proposed default MINSIZE as 16 KB.
 
Constructor Summary
DefaultHttpDataFactory()
          HttpData will be in memory if less than default size (16KB).
DefaultHttpDataFactory(boolean useDisk)
          HttpData will be always on Disk if useDisk is True, else always in Memory if False
DefaultHttpDataFactory(long minSize)
          HttpData will be on Disk if the size of the file is greater than minSize, else it will be in memory.
 
Method Summary
 void cleanAllHttpDatas()
          Remove all InterfaceHttpData from virtual File storage from clean list for all requests
 void cleanRequestHttpDatas(HttpRequest request)
          Remove all InterfaceHttpData from virtual File storage from clean list for the request
 Attribute createAttribute(HttpRequest request, String name)
           
 Attribute createAttribute(HttpRequest request, String name, String value)
           
 FileUpload createFileUpload(HttpRequest request, String name, String filename, String contentType, String contentTransferEncoding, Charset charset, long size)
           
 void removeHttpDataFromClean(HttpRequest request, InterfaceHttpData data)
          Remove the given InterfaceHttpData from clean list (will not delete the file, except if the file is still a temporary one as setup at construction)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINSIZE

public static long MINSIZE
Proposed default MINSIZE as 16 KB.

Constructor Detail

DefaultHttpDataFactory

public DefaultHttpDataFactory()
HttpData will be in memory if less than default size (16KB). The type will be Mixed.


DefaultHttpDataFactory

public DefaultHttpDataFactory(boolean useDisk)
HttpData will be always on Disk if useDisk is True, else always in Memory if False

Parameters:
useDisk -

DefaultHttpDataFactory

public DefaultHttpDataFactory(long minSize)
HttpData will be on Disk if the size of the file is greater than minSize, else it will be in memory. The type will be Mixed.

Parameters:
minSize -
Method Detail

createAttribute

public Attribute createAttribute(HttpRequest request,
                                 String name)
                          throws NullPointerException,
                                 IllegalArgumentException
Specified by:
createAttribute in interface HttpDataFactory
Parameters:
request - associated request
Returns:
a new Attribute with no value
Throws:
NullPointerException
IllegalArgumentException

createAttribute

public Attribute createAttribute(HttpRequest request,
                                 String name,
                                 String value)
                          throws NullPointerException,
                                 IllegalArgumentException
Specified by:
createAttribute in interface HttpDataFactory
Parameters:
request - associated request
Returns:
a new Attribute
Throws:
NullPointerException
IllegalArgumentException

createFileUpload

public FileUpload createFileUpload(HttpRequest request,
                                   String name,
                                   String filename,
                                   String contentType,
                                   String contentTransferEncoding,
                                   Charset charset,
                                   long size)
                            throws NullPointerException,
                                   IllegalArgumentException
Specified by:
createFileUpload in interface HttpDataFactory
Parameters:
request - associated request
size - the size of the Uploaded file
Returns:
a new FileUpload
Throws:
NullPointerException
IllegalArgumentException

removeHttpDataFromClean

public void removeHttpDataFromClean(HttpRequest request,
                                    InterfaceHttpData data)
Description copied from interface: HttpDataFactory
Remove the given InterfaceHttpData from clean list (will not delete the file, except if the file is still a temporary one as setup at construction)

Specified by:
removeHttpDataFromClean in interface HttpDataFactory
Parameters:
request - associated request

cleanRequestHttpDatas

public void cleanRequestHttpDatas(HttpRequest request)
Description copied from interface: HttpDataFactory
Remove all InterfaceHttpData from virtual File storage from clean list for the request

Specified by:
cleanRequestHttpDatas in interface HttpDataFactory
Parameters:
request - associated request

cleanAllHttpDatas

public void cleanAllHttpDatas()
Description copied from interface: HttpDataFactory
Remove all InterfaceHttpData from virtual File storage from clean list for all requests

Specified by:
cleanAllHttpDatas in interface HttpDataFactory


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.