Package com.github.ambry.account.mysql
Class ContainerDao
- java.lang.Object
-
- com.github.ambry.account.mysql.ContainerDao
-
public class ContainerDao extends java.lang.Object
Container Data Access Object.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCOUNT_ID
static java.lang.String
CONTAINER_ID
static java.lang.String
CONTAINER_INFO
static java.lang.String
CONTAINER_TABLE
static java.lang.String
CREATION_TIME
static java.lang.String
INDEX_ACCOUNT_CONTAINER
static java.lang.String
INDEX_CONTAINER_NAME
static java.lang.String
LAST_MODIFIED_TIME
static java.lang.String
VERSION
-
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.
-
-
-
Field Detail
-
CONTAINER_TABLE
public static final java.lang.String CONTAINER_TABLE
- See Also:
- Constant Field Values
-
ACCOUNT_ID
public static final java.lang.String ACCOUNT_ID
- See Also:
- Constant Field Values
-
CONTAINER_ID
public static final java.lang.String CONTAINER_ID
- See Also:
- Constant Field Values
-
CONTAINER_INFO
public static final java.lang.String CONTAINER_INFO
- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
CREATION_TIME
public static final java.lang.String CREATION_TIME
- See Also:
- Constant Field Values
-
LAST_MODIFIED_TIME
public static final java.lang.String LAST_MODIFIED_TIME
- See Also:
- Constant Field Values
-
INDEX_ACCOUNT_CONTAINER
public static final java.lang.String INDEX_ACCOUNT_CONTAINER
- See Also:
- Constant Field Values
-
INDEX_CONTAINER_NAME
public static final java.lang.String INDEX_CONTAINER_NAME
- See Also:
- Constant Field Values
-
-
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
Container
s. - 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
Container
s. - Throws:
java.sql.SQLException
-
-