Top Description Inners Fields Constructors Methods
io.undertow.server.handlers.proxy.mod_cluster

pack-priv Class MCMPHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Known Direct Subclasses
io.undertow.server.handlers.proxy.mod_cluster.MCMPWebManager
Imports
io.undertow.UndertowLogger, .UndertowMessages, .Version, io.undertow.io.Sender, io.undertow.server.HttpHandler, .HttpServerExchange, io.undertow.server.handlers.form.FormData, .FormDataParser, .FormEncodedDataDefinition, .FormParserFactory, io.undertow.util.Headers, .HttpString, .StatusCodes, org.xnio.OptionMap, .Options, org.xnio.ssl.XnioSsl, java.io.IOException, java.net.InetSocketAddress, .URI, .URISyntaxException, java.util.ArrayDeque, .ArrayList, .Arrays, .Collection, .Collections, .Deque, .HashSet, .Iterator, .LinkedHashMap, .List, .Map, .Set, java.util.concurrent.TimeUnit

The mod cluster management protocol http handler.
Author
Emanuel Muckenhuber

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final HttpString
private final MCMPConfig
protected final ModClusterContainer
private static final String
private final long
public static final HttpString
public static final HttpString
public static final HttpString
private static final Set<HttpString>
public static final HttpString
protected static final String
private final ModCluster
private final HttpHandler
private final FormParserFactory
public static final HttpString
public static final HttpString
private static final String
private static final String
private static final String
private static final String
public static final HttpString
public static final HttpString
private static final String
protected static final String

Constructor Summary

AccessConstructor and Description
pack-priv
MCMPHandler(MCMPConfig config, ModCluster modCluster, HttpHandler next)

Method Summary

Modifier and TypeMethod and Description
protected void
checkHostUp(final String
the scheme
scheme
,
final String
the host
host
,
final int
the port
port
,
final HttpServerExchange
the http server exchange
exchange
,
final NodePingUtil.PingCallback
the ping callback
callback
)

Check whether a host is up.

pack-priv static boolean
checkString(final String value)

