|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.resource.Resource
org.restlet.resource.UniformResource
org.restlet.resource.ServerResource
org.restlet.ext.javamail.TriggerResource
public class TriggerResource
Resource that handles requests to target resources according to parameters located in mails.
| Field Summary | |
|---|---|
static String |
ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME
|
static String |
ATTRIBUTE_MAILBOX_LOGIN
|
static String |
ATTRIBUTE_MAILBOX_PASSWORD
|
static String |
ATTRIBUTE_MAILBOX_URI
|
| Constructor Summary | |
|---|---|
TriggerResource()
|
|
| Method Summary | |
|---|---|
void |
acceptMails(Representation entity)
Handles POST requests. |
protected void |
callTarget(Resolver<String> resolver)
Requests the target resource. |
protected void |
deleteMail(String mailIdentifier)
Deletes a mail after it has been processed. |
protected void |
doInit()
|
protected Representation |
getMail(String identifier)
Get the mail representation according to its identifier. |
ChallengeScheme |
getMailboxChallengeScheme()
Returns the scheme of the mailbox challenge. |
String |
getMailboxLogin()
Returns the login for the mailbox. |
String |
getMailboxPassword()
Returns the password for the mailbox. |
String |
getMailboxUri()
Returns the URI of the mailbox. |
protected List<String> |
getMailIdentifiers()
Returns the list of identifiers for the mails in the inbox |
protected Reference |
getMailRef(String identifier)
Returns the reference of a mail according to its identifier. |
String |
getMailUriTemplate()
Returns the template of the mail's URI. |
MailResolver |
getResolver()
Returns the resolver based on a mail. |
protected MailResolver |
getResolver(String mailIdentifier,
Representation email)
Returns a new resolver based on a mail. |
protected Representation |
getResponseRepresentation(List<String> mailsSuccessful,
Map<String,String> mailsUnsuccessful)
Returns the response's representation according to the list of successfull and unsuccessfull mails. |
protected Status |
getResponseStatus(List<String> mailsSuccessful,
Map<String,String> mailsUnsuccessful)
Returns the response's status according to the list of successfull and unsuccessfull mails. |
protected ChallengeResponse |
getTargetChallengeResponse(Resolver<String> resolver)
Returns the authentication data sent by client to the target according to the a list of properties. |
protected Representation |
getTargetEntity(Resolver<String> resolver)
Returns the entity sent to the target. |
Method |
getTargetMethod()
Returns the default target method. |
protected Method |
getTargetMethod(Resolver<String> resolver)
Returns the target method according to a list of properties. |
protected Reference |
getTargetRef(Resolver<String> resolver)
Returns the reference of the target according to the a list of properties. |
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(String mailboxLogin)
Sets the login for the mailbox access. |
void |
setMailboxPassword(String mailboxPassword)
Sets the password for the mailbox access. |
void |
setMailboxUri(String mailboxUri)
Sets the URI of the mailbox. |
void |
setMailUriTemplate(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(String targetUri)
Sets the target URI template. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME
public static final String ATTRIBUTE_MAILBOX_LOGIN
public static final String ATTRIBUTE_MAILBOX_PASSWORD
public static final String ATTRIBUTE_MAILBOX_URI
| Constructor Detail |
|---|
public TriggerResource()
| Method Detail |
|---|
@Post
public void acceptMails(Representation entity)
throws ResourceException
entity - The representation of the mails list.
ResourceException
protected void callTarget(Resolver<String> resolver)
throws ResourceException
resolver - The data model that provides parameters value.
ResourceException
protected void deleteMail(String mailIdentifier)
throws ResourceException
mailIdentifier - The identifier of the mail
ResourceException
protected void doInit()
throws ResourceException
doInit in class ResourceResourceException
protected Representation getMail(String identifier)
throws ResourceException
identifier - the mail identifier.
ResourceExceptionpublic ChallengeScheme getMailboxChallengeScheme()
public String getMailboxLogin()
public String getMailboxPassword()
public String getMailboxUri()
protected List<String> getMailIdentifiers()
throws ResourceException
ResourceException
protected Reference getMailRef(String identifier)
throws ResourceException
identifier - The identifier of a mail.
ResourceExceptionpublic String getMailUriTemplate()
public MailResolver getResolver()
protected MailResolver getResolver(String mailIdentifier,
Representation email)
mailIdentifier - Identifier of the mail.email - The mail.
protected Representation getResponseRepresentation(List<String> mailsSuccessful,
Map<String,String> mailsUnsuccessful)
mailsSuccessful - The list of successfull mails.mailsUnsuccessful - The list of successfull mails and related error message.
protected Status getResponseStatus(List<String> mailsSuccessful,
Map<String,String> mailsUnsuccessful)
mailsSuccessful - The list of successfull mails.mailsUnsuccessful - The list of successfull mails and related error message.
protected ChallengeResponse getTargetChallengeResponse(Resolver<String> resolver)
throws ResourceException
resolver - The resolver.
ResourceExceptionprotected Representation getTargetEntity(Resolver<String> resolver)
resolver - the resolver.
public Method getTargetMethod()
protected Method getTargetMethod(Resolver<String> resolver)
resolver - The resolver.
protected Reference getTargetRef(Resolver<String> resolver)
throws ResourceException
resolver - The resolver.
ResourceExceptionpublic String getTargetUri()
public boolean isTargetEntityEnabled()
public void setMailboxChallengeScheme(ChallengeScheme mailboxChallengeScheme)
mailboxChallengeScheme - The scheme of the mailbox challenge.public void setMailboxLogin(String mailboxLogin)
mailboxLogin - The login for the mailbox access.public void setMailboxPassword(String mailboxPassword)
mailboxPassword - The password for the mailbox access.public void setMailboxUri(String mailboxUri)
mailboxUri - the URI of the mailbox.public void setMailUriTemplate(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(String targetUri)
targetUri - The target URI template.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||