Skip to content

Commit 22b86b1

Browse files
committed
System Touch
1 parent 4bdde6e commit 22b86b1

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

source/connections/ConnectionPoller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public ConnectionPoller(BaseServer BASESERVER, String HOST, Integer PORT)
3636
{
3737
this.BASESERVER = BASESERVER;
3838

39-
this.WEBEXPRESS = (WebExpress) this.BASESERVER.SUPERCLASS;
39+
this.WEBEXPRESS = (WebExpress) this.BASESERVER.INHERITOR;
4040

4141
this.HOST = HOST;
4242

source/db/N21AuthConfig.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
*/
1919
public class N21AuthConfig
2020
{
21+
public static final String COLOR_LIME_GREEN = "\u001B[92m";
22+
public static final String COLOR_YELLOW = "\u001B[93m";
23+
public static final String COLOR_STANDARD_RED = "\u001B[91m";
24+
public static final String COLOR_RESET = "\u001B[0m";
25+
2126
public final String host;
2227
public final int port;
2328
public final String username;
@@ -95,21 +100,18 @@ public void ensureMysqlRunning()
95100
if (notInstalled)
96101
{
97102
CommonRails.printSystemComponent(this, this.hashCode(),
98-
". systemctl status mysql — MySQL NOT INSTALLED on this system .",
99-
CommonRails.COLOR_STANDARD_RED);
103+
COLOR_STANDARD_RED + ". systemctl status mysql — MySQL NOT INSTALLED on this system ." + COLOR_RESET);
100104
return;
101105
}
102106
else if (running)
103107
{
104108
CommonRails.printSystemComponent(this, this.hashCode(),
105-
". systemctl status mysql — active (running) .",
106-
CommonRails.COLOR_LIME_GREEN);
109+
COLOR_LIME_GREEN + ". systemctl status mysql — active (running) ." + COLOR_RESET);
107110
}
108111
else
109112
{
110113
CommonRails.printSystemComponent(this, this.hashCode(),
111-
". systemctl status mysql — inactive / stopped .",
112-
CommonRails.COLOR_YELLOW);
114+
COLOR_YELLOW + ". systemctl status mysql — inactive / stopped ." + COLOR_RESET);
113115

114116
if (useSudo)
115117
{
@@ -120,16 +122,15 @@ else if (running)
120122
boolean nowRunning = (recheck.exitValue() == 0);
121123

122124
CommonRails.printSystemComponent(this, this.hashCode(),
123-
". systemctl start mysql — " + (nowRunning ? "now running ." : "FAILED to start ."),
124-
nowRunning ? CommonRails.COLOR_LIME_GREEN : CommonRails.COLOR_STANDARD_RED);
125+
(nowRunning ? COLOR_LIME_GREEN : COLOR_STANDARD_RED)
126+
+ ". systemctl start mysql — " + (nowRunning ? "now running ." : "FAILED to start .") + COLOR_RESET);
125127
}
126128
}
127129
}
128130
catch (Exception e)
129131
{
130132
CommonRails.printSystemComponent(this, this.hashCode(),
131-
". systemctl status mysql — check failed: " + e.getMessage() + " .",
132-
CommonRails.COLOR_STANDARD_RED);
133+
COLOR_STANDARD_RED + ". systemctl status mysql — check failed: " + e.getMessage() + " ." + COLOR_RESET);
133134
}
134135

135136
// ── 2. JDBC login test using credentials from mysql.auth.xml ──────────
@@ -143,15 +144,13 @@ else if (running)
143144
try (Connection conn = DriverManager.getConnection(url, username, password))
144145
{
145146
CommonRails.printSystemComponent(this, this.hashCode(),
146-
". MySQL JDBC login — user '" + username + "' authenticated successfully .",
147-
CommonRails.COLOR_LIME_GREEN);
147+
COLOR_LIME_GREEN + ". MySQL JDBC login — user '" + username + "' authenticated successfully ." + COLOR_RESET);
148148
}
149149
}
150150
catch (Exception e)
151151
{
152152
CommonRails.printSystemComponent(this, this.hashCode(),
153-
". MySQL JDBC login — user '" + username + "' FAILED: " + e.getMessage() + " .",
154-
CommonRails.COLOR_STANDARD_RED);
153+
COLOR_STANDARD_RED + ". MySQL JDBC login — user '" + username + "' FAILED: " + e.getMessage() + " ." + COLOR_RESET);
155154
}
156155
}
157156

source/messaging/MessageQueueSorter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public void run()
8484
catch (Exception e)
8585
{
8686
ExceptionHandler.dispatch(e);
87+
8788
CurrentConnections connections = this.WEBEXPRESS.CURRENT_CONNECTIONS;
8889

8990
connections.remove(message.CONNECTION);
@@ -100,6 +101,7 @@ public void run()
100101
catch (IOException e)
101102
{
102103
ExceptionHandler.dispatch(e);
104+
103105
CommonRails.printSystemComponent(this, this.hashCode(),". WebExpress MessageQueueSorter socket connection closed Socket: " + message.INTERNET_ADDRESS + " .");
104106
}
105107

0 commit comments

Comments
 (0)