private static void
public void
handleRequest(HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

protected void
handleRequest(final HttpString
the http method
method
,
HttpServerExchange
the http server exchange
exchange
)

Handle a management+ request.

protected boolean
pack-priv MCMPHandler.RequestData
parseFormData(final HttpServerExchange
the http server exchange
exchange
)

Transform the form data into an intermediate request data which can me used by the web manager

pack-priv void
processAppCommand(final HttpServerExchange
the http server exchange
exchange
,
final MCMPHandler.RequestData
the request data
requestData
,
final MCMPHandler.MCMPAction
the mgmt action
action
)

Process a command targeting an application.

pack-priv void
processCommand(final HttpServerExchange
the http server exchange
exchange
,
final MCMPHandler.RequestData
the request data
requestData
,
final MCMPHandler.MCMPAction
the mgmt action
action
)

Process a mod_cluster mgmt command.

private void
processConfig(final HttpServerExchange
the http server exchange
exchange
,
final MCMPHandler.RequestData
the request data
requestData
)

Process the node config.

protected void
processDump(HttpServerExchange exchange)

Process DUMP request

protected String
pack-priv static void
pack-priv static void
processError(String
the error type
type
,
String
the error string
errString
,
HttpServerExchange
the http server exchange
exchange
)

Send an error message.

protected void
processInfo(HttpServerExchange exchange)

Process INFO request

protected String
pack-priv void
processNodeCommand(final HttpServerExchange
the http server exchange
exchange
,
final MCMPHandler.RequestData
the request data
requestData
,
final MCMPHandler.MCMPAction
the mgmt action
action
)

Process a mgmt command targeting a node.

pack-priv boolean
processNodeCommand(final String jvmRoute, final MCMPHandler.MCMPAction action)

pack-priv static void
processOK(HttpServerExchange exchange)

If the process is OK, then add 200 HTTP status and its "OK" phrase

pack-priv void
processPing(final HttpServerExchange
the http server exchange
exchange
,
final MCMPHandler.RequestData
the request data
requestData
)

Process the ping request.

pack-priv void
processStatus(final HttpServerExchange
the http server exchange
exchange
,
final MCMPHandler.RequestData
the request data
requestData
)

Process the status request.

pack-priv static void
sendResponse(final HttpServerExchange
the http server exchange
exchange
,
final String
the response string
response
)

Send a simple response string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONFIGback to summary
public static final HttpString CONFIG
configback to summary
private final MCMPConfig config
containerback to summary
protected final ModClusterContainer container
CONTENT_TYPEback to summary
private static final String CONTENT_TYPE
creationTimeback to summary
private final long creationTime
DISABLE_APPback to summary
public static final HttpString DISABLE_APP
DUMPback to summary
public static final HttpString DUMP
ENABLE_APPback to summary
public static final HttpString ENABLE_APP
HANDLED_METHODSback to summary
private static final Set<HttpString> HANDLED_METHODS
INFOback to summary
public static final HttpString INFO
MOD_CLUSTER_EXPOSED_VERSIONback to summary
protected static final String MOD_CLUSTER_EXPOSED_VERSION
modClusterback to summary
private final ModCluster modCluster
nextback to summary
private final HttpHandler next
parserFactoryback to summary
private final FormParserFactory parserFactory
PINGback to summary
public static final HttpString PING
REMOVE_APPback to summary
public static final HttpString REMOVE_APP
SBADFLDback to summary
private static final String SBADFLD
SBADFLD1back to summary
private static final String SBADFLD1
SCONBADback to summary
private static final String SCONBAD
SMISFLDback to summary
private static final String SMISFLD
STATUSback to summary
public static final HttpString STATUS
STOP_APPback to summary
public static final HttpString STOP_APP
TYPESYNTAXback to summary
private static final String TYPESYNTAX
VERSION_PROTOCOLback to summary
protected static final String VERSION_PROTOCOL

Constructor Detail

MCMPHandlerback to summary
pack-priv MCMPHandler(MCMPConfig config, ModCluster modCluster, HttpHandler next)

Method Detail

checkHostUpback to summary
protected void checkHostUp(final String scheme, final String host, final int port, final HttpServerExchange exchange, final NodePingUtil.PingCallback callback)

Check whether a host is up.

Parameters
scheme:String

the scheme

host:String

the host

port:int

the port

exchange:HttpServerExchange

the http server exchange

callback:NodePingUtil.PingCallback

the ping callback

checkStringback to summary
pack-priv static boolean checkString(final String value)
checkStringForSuspiciousCharactersback to summary
private static void checkStringForSuspiciousCharacters(String data)
handleRequestback to summary
public void handleRequest(HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
handleRequestback to summary
protected void handleRequest(final HttpString method, HttpServerExchange exchange) throws Exception

Handle a management+ request.

Parameters
method:HttpString

the http method

exchange:HttpServerExchange

the http server exchange

handlesMethodback to summary
protected boolean handlesMethod(HttpString method)
parseFormDataback to summary
pack-priv MCMPHandler.RequestData parseFormData(final HttpServerExchange exchange) throws IOException

Transform the form data into an intermediate request data which can me used by the web manager

Parameters
exchange:HttpServerExchange

the http server exchange

processAppCommandback to summary
pack-priv void processAppCommand(final HttpServerExchange exchange, final MCMPHandler.RequestData requestData, final MCMPHandler.MCMPAction action) throws IOException

Process a command targeting an application.

Parameters
exchange:HttpServerExchange

the http server exchange

requestData:MCMPHandler.RequestData

the request data

action:MCMPHandler.MCMPAction

the mgmt action

processCommandback to summary
pack-priv void processCommand(final HttpServerExchange exchange, final MCMPHandler.RequestData requestData, final MCMPHandler.MCMPAction action) throws IOException

Process a mod_cluster mgmt command.

Parameters
exchange:HttpServerExchange

the http server exchange

requestData:MCMPHandler.RequestData

the request data

action:MCMPHandler.MCMPAction

the mgmt action

processConfigback to summary
private void processConfig(final HttpServerExchange exchange, final MCMPHandler.RequestData requestData)

Process the node config.

Parameters
exchange:HttpServerExchange

the http server exchange

requestData:MCMPHandler.RequestData

the request data

processDumpback to summary
protected void processDump(HttpServerExchange exchange) throws IOException

Process DUMP request

processDumpStringback to summary
protected String processDumpString()
processErrorback to summary
pack-priv static void processError(MCMPErrorCode errorCode, HttpServerExchange exchange)
processErrorback to summary
pack-priv static void processError(String type, String errString, HttpServerExchange exchange)

Send an error message.

Parameters
type:String

the error type

errString:String

the error string

exchange:HttpServerExchange

the http server exchange

processInfoback to summary
protected void processInfo(HttpServerExchange exchange) throws IOException

Process INFO request

processInfoStringback to summary
protected String processInfoString()
processNodeCommandback to summary
pack-priv void processNodeCommand(final HttpServerExchange exchange, final MCMPHandler.RequestData requestData, final MCMPHandler.MCMPAction action) throws IOException

Process a mgmt command targeting a node.

Parameters
exchange:HttpServerExchange

the http server exchange

requestData:MCMPHandler.RequestData

the request data

action:MCMPHandler.MCMPAction

the mgmt action

processNodeCommandback to summary
pack-priv boolean processNodeCommand(final String jvmRoute, final MCMPHandler.MCMPAction action) throws IOException
processOKback to summary
pack-priv static void processOK(HttpServerExchange exchange) throws IOException

If the process is OK, then add 200 HTTP status and its "OK" phrase

processPingback to summary
pack-priv void processPing(final HttpServerExchange exchange, final MCMPHandler.RequestData requestData) throws IOException

Process the ping request.

Parameters
exchange:HttpServerExchange

the http server exchange

requestData:MCMPHandler.RequestData

the request data

processStatusback to summary
pack-priv void processStatus(final HttpServerExchange exchange, final MCMPHandler.RequestData requestData) throws IOException

Process the status request.

Parameters
exchange:HttpServerExchange

the http server exchange

requestData:MCMPHandler.RequestData

the request data

sendResponseback to summary
pack-priv static void sendResponse(final HttpServerExchange exchange, final String response)

Send a simple response string.

Parameters
exchange:HttpServerExchange

the http server exchange

response:String

the response string

io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv final Enum MCMPHandler.MCMPAction

extends Enum<MCMPHandler.MCMPAction>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final MCMPHandler.MCMPAction
public static final MCMPHandler.MCMPAction
public static final MCMPHandler.MCMPAction
public static final MCMPHandler.MCMPAction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MCMPHandler.MCMPAction
public static MCMPHandler.MCMPAction[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DISABLEback to summary
public static final MCMPHandler.MCMPAction DISABLE
ENABLEback to summary
public static final MCMPHandler.MCMPAction ENABLE
REMOVEback to summary
public static final MCMPHandler.MCMPAction REMOVE
STOPback to summary
public static final MCMPHandler.MCMPAction STOP

Constructor Detail

MCMPActionback to summary
private MCMPAction()

Method Detail

valueOfback to summary
public static MCMPHandler.MCMPAction valueOf(String name)
valuesback to summary
public static MCMPHandler.MCMPAction[] values()
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Class MCMPHandler.RequestData

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.proxy.mod_cluster.MCMPHandler.RequestData

Field Summary

Modifier and TypeField and Description
private final Map<HttpString, Deque<String>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
add(final HttpString name, Deque<FormData.FormValue> values)

pack-priv void
add(final HttpString name, final FormData.FormValue value)

pack-priv void
addValues(final HttpString name, Deque<String> value)

pack-priv String
pack-priv Iterator<HttpString>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

valuesback to summary
private final Map<HttpString, Deque<String>> values

Constructor Detail

RequestDataback to summary
pack-priv RequestData()

Method Detail

addback to summary
pack-priv void add(final HttpString name, Deque<FormData.FormValue> values)
addback to summary
pack-priv void add(final HttpString name, final FormData.FormValue value)
addValuesback to summary
pack-priv void addValues(final HttpString name, Deque<String> value)
getFirstback to summary
pack-priv String getFirst(HttpString name)
iteratorback to summary
pack-priv Iterator<HttpString> iterator()