|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Handler
org.restlet.resource.Resource
com.noelios.restlet.ext.javamail.TriggerResource
public class TriggerResource
Resource that handles requests to target resources according to parameters located in mails.
Field Summary | |
---|---|
static java.lang.String |
ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME
|
static java.lang.String |
ATTRIBUTE_MAILBOX_LOGIN
|
static java.lang.String |
ATTRIBUTE_MAILBOX_PASSWORD
|
static java.lang.String |
ATTRIBUTE_MAILBOX_URI
|
Constructor Summary | |
---|---|
TriggerResource(Context context,
Request request,
Response response)
Constructor. |
Method Summary | |
---|---|
void |
acceptRepresentation(Representation entity)
Handles POST requests. |
protected void |
callTarget(Resolver<java.lang.String> resolver)
Requests the target resource. |
protected void |
deleteMail(java.lang.String mailIdentifier)
Deletes a mail after it has been processed. |
protected Representation |
getMail(java.lang.String identifier)
Get the mail representation according to its identifier. |
ChallengeScheme |
getMailboxChallengeScheme()
Returns the scheme of the mailbox challenge. |
java.lang.String |
getMailboxLogin()
Returns the login for the mailbox. |
java.lang.String |
getMailboxPassword()
Returns the password for the mailbox. |
java.lang.String |
getMailboxUri()
Returns the URI of the mailbox. |
protected java.util.List<java.lang.String> |
getMailIdentifiers()
Returns the list of identifiers for the mails in the inbox |
protected Reference |
getMailRef(java.lang.String identifier)
Returns the reference of a mail according to its identifier. |
java.lang.String |
getMailUriTemplate()
Returns the template of the mail's URI. |
MailResolver |
getResolver()
Returns the resolver based on a mail. |
protected MailResolver |
getResolver(java.lang.String mailIdentifier,
Representation email)
Returns a new resolver based on a mail. |
protected Representation |
getResponseRepresentation(java.util.List<java.lang.String> mailsSuccessful,
java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)
Returns the response's representation according to the list of successfull and unsuccessfull mails. |
protected Status |
getResponseStatus(java.util.List<java.lang.String> mailsSuccessful,
java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)
Returns the response's status according to the list of successfull and unsuccessfull mails. |
protected ChallengeResponse |
getTargetChallengeResponse(Resolver<java.lang.String> resolver)
Returns the authentication data sent by client to the target according to the a list of properties. |
protected Representation |
getTargetEntity(Resolver<java.lang.String> resolver)
Returns the entity sent to the target. |
Method |
getTargetMethod()
Returns the default target method. |
protected Method |
getTargetMethod(Resolver<java.lang.String> resolver)
Returns the target method according to a list of properties. |
protected Reference |
getTargetRef(Resolver<java.lang.String> resolver)
Returns the reference of the target according to the a list of properties. |
java.lang.String |
getTargetUri()
Returns the target URI template. |
boolean |
isTargetEntityEnabled()
Indicate whether or not the target supports entity in the request. |
void |
setMailboxChallengeScheme(ChallengeScheme mailboxChallengeScheme)
Sets the scheme of the mailbox challenge. |
void |
setMailboxLogin(java.lang.String mailboxLogin)
Sets the login for the mailbox access. |
void |
setMailboxPassword(java.lang.String mailboxPassword)
Sets the password for the mailbox access. |
void |
setMailboxUri(java.lang.String mailboxUri)
Sets the URI of the mailbox. |
void |
setMailUriTemplate(java.lang.String mailUriTemplate)
Sets the URI template for the target. |
void |
setTargetEntityEnabled(boolean targetEntityEnabled)
Indicate whether or not the target supports entity in the request. |
void |
setTargetMethod(Method targetMethod)
Sets the default target method. |
void |
setTargetUri(java.lang.String targetUri)
Sets the target URI template. |
Methods inherited from class org.restlet.resource.Resource |
---|
allowDelete, allowGet, allowPost, allowPut, delete, getPreferredRepresentation, getPreferredVariant, getRepresentation, getVariants, handleDelete, handleGet, handlePost, handlePut, init, isAvailable, isModifiable, isNegotiateContent, isReadable, post, put, removeRepresentations, represent, represent, setAvailable, setModifiable, setNegotiateContent, setReadable, setVariants, storeRepresentation |
Methods inherited from class org.restlet.Handler |
---|
allowHead, allowOptions, generateRef, getAllowedMethods, getApplication, getContext, getLogger, getMatrix, getQuery, getRequest, getResponse, handleHead, handleOptions, setContext, setRequest, setResponse, updateAllowedMethods |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME
public static final java.lang.String ATTRIBUTE_MAILBOX_LOGIN
public static final java.lang.String ATTRIBUTE_MAILBOX_PASSWORD
public static final java.lang.String ATTRIBUTE_MAILBOX_URI
Constructor Detail |
---|
public TriggerResource(Context context, Request request, Response response)
context
- The parent context.request
- The request to handle.response
- The response to return.Method Detail |
---|
public void acceptRepresentation(Representation entity) throws ResourceException
acceptRepresentation
in class Resource
ResourceException
protected void callTarget(Resolver<java.lang.String> resolver) throws ResourceException
resolver
- The data model that provides parameters value.
ResourceException
protected void deleteMail(java.lang.String mailIdentifier) throws ResourceException
mailIdentifier
- The identifier of the mail
ResourceException
protected Representation getMail(java.lang.String identifier) throws ResourceException
identifier
- the mail identifier.
ResourceException
public ChallengeScheme getMailboxChallengeScheme()
public java.lang.String getMailboxLogin()
public java.lang.String getMailboxPassword()
public java.lang.String getMailboxUri()
protected java.util.List<java.lang.String> getMailIdentifiers() throws ResourceException
ResourceException
protected Reference getMailRef(java.lang.String identifier) throws ResourceException
identifier
- The identifier of a mail.
ResourceException
public java.lang.String getMailUriTemplate()
public MailResolver getResolver()
protected MailResolver getResolver(java.lang.String mailIdentifier, Representation email)
mailIdentifier
- Identifier of the mail.email
- The mail.
protected Representation getResponseRepresentation(java.util.List<java.lang.String> mailsSuccessful, java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)
mailsSuccessful
- The list of successfull mails.mailsUnsuccessful
- The list of successfull mails and related error message.
protected Status getResponseStatus(java.util.List<java.lang.String> mailsSuccessful, java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)
mailsSuccessful
- The list of successfull mails.mailsUnsuccessful
- The list of successfull mails and related error message.
protected ChallengeResponse getTargetChallengeResponse(Resolver<java.lang.String> resolver) throws ResourceException
resolver
- The resolver.
ResourceException
protected Representation getTargetEntity(Resolver<java.lang.String> resolver)
resolver
- the resolver.
public Method getTargetMethod()
protected Method getTargetMethod(Resolver<java.lang.String> resolver)
resolver
- The resolver.
protected Reference getTargetRef(Resolver<java.lang.String> resolver) throws ResourceException
resolver
- The resolver.
ResourceException
public java.lang.String getTargetUri()
public boolean isTargetEntityEnabled()
public void setMailboxChallengeScheme(ChallengeScheme mailboxChallengeScheme)
mailboxChallengeScheme
- The scheme of the mailbox challenge.public void setMailboxLogin(java.lang.String mailboxLogin)
mailboxLogin
- The login for the mailbox access.public void setMailboxPassword(java.lang.String mailboxPassword)
mailboxPassword
- The password for the mailbox access.public void setMailboxUri(java.lang.String mailboxUri)
mailboxUri
- the URI of the mailbox.public void setMailUriTemplate(java.lang.String mailUriTemplate)
mailUriTemplate
- the URI template for the target.public void setTargetEntityEnabled(boolean targetEntityEnabled)
targetEntityEnabled
- True if the target supports entity in the request, false,
otherwise.public void setTargetMethod(Method targetMethod)
targetMethod
- The default target method.public void setTargetUri(java.lang.String targetUri)
targetUri
- The target URI template.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |