Skip to content

Commit

Permalink
Remove validOrgGuid validation and refactor property names in applica…
Browse files Browse the repository at this point in the history
…tion.yml
  • Loading branch information
bonzofenix committed Dec 29, 2024
1 parent 2137430 commit 211ea58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class CFServerConfig {
private Logger logger = Logger.getLogger(this.getClass().getName());

@Bean
HttpServer cfServer(CFServerConfiguration config) throws IOException {
// Define a simple request handler (example only)
HttpRequestHandler requestHandler =
Expand All @@ -23,14 +24,14 @@ HttpServer cfServer(CFServerConfiguration config) throws IOException {
response.setEntity(new StringEntity("Hello from CFServer!"));
};

// Build the HTTP server
HttpServer server = ServerBootstrap.bootstrap()
.setListenerPort(config.getPort())
.registerHandler("*", requestHandler) // Register a default handler
.create();
// Build the HTTP server
HttpServer server = ServerBootstrap.bootstrap()
.setListenerPort(config.getPort())
.registerHandler("*", requestHandler) // Register a default handler
.create();

logger.info("Configured HttpServer on port: " + config.getPort());
return server;
logger.info("Configured HttpServer on port: " + config.getPort());
return server;
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ public void init() {
if (this.port <= 0) {
throw new IllegalStateException("CF Server Port is not set");
}
if (this.validOrgGuid == null || this.validOrgGuid.isEmpty()) {
throw new IllegalStateException("CF Server validOrgGuid is not set");
}
}

public long getSocketTimeout() {
Expand Down
4 changes: 2 additions & 2 deletions src/scheduler/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ server:

cf-server:
port: 8082
valid-org-guid: "some-org-guid"
valid-space-guid: "some-space-guid"
validOrgGuid: "some-org-guid"
validSpaceGuid: "some-space-guid"

0 comments on commit 211ea58

Please sign in to comment.