pl.mbdev.openstage.push
Class PostRequest
java.lang.Object
pl.mbdev.openstage.push.HttpRequest
pl.mbdev.openstage.push.PostRequest
- Direct Known Subclasses:
- Push
public abstract class PostRequest
- extends HttpRequest
Defines a HTTP POST request that is a parent of the push request formed for OpenStage
device.
Copyright 2011 Mateusz Bysiek,
mb@mbdev.pl, http://mbdev.pl/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- Author:
- Mateusz Bysiek
Method Summary |
protected java.lang.String |
getResponse(java.net.URL targetAddress)
Provides default implementation for HTTP request execution. |
protected boolean |
sendTo(java.net.URL targetAddress)
Sends the push to a given URL. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PostRequest
public PostRequest(RequestParameters parameters)
- Creates new HTTP POST request.
- Parameters:
parameters
- parameters of this request
getResponse
protected java.lang.String getResponse(java.net.URL targetAddress)
throws java.io.IOException
- Description copied from class:
HttpRequest
- Provides default implementation for HTTP request execution.
- Specified by:
getResponse
in class HttpRequest
- Parameters:
targetAddress
- URL of the target to which this request will be sent
- Returns:
- response from the target address
- Throws:
java.io.IOException
- thrown when the given URL caused a connection error, there was a protocol
exception or data transfer was interrupted
sendTo
protected boolean sendTo(java.net.URL targetAddress)
throws java.io.IOException
- Description copied from class:
HttpRequest
- Sends the push to a given URL.
- Specified by:
sendTo
in class HttpRequest
- Parameters:
targetAddress
- URL of the target to which this request will be sent
- Returns:
- true if the request was successfully sent
- Throws:
java.io.IOException
- thrown when the given URL caused a connection error, there was a protocol
exception or data transfer was interrupted