@@ -41,6 +41,8 @@ public class AppConfig<T extends AppConfigurator> extends Config<AppConfigKey> i
4141
4242 public static final String CONF_FILE_NAME = "app.conf" ;
4343
44+ public static final String PORT_CLI_OVER_HTTP = "__admin__" ;
45+
4446 private App app ;
4547
4648 static {
@@ -434,7 +436,55 @@ private void _mergeCliJSONPageSz(AppConfig conf) {
434436 }
435437 }
436438
437- private int cliPort = -1 ;
439+ Boolean cliOverHttp ;
440+
441+ protected T cliOverHttp (boolean enabled ) {
442+ this .cliOverHttp = enabled ;
443+ return me ();
444+ }
445+
446+ public boolean cliOverHttp () {
447+ if (null == cliOverHttp ) {
448+ Boolean B = get (CLI_OVER_HTTP );
449+ if (null == B ) {
450+ B = false ;
451+ }
452+ cliOverHttp = B ;
453+ }
454+ return cliOverHttp ;
455+ }
456+
457+ private void _mergeCliOverHttp (AppConfig config ) {
458+ if (null == get (CLI_OVER_HTTP )) {
459+ cliOverHttp = config .cliOverHttp ;
460+ }
461+ }
462+
463+ Integer cliOverHttpPort ;
464+
465+ protected T cliOverHttpPort (int port ) {
466+ this .cliOverHttpPort = port ;
467+ return me ();
468+ }
469+
470+ public int cliOverHttpPort () {
471+ if (null == cliOverHttpPort ) {
472+ Integer I = get (CLI_OVER_HTTP_PORT );
473+ if (null == I ) {
474+ I = 5462 ;
475+ }
476+ cliOverHttpPort = I ;
477+ }
478+ return cliOverHttpPort ;
479+ }
480+
481+ private void _mergeCliOverHttpPort (AppConfig config ) {
482+ if (null == get (CLI_OVER_HTTP_PORT )) {
483+ cliOverHttpPort = config .cliOverHttpPort ;
484+ }
485+ }
486+
487+ private Integer cliPort ;
438488
439489 protected T cliPort (int port ) {
440490 E .illegalArgumentIf (port < 1 , "port value not valid: %s" , port );
@@ -443,10 +493,10 @@ protected T cliPort(int port) {
443493 }
444494
445495 public int cliPort () {
446- if (- 1 == cliPort ) {
496+ if (null == cliPort ) {
447497 Integer I = get (CLI_PORT );
448498 if (null == I ) {
449- I = 5460 ;
499+ I = 5461 ;
450500 }
451501 cliPort = I ;
452502 }
@@ -1138,7 +1188,7 @@ public List<NamedPort> namedPorts() {
11381188 if (null == namedPorts ) {
11391189 String s = get (NAMED_PORTS );
11401190 if (null == s ) {
1141- namedPorts = C . list ();
1191+ namedPorts = cliOverHttp () ? C . list ( new NamedPort ( PORT_CLI_OVER_HTTP , cliOverHttpPort ())) : C .< NamedPort > list ();
11421192 } else {
11431193 String [] sa = (s .split ("[,;]+" ));
11441194 ListBuilder <NamedPort > builder = ListBuilder .create ();
@@ -1154,6 +1204,9 @@ public List<NamedPort> namedPorts() {
11541204 throw E .invalidConfiguration ("port[%s] already configured" , name );
11551205 }
11561206 }
1207+ if (cliOverHttp ()) {
1208+ builder .add (new NamedPort (PORT_CLI_OVER_HTTP , cliOverHttpPort ()));
1209+ }
11571210 namedPorts = builder .toList ();
11581211 }
11591212 }
@@ -1580,18 +1633,18 @@ private void _mergeFlashCookieName(AppConfig config) {
15801633 }
15811634 }
15821635
1583- private Long sessionTtl = null ;
1636+ private Integer sessionTtl = null ;
15841637
1585- protected T sessionTtl (long seconds ) {
1638+ protected T sessionTtl (int seconds ) {
15861639 sessionTtl = seconds ;
15871640 return me ();
15881641 }
15891642
1590- public long sessionTtl () {
1643+ public int sessionTtl () {
15911644 if (null == sessionTtl ) {
15921645 sessionTtl = get (AppConfigKey .SESSION_TTL );
15931646 if (null == sessionTtl ) {
1594- sessionTtl = ( long ) 60 * 30 ;
1647+ sessionTtl = 60 * 30 ;
15951648 }
15961649 }
15971650 return sessionTtl ;
@@ -1870,6 +1923,8 @@ public void _merge(AppConfigurator conf) {
18701923 _mergeCorsMaxAge (conf );
18711924 _mergeCliJSONPageSz (conf );
18721925 _mergeCliTablePageSz (conf );
1926+ _mergeCliOverHttp (conf );
1927+ _mergeCliOverHttpPort (conf );
18731928 _mergeCliPort (conf );
18741929 _mergeCliSessionExpiration (conf );
18751930 _mergeCsrf (conf );
0 commit comments