indexing
	description: "Mailer object used to send or retrieve resources"
	author: "david s"
	date: "$Date$"
	revision: "$Revision$"

class interface
	MAILER

create 

feature -- Access

	from_resource: EMAIL_RESOURCE
			-- Resource that will be sent.

	to_resource: EMAIL_RESOURCE
			-- Resource that will receive.
	
feature -- Status report

	error: BOOLEAN

	transfer_error: TRANSFER_ERROR
			-- Has the transfer failed?
	
feature -- Basic operations

	transfer
			-- transfer data and check for errors.
		require
			resources_exists: from_resource /= void and then to_resource /= void
			valid_transfer: (from_resource.can_be_sent and then to_resource.can_send) or (from_resource.can_receive and then to_resource.can_be_received)
	
feature -- Settings

	set_from_resource (resource: EMAIL_RESOURCE)
			-- Set 'resource' to from_resource.
		require
			resource_exists: resource /= void
			valid_from_resource: resource.can_be_sent or resource.can_receive

	set_to_resource (resource: EMAIL_RESOURCE)
			-- Set 'resource' to to_resource.
		require
			resource_exists: resource /= void
			valid_to_resource: resource.can_send or resource.can_be_received
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

end -- class MAILER