Class 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 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.
    • Constructor Detail

      • TriggerResource

        public TriggerResource()
        Deprecated.
    • 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 ResourceException
        Deprecated.
        Deletes a mail after it has been processed.
        Parameters:
        mailIdentifier - The identifier of the mail
        Throws:
        ResourceException
      • 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 ResourceException
        Deprecated.
        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.