public class TriggerResource extends ServerResource
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME |
static String |
ATTRIBUTE_MAILBOX_LOGIN |
static String |
ATTRIBUTE_MAILBOX_PASSWORD |
static String |
ATTRIBUTE_MAILBOX_URI |
| Constructor and Description |
|---|
TriggerResource() |
| Modifier and Type | Method and Description |
|---|---|
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()
Set-up method that can be overridden in order to initialize the state of
the resource.
|
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.
|
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensionsdoError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toStringpublic 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
@Post public void acceptMails(Representation entity) throws ResourceException
entity - The representation of the mails list.ResourceExceptionprotected void callTarget(Resolver<String> resolver) throws ResourceException
resolver - The data model that provides parameters value.ResourceExceptionprotected void deleteMail(String mailIdentifier) throws ResourceException
mailIdentifier - The identifier of the mailResourceExceptionprotected void doInit()
throws ResourceException
ResourcedoInit in class ResourceResourceExceptionResource.init(Context, Request, Response)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
ResourceExceptionprotected 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.Copyright © 2005–2016. All rights reserved.