Class StorageService


  • public class StorageService
    extends java.lang.Object
    This class is a singleton, only one instance should exist at any time
    • Method Detail

      • getInstance

        public static StorageService getInstance​(java.lang.String path)
      • save

        public void save​(@NotNull
                         Conversation conversation)
                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • save

        public void save​(@NotNull
                         Message m)
                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • save

        public void save​(@NotNull
                         User u)
                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • retrieveAllMessages

        public java.util.List<Message> retrieveAllMessages()
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getConversation

        public Conversation getConversation​(@NotNull
                                            User local,
                                            @NotNull
                                            User remote)
                                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getAllRegisteredUsers

        public java.util.List<User> getAllRegisteredUsers()
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getUserFromPseudo

        public java.util.List<User> getUserFromPseudo​(java.lang.String pseudo)
                                               throws java.sql.SQLException
        Parameters:
        pseudo -
        Returns:
        a List with all the users found. An empty array if none where found
        Throws:
        java.sql.SQLException
      • getPath

        public java.lang.String getPath()