use of io.spine.server.tenant.TenantAwareOperation in project core-java by SpineEventEngine.
the class CommandStore method updateStatus.
/**
* Updates the status of the command with the passed error.
*
* @param commandEnvelope the ID of the command
* @param error the error, which occurred during command processing
*/
private void updateStatus(CommandEnvelope commandEnvelope, final Error error) {
keepTenantId(commandEnvelope.getCommand());
final TenantAwareOperation op = new CommandOperation(commandEnvelope.getCommand()) {
@Override
public void run() {
repository.updateStatus(commandId(), error);
}
};
op.execute();
}
use of io.spine.server.tenant.TenantAwareOperation in project core-java by SpineEventEngine.
the class CommandStore method store.
/**
* Stores a command with the error status.
*
* @param command a command to store
* @param error an error occurred
*/
public void store(final Command command, final Error error) {
keepTenantId(command);
final TenantAwareOperation op = new Operation(this, command) {
@Override
public void run() {
repository.store(command, error);
}
};
op.execute();
}
use of io.spine.server.tenant.TenantAwareOperation in project core-java by SpineEventEngine.
the class CommandStore method setCommandStatusOk.
/**
* Sets the status of the command to {@link CommandStatus#OK}
*/
public void setCommandStatusOk(CommandEnvelope commandEnvelope) {
keepTenantId(commandEnvelope.getCommand());
final TenantAwareOperation op = new Operation(this, commandEnvelope) {
@Override
public void run() {
repository.setOkStatus(commandId());
}
};
op.execute();
}
Aggregations