Skip to content

Commit

Permalink
Issue #495: fix constants
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-vi committed Jun 28, 2023
1 parent 48261db commit b76e6bb
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class Schedulation extends AbstractBehavior<Schedulation.Command> {
public static final EntityTypeKey<Command> ENTITY_TYPE_KEY =
EntityTypeKey.create(Command.class, "schedulation");

private static final String INIT_BEHAVIOUR = "Init";
private static final String READY_BEHAVIOUR = "Ready";
private static final String BUSY_BEHAVIOUR = "Busy";
private static final String NEXT_BEHAVIOUR = "Next";
private static final String FINISH_BEHAVIOUR = "Finish";
public static final String STOPPED_BEHAVIOUR = "Stopped";
private static final String INIT_BEHAVIOR = "Init";
private static final String READY_BEHAVIOR = "Ready";
private static final String BUSY_BEHAVIOR = "Busy";
private static final String NEXT_BEHAVIOR = "Next";
private static final String FINISH_BEHAVIOR = "Finish";
private static final String STOPPED_BEHAVIOR = "Stopped";

public sealed interface Command extends CborSerializable {}
public enum Start implements Command {INSTANCE}
Expand Down Expand Up @@ -95,7 +95,7 @@ public Receive<Command> createReceive() {
}

private Receive<Command> init() {
logBehaviour(INIT_BEHAVIOUR);
logBehavior(INIT_BEHAVIOR);

return newReceiveBuilder()
.onMessageEquals(Start.INSTANCE, this::onStart)
Expand All @@ -105,15 +105,15 @@ private Receive<Command> init() {
}

private Receive<Command> ready() {
logBehaviour(READY_BEHAVIOUR);
logBehavior(READY_BEHAVIOR);

return newReceiveBuilder()
.onMessage(Ingest.class, this::onIngestReady)
.build();
}

private Receive<Command> busy() {
logBehaviour(BUSY_BEHAVIOUR);
logBehavior(BUSY_BEHAVIOR);

return newReceiveBuilder()
.onMessage(
Expand All @@ -123,7 +123,7 @@ private Receive<Command> busy() {
}

private Receive<Command> finish() {
logBehaviour(FINISH_BEHAVIOUR);
logBehavior(FINISH_BEHAVIOR);

return newReceiveBuilder()
.onMessageEquals(SetDataIndex.INSTANCE, this::onSetDataIndex)
Expand All @@ -132,7 +132,7 @@ private Receive<Command> finish() {
}

private Behavior<Command> next() {
logBehaviour(NEXT_BEHAVIOUR);
logBehavior(NEXT_BEHAVIOR);

if (currentIngest != null && currentIngest.payload.isLast()) {
getContext().getSelf().tell(SetDataIndex.INSTANCE);
Expand Down Expand Up @@ -262,7 +262,7 @@ private Behavior<Command> onSetStatusFinished() {
})
);

logBehaviour(STOPPED_BEHAVIOUR);
logBehavior(STOPPED_BEHAVIOR);

return Behaviors.stopped();

Expand All @@ -282,8 +282,8 @@ private String getIndexName() {
return indexName;
}

private void logBehaviour(String behaviour) {
log.info("Schedulation with key {} behaviour is {}", key, behaviour);
private void logBehavior(String behavior) {
log.info("Schedulation with key {} behavior is {}", key, behavior);
}

}

0 comments on commit b76e6bb

Please sign in to comment.