Class ContainerDao


  • public class ContainerDao
    extends java.lang.Object
    Container Data Access Object.
    • Constructor Summary

      Constructors 
      Constructor Description
      ContainerDao​(com.github.ambry.mysql.MySqlDataAccessor dataAccessor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addContainer​(int accountId, com.github.ambry.account.Container container)
      Add a container to the database.
      java.util.List<com.github.ambry.account.Container> getContainers​(int accountId)
      Gets the containers in a specified account.
      java.util.List<com.github.ambry.account.Container> getNewContainers​(long updatedSince)
      Gets all containers that have been created or modified since the specified time.
      void updateContainer​(int accountId, com.github.ambry.account.Container container)
      Updates a container in the database.
      • Methods inherited from class java.lang.Object

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

      • ContainerDao

        public ContainerDao​(com.github.ambry.mysql.MySqlDataAccessor dataAccessor)
    • Method Detail

      • addContainer

        public void addContainer​(int accountId,
                                 com.github.ambry.account.Container container)
                          throws java.sql.SQLException
        Add a container to the database.
        Parameters:
        accountId - the container's parent account id.
        container - the container to insert.
        Throws:
        java.sql.SQLException
      • updateContainer

        public void updateContainer​(int accountId,
                                    com.github.ambry.account.Container container)
                             throws java.sql.SQLException
        Updates a container in the database.
        Parameters:
        accountId - the container's parent account id.
        container - the container to update.
        Throws:
        java.sql.SQLException
      • getContainers

        public java.util.List<com.github.ambry.account.Container> getContainers​(int accountId)
                                                                         throws java.sql.SQLException
        Gets the containers in a specified account.
        Parameters:
        accountId - the id for the parent account.
        Returns:
        a list of Containers.
        Throws:
        java.sql.SQLException
      • getNewContainers

        public java.util.List<com.github.ambry.account.Container> getNewContainers​(long updatedSince)
                                                                            throws java.sql.SQLException
        Gets all containers that have been created or modified since the specified time.
        Parameters:
        updatedSince - the last modified time used to filter.
        Returns:
        a list of Containers.
        Throws:
        java.sql.SQLException