RtspMethod does not need to extend HttpMethod at all - it does not add anything to HttpMethod
This commit is contained in:
parent
1ad9579e6e
commit
ea4692e967
@ -28,68 +28,76 @@ import org.jboss.netty.handler.codec.http.HttpMethod;
|
|||||||
* @author Trustin Lee (trustin@gmail.com)
|
* @author Trustin Lee (trustin@gmail.com)
|
||||||
* @version $Rev$, $Date$
|
* @version $Rev$, $Date$
|
||||||
*/
|
*/
|
||||||
public class RtspMethod extends HttpMethod {
|
public class RtspMethods {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OPTIONS method represents a request for information about the communication options available on the request/response
|
||||||
|
* chain identified by the Request-URI. This method allows the client to determine the options and/or requirements
|
||||||
|
* associated with a resource, or the capabilities of a server, without implying a resource action or initiating a
|
||||||
|
* resource retrieval.
|
||||||
|
*/
|
||||||
|
public static final HttpMethod OPTIONS = HttpMethod.OPTIONS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DESCRIBE method retrieves the description of a presentation or
|
* The DESCRIBE method retrieves the description of a presentation or
|
||||||
* media object identified by the request URL from a server.
|
* media object identified by the request URL from a server.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod DESCRIBE = new RtspMethod("DESCRIBE");
|
public static final HttpMethod DESCRIBE = new HttpMethod("DESCRIBE");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ANNOUNCE posts the description of a presentation or media object
|
* The ANNOUNCE posts the description of a presentation or media object
|
||||||
* identified by the request URL to a server, or updates the client-side
|
* identified by the request URL to a server, or updates the client-side
|
||||||
* session description in real-time.
|
* session description in real-time.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod ANNOUNCE = new RtspMethod("ANNOUNCE");
|
public static final HttpMethod ANNOUNCE = new HttpMethod("ANNOUNCE");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SETUP request for a URI specifies the transport mechanism to be
|
* The SETUP request for a URI specifies the transport mechanism to be
|
||||||
* used for the streamed media.
|
* used for the streamed media.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod SETUP = new RtspMethod("SETUP");
|
public static final HttpMethod SETUP = new HttpMethod("SETUP");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PLAY method tells the server to start sending data via the
|
* The PLAY method tells the server to start sending data via the
|
||||||
* mechanism specified in SETUP.
|
* mechanism specified in SETUP.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod PLAY = new RtspMethod("PLAY");
|
public static final HttpMethod PLAY = new HttpMethod("PLAY");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PAUSE request causes the stream delivery to be interrupted
|
* The PAUSE request causes the stream delivery to be interrupted
|
||||||
* (halted) temporarily.
|
* (halted) temporarily.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod PAUSE = new RtspMethod("PAUSE");
|
public static final HttpMethod PAUSE = new HttpMethod("PAUSE");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The TEARDOWN request stops the stream delivery for the given URI,
|
* The TEARDOWN request stops the stream delivery for the given URI,
|
||||||
* freeing the resources associated with it.
|
* freeing the resources associated with it.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod TEARDOWN = new RtspMethod("TEARDOWN");
|
public static final HttpMethod TEARDOWN = new HttpMethod("TEARDOWN");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The GET_PARAMETER request retrieves the value of a parameter of a
|
* The GET_PARAMETER request retrieves the value of a parameter of a
|
||||||
* presentation or stream specified in the URI.
|
* presentation or stream specified in the URI.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod GET_PARAMETER = new RtspMethod("GET_PARAMETER");
|
public static final HttpMethod GET_PARAMETER = new HttpMethod("GET_PARAMETER");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SET_PARAMETER requests to set the value of a parameter for a
|
* The SET_PARAMETER requests to set the value of a parameter for a
|
||||||
* presentation or stream specified by the URI.
|
* presentation or stream specified by the URI.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod SET_PARAMETER = new RtspMethod("SET_PARAMETER");
|
public static final HttpMethod SET_PARAMETER = new HttpMethod("SET_PARAMETER");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The REDIRECT request informs the client that it must connect to another
|
* The REDIRECT request informs the client that it must connect to another
|
||||||
* server location.
|
* server location.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod REDIRECT = new RtspMethod("REDIRECT");
|
public static final HttpMethod REDIRECT = new HttpMethod("REDIRECT");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The RECORD method initiates recording a range of media data according to
|
* The RECORD method initiates recording a range of media data according to
|
||||||
* the presentation description.
|
* the presentation description.
|
||||||
*/
|
*/
|
||||||
public static final RtspMethod RECORD = new RtspMethod("RECORD");
|
public static final HttpMethod RECORD = new HttpMethod("RECORD");
|
||||||
|
|
||||||
private static final Map<String, HttpMethod> methodMap = new HashMap<String, HttpMethod>();
|
private static final Map<String, HttpMethod> methodMap = new HashMap<String, HttpMethod>();
|
||||||
|
|
||||||
@ -107,20 +115,10 @@ public class RtspMethod extends HttpMethod {
|
|||||||
methodMap.put(TEARDOWN.toString(), TEARDOWN);
|
methodMap.put(TEARDOWN.toString(), TEARDOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new RTSP method with the specified name.
|
|
||||||
*/
|
|
||||||
public RtspMethod(String name) {
|
|
||||||
super(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@link HttpMethod} represented by the specified name.
|
* Returns the {@link HttpMethod} represented by the specified name.
|
||||||
* If the specified name is a standard RTSP method name, a cached instance
|
* If the specified name is a standard RTSP method name, a cached instance
|
||||||
* will be returned. Otherwise, a new instance will be returned.
|
* will be returned. Otherwise, a new instance will be returned.
|
||||||
* Please note that this method does not return {@link RtspMethod} but
|
|
||||||
* returns {@link HttpMethod} because the RTSP re-uses some HTTP methods
|
|
||||||
* in its specification.
|
|
||||||
*/
|
*/
|
||||||
public static HttpMethod valueOf(String name) {
|
public static HttpMethod valueOf(String name) {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
@ -136,8 +134,12 @@ public class RtspMethod extends HttpMethod {
|
|||||||
if (result != null) {
|
if (result != null) {
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
return new RtspMethod(name);
|
return new HttpMethod(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private RtspMethods() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -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 RtspMethod} and protocol version is {@link RtspVersion}.
|
* {@link RtspMethods} and protocol version is {@link RtspVersion}.
|
||||||
* <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.
|
||||||
@ -55,7 +55,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(RtspVersion.valueOf(initialLine[2]),
|
||||||
RtspMethod.valueOf(initialLine[0]), initialLine[1]);
|
RtspMethods.valueOf(initialLine[0]), initialLine[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user