Package com.wowza.io
Class HTTPByteReader
- Object
-
- com.wowza.io.HTTPByteReader
-
- Direct Known Subclasses:
HTTPByteReaderS3
public class HTTPByteReader extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
HTTPByteReader.SendResult
-
Field Summary
Fields Modifier and Type Field Description static int
BUFFERINCSIZE
protected int
connectionTimeout
static String
CRLF
protected org.apache.commons.lang.time.FastDateFormat
dateFormat
protected java.util.List<String>
debugInfo
protected String
debugPrefix
static int
HEADINDEX_CONTENTLENGTH
static int
HEADINDEX_LASTMODIFIED
static int
HEADINDEX_SIZE
static int
HEADINDEX_STATUS
protected String
host
static int
MAXHEADERSIZE
protected int
maxRetries
protected int
maxUsesBeforeReconnect
protected StringBuffer
msgBuf
protected String[]
parseDateFormats
protected int
port
protected String
proxyHost
protected int
proxyPort
protected int
readTimeout
protected int
receiveBufferSize
static int
RECEIVEBUFFERSIZE
protected String
reqPath
protected boolean
requestFullURL
protected int
sendBufferSize
static int
SENDBUFFERSIZE
protected java.net.Socket
socket
static int
TIMEOUT
protected String
userAgent
protected int
uses
-
Constructor Summary
Constructors Constructor Description HTTPByteReader(String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
connect()
HTTPByteReaderResult
delete(String path)
HTTPByteReaderResult
deleteDirect(String path)
protected void
dumpDebug()
protected String
getConextPath()
int
getConnectionTimeout()
protected void
getDeleteCommand(String path)
protected void
getGetCommand(String path, long pos, int flen)
protected void
getHeadCommand(String path)
int
getMaxRetries()
int
getMaxUsesBeforeReconnect()
protected void
getPostCommand(String path, PacketFragmentList fragmentList)
int
getReadTimeout()
int
getReceiveBufferSize()
protected String
getRequestPath(String path, String host, int port)
int
getSendBufferSize()
String
getUserAgent()
long[]
head(String path)
boolean
isOpen()
boolean
isRequestFullURL()
protected void
parseHeader(HTTPByteReader.SendResult result, byte[] buffer, int offset, int len, boolean isHead)
HTTPByteReaderResult
read(String path, long pos, int flen)
HTTPByteReaderResult
readDirect(String path, long pos, int flen)
protected void
reconnect()
HTTPByteReader.SendResult
sendRequest(byte[] request, boolean isHead)
HTTPByteReader.SendResult
sendRequest(byte[] request, int len, boolean isHead)
HTTPByteReader.SendResult
sendRequest(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead)
void
setConnectionTimeout(int connectionTimeout)
void
setMaxRetries(int maxRetries)
void
setMaxUsesBeforeReconnect(int maxUsesBeforeReconnect)
void
setProxyAddress(String host, int port)
void
setReadTimeout(int readTimeout)
void
setReceiveBufferSize(int receiveBufferSize)
void
setRequestFullURL(boolean requestFullURL)
void
setSendBufferSize(int sendBufferSize)
void
setUserAgent(String userAgent)
HTTPByteReaderResult
write(String path, byte[] buffer, int offset, int len)
HTTPByteReaderResult
write(String path, PacketFragmentList fragmentList)
HTTPByteReaderResult
write(String path, String str)
HTTPByteReaderResult
writeDirect(String path, PacketFragmentList fragmentList)
-
-
-
Field Detail
-
MAXHEADERSIZE
public static final int MAXHEADERSIZE
- See Also:
- Constant Field Values
-
BUFFERINCSIZE
public static final int BUFFERINCSIZE
- See Also:
- Constant Field Values
-
TIMEOUT
public static final int TIMEOUT
- See Also:
- Constant Field Values
-
SENDBUFFERSIZE
public static final int SENDBUFFERSIZE
- See Also:
- Constant Field Values
-
RECEIVEBUFFERSIZE
public static final int RECEIVEBUFFERSIZE
- See Also:
- Constant Field Values
-
CRLF
public static final String CRLF
- See Also:
- Constant Field Values
-
HEADINDEX_STATUS
public static final int HEADINDEX_STATUS
- See Also:
- Constant Field Values
-
HEADINDEX_CONTENTLENGTH
public static final int HEADINDEX_CONTENTLENGTH
- See Also:
- Constant Field Values
-
HEADINDEX_LASTMODIFIED
public static final int HEADINDEX_LASTMODIFIED
- See Also:
- Constant Field Values
-
HEADINDEX_SIZE
public static final int HEADINDEX_SIZE
- See Also:
- Constant Field Values
-
host
protected String host
-
port
protected int port
-
reqPath
protected String reqPath
-
proxyHost
protected String proxyHost
-
proxyPort
protected int proxyPort
-
dateFormat
protected org.apache.commons.lang.time.FastDateFormat dateFormat
-
socket
protected java.net.Socket socket
-
msgBuf
protected StringBuffer msgBuf
-
maxRetries
protected int maxRetries
-
maxUsesBeforeReconnect
protected int maxUsesBeforeReconnect
-
uses
protected int uses
-
readTimeout
protected int readTimeout
-
connectionTimeout
protected int connectionTimeout
-
debugInfo
protected java.util.List<String> debugInfo
-
debugPrefix
protected String debugPrefix
-
requestFullURL
protected boolean requestFullURL
-
parseDateFormats
protected String[] parseDateFormats
-
sendBufferSize
protected int sendBufferSize
-
receiveBufferSize
protected int receiveBufferSize
-
userAgent
protected String userAgent
-
-
Method Detail
-
setProxyAddress
public void setProxyAddress(String host, int port)
-
close
public void close()
-
connect
public void connect()
-
reconnect
protected void reconnect()
-
isOpen
public boolean isOpen()
-
parseHeader
protected void parseHeader(HTTPByteReader.SendResult result, byte[] buffer, int offset, int len, boolean isHead)
-
read
public HTTPByteReaderResult read(String path, long pos, int flen)
-
delete
public HTTPByteReaderResult delete(String path)
-
getDeleteCommand
protected void getDeleteCommand(String path)
-
deleteDirect
public HTTPByteReaderResult deleteDirect(String path)
-
write
public HTTPByteReaderResult write(String path, String str)
-
write
public HTTPByteReaderResult write(String path, byte[] buffer, int offset, int len)
-
write
public HTTPByteReaderResult write(String path, PacketFragmentList fragmentList)
-
getPostCommand
protected void getPostCommand(String path, PacketFragmentList fragmentList)
-
writeDirect
public HTTPByteReaderResult writeDirect(String path, PacketFragmentList fragmentList)
-
getRequestPath
protected String getRequestPath(String path, String host, int port)
-
getConextPath
protected String getConextPath()
-
getHeadCommand
protected void getHeadCommand(String path)
-
head
public long[] head(String path)
-
getGetCommand
protected void getGetCommand(String path, long pos, int flen)
-
readDirect
public HTTPByteReaderResult readDirect(String path, long pos, int flen)
-
dumpDebug
protected void dumpDebug()
-
sendRequest
public HTTPByteReader.SendResult sendRequest(byte[] request, boolean isHead)
-
sendRequest
public HTTPByteReader.SendResult sendRequest(byte[] request, int len, boolean isHead)
-
sendRequest
public HTTPByteReader.SendResult sendRequest(byte[] request, PacketFragmentList fragmentList, int len, boolean isHead)
-
getMaxUsesBeforeReconnect
public int getMaxUsesBeforeReconnect()
-
setMaxUsesBeforeReconnect
public void setMaxUsesBeforeReconnect(int maxUsesBeforeReconnect)
-
getMaxRetries
public int getMaxRetries()
-
setMaxRetries
public void setMaxRetries(int maxRetries)
-
getReadTimeout
public int getReadTimeout()
-
setReadTimeout
public void setReadTimeout(int readTimeout)
-
isRequestFullURL
public boolean isRequestFullURL()
-
setRequestFullURL
public void setRequestFullURL(boolean requestFullURL)
-
getConnectionTimeout
public int getConnectionTimeout()
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout)
-
getSendBufferSize
public int getSendBufferSize()
-
setSendBufferSize
public void setSendBufferSize(int sendBufferSize)
-
getReceiveBufferSize
public int getReceiveBufferSize()
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize)
-
getUserAgent
public String getUserAgent()
-
setUserAgent
public void setUserAgent(String userAgent)
-
-