models

Class AbstractProtocol

lucee.Component
    extended by models.AbstractProtocol

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com ---- An abstract class that gives identity to mail protocols when building custom or extending mail protocols the Mail Service uses. The `send()` function is the one you want to implement in your protocols

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any log


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any name
          The protocol's human name.

    • access = public
    • returntype = any
    true false
    struct properties
          A collection of configuration properties for a protocol.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init([struct properties='[runtime expression]'])
          Constructor.
    Method Summary
    string getLog()
    string getName()
    string getProperties()
    any getProperty(any property, [any defaultValue])
         Get a property, throws an exception if not found.
    boolean propertyExists(any property)
         Verifies if a property exists or not.
    struct send(cbmailservices.models.Mail<cbmailservices.models.Mail> payload)
         Implemented by concrete protocols to send a message.
    any setLog(any log)
    any setName(any name)
    any setProperties(struct properties)
    AbstractProtocol setProperty(any property, any value)
         Set a property with a value.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([struct properties='[runtime expression]'])

    Constructor

    Parameters:
    properties - The protocol properties to instantiate

    Property Detail

    log

    property any log

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    name

    property any name

    The protocol's human name

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    properties

    property struct properties

    A collection of configuration properties for a protocol

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    getLog

    public string getLog()


    getName

    public string getName()


    getProperties

    public string getProperties()


    getProperty

    public any getProperty(any property, [any defaultValue])

    Get a property, throws an exception if not found.

    Parameters:
    property - The property to get
    defaultValue - The default value to retrieve if property doesn't exist
    Throws:
    PropertyNotFoundException if the property doesn't exist

    propertyExists

    public boolean propertyExists(any property)

    Verifies if a property exists or not

    Parameters:
    property - The property key

    send

    public struct send(cbmailservices.models.Mail<cbmailservices.models.Mail> payload)

    Implemented by concrete protocols to send a message. The return is a struct with a minimum of the following two keys - `error` - A boolean flag if the message was sent or not - `messages` - An array of messages the protocol stored if any when sending the payload

    Parameters:
    payload - The paylod object to send the message with
    Returns:
    struct of { "error" : boolean, "messages" : [] }

    setLog

    public any setLog(any log)

    Parameters:
    log

    setName

    public any setName(any name)

    Parameters:
    name

    setProperties

    public any setProperties(struct properties)

    Parameters:
    properties

    setProperty

    public AbstractProtocol setProperty(any property, any value)

    Set a property with a value

    Parameters:
    property - The property key
    value - The property value