Package org.dizitart.no2.migration
Interface DatabaseInstruction
-
public interface DatabaseInstructionRepresents a migration instruction set for the nitrite database.- Since:
- 4.0
- Author:
- Anindya Chatterjee
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddStep(MigrationStep step)Adds a migration step to the instruction set.default DatabaseInstructionaddUser(String username, String password)Adds an instruction to set a user authentication to the database.default DatabaseInstructionchangePassword(String username, String oldPassword, String newPassword)Adds an instruction to change the password for the user authentication to the database.default DatabaseInstructioncustomInstruction(CustomInstruction instruction)Adds a custom instruction to perform a user defined operation on the database.default DatabaseInstructiondropCollection(String collectionName)Adds an instruction to drop aNitriteCollectionfrom the database.default DatabaseInstructiondropRepository(Class<?> type)Adds an instruction to drop anObjectRepositoryfrom the database.default DatabaseInstructiondropRepository(Class<?> type, String key)Adds an instruction to drop a keyedObjectRepositoryfrom the database.default DatabaseInstructiondropRepository(String typeName)Adds an instruction to drop anObjectRepositoryfrom the database.default DatabaseInstructiondropRepository(String typeName, String key)Adds an instruction to drop a keyedObjectRepositoryfrom the database.default DatabaseInstructiondropRepository(EntityDecorator<?> entityDecorator)Adds an instruction to drop anObjectRepositoryfrom the database.default DatabaseInstructiondropRepository(EntityDecorator<?> entityDecorator, String key)Adds an instruction to drop anObjectRepositoryfrom the database.
-
-
-
Method Detail
-
addUser
default DatabaseInstruction addUser(String username, String password)
Adds an instruction to set a user authentication to the database.- Parameters:
username- the usernamepassword- the password- Returns:
- the database instruction
-
changePassword
default DatabaseInstruction changePassword(String username, String oldPassword, String newPassword)
Adds an instruction to change the password for the user authentication to the database.- Parameters:
username- the usernameoldPassword- the old passwordnewPassword- the new password- Returns:
- the database instruction
-
dropCollection
default DatabaseInstruction dropCollection(String collectionName)
Adds an instruction to drop aNitriteCollectionfrom the database.- Parameters:
collectionName- the collection name- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(Class<?> type)
Adds an instruction to drop anObjectRepositoryfrom the database.- Parameters:
type- the type- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(Class<?> type, String key)
Adds an instruction to drop a keyedObjectRepositoryfrom the database.- Parameters:
type- the typekey- the key- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(EntityDecorator<?> entityDecorator)
Adds an instruction to drop anObjectRepositoryfrom the database.- Parameters:
entityDecorator- the entityDecorator- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(EntityDecorator<?> entityDecorator, String key)
Adds an instruction to drop anObjectRepositoryfrom the database.- Parameters:
entityDecorator- the entityDecorator- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(String typeName)
Adds an instruction to drop anObjectRepositoryfrom the database.- Parameters:
typeName- the type name- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(String typeName, String key)
Adds an instruction to drop a keyedObjectRepositoryfrom the database.- Parameters:
typeName- the type namekey- the key- Returns:
- the database instruction
-
customInstruction
default DatabaseInstruction customInstruction(CustomInstruction instruction)
Adds a custom instruction to perform a user defined operation on the database.- Parameters:
instruction- the instruction- Returns:
- the database instruction
-
addStep
void addStep(MigrationStep step)
Adds a migration step to the instruction set.- Parameters:
step- the step
-
-