Class: VertxMail::MailService
- Inherits:
-
Object
- Object
- VertxMail::MailService
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-mail-client/src/main/resources/vertx-mail/mail_service.rb
Overview
smtp mail service for vert.x
this Interface provides the methods to be used by the application program and is used to
generate the service in other languages
Class Method Summary (collapse)
-
+ (::VertxMail::MailService) create(vertx = nil, config = nil)
create an instance of MailService that is running in the local JVM.
-
+ (::VertxMail::MailService) create_event_bus_proxy(vertx = nil, address = nil)
create an instance of MailService that calls the mail service via the event bus running somewhere else.
Instance Method Summary (collapse)
-
- (self) send_mail(email = nil) { ... }
send a single mail via MailService.
-
- (void) start
start the MailServer instance if it is running locally (this operation is currently a no-op).
-
- (void) stop
stop the MailServer instance if it is running locally this operation shuts down the connection pool, doesn't wait for completion of the close operations when the mail service is running on the event bus, this operation has no effect.
Class Method Details
+ (::VertxMail::MailService) create(vertx = nil, config = nil)
create an instance of MailService that is running in the local JVM
23 24 25 26 27 28 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mail-client/src/main/resources/vertx-mail/mail_service.rb', line 23 def self.create(vertx=nil,config=nil) if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? return ::VertxMail::MailService.new(Java::IoVertxExtMail::MailService.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtMail::MailConfig.java_class]).call(vertx.j_del,Java::IoVertxExtMail::MailConfig.new(::Vertx::Util::Utils.to_json_object(config)))) end raise ArgumentError, "Invalid arguments when calling create(vertx,config)" end |
+ (::VertxMail::MailService) create_event_bus_proxy(vertx = nil, address = nil)
create an instance of MailService that calls the mail service via the event bus running somewhere else
33 34 35 36 37 38 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mail-client/src/main/resources/vertx-mail/mail_service.rb', line 33 def self.create_event_bus_proxy(vertx=nil,address=nil) if vertx.class.method_defined?(:j_del) && address.class == String && !block_given? return ::VertxMail::MailService.new(Java::IoVertxExtMail::MailService.java_method(:createEventBusProxy, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,address)) end raise ArgumentError, "Invalid arguments when calling create_event_bus_proxy(vertx,address)" end |
Instance Method Details
- (self) send_mail(email = nil) { ... }
send a single mail via MailService
43 44 45 46 47 48 49 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mail-client/src/main/resources/vertx-mail/mail_service.rb', line 43 def send_mail(email=nil) if email.class == Hash && block_given? @j_del.java_method(:sendMail, [Java::IoVertxExtMail::MailMessage.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxExtMail::MailMessage.new(::Vertx::Util::Utils.to_json_object(email)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) })) return self end raise ArgumentError, "Invalid arguments when calling send_mail(email)" end |
- (void) start
This method returns an undefined value.
start the MailServer instance if it is running locally (this operation is currently a no-op)
52 53 54 55 56 57 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mail-client/src/main/resources/vertx-mail/mail_service.rb', line 52 def start if !block_given? return @j_del.java_method(:start, []).call() end raise ArgumentError, "Invalid arguments when calling start()" end |
- (void) stop
This method returns an undefined value.
stop the MailServer instance if it is running locallythis operation shuts down the connection pool, doesn't wait for completion of the close operations when the mail service is running on the event bus, this operation has no effect
63 64 65 66 67 68 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-mail-client/src/main/resources/vertx-mail/mail_service.rb', line 63 def stop if !block_given? return @j_del.java_method(:stop, []).call() end raise ArgumentError, "Invalid arguments when calling stop()" end |