-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da5f8a7
commit 41f14bd
Showing
7 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
core/src/main/java/lucee/runtime/functions/gateway/GatewayAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package lucee.runtime.functions.gateway; | ||
|
||
import lucee.runtime.PageContext; | ||
import lucee.runtime.config.ConfigWebPro; | ||
import lucee.runtime.exp.FunctionException; | ||
import lucee.runtime.exp.PageException; | ||
import lucee.runtime.ext.function.Function; | ||
import lucee.runtime.gateway.GatewayEngineImpl; | ||
|
||
public final class GatewayAction implements Function { | ||
|
||
private static final long serialVersionUID = -4801573283953497373L; | ||
|
||
public static String call(PageContext pc, String gatewayID, String action) throws PageException { | ||
GatewayEngineImpl g = ((GatewayEngineImpl) ((ConfigWebPro) pc.getConfig()).getGatewayEngine()); | ||
|
||
action = action.trim().toLowerCase(); | ||
|
||
if ("start".equals(action)) g.start(gatewayID); | ||
else if ("stop".equals(action)) g.stop(gatewayID); | ||
else if ("restart".equals(action)) g.restart(gatewayID); | ||
else new FunctionException(pc, "GatewayAction", 2, "action", "invalid action [" + action + "], valid values are [start,stop,restart]"); | ||
return null; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
core/src/main/java/lucee/runtime/functions/gateway/GatewayState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package lucee.runtime.functions.gateway; | ||
|
||
import lucee.runtime.PageContext; | ||
import lucee.runtime.config.ConfigWebPro; | ||
import lucee.runtime.exp.PageException; | ||
import lucee.runtime.ext.function.Function; | ||
import lucee.runtime.gateway.GatewayEngineImpl; | ||
import lucee.runtime.gateway.GatewayUtil; | ||
|
||
public final class GatewayState implements Function { | ||
|
||
public static String call(PageContext pc, String gatewayID) throws PageException { | ||
GatewayEngineImpl g = ((GatewayEngineImpl) ((ConfigWebPro) pc.getConfig()).getGatewayEngine()); | ||
return GatewayUtil.toState(g.getState(gatewayID), "UNDEFINED"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters