Package com.mailosaur

Class Servers

java.lang.Object
com.mailosaur.Servers

public class Servers extends Object
  • Constructor Details

  • Method Details

    • list

      Returns a list of your virtual servers. Servers are returned sorted in alphabetical order.
      Returns:
      The result of the server listing operation.
      Throws:
      MailosaurException - Thrown if Mailosaur responds with an error.
      IOException - Unexpected exception.
    • create

      public Server create(ServerCreateOptions options) throws IOException, MailosaurException
      Creates a new virtual server.
      Parameters:
      options - Options used to create a new Mailosaur server.
      Returns:
      Mailosaur virtual SMTP/SMS server.
      Throws:
      MailosaurException - Thrown if Mailosaur responds with an error.
      IOException - Unexpected exception.
    • get

      public Server get(String serverId) throws IOException, MailosaurException
      Retrieves the detail for a single server.
      Parameters:
      serverId - The unique identifier of the server.
      Returns:
      Mailosaur virtual SMTP/SMS server.
      Throws:
      MailosaurException - Thrown if Mailosaur responds with an error.
      IOException - Unexpected exception.
    • getPassword

      public String getPassword(String serverId) throws IOException, MailosaurException
      Retrieves the password for a server. This password can be used for SMTP, POP3, and IMAP connectivity.
      Parameters:
      serverId - The unique identifier of the server.
      Returns:
      The password for the server.
      Throws:
      MailosaurException - Thrown if Mailosaur responds with an error.
      IOException - Unexpected exception.
    • update

      public Server update(String serverId, Server server) throws IOException, MailosaurException
      Updates the attributes of a server.
      Parameters:
      serverId - The unique identifier of the server.
      server - The updated server.
      Returns:
      Mailosaur virtual SMTP/SMS server.
      Throws:
      MailosaurException - Thrown if Mailosaur responds with an error.
      IOException - Unexpected exception.
    • delete

      public void delete(String serverId) throws MailosaurException
      Permanently delete a server. This will also delete all messages, associated attachments, etc. within the server. This operation cannot be undone.
      Parameters:
      serverId - The unique identifier of the server.
      Throws:
      MailosaurException - Thrown if Mailosaur responds with an error.
    • generateEmailAddress

      public String generateEmailAddress(String serverId)
      Generates a random email address by appending a random string in front of the server's domain name.
      Parameters:
      serverId - The identifier of the server.
      Returns:
      A random email address.