Package org.dizitart.no2.migration
Interface DatabaseInstruction
-
public interface DatabaseInstruction
Represents 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 void
addStep(MigrationStep step)
Adds a migration step to the instruction set.default DatabaseInstruction
addUser(String username, String password)
Adds an instruction to set a user authentication to the database.default DatabaseInstruction
changePassword(String username, String oldPassword, String newPassword)
Adds an instruction to change the password for the user authentication to the database.default DatabaseInstruction
customInstruction(CustomInstruction instruction)
Adds a custom instruction to perform a user defined operation on the database.default DatabaseInstruction
dropCollection(String collectionName)
Adds an instruction to drop aNitriteCollection
from the database.default DatabaseInstruction
dropRepository(Class<?> type)
Adds an instruction to drop anObjectRepository
from the database.default DatabaseInstruction
dropRepository(Class<?> type, String key)
Adds an instruction to drop a keyedObjectRepository
from the database.default DatabaseInstruction
dropRepository(String typeName)
Adds an instruction to drop anObjectRepository
from the database.default DatabaseInstruction
dropRepository(String typeName, String key)
Adds an instruction to drop a keyedObjectRepository
from the database.default DatabaseInstruction
dropRepository(EntityDecorator<?> entityDecorator)
Adds an instruction to drop anObjectRepository
from the database.default DatabaseInstruction
dropRepository(EntityDecorator<?> entityDecorator, String key)
Adds an instruction to drop anObjectRepository
from 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 aNitriteCollection
from the database.- Parameters:
collectionName
- the collection name- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(Class<?> type)
Adds an instruction to drop anObjectRepository
from the database.- Parameters:
type
- the type- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(Class<?> type, String key)
Adds an instruction to drop a keyedObjectRepository
from the database.- Parameters:
type
- the typekey
- the key- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(EntityDecorator<?> entityDecorator)
Adds an instruction to drop anObjectRepository
from the database.- Parameters:
entityDecorator
- the entityDecorator- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(EntityDecorator<?> entityDecorator, String key)
Adds an instruction to drop anObjectRepository
from the database.- Parameters:
entityDecorator
- the entityDecorator- Returns:
- the database instruction
-
dropRepository
default DatabaseInstruction dropRepository(String typeName)
Adds an instruction to drop anObjectRepository
from 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 keyedObjectRepository
from 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
-
-