com.heroku.api.request.ps
Class Restart

java.lang.Object
  extended by com.heroku.api.request.ps.Restart
All Implemented Interfaces:
Request<Unit>
Direct Known Subclasses:
Restart.NamedProcessRestart, Restart.ProcessTypeRestart

public class Restart
extends Object
implements Request<Unit>

TODO: Javadoc

Author:
Naaman Newbold

Nested Class Summary
static class Restart.NamedProcessRestart
           
static class Restart.ProcessTypeRestart
           
 
Constructor Summary
Restart(String appName)
           
 
Method Summary
 String getBody()
          Value of the request body.
 String getEndpoint()
          Path and query parameters of a URL.
 Map<String,String> getHeaders()
          Map of request-specific HTTP headers.
 Http.Method getHttpMethod()
          HTTP method.
 Unit getResponse(byte[] bytes, int status)
          Response handler.
 Http.Accept getResponseType()
          HTTP Accept header.
 boolean hasBody()
          Whether or not the request has a body.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Restart

public Restart(String appName)
Method Detail

getHttpMethod

public Http.Method getHttpMethod()
Description copied from interface: Request
HTTP method. e.g. GET, POST, PUT, DELETE

Specified by:
getHttpMethod in interface Request<Unit>
Returns:
The HTTP method used in the request.

getEndpoint

public String getEndpoint()
Description copied from interface: Request
Path and query parameters of a URL.

Specified by:
getEndpoint in interface Request<Unit>
Returns:
The path and query parameters as a String.

hasBody

public boolean hasBody()
Description copied from interface: Request
Whether or not the request has a body.

Specified by:
hasBody in interface Request<Unit>
Returns:
true if it has a request body, otherwise false

getBody

public String getBody()
Description copied from interface: Request
Value of the request body.

Specified by:
getBody in interface Request<Unit>
Returns:
Body

getResponseType

public Http.Accept getResponseType()
Description copied from interface: Request
HTTP Accept header.

Specified by:
getResponseType in interface Request<Unit>
Returns:
The Accept header to be used in the request. Typically "application/json" or "text/xml"
See Also:
Http.Accept

getHeaders

public Map<String,String> getHeaders()
Description copied from interface: Request
Map of request-specific HTTP headers.

Specified by:
getHeaders in interface Request<Unit>
Returns:
Name/value pairs of HTTP headers.

getResponse

public Unit getResponse(byte[] bytes,
                        int status)
Description copied from interface: Request
Response handler.

Specified by:
getResponse in interface Request<Unit>
Parameters:
bytes - Data returned from the request.
status - HTTP status code.
Returns:
The type T as specified by an individual request.


Copyright © 2012. All Rights Reserved.