Skip to content

Commit

Permalink
Controller shared interface (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziadsadek999 authored May 5, 2024
1 parent 9146b6c commit ef8ffdd
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.workup.shared.commands.controller;

/** Adds a new command to the commands maps. */
public class AddCommandRequest {
// TODO: Add fields
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.workup.shared.commands.controller;

/** Makes a service start accepting requests and acquire resources again. */
public class ContinueRequest {
// No fields are required?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.workup.shared.commands.controller;

/** Deletes a command from the commands map. */
public class DeleteCommandRequest {
// TODO: Add fields
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.workup.shared.commands.controller;

/** Makes a service stop accepting requests and release resources. */
public class FreezeRequest {
// No fields are required?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.workup.shared.commands.controller;

import com.workup.shared.enums.ErrorLevel;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

/** Set the severity level of an error to be reported. */
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class SetErrorReportingLevelRequest {
ErrorLevel errorLevel;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.workup.shared.commands.controller;

import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

/** Sets the number of DB connections in the pool of a service. */
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class SetMaxDBConnectionsRequest {
int maxDBConnections;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.workup.shared.commands.controller;

import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

/** Set the maximum number of threads that a service can use. */
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class SetMaxThreadsRequest {
int maxThreads;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.workup.shared.commands.controller;

import com.workup.shared.enums.ServiceQueueNames;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

/** Sets the name of the message queue the service is listening to. */
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class SetMessageQueueRequest {
ServiceQueueNames messageQueue;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.workup.shared.commands.controller;

/** Updates a single class in the system. Not sure how, when, or why this would be used. */
public class UpdateClassRequest {
// TODO: Implement this class
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.workup.shared.commands.controller;

/** Updates the logic of a certain command. */
public class UpdateCommandRequest {
// TODO: Implement this class
}
8 changes: 8 additions & 0 deletions shared/src/main/java/com/workup/shared/enums/ErrorLevel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.workup.shared.enums;

public enum ErrorLevel {
INFO,
WARNING,
ERROR,
FATAL
}

0 comments on commit ef8ffdd

Please sign in to comment.