public class ConversationService extends Object
Constructor and Description |
---|
ConversationService(int fileUploadSizeThreshold,
File fileUploadDirectory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ConversationCookie |
createCookie(String name)
Returns a new conversation cookie instance if the cookie doesn't exist
yet, or the existing cookie if it does.
|
Reference |
getApplicationRoot()
The application's root URI on the virtual host that routed the current
request.
|
String |
getBase()
The relative path that would reach the base URI of the application if
appended to the current resource URI.
|
ClientInfo |
getClient()
A shortcut to the request's client info.
|
ConversationCookie |
getCookie(String name)
Gets a conversation cookie by name.
|
Collection<ConversationCookie> |
getCookies()
The conversation cookies.
|
Disposition |
getDisposition()
The representation's disposition.
|
boolean |
getDoNotTrack()
Whether the client asked for do-not-track.
|
Map<String,Object> |
getForm()
The form, sent via POST or PUT, as a map.
|
Form |
getFormAll()
The form, sent via POST or PUT, as a list.
|
VirtualHost |
getHost()
The virtual host that routed this request.
|
boolean |
getInternal()
Checks if the request was received via the RIAP protocol
|
ConcurrentMap<String,Object> |
getLocals()
The request attributes.
|
String |
getPathToBase()
Deprecated.
|
Map<String,String> |
getQuery()
The URI query as a map.
|
Form |
getQueryAll()
The URI query as a list.
|
Reference |
getReference()
The resource reference.
|
Request |
getRequest()
A shortcut to the request.
|
Series<Header> |
getRequestHeaders()
The request headers
|
Response |
getResponse()
A shortcut to the response.
|
Series<Header> |
getResponseHeaders()
The extra response headers
|
Status |
getStatus()
The response status.
|
int |
getStatusCode()
The response status code.
|
boolean |
getStatusPassthrough()
When true, the
DelegatedStatusService will not intercept errors. |
String |
getWildcard()
The resource reference's remaining part (not including the query).
|
void |
redirectPermanent(String uri)
Permanent client-side redirection.
|
void |
redirectSeeOther(String uri)
See-other client-side redirection.
|
void |
redirectTemporary(String uri)
Temporary client-side redirection.
|
ByteArrayRepresentation |
setResponseBinary(byte[] byteArray,
String mediaTypeName)
A shortcut to set the response entity to a
ByteArrayRepresentation . |
StringRepresentation |
setResponseText(String text,
String mediaTypeName,
String languageName,
String characterSetName)
A shortcut to set the response entity to a
StringRepresentation . |
void |
setStatus(Status status)
The response status.
|
void |
setStatusCode(int statusCode)
The response status code.
|
void |
setStatusPassthrough(boolean passthrough) |
boolean |
stop()
Abruptly ends the conversation.
|
public ConversationService(int fileUploadSizeThreshold, File fileUploadDirectory)
fileUploadSizeThreshold
- The size in bytes beyond which uploaded files will be stored to
diskfileUploadDirectory
- The directory in which to place uploaded filespublic Reference getReference()
public String getWildcard()
public Reference getApplicationRoot()
public VirtualHost getHost()
public Collection<ConversationCookie> getCookies()
This value is cached locally.
public ConversationCookie getCookie(String name)
name
- The cookie namepublic ConversationCookie createCookie(String name)
ConversationCookie.save()
.name
- The cookie namepublic Status getStatus()
setStatus(Status)
public void setStatus(Status status)
status
- The response statusgetStatus()
public int getStatusCode()
setStatusCode(int)
public void setStatusCode(int statusCode)
statusCode
- The response status codegetStatusCode()
public boolean getStatusPassthrough()
DelegatedStatusService
will not intercept errors.
Note that this will only have an effect if the
DelegatedStatusService
is installed in the application.
setStatusPassthrough(boolean)
public void setStatusPassthrough(boolean passthrough)
passthrough
- The passthrough statusgetStatusPassthrough()
public Request getRequest()
public ClientInfo getClient()
public Response getResponse()
public StringRepresentation setResponseText(String text, String mediaTypeName, String languageName, String characterSetName)
StringRepresentation
.text
- The textmediaTypeName
- The media type or null to leave unchangedlanguageName
- The language or null to leave unchangedcharacterSetName
- The character set or null to leave unchangedpublic ByteArrayRepresentation setResponseBinary(byte[] byteArray, String mediaTypeName)
ByteArrayRepresentation
.byteArray
- The byte arraymediaTypeName
- The media type or null to leave unchangedpublic boolean getInternal()
LocalReference
public String getBase()
@Deprecated public String getPathToBase()
public Form getQueryAll()
This value is cached locally.
public Map<String,String> getQuery()
This value is cached locally.
public Form getFormAll()
FileParameter
.
This value is cached locally.
public Map<String,Object> getForm()
FileParameter
. Other fields will be plain strings.
This value is cached locally.
public Disposition getDisposition()
public Series<Header> getRequestHeaders()
public Series<Header> getResponseHeaders()
public boolean getDoNotTrack()
public ConcurrentMap<String,Object> getLocals()
public void redirectPermanent(String uri)
uri
- The URIpublic void redirectSeeOther(String uri)
uri
- The URIpublic void redirectTemporary(String uri)
uri
- The URIpublic boolean stop()
Works by throwing a ConversationStoppedException
.
Copyright © 2009-2016 Three Crickets LLC.