Package org.restlet.ext.javamail
Class TriggerResource
- java.lang.Object
-
- org.restlet.resource.Resource
-
- org.restlet.resource.ServerResource
-
- org.restlet.ext.javamail.TriggerResource
-
@Deprecated public class TriggerResource extends ServerResource
Deprecated.Will be removed in next major release.Resource that handles requests to target resources according to parameters located in mails.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTRIBUTE_MAILBOX_CHALLENGE_SCHEMEDeprecated.static java.lang.StringATTRIBUTE_MAILBOX_LOGINDeprecated.static java.lang.StringATTRIBUTE_MAILBOX_PASSWORDDeprecated.static java.lang.StringATTRIBUTE_MAILBOX_URIDeprecated.private ChallengeSchememailboxChallengeSchemeDeprecated.private java.lang.StringmailboxLoginDeprecated.private java.lang.StringmailboxPasswordDeprecated.private java.lang.StringmailboxUriDeprecated.The mailbox URI template.private java.lang.StringmailUriTemplateDeprecated.The mail URI template, optionally relative to the mailbox URI.private MailResolverresolverDeprecated.Resolver that resolves a name into a value.private booleantargetEntityEnabledDeprecated.Indicates if the target entity should be provided to the target resource.private MethodtargetMethodDeprecated.The method to invoke on the target resource.private java.lang.StringtargetUriDeprecated.The target URI template.
-
Constructor Summary
Constructors Constructor Description TriggerResource()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidacceptMails(Representation entity)Deprecated.Handles POST requests.protected voidcallTarget(Resolver<java.lang.String> resolver)Deprecated.Requests the target resource.protected voiddeleteMail(java.lang.String mailIdentifier)Deprecated.Deletes a mail after it has been processed.protected voiddoInit()Deprecated.Set-up method that can be overridden in order to initialize the state of the resource.protected RepresentationgetMail(java.lang.String identifier)Deprecated.Get the mail representation according to its identifier.ChallengeSchemegetMailboxChallengeScheme()Deprecated.Returns the scheme of the mailbox challenge.java.lang.StringgetMailboxLogin()Deprecated.Returns the login for the mailbox.java.lang.StringgetMailboxPassword()Deprecated.Returns the password for the mailbox.java.lang.StringgetMailboxUri()Deprecated.Returns the URI of the mailbox.protected java.util.List<java.lang.String>getMailIdentifiers()Deprecated.Returns the list of identifiers for the mails in the inboxprotected ReferencegetMailRef(java.lang.String identifier)Deprecated.Returns the reference of a mail according to its identifier.java.lang.StringgetMailUriTemplate()Deprecated.Returns the template of the mail's URI.MailResolvergetResolver()Deprecated.Returns the resolver based on a mail.protected MailResolvergetResolver(java.lang.String mailIdentifier, Representation email)Deprecated.Returns a new resolver based on a mail.protected RepresentationgetResponseRepresentation(java.util.List<java.lang.String> mailsSuccessful, java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)Deprecated.Returns the response's representation according to the list of successfull and unsuccessfull mails.protected StatusgetResponseStatus(java.util.List<java.lang.String> mailsSuccessful, java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)Deprecated.Returns the response's status according to the list of successfull and unsuccessfull mails.protected ChallengeResponsegetTargetChallengeResponse(Resolver<java.lang.String> resolver)Deprecated.Returns the authentication data sent by client to the target according to the a list of properties.protected RepresentationgetTargetEntity(Resolver<java.lang.String> resolver)Deprecated.Returns the entity sent to the target.MethodgetTargetMethod()Deprecated.Returns the default target method.protected MethodgetTargetMethod(Resolver<java.lang.String> resolver)Deprecated.Returns the target method according to a list of properties.protected ReferencegetTargetRef(Resolver<java.lang.String> resolver)Deprecated.Returns the reference of the target according to the a list of properties.java.lang.StringgetTargetUri()Deprecated.Returns the target URI template.booleanisTargetEntityEnabled()Deprecated.Indicate whether or not the target supports entity in the request.voidsetMailboxChallengeScheme(ChallengeScheme mailboxChallengeScheme)Deprecated.Sets the scheme of the mailbox challenge.voidsetMailboxLogin(java.lang.String mailboxLogin)Deprecated.Sets the login for the mailbox access.voidsetMailboxPassword(java.lang.String mailboxPassword)Deprecated.Sets the password for the mailbox access.voidsetMailboxUri(java.lang.String mailboxUri)Deprecated.Sets the URI of the mailbox.voidsetMailUriTemplate(java.lang.String mailUriTemplate)Deprecated.Sets the URI template for the target.voidsetTargetEntityEnabled(boolean targetEntityEnabled)Deprecated.Indicate whether or not the target supports entity in the request.voidsetTargetMethod(Method targetMethod)Deprecated.Sets the default target method.voidsetTargetUri(java.lang.String targetUri)Deprecated.Sets the target URI template.-
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doHandle, doNegotiatedHandle, get, get, getAnnotation, getAnnotation, getAnnotations, 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, updateDimensions
-
Methods inherited from class org.restlet.resource.Resource
doError, 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, toString
-
-
-
-
Field Detail
-
ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME
public static final java.lang.String ATTRIBUTE_MAILBOX_CHALLENGE_SCHEME
Deprecated.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAILBOX_LOGIN
public static final java.lang.String ATTRIBUTE_MAILBOX_LOGIN
Deprecated.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAILBOX_PASSWORD
public static final java.lang.String ATTRIBUTE_MAILBOX_PASSWORD
Deprecated.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAILBOX_URI
public static final java.lang.String ATTRIBUTE_MAILBOX_URI
Deprecated.- See Also:
- Constant Field Values
-
mailboxChallengeScheme
private ChallengeScheme mailboxChallengeScheme
Deprecated.
-
mailboxLogin
private java.lang.String mailboxLogin
Deprecated.
-
mailboxPassword
private java.lang.String mailboxPassword
Deprecated.
-
mailboxUri
private java.lang.String mailboxUri
Deprecated.The mailbox URI template.
-
mailUriTemplate
private java.lang.String mailUriTemplate
Deprecated.The mail URI template, optionally relative to the mailbox URI. The template should contain a variable "{mailId}" for the insertion of the mail identifier in the proper location. The default value is "/{mailId}".
-
resolver
private MailResolver resolver
Deprecated.Resolver that resolves a name into a value.
-
targetEntityEnabled
private boolean targetEntityEnabled
Deprecated.Indicates if the target entity should be provided to the target resource.
-
targetMethod
private Method targetMethod
Deprecated.The method to invoke on the target resource.
-
targetUri
private java.lang.String targetUri
Deprecated.The target URI template.
-
-
Method Detail
-
acceptMails
@Post public void acceptMails(Representation entity) throws ResourceException
Deprecated.Handles POST requests. It retrieves a list of mails and generate requests to target resources.- Parameters:
entity- The representation of the mails list.- Throws:
ResourceException
-
callTarget
protected void callTarget(Resolver<java.lang.String> resolver) throws ResourceException
Deprecated.Requests the target resource.- Parameters:
resolver- The data model that provides parameters value.- Throws:
ResourceException
-
deleteMail
protected void deleteMail(java.lang.String mailIdentifier) throws ResourceExceptionDeprecated.Deletes a mail after it has been processed.- Parameters:
mailIdentifier- The identifier of the mail- Throws:
ResourceException
-
doInit
protected void doInit() throws ResourceExceptionDeprecated.Description copied from class:ResourceSet-up method that can be overridden in order to initialize the state of the resource. By default it does nothing.- Overrides:
doInitin classResource- Throws:
ResourceException- See Also:
Resource.init(Context, Request, Response)
-
getMail
protected Representation getMail(java.lang.String identifier) throws ResourceException
Deprecated.Get the mail representation according to its identifier.- Parameters:
identifier- the mail identifier.- Throws:
ResourceException
-
getMailboxChallengeScheme
public ChallengeScheme getMailboxChallengeScheme()
Deprecated.Returns the scheme of the mailbox challenge.- Returns:
- The scheme of the mailbox challenge.
-
getMailboxLogin
public java.lang.String getMailboxLogin()
Deprecated.Returns the login for the mailbox.- Returns:
- The login for the mailbox.
-
getMailboxPassword
public java.lang.String getMailboxPassword()
Deprecated.Returns the password for the mailbox.- Returns:
- The password for the mailbox.
-
getMailboxUri
public java.lang.String getMailboxUri()
Deprecated.Returns the URI of the mailbox.- Returns:
- The URI of the mailbox.
-
getMailIdentifiers
protected java.util.List<java.lang.String> getMailIdentifiers() throws ResourceExceptionDeprecated.Returns the list of identifiers for the mails in the inbox- Returns:
- The list of identifiers.
- Throws:
ResourceException
-
getMailRef
protected Reference getMailRef(java.lang.String identifier) throws ResourceException
Deprecated.Returns the reference of a mail according to its identifier.- Parameters:
identifier- The identifier of a mail.- Returns:
- The URI of the mail.
- Throws:
ResourceException
-
getMailUriTemplate
public java.lang.String getMailUriTemplate()
Deprecated.Returns the template of the mail's URI.- Returns:
- the template of the mail's URI.
-
getResolver
public MailResolver getResolver()
Deprecated.Returns the resolver based on a mail.- Returns:
- The resolver.
-
getResolver
protected MailResolver getResolver(java.lang.String mailIdentifier, Representation email)
Deprecated.Returns a new resolver based on a mail.- Parameters:
mailIdentifier- Identifier of the mail.email- The mail.- Returns:
- A resolver.
-
getResponseRepresentation
protected Representation getResponseRepresentation(java.util.List<java.lang.String> mailsSuccessful, java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)
Deprecated.Returns the response's representation according to the list of successfull and unsuccessfull mails.- Parameters:
mailsSuccessful- The list of successfull mails.mailsUnsuccessful- The list of successfull mails and related error message.- Returns:
- The response's representation.
-
getResponseStatus
protected Status getResponseStatus(java.util.List<java.lang.String> mailsSuccessful, java.util.Map<java.lang.String,java.lang.String> mailsUnsuccessful)
Deprecated.Returns the response's status according to the list of successfull and unsuccessfull mails.- Parameters:
mailsSuccessful- The list of successfull mails.mailsUnsuccessful- The list of successfull mails and related error message.- Returns:
- The response's status.
-
getTargetChallengeResponse
protected ChallengeResponse getTargetChallengeResponse(Resolver<java.lang.String> resolver) throws ResourceException
Deprecated.Returns the authentication data sent by client to the target according to the a list of properties. By default, this method returns checks the variable "challengeScheme", "login", "password" in order to build the ChallengeResponse object. It can be overriden.- Parameters:
resolver- The resolver.- Returns:
- The target challengeResponse object.
- Throws:
ResourceException
-
getTargetEntity
protected Representation getTargetEntity(Resolver<java.lang.String> resolver)
Deprecated.Returns the entity sent to the target. By default, it sends the mail message.- Parameters:
resolver- the resolver.- Returns:
- The entity to be sent to the target.
-
getTargetMethod
public Method getTargetMethod()
Deprecated.Returns the default target method.- Returns:
- The default target method.
-
getTargetMethod
protected Method getTargetMethod(Resolver<java.lang.String> resolver)
Deprecated.Returns the target method according to a list of properties.- Parameters:
resolver- The resolver.- Returns:
- The target method.
-
getTargetRef
protected Reference getTargetRef(Resolver<java.lang.String> resolver) throws ResourceException
Deprecated.Returns the reference of the target according to the a list of properties.- Parameters:
resolver- The resolver.- Returns:
- The target reference.
- Throws:
ResourceException
-
getTargetUri
public java.lang.String getTargetUri()
Deprecated.Returns the target URI template.- Returns:
- The template that represents a target URI.
-
isTargetEntityEnabled
public boolean isTargetEntityEnabled()
Deprecated.Indicate whether or not the target supports entity in the request.- Returns:
- True if the target supports entity in the request, false, otherwise.
-
setMailboxChallengeScheme
public void setMailboxChallengeScheme(ChallengeScheme mailboxChallengeScheme)
Deprecated.Sets the scheme of the mailbox challenge.- Parameters:
mailboxChallengeScheme- The scheme of the mailbox challenge.
-
setMailboxLogin
public void setMailboxLogin(java.lang.String mailboxLogin)
Deprecated.Sets the login for the mailbox access.- Parameters:
mailboxLogin- The login for the mailbox access.
-
setMailboxPassword
public void setMailboxPassword(java.lang.String mailboxPassword)
Deprecated.Sets the password for the mailbox access.- Parameters:
mailboxPassword- The password for the mailbox access.
-
setMailboxUri
public void setMailboxUri(java.lang.String mailboxUri)
Deprecated.Sets the URI of the mailbox.- Parameters:
mailboxUri- the URI of the mailbox.
-
setMailUriTemplate
public void setMailUriTemplate(java.lang.String mailUriTemplate)
Deprecated.Sets the URI template for the target.- Parameters:
mailUriTemplate- the URI template for the target.
-
setTargetEntityEnabled
public void setTargetEntityEnabled(boolean targetEntityEnabled)
Deprecated.Indicate whether or not the target supports entity in the request.- Parameters:
targetEntityEnabled- True if the target supports entity in the request, false, otherwise.
-
setTargetMethod
public void setTargetMethod(Method targetMethod)
Deprecated.Sets the default target method.- Parameters:
targetMethod- The default target method.
-
setTargetUri
public void setTargetUri(java.lang.String targetUri)
Deprecated.Sets the target URI template.- Parameters:
targetUri- The target URI template.
-
-