RtspVersion does not need to extend HttpVersion at all - it does not add anything to HttpVersion
This commit is contained in:
parent
d389be442f
commit
07b6e791b5
@ -23,7 +23,7 @@ import org.jboss.netty.handler.codec.http.HttpRequest;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes {@link ChannelBuffer}s into {@link HttpRequest}s whose method is
|
* Decodes {@link ChannelBuffer}s into {@link HttpRequest}s whose method is
|
||||||
* {@link RtspMethods} and protocol version is {@link RtspVersion}.
|
* {@link RtspMethods} and protocol version is {@link RtspVersions}.
|
||||||
* <p>
|
* <p>
|
||||||
* Please refer to {@link HttpMessageDecoder} for the detailed information on
|
* Please refer to {@link HttpMessageDecoder} for the detailed information on
|
||||||
* how this decoder works and what parameters are available.
|
* how this decoder works and what parameters are available.
|
||||||
@ -54,7 +54,7 @@ public class RtspRequestDecoder extends HttpMessageDecoder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected HttpMessage createMessage(String[] initialLine) throws Exception {
|
protected HttpMessage createMessage(String[] initialLine) throws Exception {
|
||||||
return new DefaultHttpRequest(RtspVersion.valueOf(initialLine[2]),
|
return new DefaultHttpRequest(RtspVersions.valueOf(initialLine[2]),
|
||||||
RtspMethods.valueOf(initialLine[0]), initialLine[1]);
|
RtspMethods.valueOf(initialLine[0]), initialLine[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes {@link ChannelBuffer}s into {@link HttpResponse}s whose status is
|
* Decodes {@link ChannelBuffer}s into {@link HttpResponse}s whose status is
|
||||||
* {@link RtspResponseStatuses} and protocol version is {@link RtspVersion}.
|
* {@link RtspResponseStatuses} and protocol version is {@link RtspVersions}.
|
||||||
* <p>
|
* <p>
|
||||||
* Please refer to {@link HttpMessageDecoder} for the detailed information on
|
* Please refer to {@link HttpMessageDecoder} for the detailed information on
|
||||||
* how this decoder works and what parameters are available.
|
* how this decoder works and what parameters are available.
|
||||||
@ -56,7 +56,7 @@ public class RtspResponseDecoder extends HttpMessageDecoder {
|
|||||||
@Override
|
@Override
|
||||||
protected HttpMessage createMessage(String[] initialLine) throws Exception {
|
protected HttpMessage createMessage(String[] initialLine) throws Exception {
|
||||||
return new DefaultHttpResponse(
|
return new DefaultHttpResponse(
|
||||||
RtspVersion.valueOf(initialLine[0]),
|
RtspVersions.valueOf(initialLine[0]),
|
||||||
new HttpResponseStatus(Integer.valueOf(initialLine[1]),initialLine[2]));
|
new HttpResponseStatus(Integer.valueOf(initialLine[1]),initialLine[2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,20 +25,20 @@ import org.jboss.netty.handler.codec.http.HttpVersion;
|
|||||||
* @author Trustin Lee (trustin@gmail.com)
|
* @author Trustin Lee (trustin@gmail.com)
|
||||||
* @version $Rev$, $Date$
|
* @version $Rev$, $Date$
|
||||||
*/
|
*/
|
||||||
public class RtspVersion extends HttpVersion {
|
public final class RtspVersions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RTSP/1.0
|
* RTSP/1.0
|
||||||
*/
|
*/
|
||||||
public static final RtspVersion RTSP_1_0 = new RtspVersion("RTSP", 1, 0);
|
public static final HttpVersion RTSP_1_0 = new HttpVersion("RTSP", 1, 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an existing or new {@link RtspVersion} instance which matches to
|
* Returns an existing or new {@link HttpVersion} instance which matches to
|
||||||
* the specified protocol version string. If the specified {@code text} is
|
* the specified RTSP version string. If the specified {@code text} is
|
||||||
* equal to {@code "RTSP/1.0"}, {@link #RTSP_1_0} will be returned.
|
* equal to {@code "RTSP/1.0"}, {@link #RTSP_1_0} will be returned.
|
||||||
* Otherwise, a new {@link RtspVersion} instance will be returned.
|
* Otherwise, a new {@link HttpVersion} instance will be returned.
|
||||||
*/
|
*/
|
||||||
public static RtspVersion valueOf(String text) {
|
public static HttpVersion valueOf(String text) {
|
||||||
if (text == null) {
|
if (text == null) {
|
||||||
throw new NullPointerException("text");
|
throw new NullPointerException("text");
|
||||||
}
|
}
|
||||||
@ -48,21 +48,10 @@ public class RtspVersion extends HttpVersion {
|
|||||||
return RTSP_1_0;
|
return RTSP_1_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new RtspVersion(text);
|
return new HttpVersion(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private RtspVersions() {
|
||||||
* Creates a new RTSP version with the specified version string.
|
super();
|
||||||
*/
|
|
||||||
public RtspVersion(String text) {
|
|
||||||
super(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new HTTP version with the specified protocol name and version
|
|
||||||
* numbers.
|
|
||||||
*/
|
|
||||||
public RtspVersion(String protocolName, int majorVersion, int minorVersion) {
|
|
||||||
super(protocolName, majorVersion, minorVersion);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user