Constructor and Description |
---|
Message()
Constructor.
|
Message(Representation entity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
bufferEntity()
If the entity is transient or its size unknown in advance but available,
then the entity is wrapped with a
BufferingRepresentation . |
void |
flushBuffers()
Asks the underlying connector to immediately flush the network buffers.
|
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> |
getAttributes()
Returns the modifiable map of attributes that can be used by developers
to save information relative to the message.
|
java.util.List<CacheDirective> |
getCacheDirectives()
Returns the cache directives.
|
java.util.Date |
getDate()
Returns the date and time at which the message was originated.
|
Representation |
getEntity()
Returns the entity representation.
|
java.lang.String |
getEntityAsText()
Returns the entity as text.
|
Series<Header> |
getHeaders()
Returns the series of lower-level HTTP headers.
|
Uniform |
getOnError()
Returns the callback invoked when an error occurs when sending the
message.
|
Uniform |
getOnSent()
Returns the callback invoked after sending the message.
|
java.util.List<RecipientInfo> |
getRecipientsInfo()
Returns the intermediary recipient information.
|
java.util.List<Warning> |
getWarnings()
Returns the additional warnings information.
|
abstract boolean |
isConfidential()
Indicates if the message was or will be exchanged confidentially, for
example via a SSL-secured connection.
|
boolean |
isEntityAvailable()
Indicates if a content is available and can be sent or received.
|
void |
release()
Releases the message's entity if present.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Sets the modifiable map of attributes.
|
void |
setCacheDirectives(java.util.List<CacheDirective> cacheDirectives)
Sets the cache directives.
|
void |
setDate(java.util.Date date)
Sets the date and time at which the message was originated.
|
void |
setEntity(Representation entity)
Sets the entity representation.
|
void |
setEntity(java.lang.String value,
MediaType mediaType)
Sets a textual entity.
|
void |
setOnError(Uniform onError)
Sets the callback invoked when an error occurs when sending the message.
|
void |
setOnSent(Uniform onSentCallback)
Sets the callback invoked after sending the message.
|
void |
setRecipientsInfo(java.util.List<RecipientInfo> recipientsInfo)
Sets the modifiable list of intermediary recipients.
|
void |
setWarnings(java.util.List<Warning> warnings)
Sets the additional warnings information.
|
public Message()
public Message(Representation entity)
entity
- The payload of the message.public void bufferEntity()
BufferingRepresentation
.public void flushBuffers() throws java.io.IOException
java.io.IOException
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getAttributes()
Attribute name | Class name | Description |
---|---|---|
org.restlet.http.headers | org.restlet.util.Series<org.restlet.engine.header.Header> | Server HTTP connectors must provide all request headers and client HTTP connectors must provide all response headers, exactly as they were received. In addition, developers can also use this attribute to specify non-standard headers that should be added to the request or to the response. |
org.restlet.https.clientCertificates | List |
For requests received via a secure connector, indicates the ordered list of client certificates, if they are available and accessible. |
public java.util.List<CacheDirective> getCacheDirectives()
public java.util.Date getDate()
public Representation getEntity()
public java.lang.String getEntityAsText()
public Series<Header> getHeaders()
public Uniform getOnError()
public Uniform getOnSent()
public java.util.List<RecipientInfo> getRecipientsInfo()
public java.util.List<Warning> getWarnings()
public abstract boolean isConfidential()
public boolean isEntityAvailable()
public void release()
Representation.release()
public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
attributes
- A map of attributespublic void setCacheDirectives(java.util.List<CacheDirective> cacheDirectives)
cacheDirectives
- The cache directives.public void setDate(java.util.Date date)
date
- The date and time at which the message was originated.public void setEntity(Representation entity)
entity
- The entity representation.public void setEntity(java.lang.String value, MediaType mediaType)
value
- The represented string.mediaType
- The representation's media type.public void setOnError(Uniform onError)
onError
- The callback invoked when an error occurs when sending the
message.public void setOnSent(Uniform onSentCallback)
onSentCallback
- The callback invoked after sending the message.public void setRecipientsInfo(java.util.List<RecipientInfo> recipientsInfo)
recipientsInfo
- A list of intermediary recipients.public void setWarnings(java.util.List<Warning> warnings)
warnings
- The warnings.Copyright © 2005-2024 Restlet.