Class BlueMindSessionMailbox

java.lang.Object
org.exoplatform.bluemind.mail.service.BlueMindSessionMailbox
All Implemented Interfaces:
BlueMindMailbox

public class BlueMindSessionMailbox extends Object implements BlueMindMailbox
The mailbox of one open session, over bluemind-client's mailbox calls: every call is the client's, on the session the client opened, so the paths, the key header and the failures by kind are the client's rules.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlueMindSessionMailbox(org.exoplatform.bluemind.client.BlueMindMailboxClient mailboxClient, org.exoplatform.bluemind.client.BlueMindMailboxSharingClient sharingClient, org.exoplatform.bluemind.client.BlueMindSession session)
    The mailbox of a session.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    addRule(tools.jackson.databind.node.ObjectNode rule)
    Adds one filter rule (PUT _rules) after the last rule of its own client, and nothing else.
    void
    deleteRule(long id)
    Removes one filter rule (DELETE _rules/{id}), and nothing else.
    org.exoplatform.bluemind.client.model.BlueMindDirectoryEntry
    The directory entry of an address (directory/_byEmail).
    org.exoplatform.bluemind.client.model.BlueMindDirectoryEntry
    The directory entry of a uid (directory/entry-uid).
    List<org.exoplatform.bluemind.client.model.BlueMindAclEntry>
    The access-control list of the login's own mailbox (GET _acls).
    List<org.exoplatform.bluemind.client.model.BlueMindAclEntry>
    getFolderAcl(String folderUid)
    The access-control list of one of the login's own folders (GET _acl of its records container), every subject's verbs expanded, the owner's row included.
    List<org.exoplatform.bluemind.client.model.BlueMindMailFolder>
    The folders of the login's own mailbox, the deleted ones left out.
    org.exoplatform.bluemind.client.model.BlueMindForwarding
    The forward (GET _forwarding).
    List<tools.jackson.databind.node.ObjectNode>
    Every filter rule of the login's own mailbox (GET _rules), whatever client wrote it, in BlueMind's order.
    List<tools.jackson.databind.node.ObjectNode>
    The filter rules one client wrote in the login's own mailbox (GET _rulesByClient), in BlueMind's order.
    List<org.exoplatform.bluemind.client.model.BlueMindSharedContainer>
    The login's own folders shared with somebody, in one call (_shared?type=mailbox_records): each folder's records container and the rows given on it, as stored (compact, the owner's rows left out).
    org.exoplatform.bluemind.client.model.BlueMindVacation
    The automatic reply (GET _vacation).
    List<org.exoplatform.bluemind.client.model.BlueMindMailboxSubscription>
    The login's own user's subscriptions to mailboxes, its own mailbox included.
    void
    setAcls(List<org.exoplatform.bluemind.client.model.BlueMindAclEntry> entries)
    Replaces the access-control list of the login's own mailbox (POST _acls) with exactly the rows given.
    void
    setFolderAcl(String folderUid, List<org.exoplatform.bluemind.client.model.BlueMindAclEntry> entries)
    Replaces the access-control list of one of the login's own folders (PUT _acl of its records container) with exactly the rows given.
    void
    setForwarding(org.exoplatform.bluemind.client.model.BlueMindForwarding forwarding)
    Replaces the forward (POST _forwarding), and nothing else.
    void
    setVacation(org.exoplatform.bluemind.client.model.BlueMindVacation vacation)
    Replaces the automatic reply (POST _vacation), and nothing else.
    void
    Subscribes the login's own user to another user's mailbox.
    The account's own time zone, as its login answered it.
    void
    Withdraws the login's own user's subscription to another user's mailbox.
    void
    updateRule(long id, tools.jackson.databind.node.ObjectNode rule)
    Replaces one filter rule in place (POST _rules/{id}), and nothing else.
    The directory entry uid the session was authenticated as, as its login answered it: the owner of the mailbox every call here addresses.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlueMindSessionMailbox

      public BlueMindSessionMailbox(org.exoplatform.bluemind.client.BlueMindMailboxClient mailboxClient, org.exoplatform.bluemind.client.BlueMindMailboxSharingClient sharingClient, org.exoplatform.bluemind.client.BlueMindSession session)
      The mailbox of a session.
      Parameters:
      mailboxClient - the client's mailbox calls
      sharingClient - the client's sharing calls
      session - the session the client opened for the job
  • Method Details

    • timeZone

      public String timeZone()
      The account's own time zone, as its login answered it.
      Specified by:
      timeZone in interface BlueMindMailbox
      Returns:
      the zone id, or null when the answer named none
    • getVacation

      public org.exoplatform.bluemind.client.model.BlueMindVacation getVacation()
      The automatic reply (GET _vacation).
      Specified by:
      getVacation in interface BlueMindMailbox
      Returns:
      what the server holds; off and empty when nothing was ever set
    • setVacation

      public void setVacation(org.exoplatform.bluemind.client.model.BlueMindVacation vacation)
      Replaces the automatic reply (POST _vacation), and nothing else.
      Specified by:
      setVacation in interface BlueMindMailbox
      Parameters:
      vacation - the reply
    • getForwarding

      public org.exoplatform.bluemind.client.model.BlueMindForwarding getForwarding()
      The forward (GET _forwarding).
      Specified by:
      getForwarding in interface BlueMindMailbox
      Returns:
      what the server holds; off when nothing was ever set
    • setForwarding

      public void setForwarding(org.exoplatform.bluemind.client.model.BlueMindForwarding forwarding)
      Replaces the forward (POST _forwarding), and nothing else. The caller has checked the destination.
      Specified by:
      setForwarding in interface BlueMindMailbox
      Parameters:
      forwarding - the forward
    • userUid

      public String userUid()
      The directory entry uid the session was authenticated as, as its login answered it: the owner of the mailbox every call here addresses.
      Specified by:
      userUid in interface BlueMindMailbox
      Returns:
      the uid, or null when the answer named none
    • getAcls

      public List<org.exoplatform.bluemind.client.model.BlueMindAclEntry> getAcls()
      The access-control list of the login's own mailbox (GET _acls).
      Specified by:
      getAcls in interface BlueMindMailbox
      Returns:
      the rows, in BlueMind's order
    • setAcls

      public void setAcls(List<org.exoplatform.bluemind.client.model.BlueMindAclEntry> entries)
      Replaces the access-control list of the login's own mailbox (POST _acls) with exactly the rows given.
      Specified by:
      setAcls in interface BlueMindMailbox
      Parameters:
      entries - the whole list, the owner's own rows included
    • findByEmail

      public org.exoplatform.bluemind.client.model.BlueMindDirectoryEntry findByEmail(String email)
      The directory entry of an address (directory/_byEmail).
      Specified by:
      findByEmail in interface BlueMindMailbox
      Parameters:
      email - the address
      Returns:
      the entry, or null when the directory holds none
    • findByUid

      public org.exoplatform.bluemind.client.model.BlueMindDirectoryEntry findByUid(String uid)
      The directory entry of a uid (directory/entry-uid).
      Specified by:
      findByUid in interface BlueMindMailbox
      Parameters:
      uid - the uid
      Returns:
      the entry, or null when the directory holds none
    • subscribeToMailbox

      public void subscribeToMailbox(String ownerUid)
      Subscribes the login's own user to another user's mailbox.
      Specified by:
      subscribeToMailbox in interface BlueMindMailbox
      Parameters:
      ownerUid - the owner's uid
    • unsubscribeFromMailbox

      public void unsubscribeFromMailbox(String ownerUid)
      Withdraws the login's own user's subscription to another user's mailbox.
      Specified by:
      unsubscribeFromMailbox in interface BlueMindMailbox
      Parameters:
      ownerUid - the owner's uid
    • mailboxSubscriptions

      public List<org.exoplatform.bluemind.client.model.BlueMindMailboxSubscription> mailboxSubscriptions()
      The login's own user's subscriptions to mailboxes, its own mailbox included.
      Specified by:
      mailboxSubscriptions in interface BlueMindMailbox
      Returns:
      the subscriptions
    • getRules

      public List<tools.jackson.databind.node.ObjectNode> getRules()
      Every filter rule of the login's own mailbox (GET _rules), whatever client wrote it, in BlueMind's order.
      Specified by:
      getRules in interface BlueMindMailbox
      Returns:
      the rules, as BlueMind's JSON objects
    • getRulesByClient

      public List<tools.jackson.databind.node.ObjectNode> getRulesByClient(String client)
      The filter rules one client wrote in the login's own mailbox (GET _rulesByClient), in BlueMind's order.
      Specified by:
      getRulesByClient in interface BlueMindMailbox
      Parameters:
      client - the client
      Returns:
      the rules, as BlueMind's JSON objects
    • addRule

      public long addRule(tools.jackson.databind.node.ObjectNode rule)
      Adds one filter rule (PUT _rules) after the last rule of its own client, and nothing else.
      Specified by:
      addRule in interface BlueMindMailbox
      Parameters:
      rule - the rule, without an id
      Returns:
      the id BlueMind gave it
    • updateRule

      public void updateRule(long id, tools.jackson.databind.node.ObjectNode rule)
      Replaces one filter rule in place (POST _rules/{id}), and nothing else.
      Specified by:
      updateRule in interface BlueMindMailbox
      Parameters:
      id - the rule's id
      rule - the rule
    • deleteRule

      public void deleteRule(long id)
      Removes one filter rule (DELETE _rules/{id}), and nothing else.
      Specified by:
      deleteRule in interface BlueMindMailbox
      Parameters:
      id - the rule's id
    • getFolders

      public List<org.exoplatform.bluemind.client.model.BlueMindMailFolder> getFolders()
      The folders of the login's own mailbox, the deleted ones left out.
      Specified by:
      getFolders in interface BlueMindMailbox
      Returns:
      the folders
    • getFolderAcl

      public List<org.exoplatform.bluemind.client.model.BlueMindAclEntry> getFolderAcl(String folderUid)
      The access-control list of one of the login's own folders (GET _acl of its records container), every subject's verbs expanded, the owner's row included.
      Specified by:
      getFolderAcl in interface BlueMindMailbox
      Parameters:
      folderUid - the folder's uid, from BlueMindMailbox.getFolders()
      Returns:
      the rows, in BlueMind's order
    • setFolderAcl

      public void setFolderAcl(String folderUid, List<org.exoplatform.bluemind.client.model.BlueMindAclEntry> entries)
      Replaces the access-control list of one of the login's own folders (PUT _acl of its records container) with exactly the rows given.
      Specified by:
      setFolderAcl in interface BlueMindMailbox
      Parameters:
      folderUid - the folder's uid, from BlueMindMailbox.getFolders()
      entries - the whole list, the owner's own rows included
    • getSharedFolders

      public List<org.exoplatform.bluemind.client.model.BlueMindSharedContainer> getSharedFolders()
      The login's own folders shared with somebody, in one call (_shared?type=mailbox_records): each folder's records container and the rows given on it, as stored (compact, the owner's rows left out).
      Specified by:
      getSharedFolders in interface BlueMindMailbox
      Returns:
      the shared folders' containers