id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
105,500 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpProxyRequest.java | HttpProxyRequest.toHttpString | public String toHttpString() {
StringBuilder sb = new StringBuilder();
sb.append(getHttpVerb()).append(' ').append(getHttpURI()).append(' ')
.append(getHttpVersion()).append(HttpProxyConstants.CRLF);
boolean hostHeaderFound = false;
if (getHeaders() != null) {
... | java | public String toHttpString() {
StringBuilder sb = new StringBuilder();
sb.append(getHttpVerb()).append(' ').append(getHttpURI()).append(' ')
.append(getHttpVersion()).append(HttpProxyConstants.CRLF);
boolean hostHeaderFound = false;
if (getHeaders() != null) {
... | [
"public",
"String",
"toHttpString",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"getHttpVerb",
"(",
")",
")",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"getHttpURI",
"(",
")... | Returns the string representation of the HTTP request . | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"HTTP",
"request",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpProxyRequest.java#L267-L298 |
105,501 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/impl/GatewayCreatorImpl.java | GatewayCreatorImpl.configureGateway | @Override
public void configureGateway(Gateway gateway) {
Properties properties = new Properties();
properties.putAll(System.getProperties());
String gatewayHome = properties.getProperty(Gateway.GATEWAY_HOME_PROPERTY);
if ((gatewayHome == null) || "".equals(gatewayHome)) {
... | java | @Override
public void configureGateway(Gateway gateway) {
Properties properties = new Properties();
properties.putAll(System.getProperties());
String gatewayHome = properties.getProperty(Gateway.GATEWAY_HOME_PROPERTY);
if ((gatewayHome == null) || "".equals(gatewayHome)) {
... | [
"@",
"Override",
"public",
"void",
"configureGateway",
"(",
"Gateway",
"gateway",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"putAll",
"(",
"System",
".",
"getProperties",
"(",
")",
")",
";",
"String",
... | Bootstrap the Gateway instance with a GATEWAY_HOME if not already set in System properties. | [
"Bootstrap",
"the",
"Gateway",
"instance",
"with",
"a",
"GATEWAY_HOME",
"if",
"not",
"already",
"set",
"in",
"System",
"properties",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/impl/GatewayCreatorImpl.java#L38-L77 |
105,502 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameDecoder.java | WsFrameDecoder.validateOpcodeUsingFin | private void validateOpcodeUsingFin(Opcode opcode, boolean fin) throws ProtocolDecoderException {
switch (opcode) {
case CONTINUATION:
if (prevDataFin) {
throw new ProtocolDecoderException("Not expecting CONTINUATION frame");
}
brea... | java | private void validateOpcodeUsingFin(Opcode opcode, boolean fin) throws ProtocolDecoderException {
switch (opcode) {
case CONTINUATION:
if (prevDataFin) {
throw new ProtocolDecoderException("Not expecting CONTINUATION frame");
}
brea... | [
"private",
"void",
"validateOpcodeUsingFin",
"(",
"Opcode",
"opcode",
",",
"boolean",
"fin",
")",
"throws",
"ProtocolDecoderException",
"{",
"switch",
"(",
"opcode",
")",
"{",
"case",
"CONTINUATION",
":",
"if",
"(",
"prevDataFin",
")",
"{",
"throw",
"new",
"Pr... | Validates opcode w.r.t FIN bit | [
"Validates",
"opcode",
"w",
".",
"r",
".",
"t",
"FIN",
"bit"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameDecoder.java#L172-L197 |
105,503 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameDecoder.java | WsFrameDecoder.validateRSV | private void validateRSV(byte opcodeByte) throws ProtocolDecoderException {
if ((opcodeByte & 0x70) != 0) {
// We don't support negotiated extensions that deal with RSV bits
if ((opcodeByte & 0x40) != 0) {
throw new ProtocolDecoderException("RSV1 is set");
}
... | java | private void validateRSV(byte opcodeByte) throws ProtocolDecoderException {
if ((opcodeByte & 0x70) != 0) {
// We don't support negotiated extensions that deal with RSV bits
if ((opcodeByte & 0x40) != 0) {
throw new ProtocolDecoderException("RSV1 is set");
}
... | [
"private",
"void",
"validateRSV",
"(",
"byte",
"opcodeByte",
")",
"throws",
"ProtocolDecoderException",
"{",
"if",
"(",
"(",
"opcodeByte",
"&",
"0x70",
")",
"!=",
"0",
")",
"{",
"// We don't support negotiated extensions that deal with RSV bits",
"if",
"(",
"(",
"op... | Validates RSV bits | [
"Validates",
"RSV",
"bits"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameDecoder.java#L200-L213 |
105,504 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java | Socks5LogicHandler.doHandshake | public synchronized void doHandshake(final NextFilter nextFilter) {
LOGGER.debug(" doHandshake()");
// Send request
writeRequest(nextFilter, request, (Integer) getSession().getAttribute(
HANDSHAKE_STEP));
} | java | public synchronized void doHandshake(final NextFilter nextFilter) {
LOGGER.debug(" doHandshake()");
// Send request
writeRequest(nextFilter, request, (Integer) getSession().getAttribute(
HANDSHAKE_STEP));
} | [
"public",
"synchronized",
"void",
"doHandshake",
"(",
"final",
"NextFilter",
"nextFilter",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\" doHandshake()\"",
")",
";",
"// Send request",
"writeRequest",
"(",
"nextFilter",
",",
"request",
",",
"(",
"Integer",
")",
"get... | Performs the handshake process.
@param nextFilter the next filter | [
"Performs",
"the",
"handshake",
"process",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java#L87-L93 |
105,505 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java | Socks5LogicHandler.encodeInitialGreetingPacket | private IoBuffer encodeInitialGreetingPacket(final SocksProxyRequest request) {
byte nbMethods = (byte) SocksProxyConstants.SUPPORTED_AUTH_METHODS.length;
IoBuffer buf = IoBuffer.allocate(2 + nbMethods);
buf.put(request.getProtocolVersion());
buf.put(nbMethods);
buf.put(SocksPro... | java | private IoBuffer encodeInitialGreetingPacket(final SocksProxyRequest request) {
byte nbMethods = (byte) SocksProxyConstants.SUPPORTED_AUTH_METHODS.length;
IoBuffer buf = IoBuffer.allocate(2 + nbMethods);
buf.put(request.getProtocolVersion());
buf.put(nbMethods);
buf.put(SocksPro... | [
"private",
"IoBuffer",
"encodeInitialGreetingPacket",
"(",
"final",
"SocksProxyRequest",
"request",
")",
"{",
"byte",
"nbMethods",
"=",
"(",
"byte",
")",
"SocksProxyConstants",
".",
"SUPPORTED_AUTH_METHODS",
".",
"length",
";",
"IoBuffer",
"buf",
"=",
"IoBuffer",
".... | Encodes the initial greeting packet.
@param request the socks proxy request data
@return the encoded buffer | [
"Encodes",
"the",
"initial",
"greeting",
"packet",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java#L101-L110 |
105,506 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java | Socks5LogicHandler.encodeProxyRequestPacket | private IoBuffer encodeProxyRequestPacket(final SocksProxyRequest request)
throws UnsupportedEncodingException {
int len = 6;
InetSocketAddress adr = request.getEndpointAddress();
byte addressType = 0;
byte[] host = null;
if (adr != null && !adr.isUnresolved(... | java | private IoBuffer encodeProxyRequestPacket(final SocksProxyRequest request)
throws UnsupportedEncodingException {
int len = 6;
InetSocketAddress adr = request.getEndpointAddress();
byte addressType = 0;
byte[] host = null;
if (adr != null && !adr.isUnresolved(... | [
"private",
"IoBuffer",
"encodeProxyRequestPacket",
"(",
"final",
"SocksProxyRequest",
"request",
")",
"throws",
"UnsupportedEncodingException",
"{",
"int",
"len",
"=",
"6",
";",
"InetSocketAddress",
"adr",
"=",
"request",
".",
"getEndpointAddress",
"(",
")",
";",
"b... | Encodes the proxy authorization request packet.
@param request the socks proxy request data
@return the encoded buffer
@throws UnsupportedEncodingException if request's hostname charset
can't be converted to ASCII. | [
"Encodes",
"the",
"proxy",
"authorization",
"request",
"packet",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java#L120-L165 |
105,507 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java | Socks5LogicHandler.writeRequest | private void writeRequest(final NextFilter nextFilter,
final SocksProxyRequest request, int step) {
try {
IoBuffer buf = null;
if (step == SocksProxyConstants.SOCKS5_GREETING_STEP) {
buf = encodeInitialGreetingPacket(request);
} else if (step == S... | java | private void writeRequest(final NextFilter nextFilter,
final SocksProxyRequest request, int step) {
try {
IoBuffer buf = null;
if (step == SocksProxyConstants.SOCKS5_GREETING_STEP) {
buf = encodeInitialGreetingPacket(request);
} else if (step == S... | [
"private",
"void",
"writeRequest",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"SocksProxyRequest",
"request",
",",
"int",
"step",
")",
"{",
"try",
"{",
"IoBuffer",
"buf",
"=",
"null",
";",
"if",
"(",
"step",
"==",
"SocksProxyConstants",
".",
"SO... | Encodes a SOCKS5 request and writes it to the next filter
so it can be sent to the proxy server.
@param nextFilter the next filter
@param request the request to send.
@param step the current step in the handshake process | [
"Encodes",
"a",
"SOCKS5",
"request",
"and",
"writes",
"it",
"to",
"the",
"next",
"filter",
"so",
"it",
"can",
"be",
"sent",
"to",
"the",
"proxy",
"server",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks5LogicHandler.java#L292-L318 |
105,508 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/firewall/BlacklistFilter.java | BlacklistFilter.setSubnetBlacklist | public void setSubnetBlacklist(Iterable<Subnet> subnets) {
if (subnets == null) {
throw new NullPointerException("Subnets must not be null");
}
blacklist.clear();
for (Subnet subnet : subnets) {
block(subnet);
}
} | java | public void setSubnetBlacklist(Iterable<Subnet> subnets) {
if (subnets == null) {
throw new NullPointerException("Subnets must not be null");
}
blacklist.clear();
for (Subnet subnet : subnets) {
block(subnet);
}
} | [
"public",
"void",
"setSubnetBlacklist",
"(",
"Iterable",
"<",
"Subnet",
">",
"subnets",
")",
"{",
"if",
"(",
"subnets",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Subnets must not be null\"",
")",
";",
"}",
"blacklist",
".",
"clear... | Sets the subnets to be blacklisted.
NOTE: this call will remove any previously blacklisted subnets.
@param subnets an array of subnets to be blacklisted. | [
"Sets",
"the",
"subnets",
"to",
"be",
"blacklisted",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/firewall/BlacklistFilter.java#L107-L115 |
105,509 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/session/IdleStatusChecker.java | IdleStatusChecker.addSession | public void addSession(AbstractIoSession session) {
sessions.add(session);
CloseFuture closeFuture = session.getCloseFuture();
// isn't service reponsability to remove the session nicely ?
closeFuture.addListener(sessionCloseListener);
} | java | public void addSession(AbstractIoSession session) {
sessions.add(session);
CloseFuture closeFuture = session.getCloseFuture();
// isn't service reponsability to remove the session nicely ?
closeFuture.addListener(sessionCloseListener);
} | [
"public",
"void",
"addSession",
"(",
"AbstractIoSession",
"session",
")",
"{",
"sessions",
".",
"add",
"(",
"session",
")",
";",
"CloseFuture",
"closeFuture",
"=",
"session",
".",
"getCloseFuture",
"(",
")",
";",
"// isn't service reponsability to remove the session n... | Add the session for being checked for idle.
@param session the session to check | [
"Add",
"the",
"session",
"for",
"being",
"checked",
"for",
"idle",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/session/IdleStatusChecker.java#L59-L65 |
105,510 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java | ProtocolCodecFilter.disposeEncoder | private void disposeEncoder(IoSession session) {
ProtocolEncoder encoder = (ProtocolEncoder) session
.removeAttribute(ENCODER);
if (encoder == null) {
return;
}
try {
encoder.dispose(session);
} catch (Throwable t) {
LOGGER.war... | java | private void disposeEncoder(IoSession session) {
ProtocolEncoder encoder = (ProtocolEncoder) session
.removeAttribute(ENCODER);
if (encoder == null) {
return;
}
try {
encoder.dispose(session);
} catch (Throwable t) {
LOGGER.war... | [
"private",
"void",
"disposeEncoder",
"(",
"IoSession",
"session",
")",
"{",
"ProtocolEncoder",
"encoder",
"=",
"(",
"ProtocolEncoder",
")",
"session",
".",
"removeAttribute",
"(",
"ENCODER",
")",
";",
"if",
"(",
"encoder",
"==",
"null",
")",
"{",
"return",
"... | Dispose the encoder, removing its instance from the
session's attributes, and calling the associated
dispose method. | [
"Dispose",
"the",
"encoder",
"removing",
"its",
"instance",
"from",
"the",
"session",
"s",
"attributes",
"and",
"calling",
"the",
"associated",
"dispose",
"method",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java#L471-L484 |
105,511 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java | ProtocolCodecFilter.disposeDecoder | private void disposeDecoder(IoSession session) {
ProtocolDecoder decoder = (ProtocolDecoder) session
.removeAttribute(DECODER);
if (decoder == null) {
return;
}
try {
decoder.dispose(session);
} catch (Throwable t) {
LOGGER.war... | java | private void disposeDecoder(IoSession session) {
ProtocolDecoder decoder = (ProtocolDecoder) session
.removeAttribute(DECODER);
if (decoder == null) {
return;
}
try {
decoder.dispose(session);
} catch (Throwable t) {
LOGGER.war... | [
"private",
"void",
"disposeDecoder",
"(",
"IoSession",
"session",
")",
"{",
"ProtocolDecoder",
"decoder",
"=",
"(",
"ProtocolDecoder",
")",
"session",
".",
"removeAttribute",
"(",
"DECODER",
")",
";",
"if",
"(",
"decoder",
"==",
"null",
")",
"{",
"return",
"... | Dispose the decoder, removing its instance from the
session's attributes, and calling the associated
dispose method. | [
"Dispose",
"the",
"decoder",
"removing",
"its",
"instance",
"from",
"the",
"session",
"s",
"attributes",
"and",
"calling",
"the",
"associated",
"dispose",
"method",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java#L501-L514 |
105,512 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java | ProtocolCodecFilter.getDecoderOut | private ProtocolDecoderOutput getDecoderOut(IoSession session,
NextFilter nextFilter) {
ProtocolDecoderOutput out = (ProtocolDecoderOutput) session.getAttribute(DECODER_OUT);
if (out == null) {
// Create a new instance, and stores it into the session
out = ne... | java | private ProtocolDecoderOutput getDecoderOut(IoSession session,
NextFilter nextFilter) {
ProtocolDecoderOutput out = (ProtocolDecoderOutput) session.getAttribute(DECODER_OUT);
if (out == null) {
// Create a new instance, and stores it into the session
out = ne... | [
"private",
"ProtocolDecoderOutput",
"getDecoderOut",
"(",
"IoSession",
"session",
",",
"NextFilter",
"nextFilter",
")",
"{",
"ProtocolDecoderOutput",
"out",
"=",
"(",
"ProtocolDecoderOutput",
")",
"session",
".",
"getAttribute",
"(",
"DECODER_OUT",
")",
";",
"if",
"... | Return a reference to the decoder callback. If it's not already created
and stored into the session, we create a new instance. | [
"Return",
"a",
"reference",
"to",
"the",
"decoder",
"callback",
".",
"If",
"it",
"s",
"not",
"already",
"created",
"and",
"stored",
"into",
"the",
"session",
"we",
"create",
"a",
"new",
"instance",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java#L520-L531 |
105,513 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/WsHandshakeValidator.java | WsHandshakeValidator.validate | public boolean validate(HttpRequestMessage request, boolean isPostMethodAllowed) {
WebSocketWireProtocol wireProtocolVersion = guessWireProtocolVersion(request);
if ( wireProtocolVersion == null ) {
return false;
}
final WsHandshakeValidator validator = handshakeValidatorsBy... | java | public boolean validate(HttpRequestMessage request, boolean isPostMethodAllowed) {
WebSocketWireProtocol wireProtocolVersion = guessWireProtocolVersion(request);
if ( wireProtocolVersion == null ) {
return false;
}
final WsHandshakeValidator validator = handshakeValidatorsBy... | [
"public",
"boolean",
"validate",
"(",
"HttpRequestMessage",
"request",
",",
"boolean",
"isPostMethodAllowed",
")",
"{",
"WebSocketWireProtocol",
"wireProtocolVersion",
"=",
"guessWireProtocolVersion",
"(",
"request",
")",
";",
"if",
"(",
"wireProtocolVersion",
"==",
"nu... | Facade method to validate an HttpMessageRequest.
@param request the request to validate
@return true iff the appropriate handshake for websocket protocol is contained
within the provided request. | [
"Facade",
"method",
"to",
"validate",
"an",
"HttpMessageRequest",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/WsHandshakeValidator.java#L58-L67 |
105,514 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/WsHandshakeValidator.java | WsHandshakeValidator.doValidate | protected boolean doValidate(HttpRequestMessage request, final boolean isPostMethodAllowed) {
if ( !isPostMethodAllowed ) {
if ( request.getMethod() != HttpMethod.GET) {
return false;
}
} else {
if ( request.getMethod() != HttpMethod.GET || request.ge... | java | protected boolean doValidate(HttpRequestMessage request, final boolean isPostMethodAllowed) {
if ( !isPostMethodAllowed ) {
if ( request.getMethod() != HttpMethod.GET) {
return false;
}
} else {
if ( request.getMethod() != HttpMethod.GET || request.ge... | [
"protected",
"boolean",
"doValidate",
"(",
"HttpRequestMessage",
"request",
",",
"final",
"boolean",
"isPostMethodAllowed",
")",
"{",
"if",
"(",
"!",
"isPostMethodAllowed",
")",
"{",
"if",
"(",
"request",
".",
"getMethod",
"(",
")",
"!=",
"HttpMethod",
".",
"G... | Does the provided request form a valid web socket handshake request?
@param request the candidate web socket handshake request
@return true iff the provided request is a web socket handshake request. | [
"Does",
"the",
"provided",
"request",
"form",
"a",
"valid",
"web",
"socket",
"handshake",
"request?"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/WsHandshakeValidator.java#L94-L123 |
105,515 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/WsHandshakeValidator.java | WsHandshakeValidator.register | private void register(WebSocketWireProtocol wireProtocolVersion, WsHandshakeValidator validator) {
if ( wireProtocolVersion == null ) {
throw new NullPointerException("wireProtocolVersion");
}
if ( validator == null ) {
throw new NullPointerException("validator");
... | java | private void register(WebSocketWireProtocol wireProtocolVersion, WsHandshakeValidator validator) {
if ( wireProtocolVersion == null ) {
throw new NullPointerException("wireProtocolVersion");
}
if ( validator == null ) {
throw new NullPointerException("validator");
... | [
"private",
"void",
"register",
"(",
"WebSocketWireProtocol",
"wireProtocolVersion",
",",
"WsHandshakeValidator",
"validator",
")",
"{",
"if",
"(",
"wireProtocolVersion",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"wireProtocolVersion\"",
")",... | Allow subclasses to register themselves as validators for specific versions of
the wire protocol.
@param wireProtocolVersion the version of the protocol
@param validator the validator | [
"Allow",
"subclasses",
"to",
"register",
"themselves",
"as",
"validators",
"for",
"specific",
"versions",
"of",
"the",
"wire",
"protocol",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/WsHandshakeValidator.java#L170-L185 |
105,516 | kaazing/gateway | transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/bridge/filter/SslHandler.java | SslHandler.fetchAppBuffer | public IoBuffer fetchAppBuffer() {
IoBufferEx appBuffer = this.appBuffer.flip();
this.appBuffer = null;
return (IoBuffer) appBuffer;
} | java | public IoBuffer fetchAppBuffer() {
IoBufferEx appBuffer = this.appBuffer.flip();
this.appBuffer = null;
return (IoBuffer) appBuffer;
} | [
"public",
"IoBuffer",
"fetchAppBuffer",
"(",
")",
"{",
"IoBufferEx",
"appBuffer",
"=",
"this",
".",
"appBuffer",
".",
"flip",
"(",
")",
";",
"this",
".",
"appBuffer",
"=",
"null",
";",
"return",
"(",
"IoBuffer",
")",
"appBuffer",
";",
"}"
] | Get decrypted application data.
@return buffer with data | [
"Get",
"decrypted",
"application",
"data",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/bridge/filter/SslHandler.java#L409-L413 |
105,517 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/URLUtils.java | URLUtils.hasLiteralIPAddress | public static boolean hasLiteralIPAddress(URI resource) {
String host = resource.getHost();
if ( host == null || host.isEmpty() ) {
return false;
}
// basic check for a '.'-separated numeric string for now
return host.matches("([0-9A-Fa-f]|\\.){4,16}");
} | java | public static boolean hasLiteralIPAddress(URI resource) {
String host = resource.getHost();
if ( host == null || host.isEmpty() ) {
return false;
}
// basic check for a '.'-separated numeric string for now
return host.matches("([0-9A-Fa-f]|\\.){4,16}");
} | [
"public",
"static",
"boolean",
"hasLiteralIPAddress",
"(",
"URI",
"resource",
")",
"{",
"String",
"host",
"=",
"resource",
".",
"getHost",
"(",
")",
";",
"if",
"(",
"host",
"==",
"null",
"||",
"host",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"fals... | We can make this tighter but IPAddressUtil is in a sun package sadly | [
"We",
"can",
"make",
"this",
"tighter",
"but",
"IPAddressUtil",
"is",
"in",
"a",
"sun",
"package",
"sadly"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/URLUtils.java#L264-L271 |
105,518 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/CacheControlHandler.java | CacheControlHandler.getCacheControlHeader | public String getCacheControlHeader() {
checkIfMaxAgeIsResolved();
String maxAge = Directive.MAX_AGE.getName() + "=" + (maxAgeResolvedValue > 0 ? maxAgeResolvedValue : "0");
return staticDirectives.toString() + maxAge;
} | java | public String getCacheControlHeader() {
checkIfMaxAgeIsResolved();
String maxAge = Directive.MAX_AGE.getName() + "=" + (maxAgeResolvedValue > 0 ? maxAgeResolvedValue : "0");
return staticDirectives.toString() + maxAge;
} | [
"public",
"String",
"getCacheControlHeader",
"(",
")",
"{",
"checkIfMaxAgeIsResolved",
"(",
")",
";",
"String",
"maxAge",
"=",
"Directive",
".",
"MAX_AGE",
".",
"getName",
"(",
")",
"+",
"\"=\"",
"+",
"(",
"maxAgeResolvedValue",
">",
"0",
"?",
"maxAgeResolvedV... | Returns the Cache-control header string
@return | [
"Returns",
"the",
"Cache",
"-",
"control",
"header",
"string"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/CacheControlHandler.java#L56-L60 |
105,519 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/CacheControlHandler.java | CacheControlHandler.buildDirectives | private void buildDirectives(PatternCacheControl patternCacheControl) {
for (Map.Entry<Directive, String> entry : patternCacheControl.getDirectives().entrySet()) {
Directive key = entry.getKey();
String value = entry.getValue();
switch (key) {
case MAX_AGE:
... | java | private void buildDirectives(PatternCacheControl patternCacheControl) {
for (Map.Entry<Directive, String> entry : patternCacheControl.getDirectives().entrySet()) {
Directive key = entry.getKey();
String value = entry.getValue();
switch (key) {
case MAX_AGE:
... | [
"private",
"void",
"buildDirectives",
"(",
"PatternCacheControl",
"patternCacheControl",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Directive",
",",
"String",
">",
"entry",
":",
"patternCacheControl",
".",
"getDirectives",
"(",
")",
".",
"entrySet",
"(",
... | Builds a string of directives by concatenating all the static directives
@param patternCacheControl | [
"Builds",
"a",
"string",
"of",
"directives",
"by",
"concatenating",
"all",
"the",
"static",
"directives"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/CacheControlHandler.java#L127-L145 |
105,520 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/Utils.java | Utils.fill | public static String fill(char c, int size) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < size; i++) {
builder.append(c);
}
return builder.toString();
} | java | public static String fill(char c, int size) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < size; i++) {
builder.append(c);
}
return builder.toString();
} | [
"public",
"static",
"String",
"fill",
"(",
"char",
"c",
",",
"int",
"size",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"buil... | Creates a new String filled with size of a repeating character
@param c Character to repeat
@param size Size of resulting String
@return String full of repeated characters | [
"Creates",
"a",
"new",
"String",
"filled",
"with",
"size",
"of",
"a",
"repeating",
"character"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/Utils.java#L137-L143 |
105,521 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/Utils.java | Utils.initCaps | public static String initCaps(String in) {
return in.length() < 2 ? in.toUpperCase() : in.substring(0, 1).toUpperCase() + in.substring(1);
} | java | public static String initCaps(String in) {
return in.length() < 2 ? in.toUpperCase() : in.substring(0, 1).toUpperCase() + in.substring(1);
} | [
"public",
"static",
"String",
"initCaps",
"(",
"String",
"in",
")",
"{",
"return",
"in",
".",
"length",
"(",
")",
"<",
"2",
"?",
"in",
".",
"toUpperCase",
"(",
")",
":",
"in",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")... | Converts the first character of the string to uppercase. Does NOT deal with surrogate pairs. | [
"Converts",
"the",
"first",
"character",
"of",
"the",
"string",
"to",
"uppercase",
".",
"Does",
"NOT",
"deal",
"with",
"surrogate",
"pairs",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/Utils.java#L457-L459 |
105,522 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyIoHandler.java | AbstractProxyIoHandler.sessionOpened | @Override
public final void sessionOpened(IoSession session) throws Exception {
ProxyIoSession proxyIoSession = (ProxyIoSession) session
.getAttribute(ProxyIoSession.PROXY_SESSION);
if (proxyIoSession.getRequest() instanceof SocksProxyRequest
|| proxyIoSession.isAuth... | java | @Override
public final void sessionOpened(IoSession session) throws Exception {
ProxyIoSession proxyIoSession = (ProxyIoSession) session
.getAttribute(ProxyIoSession.PROXY_SESSION);
if (proxyIoSession.getRequest() instanceof SocksProxyRequest
|| proxyIoSession.isAuth... | [
"@",
"Override",
"public",
"final",
"void",
"sessionOpened",
"(",
"IoSession",
"session",
")",
"throws",
"Exception",
"{",
"ProxyIoSession",
"proxyIoSession",
"=",
"(",
"ProxyIoSession",
")",
"session",
".",
"getAttribute",
"(",
"ProxyIoSession",
".",
"PROXY_SESSION... | Hooked session opened event.
@param session the io session | [
"Hooked",
"session",
"opened",
"event",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyIoHandler.java#L48-L60 |
105,523 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/AbstractBridgeSession.java | AbstractBridgeSession.reset | public void reset(final Throwable cause) {
if (cause == null) {
throw new NullPointerException("cause must not be null in AbstractBridgeSession.reset");
}
if (!isIoAligned() || getIoThread() == Thread.currentThread()) {
reset0(cause);
}
else {
... | java | public void reset(final Throwable cause) {
if (cause == null) {
throw new NullPointerException("cause must not be null in AbstractBridgeSession.reset");
}
if (!isIoAligned() || getIoThread() == Thread.currentThread()) {
reset0(cause);
}
else {
... | [
"public",
"void",
"reset",
"(",
"final",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"cause",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"cause must not be null in AbstractBridgeSession.reset\"",
")",
";",
"}",
"if",
"(",
"!",
"isIoAli... | Behave similarly to connection reset by peer at NIO layer. This method should be called
from handlers' exceptionCaught method instead of calling fireExceptionCaught and
IoProcessor.remove, because the latter will fail if we're not on its IO thread.
@param cause | [
"Behave",
"similarly",
"to",
"connection",
"reset",
"by",
"peer",
"at",
"NIO",
"layer",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"handlers",
"exceptionCaught",
"method",
"instead",
"of",
"calling",
"fireExceptionCaught",
"and",
"IoProcessor",
".",
... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/AbstractBridgeSession.java#L216-L232 |
105,524 | kaazing/gateway | samples/security/TokenLoginModule.java | TokenLoginModule.processToken | private void processToken(String tokenData) throws JSONException, LoginException {
JSONObject json = new JSONObject(tokenData);
// Validate that the token hasn't expired.
ZonedDateTime expires = ZonedDateTime.parse(json.getString("tokenExpires"));
ZonedDateTime now = ZonedDateTime.now(... | java | private void processToken(String tokenData) throws JSONException, LoginException {
JSONObject json = new JSONObject(tokenData);
// Validate that the token hasn't expired.
ZonedDateTime expires = ZonedDateTime.parse(json.getString("tokenExpires"));
ZonedDateTime now = ZonedDateTime.now(... | [
"private",
"void",
"processToken",
"(",
"String",
"tokenData",
")",
"throws",
"JSONException",
",",
"LoginException",
"{",
"JSONObject",
"json",
"=",
"new",
"JSONObject",
"(",
"tokenData",
")",
";",
"// Validate that the token hasn't expired.",
"ZonedDateTime",
"expires... | Validate the token and extract the username to add to shared state. An exception is thrown if the token is found to be
invalid
This method expects the token to be in JSON format:
{
username: "joe",
nonce: "5171483440790326",
tokenExpires: "2017-04-20T15:48:49.187Z"
} | [
"Validate",
"the",
"token",
"and",
"extract",
"the",
"username",
"to",
"add",
"to",
"shared",
"state",
".",
"An",
"exception",
"is",
"thrown",
"if",
"the",
"token",
"is",
"found",
"to",
"be",
"invalid"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/samples/security/TokenLoginModule.java#L199-L230 |
105,525 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameUtils.java | WsFrameUtils.xor | public static void xor(ByteBuffer src, ByteBuffer dst, int mask) {
int remainder = src.remaining() % 4;
int remaining = src.remaining() - remainder;
int end = remaining + src.position();
// xor a 32bit word at a time as long as possible
while (src.position() < end) {
int masked = src.get... | java | public static void xor(ByteBuffer src, ByteBuffer dst, int mask) {
int remainder = src.remaining() % 4;
int remaining = src.remaining() - remainder;
int end = remaining + src.position();
// xor a 32bit word at a time as long as possible
while (src.position() < end) {
int masked = src.get... | [
"public",
"static",
"void",
"xor",
"(",
"ByteBuffer",
"src",
",",
"ByteBuffer",
"dst",
",",
"int",
"mask",
")",
"{",
"int",
"remainder",
"=",
"src",
".",
"remaining",
"(",
")",
"%",
"4",
";",
"int",
"remaining",
"=",
"src",
".",
"remaining",
"(",
")"... | Masks source buffer into destination buffer.
@param src the buffer containing readable bytes to be masked
@param dst the buffer where masked bytes are written
@param mask the mask to apply | [
"Masks",
"source",
"buffer",
"into",
"destination",
"buffer",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameUtils.java#L32-L68 |
105,526 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/config/parse/GatewayConfigParser.java | GatewayConfigParser.countNewLines | private static int countNewLines(char[] ch, int start, int length) {
int newLineCount = 0;
// quite reliable, since only Commodore 8-bit machines, TRS-80, Apple II family, Mac OS up to version 9 and OS-9
// use only '\r'
for (int i = start; i < length; i++) {
newLineCount = n... | java | private static int countNewLines(char[] ch, int start, int length) {
int newLineCount = 0;
// quite reliable, since only Commodore 8-bit machines, TRS-80, Apple II family, Mac OS up to version 9 and OS-9
// use only '\r'
for (int i = start; i < length; i++) {
newLineCount = n... | [
"private",
"static",
"int",
"countNewLines",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"int",
"newLineCount",
"=",
"0",
";",
"// quite reliable, since only Commodore 8-bit machines, TRS-80, Apple II family, Mac OS up to version 9 an... | Count the number of new lines
@param ch
@param start
@param length | [
"Count",
"the",
"number",
"of",
"new",
"lines"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/config/parse/GatewayConfigParser.java#L461-L469 |
105,527 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/PatternCacheControl.java | PatternCacheControl.parseDirectiveWithValue | private void parseDirectiveWithValue(String directiveName, String directiveValue) {
Directive directive;
if (directiveName.equals(Directive.MAX_AGE.getName())) {
if (directiveValue.startsWith(M_PLUS_STRING)) {
directiveValue = directiveValue.replace(M_PLUS_STRING, EMPTY_STRIN... | java | private void parseDirectiveWithValue(String directiveName, String directiveValue) {
Directive directive;
if (directiveName.equals(Directive.MAX_AGE.getName())) {
if (directiveValue.startsWith(M_PLUS_STRING)) {
directiveValue = directiveValue.replace(M_PLUS_STRING, EMPTY_STRIN... | [
"private",
"void",
"parseDirectiveWithValue",
"(",
"String",
"directiveName",
",",
"String",
"directiveValue",
")",
"{",
"Directive",
"directive",
";",
"if",
"(",
"directiveName",
".",
"equals",
"(",
"Directive",
".",
"MAX_AGE",
".",
"getName",
"(",
")",
")",
... | Adds a directive with the associated value to the directives map, after parsing the value from the configuration file
@param directiveName
@param directiveValue | [
"Adds",
"a",
"directive",
"with",
"the",
"associated",
"value",
"to",
"the",
"directives",
"map",
"after",
"parsing",
"the",
"value",
"from",
"the",
"configuration",
"file"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/PatternCacheControl.java#L134-L148 |
105,528 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/PatternCacheControl.java | PatternCacheControl.checkDirective | private boolean checkDirective(String directive) {
if (directives.containsKey(directive)) {
throw new IllegalArgumentException("Duplicate cache-control directive in configuration file");
} else if (Directive.get(directive) == null) {
throw new IllegalArgumentException("Missing or... | java | private boolean checkDirective(String directive) {
if (directives.containsKey(directive)) {
throw new IllegalArgumentException("Duplicate cache-control directive in configuration file");
} else if (Directive.get(directive) == null) {
throw new IllegalArgumentException("Missing or... | [
"private",
"boolean",
"checkDirective",
"(",
"String",
"directive",
")",
"{",
"if",
"(",
"directives",
".",
"containsKey",
"(",
"directive",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Duplicate cache-control directive in configuration file\"",
")... | Checks for duplicate directive values and correct syntax
@param directive
@return | [
"Checks",
"for",
"duplicate",
"directive",
"values",
"and",
"correct",
"syntax"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/PatternCacheControl.java#L155-L162 |
105,529 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/TransportFactory.java | TransportFactory.injectResources | public Map<String, Object> injectResources(Map<String, Object> resources) {
Map<String, Object> allResources = new HashMap<>(resources);
for (Entry<String, Transport> entry : transportsByName.entrySet()) {
allResources.put(entry.getKey() + ".acceptor", entry.getValue().getAcceptor());
... | java | public Map<String, Object> injectResources(Map<String, Object> resources) {
Map<String, Object> allResources = new HashMap<>(resources);
for (Entry<String, Transport> entry : transportsByName.entrySet()) {
allResources.put(entry.getKey() + ".acceptor", entry.getValue().getAcceptor());
... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"injectResources",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"resources",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"allResources",
"=",
"new",
"HashMap",
"<>",
"(",
"resources",
")",
"... | Inject the given resources plus all available transport acceptors and connectors into every available acceptor
and connector.
@param resources Resources that should be injected (in addition to available transport acceptors and connectors)
@return A map containing the given input resources plus entries for the acceptor ... | [
"Inject",
"the",
"given",
"resources",
"plus",
"all",
"available",
"transport",
"acceptors",
"and",
"connectors",
"into",
"every",
"available",
"acceptor",
"and",
"connector",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/TransportFactory.java#L197-L217 |
105,530 | kaazing/gateway | service/http.balancer/src/main/java/org/kaazing/gateway/service/http/balancer/HttpBalancerService.java | HttpBalancerService.toWsBalancerURIs | private static Collection<String> toWsBalancerURIs(Collection<String> uris,
AcceptOptionsContext acceptOptionsCtx,
TransportFactory transportFactory) throws Exception {
List<String> httpURIs = new ArrayList<>... | java | private static Collection<String> toWsBalancerURIs(Collection<String> uris,
AcceptOptionsContext acceptOptionsCtx,
TransportFactory transportFactory) throws Exception {
List<String> httpURIs = new ArrayList<>... | [
"private",
"static",
"Collection",
"<",
"String",
">",
"toWsBalancerURIs",
"(",
"Collection",
"<",
"String",
">",
"uris",
",",
"AcceptOptionsContext",
"acceptOptionsCtx",
",",
"TransportFactory",
"transportFactory",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Str... | Converts a collection of WS URIs to their equivalent WSN balancer URIs.
@param uris
the URIs to convert
@return the converted URIs
@throws Exception | [
"Converts",
"a",
"collection",
"of",
"WS",
"URIs",
"to",
"their",
"equivalent",
"WSN",
"balancer",
"URIs",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.balancer/src/main/java/org/kaazing/gateway/service/http/balancer/HttpBalancerService.java#L175-L202 |
105,531 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/event/IoSessionEventQueue.java | IoSessionEventQueue.flushPendingSessionEvents | public void flushPendingSessionEvents() throws Exception {
synchronized (sessionEventsQueue) {
IoSessionEvent evt;
while ((evt = sessionEventsQueue.poll()) != null) {
logger.debug(" Flushing buffered event: {}", evt);
evt.deliverEvent();
... | java | public void flushPendingSessionEvents() throws Exception {
synchronized (sessionEventsQueue) {
IoSessionEvent evt;
while ((evt = sessionEventsQueue.poll()) != null) {
logger.debug(" Flushing buffered event: {}", evt);
evt.deliverEvent();
... | [
"public",
"void",
"flushPendingSessionEvents",
"(",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"sessionEventsQueue",
")",
"{",
"IoSessionEvent",
"evt",
";",
"while",
"(",
"(",
"evt",
"=",
"sessionEventsQueue",
".",
"poll",
"(",
")",
")",
"!=",
"null... | Send any session event which were queued while waiting for handshaking to complete.
Please note this is an internal method. DO NOT USE it in your code. | [
"Send",
"any",
"session",
"event",
"which",
"were",
"queued",
"while",
"waiting",
"for",
"handshaking",
"to",
"complete",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/event/IoSessionEventQueue.java#L109-L118 |
105,532 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/event/IoSessionEventQueue.java | IoSessionEventQueue.enqueueSessionEvent | private void enqueueSessionEvent(final IoSessionEvent evt) {
synchronized (sessionEventsQueue) {
logger.debug("Enqueuing event: {}", evt);
sessionEventsQueue.offer(evt);
}
} | java | private void enqueueSessionEvent(final IoSessionEvent evt) {
synchronized (sessionEventsQueue) {
logger.debug("Enqueuing event: {}", evt);
sessionEventsQueue.offer(evt);
}
} | [
"private",
"void",
"enqueueSessionEvent",
"(",
"final",
"IoSessionEvent",
"evt",
")",
"{",
"synchronized",
"(",
"sessionEventsQueue",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Enqueuing event: {}\"",
",",
"evt",
")",
";",
"sessionEventsQueue",
".",
"offer",
"(",
... | Enqueue an event to be delivered once handshaking is complete.
@param evt the session event to enqueue | [
"Enqueue",
"an",
"event",
"to",
"be",
"delivered",
"once",
"handshaking",
"is",
"complete",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/event/IoSessionEventQueue.java#L125-L130 |
105,533 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingConnectionlessIoAcceptor.java | AbstractPollingConnectionlessIoAcceptor.startupAcceptor | private void startupAcceptor() {
if (!selectable) {
registerQueue.clear();
cancelQueue.clear();
flushingSessions.clear();
}
synchronized (lock) {
if (acceptor == null) {
acceptor = new Acceptor();
executeWorker(acce... | java | private void startupAcceptor() {
if (!selectable) {
registerQueue.clear();
cancelQueue.clear();
flushingSessions.clear();
}
synchronized (lock) {
if (acceptor == null) {
acceptor = new Acceptor();
executeWorker(acce... | [
"private",
"void",
"startupAcceptor",
"(",
")",
"{",
"if",
"(",
"!",
"selectable",
")",
"{",
"registerQueue",
".",
"clear",
"(",
")",
";",
"cancelQueue",
".",
"clear",
"(",
")",
";",
"flushingSessions",
".",
"clear",
"(",
")",
";",
"}",
"synchronized",
... | Starts the inner Acceptor thread. | [
"Starts",
"the",
"inner",
"Acceptor",
"thread",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingConnectionlessIoAcceptor.java#L315-L328 |
105,534 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/SocksProxyConstants.java | SocksProxyConstants.getReplyCodeAsString | public static String getReplyCodeAsString(byte code) {
switch (code) {
// v4 & v4a codes
case V4_REPLY_REQUEST_GRANTED:
return "Request granted";
case V4_REPLY_REQUEST_REJECTED_OR_FAILED:
return "Request rejected or failed";
case V4_REPLY_REQUEST_FAILED_NO... | java | public static String getReplyCodeAsString(byte code) {
switch (code) {
// v4 & v4a codes
case V4_REPLY_REQUEST_GRANTED:
return "Request granted";
case V4_REPLY_REQUEST_REJECTED_OR_FAILED:
return "Request rejected or failed";
case V4_REPLY_REQUEST_FAILED_NO... | [
"public",
"static",
"String",
"getReplyCodeAsString",
"(",
"byte",
"code",
")",
"{",
"switch",
"(",
"code",
")",
"{",
"// v4 & v4a codes",
"case",
"V4_REPLY_REQUEST_GRANTED",
":",
"return",
"\"Request granted\"",
";",
"case",
"V4_REPLY_REQUEST_REJECTED_OR_FAILED",
":",
... | Return the string associated with the specified reply code.
@param code the reply code
@return the reply string | [
"Return",
"the",
"string",
"associated",
"with",
"the",
"specified",
"reply",
"code",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/SocksProxyConstants.java#L142-L177 |
105,535 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/Transform.java | Transform.getThrowableStrRep | public static String[] getThrowableStrRep(Throwable throwable) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
throwable.printStackTrace(pw);
pw.flush();
LineNumberReader reader = new LineNumberReader(new StringReader(sw.toString()));
ArrayLi... | java | public static String[] getThrowableStrRep(Throwable throwable) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
throwable.printStackTrace(pw);
pw.flush();
LineNumberReader reader = new LineNumberReader(new StringReader(sw.toString()));
ArrayLi... | [
"public",
"static",
"String",
"[",
"]",
"getThrowableStrRep",
"(",
"Throwable",
"throwable",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"PrintWriter",
"pw",
"=",
"new",
"PrintWriter",
"(",
"sw",
")",
";",
"throwable",
".",
"... | convert a Throwable into an array of Strings
@param throwable
@return string representation of the throwable | [
"convert",
"a",
"Throwable",
"into",
"an",
"array",
"of",
"Strings"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/Transform.java#L122-L141 |
105,536 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryServiceHandler.java | HttpDirectoryServiceHandler.addCacheControl | private void addCacheControl(HttpAcceptSession session, File requestFile, String requestPath) {
CacheControlHandler cacheControlHandler = urlCacheControlMap.computeIfAbsent(requestPath,
path -> patterns.stream()
.filter(patternCacheControl -> PatternMatcherUtils.caseInsensi... | java | private void addCacheControl(HttpAcceptSession session, File requestFile, String requestPath) {
CacheControlHandler cacheControlHandler = urlCacheControlMap.computeIfAbsent(requestPath,
path -> patterns.stream()
.filter(patternCacheControl -> PatternMatcherUtils.caseInsensi... | [
"private",
"void",
"addCacheControl",
"(",
"HttpAcceptSession",
"session",
",",
"File",
"requestFile",
",",
"String",
"requestPath",
")",
"{",
"CacheControlHandler",
"cacheControlHandler",
"=",
"urlCacheControlMap",
".",
"computeIfAbsent",
"(",
"requestPath",
",",
"path... | Matches the file URL with the most specific pattern and caches this information in a map
Sets cache-control and expires headers
@param session
@param requestFile
@param requestPath | [
"Matches",
"the",
"file",
"URL",
"with",
"the",
"most",
"specific",
"pattern",
"and",
"caches",
"this",
"information",
"in",
"a",
"map",
"Sets",
"cache",
"-",
"control",
"and",
"expires",
"headers"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryServiceHandler.java#L311-L323 |
105,537 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/HttpNTLMAuthLogicHandler.java | HttpNTLMAuthLogicHandler.getNTLMHeader | private String getNTLMHeader(final HttpProxyResponse response) {
List<String> values = response.getHeaders().get("Proxy-Authenticate");
for (String s : values) {
if (s.startsWith("NTLM")) {
return s;
}
}
return null;
} | java | private String getNTLMHeader(final HttpProxyResponse response) {
List<String> values = response.getHeaders().get("Proxy-Authenticate");
for (String s : values) {
if (s.startsWith("NTLM")) {
return s;
}
}
return null;
} | [
"private",
"String",
"getNTLMHeader",
"(",
"final",
"HttpProxyResponse",
"response",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"response",
".",
"getHeaders",
"(",
")",
".",
"get",
"(",
"\"Proxy-Authenticate\"",
")",
";",
"for",
"(",
"String",
"s",... | Returns the value of the NTLM Proxy-Authenticate header.
@param response the proxy response | [
"Returns",
"the",
"value",
"of",
"the",
"NTLM",
"Proxy",
"-",
"Authenticate",
"header",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/HttpNTLMAuthLogicHandler.java#L134-L144 |
105,538 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/demux/DemuxingIoHandler.java | DemuxingIoHandler.exceptionCaught | @Override
public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
ExceptionHandler<Throwable> handler = findExceptionHandler(cause.getClass());
if (handler != null) {
handler.exceptionCaught(session, cause);
} else {
throw new UnknownMessage... | java | @Override
public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
ExceptionHandler<Throwable> handler = findExceptionHandler(cause.getClass());
if (handler != null) {
handler.exceptionCaught(session, cause);
} else {
throw new UnknownMessage... | [
"@",
"Override",
"public",
"void",
"exceptionCaught",
"(",
"IoSession",
"session",
",",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"ExceptionHandler",
"<",
"Throwable",
">",
"handler",
"=",
"findExceptionHandler",
"(",
"cause",
".",
"getClass",
"(",
... | Invoked when any exception is thrown by user IoHandler implementation
or by MINA. If cause is an instance of IOException, MINA will close the
connection automatically.
<b>Warning !</b> If you are to overload this method, be aware that you
_must_ call the messageHandler in your own method, otherwise it won't
be called. | [
"Invoked",
"when",
"any",
"exception",
"is",
"thrown",
"by",
"user",
"IoHandler",
"implementation",
"or",
"by",
"MINA",
".",
"If",
"cause",
"is",
"an",
"instance",
"of",
"IOException",
"MINA",
"will",
"close",
"the",
"connection",
"automatically",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/demux/DemuxingIoHandler.java#L264-L274 |
105,539 | kaazing/gateway | mina.core/transport-serial/src/main/java/org/apache/mina/transport/serial/SerialSessionImpl.java | SerialSessionImpl.start | void start() throws IOException, TooManyListenersException {
inputStream = port.getInputStream();
outputStream = port.getOutputStream();
ReadWorker w = new ReadWorker();
w.start();
port.addEventListener(this);
service.getIdleStatusChecker0().addSession(this);
try ... | java | void start() throws IOException, TooManyListenersException {
inputStream = port.getInputStream();
outputStream = port.getOutputStream();
ReadWorker w = new ReadWorker();
w.start();
port.addEventListener(this);
service.getIdleStatusChecker0().addSession(this);
try ... | [
"void",
"start",
"(",
")",
"throws",
"IOException",
",",
"TooManyListenersException",
"{",
"inputStream",
"=",
"port",
".",
"getInputStream",
"(",
")",
";",
"outputStream",
"=",
"port",
".",
"getOutputStream",
"(",
")",
";",
"ReadWorker",
"w",
"=",
"new",
"R... | start handling streams
@throws IOException
@throws TooManyListenersException | [
"start",
"handling",
"streams"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/transport-serial/src/main/java/org/apache/mina/transport/serial/SerialSessionImpl.java#L141-L155 |
105,540 | kaazing/gateway | service/update.check/src/main/java/org/kaazing/gateway/service/update/check/UpdateCheckService.java | UpdateCheckService.checkForUpdate | public void checkForUpdate(UpdateCheckListener updateCheckListener) {
listeners.add(updateCheckListener);
if (scheduler != null) {
scheduler.schedule(new UpdateCheckTask(this, versionServiceUrl, productName), 0, SECONDS);
} else {
// the scheduler won't be provided if the... | java | public void checkForUpdate(UpdateCheckListener updateCheckListener) {
listeners.add(updateCheckListener);
if (scheduler != null) {
scheduler.schedule(new UpdateCheckTask(this, versionServiceUrl, productName), 0, SECONDS);
} else {
// the scheduler won't be provided if the... | [
"public",
"void",
"checkForUpdate",
"(",
"UpdateCheckListener",
"updateCheckListener",
")",
"{",
"listeners",
".",
"add",
"(",
"updateCheckListener",
")",
";",
"if",
"(",
"scheduler",
"!=",
"null",
")",
"{",
"scheduler",
".",
"schedule",
"(",
"new",
"UpdateCheck... | Forces a check for an update and registers the listener if it is not already registered
@param updateCheckListener | [
"Forces",
"a",
"check",
"for",
"an",
"update",
"and",
"registers",
"the",
"listener",
"if",
"it",
"is",
"not",
"already",
"registered"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/update.check/src/main/java/org/kaazing/gateway/service/update/check/UpdateCheckService.java#L123-L132 |
105,541 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.setServicesCount | private void setServicesCount() {
servicesCount = MAX_SERVICE_COUNT;
metadataLength = NUMBER_OF_INTS_IN_HEADER * BitUtil.SIZE_OF_INT + SIZEOF_STRING + servicesCount * (SIZEOF_STRING +
NUMBER_OF_INTS_PER_SERVICE * BitUtil.SIZE_OF_INT);
endOfMetadata = BitUtil.align(metadataLength ... | java | private void setServicesCount() {
servicesCount = MAX_SERVICE_COUNT;
metadataLength = NUMBER_OF_INTS_IN_HEADER * BitUtil.SIZE_OF_INT + SIZEOF_STRING + servicesCount * (SIZEOF_STRING +
NUMBER_OF_INTS_PER_SERVICE * BitUtil.SIZE_OF_INT);
endOfMetadata = BitUtil.align(metadataLength ... | [
"private",
"void",
"setServicesCount",
"(",
")",
"{",
"servicesCount",
"=",
"MAX_SERVICE_COUNT",
";",
"metadataLength",
"=",
"NUMBER_OF_INTS_IN_HEADER",
"*",
"BitUtil",
".",
"SIZE_OF_INT",
"+",
"SIZEOF_STRING",
"+",
"servicesCount",
"*",
"(",
"SIZEOF_STRING",
"+",
"... | Method setting the number of services and metadata length | [
"Method",
"setting",
"the",
"number",
"of",
"services",
"and",
"metadata",
"length"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L182-L188 |
105,542 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.fillMetaData | private void fillMetaData() {
metaDataBuffer.putInt(MONITOR_VERSION_OFFSET, MONITOR_VERSION);
metaDataBuffer.putInt(GW_DATA_REFERENCE_OFFSET, GW_DATA_OFFSET);
metaDataBuffer.putInt(SERVICE_DATA_REFERENCE_OFFSET, serviceDataOffset);
metaDataBuffer.putStringUtf8(GW_ID_OFFSET, gatewayId, By... | java | private void fillMetaData() {
metaDataBuffer.putInt(MONITOR_VERSION_OFFSET, MONITOR_VERSION);
metaDataBuffer.putInt(GW_DATA_REFERENCE_OFFSET, GW_DATA_OFFSET);
metaDataBuffer.putInt(SERVICE_DATA_REFERENCE_OFFSET, serviceDataOffset);
metaDataBuffer.putStringUtf8(GW_ID_OFFSET, gatewayId, By... | [
"private",
"void",
"fillMetaData",
"(",
")",
"{",
"metaDataBuffer",
".",
"putInt",
"(",
"MONITOR_VERSION_OFFSET",
",",
"MONITOR_VERSION",
")",
";",
"metaDataBuffer",
".",
"putInt",
"(",
"GW_DATA_REFERENCE_OFFSET",
",",
"GW_DATA_OFFSET",
")",
";",
"metaDataBuffer",
"... | Fills the meta data in the specified buffer
@param monitorMetaDataBuffer - the meta data buffer | [
"Fills",
"the",
"meta",
"data",
"in",
"the",
"specified",
"buffer"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L194-L204 |
105,543 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.fillServiceMetadata | private void fillServiceMetadata(final String serviceName, final int index) {
final int servAreaOffset = noOfServicesOffset + BitUtil.SIZE_OF_INT;
metaDataBuffer.putInt(noOfServicesOffset, metaDataBuffer.getInt(noOfServicesOffset) + 1);
int serviceNameOffset = getServiceNameOffset(servAreaOffset... | java | private void fillServiceMetadata(final String serviceName, final int index) {
final int servAreaOffset = noOfServicesOffset + BitUtil.SIZE_OF_INT;
metaDataBuffer.putInt(noOfServicesOffset, metaDataBuffer.getInt(noOfServicesOffset) + 1);
int serviceNameOffset = getServiceNameOffset(servAreaOffset... | [
"private",
"void",
"fillServiceMetadata",
"(",
"final",
"String",
"serviceName",
",",
"final",
"int",
"index",
")",
"{",
"final",
"int",
"servAreaOffset",
"=",
"noOfServicesOffset",
"+",
"BitUtil",
".",
"SIZE_OF_INT",
";",
"metaDataBuffer",
".",
"putInt",
"(",
"... | Method adding services metadata
@param monitorMetaDataBuffer - the metadata buffer | [
"Method",
"adding",
"services",
"metadata"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L210-L220 |
105,544 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.getServiceNameOffset | private int getServiceNameOffset(final int servAreaOffset) {
// if there are other services which have been written
if (prevServiceOffset != 0) {
return prevServiceOffset + prevServiceName.length() + BitUtil.SIZE_OF_INT + BitUtil.SIZE_OF_INT;
}
// else
return servArea... | java | private int getServiceNameOffset(final int servAreaOffset) {
// if there are other services which have been written
if (prevServiceOffset != 0) {
return prevServiceOffset + prevServiceName.length() + BitUtil.SIZE_OF_INT + BitUtil.SIZE_OF_INT;
}
// else
return servArea... | [
"private",
"int",
"getServiceNameOffset",
"(",
"final",
"int",
"servAreaOffset",
")",
"{",
"// if there are other services which have been written",
"if",
"(",
"prevServiceOffset",
"!=",
"0",
")",
"{",
"return",
"prevServiceOffset",
"+",
"prevServiceName",
".",
"length",
... | Method returning serviceNameOffset
@param servAreaOffset
@return | [
"Method",
"returning",
"serviceNameOffset"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L227-L234 |
105,545 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.initializeServiceRefMetadata | private void initializeServiceRefMetadata(int serviceLocationOffset, int serviceOffsetIndex) {
metaDataBuffer.putInt(serviceLocationOffset, serviceRefSection + serviceOffsetIndex * BitUtil.SIZE_OF_INT);
// service reference section
metaDataBuffer.putInt(serviceRefSection + serviceOffsetIndex * ... | java | private void initializeServiceRefMetadata(int serviceLocationOffset, int serviceOffsetIndex) {
metaDataBuffer.putInt(serviceLocationOffset, serviceRefSection + serviceOffsetIndex * BitUtil.SIZE_OF_INT);
// service reference section
metaDataBuffer.putInt(serviceRefSection + serviceOffsetIndex * ... | [
"private",
"void",
"initializeServiceRefMetadata",
"(",
"int",
"serviceLocationOffset",
",",
"int",
"serviceOffsetIndex",
")",
"{",
"metaDataBuffer",
".",
"putInt",
"(",
"serviceLocationOffset",
",",
"serviceRefSection",
"+",
"serviceOffsetIndex",
"*",
"BitUtil",
".",
"... | Method initializing service ref metadata section data
@param serviceLocationOffset
@param serviceOffsetIndex | [
"Method",
"initializing",
"service",
"ref",
"metadata",
"section",
"data"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L241-L251 |
105,546 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.setGatewayIdDependentOffsets | private void setGatewayIdDependentOffsets(String gatewayId) {
gwCountersLblBuffersReferenceOffset = GW_ID_OFFSET + gatewayId.length() + BitUtil.SIZE_OF_INT;
gwCountersLblBuffersLengthOffset = gwCountersLblBuffersReferenceOffset + BitUtil.SIZE_OF_INT;
gwCountersValueBuffersReferenceOffset = gwCou... | java | private void setGatewayIdDependentOffsets(String gatewayId) {
gwCountersLblBuffersReferenceOffset = GW_ID_OFFSET + gatewayId.length() + BitUtil.SIZE_OF_INT;
gwCountersLblBuffersLengthOffset = gwCountersLblBuffersReferenceOffset + BitUtil.SIZE_OF_INT;
gwCountersValueBuffersReferenceOffset = gwCou... | [
"private",
"void",
"setGatewayIdDependentOffsets",
"(",
"String",
"gatewayId",
")",
"{",
"gwCountersLblBuffersReferenceOffset",
"=",
"GW_ID_OFFSET",
"+",
"gatewayId",
".",
"length",
"(",
")",
"+",
"BitUtil",
".",
"SIZE_OF_INT",
";",
"gwCountersLblBuffersLengthOffset",
"... | Method setting gatewayId dependent offsets
@param gatewayId | [
"Method",
"setting",
"gatewayId",
"dependent",
"offsets"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L257-L264 |
105,547 | kaazing/gateway | server.api/src/main/java/org/kaazing/gateway/server/GatewayFactory.java | GatewayFactory.createGateway | public static Gateway createGateway() {
Gateway gateway = null;
for (GatewayCreator factory : loader) {
gateway = factory.createGateway(gateway);
factory.configureGateway(gateway);
}
if (gateway == null) {
throw new RuntimeException("Failed to load Ga... | java | public static Gateway createGateway() {
Gateway gateway = null;
for (GatewayCreator factory : loader) {
gateway = factory.createGateway(gateway);
factory.configureGateway(gateway);
}
if (gateway == null) {
throw new RuntimeException("Failed to load Ga... | [
"public",
"static",
"Gateway",
"createGateway",
"(",
")",
"{",
"Gateway",
"gateway",
"=",
"null",
";",
"for",
"(",
"GatewayCreator",
"factory",
":",
"loader",
")",
"{",
"gateway",
"=",
"factory",
".",
"createGateway",
"(",
"gateway",
")",
";",
"factory",
"... | Creates an implementation of an Gateway.
@return a Gateway | [
"Creates",
"an",
"implementation",
"of",
"an",
"Gateway",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server.api/src/main/java/org/kaazing/gateway/server/GatewayFactory.java#L37-L49 |
105,548 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/filter/codec/ProtocolCodecFilter.java | ProtocolCodecFilter.messageReceived | @Override
public void messageReceived(NextFilter nextFilter, IoSession session,
Object message) throws Exception {
LOGGER.debug("Processing a MESSAGE_RECEIVED for session {}", session.getId());
if (!(message instanceof IoBuffer)) {
nextFilter.messageReceived(session, message... | java | @Override
public void messageReceived(NextFilter nextFilter, IoSession session,
Object message) throws Exception {
LOGGER.debug("Processing a MESSAGE_RECEIVED for session {}", session.getId());
if (!(message instanceof IoBuffer)) {
nextFilter.messageReceived(session, message... | [
"@",
"Override",
"public",
"void",
"messageReceived",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Processing a MESSAGE_RECEIVED for session {}\"",
",",
"sessio... | Process the incoming message, calling the session decoder. As the incoming
buffer might contains more than one messages, we have to loop until the decoder
throws an exception.
while ( buffer not empty )
try
decode ( buffer )
catch
break; | [
"Process",
"the",
"incoming",
"message",
"calling",
"the",
"session",
"decoder",
".",
"As",
"the",
"incoming",
"buffer",
"might",
"contains",
"more",
"than",
"one",
"messages",
"we",
"have",
"to",
"loop",
"until",
"the",
"decoder",
"throws",
"an",
"exception",... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/filter/codec/ProtocolCodecFilter.java#L214-L286 |
105,549 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/filter/codec/ProtocolCodecFilter.java | ProtocolCodecFilter.initCodec | private void initCodec(IoSession session) throws Exception {
// Creates the decoder and stores it into the newly created session
ProtocolDecoder decoder = factory.getDecoder(session);
session.setAttribute(DECODER, decoder);
// Creates the encoder and stores it into the newly created ses... | java | private void initCodec(IoSession session) throws Exception {
// Creates the decoder and stores it into the newly created session
ProtocolDecoder decoder = factory.getDecoder(session);
session.setAttribute(DECODER, decoder);
// Creates the encoder and stores it into the newly created ses... | [
"private",
"void",
"initCodec",
"(",
"IoSession",
"session",
")",
"throws",
"Exception",
"{",
"// Creates the decoder and stores it into the newly created session",
"ProtocolDecoder",
"decoder",
"=",
"factory",
".",
"getDecoder",
"(",
"session",
")",
";",
"session",
".",
... | Initialize the encoder and the decoder, storing them in the
session attributes. | [
"Initialize",
"the",
"encoder",
"and",
"the",
"decoder",
"storing",
"them",
"in",
"the",
"session",
"attributes",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/filter/codec/ProtocolCodecFilter.java#L440-L448 |
105,550 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.log | public static void log(IoSession session, Throwable t) {
Logger logger = getTransportLogger(session);
log(session, logger, t);
} | java | public static void log(IoSession session, Throwable t) {
Logger logger = getTransportLogger(session);
log(session, logger, t);
} | [
"public",
"static",
"void",
"log",
"(",
"IoSession",
"session",
",",
"Throwable",
"t",
")",
"{",
"Logger",
"logger",
"=",
"getTransportLogger",
"(",
"session",
")",
";",
"log",
"(",
"session",
",",
"logger",
",",
"t",
")",
";",
"}"
] | Logs an unexpected exception in the same way LoggingFilter would, using the transport
logger for the transport of the given session. | [
"Logs",
"an",
"unexpected",
"exception",
"in",
"the",
"same",
"way",
"LoggingFilter",
"would",
"using",
"the",
"transport",
"logger",
"for",
"the",
"transport",
"of",
"the",
"given",
"session",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L82-L85 |
105,551 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.log | public static void log(IoSession session, Logger logger, Throwable t) {
log(session, logger, t.toString(), t);
} | java | public static void log(IoSession session, Logger logger, Throwable t) {
log(session, logger, t.toString(), t);
} | [
"public",
"static",
"void",
"log",
"(",
"IoSession",
"session",
",",
"Logger",
"logger",
",",
"Throwable",
"t",
")",
"{",
"log",
"(",
"session",
",",
"logger",
",",
"t",
".",
"toString",
"(",
")",
",",
"t",
")",
";",
"}"
] | Logs an unexpected exception in the same way LoggingFilter would. | [
"Logs",
"an",
"unexpected",
"exception",
"in",
"the",
"same",
"way",
"LoggingFilter",
"would",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L90-L92 |
105,552 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.getUserIdentifier | static String getUserIdentifier(IoSession session) {
boolean isAcceptor = isAcceptor(session);
SocketAddress hostPortAddress = isAcceptor ? session.getRemoteAddress() : session.getLocalAddress();
SocketAddress identityAddress = isAcceptor ? session.getLocalAddress() : session.getRemoteAddress();... | java | static String getUserIdentifier(IoSession session) {
boolean isAcceptor = isAcceptor(session);
SocketAddress hostPortAddress = isAcceptor ? session.getRemoteAddress() : session.getLocalAddress();
SocketAddress identityAddress = isAcceptor ? session.getLocalAddress() : session.getRemoteAddress();... | [
"static",
"String",
"getUserIdentifier",
"(",
"IoSession",
"session",
")",
"{",
"boolean",
"isAcceptor",
"=",
"isAcceptor",
"(",
"session",
")",
";",
"SocketAddress",
"hostPortAddress",
"=",
"isAcceptor",
"?",
"session",
".",
"getRemoteAddress",
"(",
")",
":",
"... | Get a suitable identification for the user. For now this just consists of the TCP endpoint.
the HTTP-layer auth principal, etc.
@param session
@return | [
"Get",
"a",
"suitable",
"identification",
"for",
"the",
"user",
".",
"For",
"now",
"this",
"just",
"consists",
"of",
"the",
"TCP",
"endpoint",
".",
"the",
"HTTP",
"-",
"layer",
"auth",
"principal",
"etc",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L139-L146 |
105,553 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.resolveIdentity | private static String resolveIdentity(SocketAddress address, IoSessionEx session) {
if (address instanceof ResourceAddress) {
Subject subject = session.getSubject();
if (subject == null) {
subject = new Subject();
}
return resolveIdentity((Resource... | java | private static String resolveIdentity(SocketAddress address, IoSessionEx session) {
if (address instanceof ResourceAddress) {
Subject subject = session.getSubject();
if (subject == null) {
subject = new Subject();
}
return resolveIdentity((Resource... | [
"private",
"static",
"String",
"resolveIdentity",
"(",
"SocketAddress",
"address",
",",
"IoSessionEx",
"session",
")",
"{",
"if",
"(",
"address",
"instanceof",
"ResourceAddress",
")",
"{",
"Subject",
"subject",
"=",
"session",
".",
"getSubject",
"(",
")",
";",
... | Method performing identity resolution - attempts to extract a subject from the current
IoSessionEx session
@param address
@param session
@return | [
"Method",
"performing",
"identity",
"resolution",
"-",
"attempts",
"to",
"extract",
"a",
"subject",
"from",
"the",
"current",
"IoSessionEx",
"session"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L160-L169 |
105,554 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.resolveIdentity | private static String resolveIdentity(ResourceAddress address, Subject subject) {
IdentityResolver resolver = address.getOption(IDENTITY_RESOLVER);
ResourceAddress transport = address.getTransport();
if (resolver != null) {
return resolver.resolve(subject);
}
if (tran... | java | private static String resolveIdentity(ResourceAddress address, Subject subject) {
IdentityResolver resolver = address.getOption(IDENTITY_RESOLVER);
ResourceAddress transport = address.getTransport();
if (resolver != null) {
return resolver.resolve(subject);
}
if (tran... | [
"private",
"static",
"String",
"resolveIdentity",
"(",
"ResourceAddress",
"address",
",",
"Subject",
"subject",
")",
"{",
"IdentityResolver",
"resolver",
"=",
"address",
".",
"getOption",
"(",
"IDENTITY_RESOLVER",
")",
";",
"ResourceAddress",
"transport",
"=",
"addr... | Method attempting to perform identity resolution based on the provided subject parameter and transport
It is attempted to perform the resolution from the highest to the lowest layer, recursively.
@param address
@param subject
@return | [
"Method",
"attempting",
"to",
"perform",
"identity",
"resolution",
"based",
"on",
"the",
"provided",
"subject",
"parameter",
"and",
"transport",
"It",
"is",
"attempted",
"to",
"perform",
"the",
"resolution",
"from",
"the",
"highest",
"to",
"the",
"lowest",
"laye... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L178-L188 |
105,555 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.getHostPort | private static String getHostPort(SocketAddress address) {
if (address instanceof ResourceAddress) {
ResourceAddress lowest = getLowestTransportLayer((ResourceAddress)address);
return format(HOST_PORT_FORMAT, lowest.getResource().getHost(), lowest.getResource().getPort());
}
... | java | private static String getHostPort(SocketAddress address) {
if (address instanceof ResourceAddress) {
ResourceAddress lowest = getLowestTransportLayer((ResourceAddress)address);
return format(HOST_PORT_FORMAT, lowest.getResource().getHost(), lowest.getResource().getPort());
}
... | [
"private",
"static",
"String",
"getHostPort",
"(",
"SocketAddress",
"address",
")",
"{",
"if",
"(",
"address",
"instanceof",
"ResourceAddress",
")",
"{",
"ResourceAddress",
"lowest",
"=",
"getLowestTransportLayer",
"(",
"(",
"ResourceAddress",
")",
"address",
")",
... | Method attempting to retrieve host port identifier
@param address
@return | [
"Method",
"attempting",
"to",
"retrieve",
"host",
"port",
"identifier"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L195-L207 |
105,556 | kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.getLowestTransportLayer | static ResourceAddress getLowestTransportLayer(ResourceAddress transport) {
if (transport.getTransport() != null) {
return getLowestTransportLayer(transport.getTransport());
}
return transport;
} | java | static ResourceAddress getLowestTransportLayer(ResourceAddress transport) {
if (transport.getTransport() != null) {
return getLowestTransportLayer(transport.getTransport());
}
return transport;
} | [
"static",
"ResourceAddress",
"getLowestTransportLayer",
"(",
"ResourceAddress",
"transport",
")",
"{",
"if",
"(",
"transport",
".",
"getTransport",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"getLowestTransportLayer",
"(",
"transport",
".",
"getTransport",
"(",
"... | Method returning lowest transport layer
@param transport
@return | [
"Method",
"returning",
"lowest",
"transport",
"layer"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L214-L219 |
105,557 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/jmx/JmxManagementService.java | JmxManagementService.handleNotification | @Override
public void handleNotification(Notification notification, Object handback) {
String notificationType = notification.getType();
if (notificationType.equals(JMXConnectionNotification.OPENED)) {
managementContext.incrementManagementSessionCount();
} else if (notificationTy... | java | @Override
public void handleNotification(Notification notification, Object handback) {
String notificationType = notification.getType();
if (notificationType.equals(JMXConnectionNotification.OPENED)) {
managementContext.incrementManagementSessionCount();
} else if (notificationTy... | [
"@",
"Override",
"public",
"void",
"handleNotification",
"(",
"Notification",
"notification",
",",
"Object",
"handback",
")",
"{",
"String",
"notificationType",
"=",
"notification",
".",
"getType",
"(",
")",
";",
"if",
"(",
"notificationType",
".",
"equals",
"("... | NotificationListener support for connection open and closed notifications | [
"NotificationListener",
"support",
"for",
"connection",
"open",
"and",
"closed",
"notifications"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/jmx/JmxManagementService.java#L230-L238 |
105,558 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/security/auth/challenge/DispatchHttpChallengeFactory.java | DispatchHttpChallengeFactory.lookup | public HttpChallengeFactory lookup(String authScheme) {
HttpChallengeFactory result;
if (authScheme == null) return null;
result = challengeFactoriesByAuthScheme.get(authScheme);
if (result == null) {
if (authScheme.startsWith(AUTH_SCHEME_APPLICATION_PREFIX)) {
... | java | public HttpChallengeFactory lookup(String authScheme) {
HttpChallengeFactory result;
if (authScheme == null) return null;
result = challengeFactoriesByAuthScheme.get(authScheme);
if (result == null) {
if (authScheme.startsWith(AUTH_SCHEME_APPLICATION_PREFIX)) {
... | [
"public",
"HttpChallengeFactory",
"lookup",
"(",
"String",
"authScheme",
")",
"{",
"HttpChallengeFactory",
"result",
";",
"if",
"(",
"authScheme",
"==",
"null",
")",
"return",
"null",
";",
"result",
"=",
"challengeFactoriesByAuthScheme",
".",
"get",
"(",
"authSche... | public until unit test is moved | [
"public",
"until",
"unit",
"test",
"is",
"moved"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/security/auth/challenge/DispatchHttpChallengeFactory.java#L73-L88 |
105,559 | kaazing/gateway | service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/codec/AmqpMessageEncoder.java | AmqpMessageEncoder.putUnsignedLong | private static ByteBuffer putUnsignedLong(ByteBuffer buffer, long v) {
buffer.putInt(0);
return putUnsignedInt(buffer, (int)v);
} | java | private static ByteBuffer putUnsignedLong(ByteBuffer buffer, long v) {
buffer.putInt(0);
return putUnsignedInt(buffer, (int)v);
} | [
"private",
"static",
"ByteBuffer",
"putUnsignedLong",
"(",
"ByteBuffer",
"buffer",
",",
"long",
"v",
")",
"{",
"buffer",
".",
"putInt",
"(",
"0",
")",
";",
"return",
"putUnsignedInt",
"(",
"buffer",
",",
"(",
"int",
")",
"v",
")",
";",
"}"
] | Puts an unsigned long. | [
"Puts",
"an",
"unsigned",
"long",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/codec/AmqpMessageEncoder.java#L1005-L1008 |
105,560 | kaazing/gateway | service/proxy/src/main/java/org/kaazing/gateway/service/proxy/AbstractProxyHandler.java | AbstractProxyHandler.flushQueuedMessages | protected void flushQueuedMessages(IoSession session, AttachedSessionManager attachedSessionManager) {
Queue<Object> messageQueue = getMessageQueue(session);
if (messageQueue != null) {
flushQueuedMessages(messageQueue, session, attachedSessionManager);
// Note: leave messageQueu... | java | protected void flushQueuedMessages(IoSession session, AttachedSessionManager attachedSessionManager) {
Queue<Object> messageQueue = getMessageQueue(session);
if (messageQueue != null) {
flushQueuedMessages(messageQueue, session, attachedSessionManager);
// Note: leave messageQueu... | [
"protected",
"void",
"flushQueuedMessages",
"(",
"IoSession",
"session",
",",
"AttachedSessionManager",
"attachedSessionManager",
")",
"{",
"Queue",
"<",
"Object",
">",
"messageQueue",
"=",
"getMessageQueue",
"(",
"session",
")",
";",
"if",
"(",
"messageQueue",
"!="... | called by connect listener in proxy service handler | [
"called",
"by",
"connect",
"listener",
"in",
"proxy",
"service",
"handler"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/proxy/src/main/java/org/kaazing/gateway/service/proxy/AbstractProxyHandler.java#L189-L196 |
105,561 | kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioChildDatagramChannel.java | NioChildDatagramChannel.joinGroup | public ChannelFuture joinGroup(
InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source) {
if (DetectionUtil.javaVersion() < 7) {
throw new UnsupportedOperationException();
}
if (multicastAddress == null) {
throw new NullPointerExc... | java | public ChannelFuture joinGroup(
InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source) {
if (DetectionUtil.javaVersion() < 7) {
throw new UnsupportedOperationException();
}
if (multicastAddress == null) {
throw new NullPointerExc... | [
"public",
"ChannelFuture",
"joinGroup",
"(",
"InetAddress",
"multicastAddress",
",",
"NetworkInterface",
"networkInterface",
",",
"InetAddress",
"source",
")",
"{",
"if",
"(",
"DetectionUtil",
".",
"javaVersion",
"(",
")",
"<",
"7",
")",
"{",
"throw",
"new",
"Un... | Joins the specified multicast group at the specified interface using the specified source. | [
"Joins",
"the",
"specified",
"multicast",
"group",
"at",
"the",
"specified",
"interface",
"using",
"the",
"specified",
"source",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioChildDatagramChannel.java#L152-L189 |
105,562 | kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioChildDatagramChannel.java | NioChildDatagramChannel.leaveGroup | public ChannelFuture leaveGroup(InetAddress multicastAddress,
NetworkInterface networkInterface, InetAddress source) {
if (DetectionUtil.javaVersion() < 7) {
throw new UnsupportedOperationException();
} else {
if (multicastAddress == null) {
... | java | public ChannelFuture leaveGroup(InetAddress multicastAddress,
NetworkInterface networkInterface, InetAddress source) {
if (DetectionUtil.javaVersion() < 7) {
throw new UnsupportedOperationException();
} else {
if (multicastAddress == null) {
... | [
"public",
"ChannelFuture",
"leaveGroup",
"(",
"InetAddress",
"multicastAddress",
",",
"NetworkInterface",
"networkInterface",
",",
"InetAddress",
"source",
")",
"{",
"if",
"(",
"DetectionUtil",
".",
"javaVersion",
"(",
")",
"<",
"7",
")",
"{",
"throw",
"new",
"U... | Leave the specified multicast group at the specified interface using the specified source. | [
"Leave",
"the",
"specified",
"multicast",
"group",
"at",
"the",
"specified",
"interface",
"using",
"the",
"specified",
"source",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioChildDatagramChannel.java#L208-L245 |
105,563 | kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioChildDatagramChannel.java | NioChildDatagramChannel.block | public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock) {
try {
block(multicastAddress, NetworkInterface.getByInetAddress(getLocalAddress().getAddress()), sourceToBlock);
} catch (SocketException e) {
return failedFuture(this, e);
}
ret... | java | public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock) {
try {
block(multicastAddress, NetworkInterface.getByInetAddress(getLocalAddress().getAddress()), sourceToBlock);
} catch (SocketException e) {
return failedFuture(this, e);
}
ret... | [
"public",
"ChannelFuture",
"block",
"(",
"InetAddress",
"multicastAddress",
",",
"InetAddress",
"sourceToBlock",
")",
"{",
"try",
"{",
"block",
"(",
"multicastAddress",
",",
"NetworkInterface",
".",
"getByInetAddress",
"(",
"getLocalAddress",
"(",
")",
".",
"getAddr... | Block the given sourceToBlock address for the given multicastAddress | [
"Block",
"the",
"given",
"sourceToBlock",
"address",
"for",
"the",
"given",
"multicastAddress"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioChildDatagramChannel.java#L288-L295 |
105,564 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/config/SecurityConfigurationBeanImpl.java | SecurityConfigurationBeanImpl.getAlternativeNames | private JSONArray getAlternativeNames(Collection<List<?>> alternativeNames) {
if (alternativeNames == null || alternativeNames.size() == 0) {
return null;
}
JSONArray altNames = new JSONArray();
for (List<?> altName : alternativeNames) {
//int altNameType = (Int... | java | private JSONArray getAlternativeNames(Collection<List<?>> alternativeNames) {
if (alternativeNames == null || alternativeNames.size() == 0) {
return null;
}
JSONArray altNames = new JSONArray();
for (List<?> altName : alternativeNames) {
//int altNameType = (Int... | [
"private",
"JSONArray",
"getAlternativeNames",
"(",
"Collection",
"<",
"List",
"<",
"?",
">",
">",
"alternativeNames",
")",
"{",
"if",
"(",
"alternativeNames",
"==",
"null",
"||",
"alternativeNames",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"n... | Given an AlternativeNames structure, return a JSONArray with the name strings.
@param alternativeNames
@return | [
"Given",
"an",
"AlternativeNames",
"structure",
"return",
"a",
"JSONArray",
"with",
"the",
"name",
"strings",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/config/SecurityConfigurationBeanImpl.java#L179-L194 |
105,565 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/AbstractWsBridgeSession.java | AbstractWsBridgeSession.startupSessionTimeoutCommand | public void startupSessionTimeoutCommand() {
if (initSessionTimeoutCommand.compareAndSet(false, true)) {
final Long sessionTimeout = getSessionTimeout();
if ( sessionTimeout != null && sessionTimeout > 0) {
if ( scheduledEventslogger.isTraceEnabled() ) {
... | java | public void startupSessionTimeoutCommand() {
if (initSessionTimeoutCommand.compareAndSet(false, true)) {
final Long sessionTimeout = getSessionTimeout();
if ( sessionTimeout != null && sessionTimeout > 0) {
if ( scheduledEventslogger.isTraceEnabled() ) {
... | [
"public",
"void",
"startupSessionTimeoutCommand",
"(",
")",
"{",
"if",
"(",
"initSessionTimeoutCommand",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"final",
"Long",
"sessionTimeout",
"=",
"getSessionTimeout",
"(",
")",
";",
"if",
"(",
"ses... | Start up timer for the session timeout of the WebSocket session | [
"Start",
"up",
"timer",
"for",
"the",
"session",
"timeout",
"of",
"the",
"WebSocket",
"session"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/AbstractWsBridgeSession.java#L143-L153 |
105,566 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/AbstractWsBridgeSession.java | AbstractWsBridgeSession.logout | public void logout() {
if (loginContext != null) {
try {
loginContext.logout();
if (logoutLogger.isDebugEnabled()) {
logoutLogger.debug("[ws/#" + getId() + "] Logout successful.");
}
} catch (LoginException e) {
... | java | public void logout() {
if (loginContext != null) {
try {
loginContext.logout();
if (logoutLogger.isDebugEnabled()) {
logoutLogger.debug("[ws/#" + getId() + "] Logout successful.");
}
} catch (LoginException e) {
... | [
"public",
"void",
"logout",
"(",
")",
"{",
"if",
"(",
"loginContext",
"!=",
"null",
")",
"{",
"try",
"{",
"loginContext",
".",
"logout",
"(",
")",
";",
"if",
"(",
"logoutLogger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logoutLogger",
".",
"debug",
... | Log out of the login context associated with this WebSocket session.
Used to clean up any login context state that should be cleaned up. | [
"Log",
"out",
"of",
"the",
"login",
"context",
"associated",
"with",
"this",
"WebSocket",
"session",
".",
"Used",
"to",
"clean",
"up",
"any",
"login",
"context",
"state",
"that",
"should",
"be",
"cleaned",
"up",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/AbstractWsBridgeSession.java#L188-L200 |
105,567 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java | NTLMUtilities.getOsVersion | public static byte[] getOsVersion() {
String os = System.getProperty("os.name");
if (os == null || !os.toUpperCase().contains("WINDOWS")) {
return DEFAULT_OS_VERSION;
}
byte[] osVer = new byte[8];
// Let's enclose the code by a try...catch in order ... | java | public static byte[] getOsVersion() {
String os = System.getProperty("os.name");
if (os == null || !os.toUpperCase().contains("WINDOWS")) {
return DEFAULT_OS_VERSION;
}
byte[] osVer = new byte[8];
// Let's enclose the code by a try...catch in order ... | [
"public",
"static",
"byte",
"[",
"]",
"getOsVersion",
"(",
")",
"{",
"String",
"os",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"if",
"(",
"os",
"==",
"null",
"||",
"!",
"os",
".",
"toUpperCase",
"(",
")",
".",
"contains",
"(",
... | Tries to return a valid OS version on Windows systems. If it fails to
do so or if we're running on another OS then a fake Windows XP OS
version is returned because the protocol uses it.
@return a NTLM OS version byte buffer | [
"Tries",
"to",
"return",
"a",
"valid",
"OS",
"version",
"on",
"Windows",
"systems",
".",
"If",
"it",
"fails",
"to",
"do",
"so",
"or",
"if",
"we",
"re",
"running",
"on",
"another",
"OS",
"then",
"a",
"fake",
"Windows",
"XP",
"OS",
"version",
"is",
"re... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java#L97-L163 |
105,568 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java | NTLMUtilities.writeSecurityBufferAndUpdatePointer | public static int writeSecurityBufferAndUpdatePointer(
ByteArrayOutputStream baos, short len, int pointer)
throws IOException {
baos.write(writeSecurityBuffer(len, pointer));
return pointer + len;
} | java | public static int writeSecurityBufferAndUpdatePointer(
ByteArrayOutputStream baos, short len, int pointer)
throws IOException {
baos.write(writeSecurityBuffer(len, pointer));
return pointer + len;
} | [
"public",
"static",
"int",
"writeSecurityBufferAndUpdatePointer",
"(",
"ByteArrayOutputStream",
"baos",
",",
"short",
"len",
",",
"int",
"pointer",
")",
"throws",
"IOException",
"{",
"baos",
".",
"write",
"(",
"writeSecurityBuffer",
"(",
"len",
",",
"pointer",
")"... | Writes a security buffer and returns the pointer of the position
where to write the next security buffer.
@param baos the stream where the security buffer is written
@param len the length of the security buffer
@param pointer the position where the security buffer can be written
@return the position where the next sec... | [
"Writes",
"a",
"security",
"buffer",
"and",
"returns",
"the",
"pointer",
"of",
"the",
"position",
"where",
"to",
"write",
"the",
"next",
"security",
"buffer",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java#L239-L244 |
105,569 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java | NTLMUtilities.extractFlagsFromType2Message | public static int extractFlagsFromType2Message(byte[] msg) {
byte[] flagsBytes = new byte[4];
System.arraycopy(msg, 20, flagsBytes, 0, 4);
ByteUtilities.changeWordEndianess(flagsBytes, 0, 4);
return ByteUtilities.makeIntFromByte4(flagsBytes);
} | java | public static int extractFlagsFromType2Message(byte[] msg) {
byte[] flagsBytes = new byte[4];
System.arraycopy(msg, 20, flagsBytes, 0, 4);
ByteUtilities.changeWordEndianess(flagsBytes, 0, 4);
return ByteUtilities.makeIntFromByte4(flagsBytes);
} | [
"public",
"static",
"int",
"extractFlagsFromType2Message",
"(",
"byte",
"[",
"]",
"msg",
")",
"{",
"byte",
"[",
"]",
"flagsBytes",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"System",
".",
"arraycopy",
"(",
"msg",
",",
"20",
",",
"flagsBytes",
",",
"0",
... | Extracts the NTLM flags from the type 2 message.
@param msg the type 2 message byte array
@return the proxy flags as an int | [
"Extracts",
"the",
"NTLM",
"flags",
"from",
"the",
"type",
"2",
"message",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java#L264-L271 |
105,570 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java | NTLMUtilities.extractTargetNameFromType2Message | public static String extractTargetNameFromType2Message(byte[] msg,
Integer msgFlags) throws UnsupportedEncodingException {
// Read the security buffer to determine where the target name
// is stored and what it's length is
byte[] targetName = readSecurityBufferTarget(msg, 12);
... | java | public static String extractTargetNameFromType2Message(byte[] msg,
Integer msgFlags) throws UnsupportedEncodingException {
// Read the security buffer to determine where the target name
// is stored and what it's length is
byte[] targetName = readSecurityBufferTarget(msg, 12);
... | [
"public",
"static",
"String",
"extractTargetNameFromType2Message",
"(",
"byte",
"[",
"]",
"msg",
",",
"Integer",
"msgFlags",
")",
"throws",
"UnsupportedEncodingException",
"{",
"// Read the security buffer to determine where the target name",
"// is stored and what it's length is",... | Extracts the target name from the type 2 message.
@param msg the type 2 message byte array
@param msgFlags the flags if null then flags are extracted from the
type 2 message
@return the target name
@throws UnsupportedEncodingException if unable to use the
needed UTF-16LE or ASCII charsets | [
"Extracts",
"the",
"target",
"name",
"from",
"the",
"type",
"2",
"message",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java#L306-L320 |
105,571 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java | NTLMUtilities.extractTargetInfoFromType2Message | public static byte[] extractTargetInfoFromType2Message(byte[] msg,
Integer msgFlags) {
int flags = msgFlags == null ? extractFlagsFromType2Message(msg)
: msgFlags;
if (!ByteUtilities.isFlagSet(flags, FLAG_NEGOTIATE_TARGET_INFO))
return null;
int pos = 40... | java | public static byte[] extractTargetInfoFromType2Message(byte[] msg,
Integer msgFlags) {
int flags = msgFlags == null ? extractFlagsFromType2Message(msg)
: msgFlags;
if (!ByteUtilities.isFlagSet(flags, FLAG_NEGOTIATE_TARGET_INFO))
return null;
int pos = 40... | [
"public",
"static",
"byte",
"[",
"]",
"extractTargetInfoFromType2Message",
"(",
"byte",
"[",
"]",
"msg",
",",
"Integer",
"msgFlags",
")",
"{",
"int",
"flags",
"=",
"msgFlags",
"==",
"null",
"?",
"extractFlagsFromType2Message",
"(",
"msg",
")",
":",
"msgFlags",... | Extracts the target information block from the type 2 message.
@param msg the type 2 message byte array
@param msgFlags the flags if null then flags are extracted from the
type 2 message
@return the target info | [
"Extracts",
"the",
"target",
"information",
"block",
"from",
"the",
"type",
"2",
"message",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMUtilities.java#L330-L341 |
105,572 | kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioDatagramPipelineSink.java | NioDatagramPipelineSink.bind | private static void bind(final NioDatagramChannel channel,
final ChannelFuture future, final InetSocketAddress address) {
boolean bound = false;
boolean started = false;
try {
// First bind the DatagramSocket the specified port.
channel.getDat... | java | private static void bind(final NioDatagramChannel channel,
final ChannelFuture future, final InetSocketAddress address) {
boolean bound = false;
boolean started = false;
try {
// First bind the DatagramSocket the specified port.
channel.getDat... | [
"private",
"static",
"void",
"bind",
"(",
"final",
"NioDatagramChannel",
"channel",
",",
"final",
"ChannelFuture",
"future",
",",
"final",
"InetSocketAddress",
"address",
")",
"{",
"boolean",
"bound",
"=",
"false",
";",
"boolean",
"started",
"=",
"false",
";",
... | Will bind the DatagramSocket to the passed-in address.
Every call bind will spawn a new thread using the that basically in turn | [
"Will",
"bind",
"the",
"DatagramSocket",
"to",
"the",
"passed",
"-",
"in",
"address",
".",
"Every",
"call",
"bind",
"will",
"spawn",
"a",
"new",
"thread",
"using",
"the",
"that",
"basically",
"in",
"turn"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioDatagramPipelineSink.java#L120-L142 |
105,573 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameEncodingSupport.java | WsFrameEncodingSupport.doEncode | public static IoBufferEx doEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) {
IoBufferEx ioBuf = getBytes(allocator, flags, message);
ByteBuffer buf = ioBuf.buf();
boolean mask = false; // FIXME enable masking for WsnConnector
boolean fin = message.isFin();
int maskVa... | java | public static IoBufferEx doEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) {
IoBufferEx ioBuf = getBytes(allocator, flags, message);
ByteBuffer buf = ioBuf.buf();
boolean mask = false; // FIXME enable masking for WsnConnector
boolean fin = message.isFin();
int maskVa... | [
"public",
"static",
"IoBufferEx",
"doEncode",
"(",
"IoBufferAllocatorEx",
"<",
"?",
">",
"allocator",
",",
"int",
"flags",
",",
"WsMessage",
"message",
")",
"{",
"IoBufferEx",
"ioBuf",
"=",
"getBytes",
"(",
"allocator",
",",
"flags",
",",
"message",
")",
";"... | Encode WebSocket message as a single frame | [
"Encode",
"WebSocket",
"message",
"as",
"a",
"single",
"frame"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameEncodingSupport.java#L85-L161 |
105,574 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.buildPatternsList | private List<PatternCacheControl> buildPatternsList(ServiceProperties properties) {
Map<String, PatternCacheControl> patterns = new LinkedHashMap<>();
List<ServiceProperties> locationsList = properties.getNested("location");
if (locationsList != null && locationsList.size() != 0) {
f... | java | private List<PatternCacheControl> buildPatternsList(ServiceProperties properties) {
Map<String, PatternCacheControl> patterns = new LinkedHashMap<>();
List<ServiceProperties> locationsList = properties.getNested("location");
if (locationsList != null && locationsList.size() != 0) {
f... | [
"private",
"List",
"<",
"PatternCacheControl",
">",
"buildPatternsList",
"(",
"ServiceProperties",
"properties",
")",
"{",
"Map",
"<",
"String",
",",
"PatternCacheControl",
">",
"patterns",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"List",
"<",
"ServiceP... | Creates the list of PatternCacheControl objects
@param properties - list of ServiceProperties from the configuration file
@return a list of PatternCacheControl objects | [
"Creates",
"the",
"list",
"of",
"PatternCacheControl",
"objects"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L134-L149 |
105,575 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.resolvePatternSpecificity | private void resolvePatternSpecificity(Map<String, PatternCacheControl> patterns) {
List<String> patternList = new ArrayList<>();
patternList.addAll(patterns.keySet());
int patternCount = patternList.size();
for (int i = 0; i < patternCount - 1; i++) {
String specificPatter... | java | private void resolvePatternSpecificity(Map<String, PatternCacheControl> patterns) {
List<String> patternList = new ArrayList<>();
patternList.addAll(patterns.keySet());
int patternCount = patternList.size();
for (int i = 0; i < patternCount - 1; i++) {
String specificPatter... | [
"private",
"void",
"resolvePatternSpecificity",
"(",
"Map",
"<",
"String",
",",
"PatternCacheControl",
">",
"patterns",
")",
"{",
"List",
"<",
"String",
">",
"patternList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"patternList",
".",
"addAll",
"(",
"pat... | Matches the patterns from the map and determines each pattern's specificity
@param patterns - the map with the patterns to be matched | [
"Matches",
"the",
"patterns",
"from",
"the",
"map",
"and",
"determines",
"each",
"pattern",
"s",
"specificity"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L155-L169 |
105,576 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.checkPatternMatching | private void checkPatternMatching(Map<String, PatternCacheControl> patterns, String specificPattern, String generalPattern) {
if (PatternMatcherUtils.caseInsensitiveMatch(specificPattern, generalPattern)) {
PatternCacheControl specificPatternDirective = patterns.get(specificPattern);
Pat... | java | private void checkPatternMatching(Map<String, PatternCacheControl> patterns, String specificPattern, String generalPattern) {
if (PatternMatcherUtils.caseInsensitiveMatch(specificPattern, generalPattern)) {
PatternCacheControl specificPatternDirective = patterns.get(specificPattern);
Pat... | [
"private",
"void",
"checkPatternMatching",
"(",
"Map",
"<",
"String",
",",
"PatternCacheControl",
">",
"patterns",
",",
"String",
"specificPattern",
",",
"String",
"generalPattern",
")",
"{",
"if",
"(",
"PatternMatcherUtils",
".",
"caseInsensitiveMatch",
"(",
"speci... | Checks if the first pattern can be included in the second one and resolves directive conflicts if needed
@param patterns
@param specificPattern
@param generalPattern | [
"Checks",
"if",
"the",
"first",
"pattern",
"can",
"be",
"included",
"in",
"the",
"second",
"one",
"and",
"resolves",
"directive",
"conflicts",
"if",
"needed"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L177-L184 |
105,577 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.sortByMatchingPatternCount | private List<PatternCacheControl> sortByMatchingPatternCount(Map<String, PatternCacheControl> unsortedMap) {
List<PatternCacheControl> list = new ArrayList<>(unsortedMap.values());
Collections.sort(list, PATTERN_CACHE_CONTROL_COMPARATOR);
return list;
} | java | private List<PatternCacheControl> sortByMatchingPatternCount(Map<String, PatternCacheControl> unsortedMap) {
List<PatternCacheControl> list = new ArrayList<>(unsortedMap.values());
Collections.sort(list, PATTERN_CACHE_CONTROL_COMPARATOR);
return list;
} | [
"private",
"List",
"<",
"PatternCacheControl",
">",
"sortByMatchingPatternCount",
"(",
"Map",
"<",
"String",
",",
"PatternCacheControl",
">",
"unsortedMap",
")",
"{",
"List",
"<",
"PatternCacheControl",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"unsortedMap... | Sorts the patterns map by the number of matching patterns and returns a list of sorted PatternCacheControl elements.
The sorted list is used at request, so that a file's URL can be matched to the most specific pattern.
@param unsortedMap
@return a list of sorted PatternCacheControl elements | [
"Sorts",
"the",
"patterns",
"map",
"by",
"the",
"number",
"of",
"matching",
"patterns",
"and",
"returns",
"a",
"list",
"of",
"sorted",
"PatternCacheControl",
"elements",
".",
"The",
"sorted",
"list",
"is",
"used",
"at",
"request",
"so",
"that",
"a",
"file",
... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L192-L196 |
105,578 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.toFile | private File toFile(File rootDir, String location) {
File locationFile = rootDir;
if (location != null) {
URI locationURI = URI.create(location);
locationFile = new File(locationURI.getPath());
if (locationURI.getScheme() == null) {
locationFile = new ... | java | private File toFile(File rootDir, String location) {
File locationFile = rootDir;
if (location != null) {
URI locationURI = URI.create(location);
locationFile = new File(locationURI.getPath());
if (locationURI.getScheme() == null) {
locationFile = new ... | [
"private",
"File",
"toFile",
"(",
"File",
"rootDir",
",",
"String",
"location",
")",
"{",
"File",
"locationFile",
"=",
"rootDir",
";",
"if",
"(",
"location",
"!=",
"null",
")",
"{",
"URI",
"locationURI",
"=",
"URI",
".",
"create",
"(",
"location",
")",
... | Converts a location in the gateway configuration file into a file relative to a specified root directory.
@param rootDir
the root directory
@param location
the location (either a file:// URI or a location relative the root directory
@return the file corresponding to the location | [
"Converts",
"a",
"location",
"in",
"the",
"gateway",
"configuration",
"file",
"into",
"a",
"file",
"relative",
"to",
"a",
"specified",
"root",
"directory",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L207-L219 |
105,579 | kaazing/gateway | security/src/main/java/org/kaazing/gateway/security/auth/context/DefaultLoginContextFactory.java | DefaultLoginContextFactory.createLoginContext | @Override
public LoginContext createLoginContext(Subject subject, final String username, final char[] password) throws LoginException {
final DefaultLoginResult loginResult = new DefaultLoginResult();
CallbackHandler handler = new CallbackHandler() {
@Override
public void ha... | java | @Override
public LoginContext createLoginContext(Subject subject, final String username, final char[] password) throws LoginException {
final DefaultLoginResult loginResult = new DefaultLoginResult();
CallbackHandler handler = new CallbackHandler() {
@Override
public void ha... | [
"@",
"Override",
"public",
"LoginContext",
"createLoginContext",
"(",
"Subject",
"subject",
",",
"final",
"String",
"username",
",",
"final",
"char",
"[",
"]",
"password",
")",
"throws",
"LoginException",
"{",
"final",
"DefaultLoginResult",
"loginResult",
"=",
"ne... | For login context providers that can abstract their tokens into a username and password,
this is a utility method that can create the login context based on the provided username and password.
@param subject the subject that has been created for the user, or <code>null</code> if none has been created.
@param username... | [
"For",
"login",
"context",
"providers",
"that",
"can",
"abstract",
"their",
"tokens",
"into",
"a",
"username",
"and",
"password",
"this",
"is",
"a",
"utility",
"method",
"that",
"can",
"create",
"the",
"login",
"context",
"based",
"on",
"the",
"provided",
"u... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/security/src/main/java/org/kaazing/gateway/security/auth/context/DefaultLoginContextFactory.java#L155-L179 |
105,580 | kaazing/gateway | security/src/main/java/org/kaazing/gateway/security/auth/context/DefaultLoginContextFactory.java | DefaultLoginContextFactory.createLoginContext | protected LoginContext createLoginContext(Subject subject, CallbackHandler handler, DefaultLoginResult loginResult)
throws LoginException {
return new ResultAwareLoginContext(name, subject, handler, configuration, loginResult);
} | java | protected LoginContext createLoginContext(Subject subject, CallbackHandler handler, DefaultLoginResult loginResult)
throws LoginException {
return new ResultAwareLoginContext(name, subject, handler, configuration, loginResult);
} | [
"protected",
"LoginContext",
"createLoginContext",
"(",
"Subject",
"subject",
",",
"CallbackHandler",
"handler",
",",
"DefaultLoginResult",
"loginResult",
")",
"throws",
"LoginException",
"{",
"return",
"new",
"ResultAwareLoginContext",
"(",
"name",
",",
"subject",
",",... | For login context providers that can abstract their tokens into a subject and a CallbackHandler
that understands their token, this is a utility method that can be called to construct a create login.
@param subject the subject that has been created for the user, or <code>null</code> if none has been created.
@param ha... | [
"For",
"login",
"context",
"providers",
"that",
"can",
"abstract",
"their",
"tokens",
"into",
"a",
"subject",
"and",
"a",
"CallbackHandler",
"that",
"understands",
"their",
"token",
"this",
"is",
"a",
"utility",
"method",
"that",
"can",
"be",
"called",
"to",
... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/security/src/main/java/org/kaazing/gateway/security/auth/context/DefaultLoginContextFactory.java#L192-L195 |
105,581 | kaazing/gateway | security/src/main/java/org/kaazing/gateway/security/auth/context/DefaultLoginContextFactory.java | DefaultLoginContextFactory.createLoginContext | protected LoginContext createLoginContext(CallbackHandler handler, final DefaultLoginResult loginResult)
throws LoginException {
return createLoginContext(null, handler, loginResult);
} | java | protected LoginContext createLoginContext(CallbackHandler handler, final DefaultLoginResult loginResult)
throws LoginException {
return createLoginContext(null, handler, loginResult);
} | [
"protected",
"LoginContext",
"createLoginContext",
"(",
"CallbackHandler",
"handler",
",",
"final",
"DefaultLoginResult",
"loginResult",
")",
"throws",
"LoginException",
"{",
"return",
"createLoginContext",
"(",
"null",
",",
"handler",
",",
"loginResult",
")",
";",
"}... | For login context providers that can abstract their tokens into a CallbackHandler
that understands their token, this is a utility method that can be called to construct a create login.
@param handler the callback handler that can understand
@return a login context
@throws LoginException when a login context cannot be ... | [
"For",
"login",
"context",
"providers",
"that",
"can",
"abstract",
"their",
"tokens",
"into",
"a",
"CallbackHandler",
"that",
"understands",
"their",
"token",
"this",
"is",
"a",
"utility",
"method",
"that",
"can",
"be",
"called",
"to",
"construct",
"a",
"creat... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/security/src/main/java/org/kaazing/gateway/security/auth/context/DefaultLoginContextFactory.java#L205-L208 |
105,582 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/context/resolve/DefaultClusterContext.java | DefaultClusterContext.fireMemberAdded | private void fireMemberAdded(MemberId newMember) {
GL.debug(GL.CLUSTER_LOGGER_NAME, "Firing member added for : {}", newMember);
for (MembershipEventListener listener : membershipEventListeners) {
try {
listener.memberAdded(newMember);
} catch (Throwable e) {
... | java | private void fireMemberAdded(MemberId newMember) {
GL.debug(GL.CLUSTER_LOGGER_NAME, "Firing member added for : {}", newMember);
for (MembershipEventListener listener : membershipEventListeners) {
try {
listener.memberAdded(newMember);
} catch (Throwable e) {
... | [
"private",
"void",
"fireMemberAdded",
"(",
"MemberId",
"newMember",
")",
"{",
"GL",
".",
"debug",
"(",
"GL",
".",
"CLUSTER_LOGGER_NAME",
",",
"\"Firing member added for : {}\"",
",",
"newMember",
")",
";",
"for",
"(",
"MembershipEventListener",
"listener",
":",
"m... | Fire member added event | [
"Fire",
"member",
"added",
"event"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/context/resolve/DefaultClusterContext.java#L664-L673 |
105,583 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/context/resolve/DefaultClusterContext.java | DefaultClusterContext.fireMemberRemoved | private void fireMemberRemoved(MemberId exMember) {
GL.debug(GL.CLUSTER_LOGGER_NAME, "Firing member removed for: {}", exMember);
for (MembershipEventListener listener : membershipEventListeners) {
try {
listener.memberRemoved(exMember);
} catch (Throwable e) {
... | java | private void fireMemberRemoved(MemberId exMember) {
GL.debug(GL.CLUSTER_LOGGER_NAME, "Firing member removed for: {}", exMember);
for (MembershipEventListener listener : membershipEventListeners) {
try {
listener.memberRemoved(exMember);
} catch (Throwable e) {
... | [
"private",
"void",
"fireMemberRemoved",
"(",
"MemberId",
"exMember",
")",
"{",
"GL",
".",
"debug",
"(",
"GL",
".",
"CLUSTER_LOGGER_NAME",
",",
"\"Firing member removed for: {}\"",
",",
"exMember",
")",
";",
"for",
"(",
"MembershipEventListener",
"listener",
":",
"... | Fire member removed event | [
"Fire",
"member",
"removed",
"event"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/context/resolve/DefaultClusterContext.java#L678-L687 |
105,584 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/buffer/ByteBufferWrappingChannelBuffer.java | ByteBufferWrappingChannelBuffer.wrap | public ChannelBuffer wrap(ByteBuffer buffer) {
if (buffer == null) {
throw new NullPointerException("buffer");
}
int position = buffer.position();
int limit = buffer.limit();
this.order = buffer.order();
this.buffer = buffer;
this.capacity = buffer.c... | java | public ChannelBuffer wrap(ByteBuffer buffer) {
if (buffer == null) {
throw new NullPointerException("buffer");
}
int position = buffer.position();
int limit = buffer.limit();
this.order = buffer.order();
this.buffer = buffer;
this.capacity = buffer.c... | [
"public",
"ChannelBuffer",
"wrap",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"buffer\"",
")",
";",
"}",
"int",
"position",
"=",
"buffer",
".",
"position",
"(",
")",
... | Creates a new buffer which wraps the specified buffer's slice. | [
"Creates",
"a",
"new",
"buffer",
"which",
"wraps",
"the",
"specified",
"buffer",
"s",
"slice",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/buffer/ByteBufferWrappingChannelBuffer.java#L48-L61 |
105,585 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/firewall/Subnet.java | Subnet.toInt | private int toInt(InetAddress inetAddress) {
byte[] address = inetAddress.getAddress();
int result = 0;
for (int i = 0; i < address.length; i++) {
result <<= 8;
result |= address[i] & BYTE_MASK;
}
return result;
} | java | private int toInt(InetAddress inetAddress) {
byte[] address = inetAddress.getAddress();
int result = 0;
for (int i = 0; i < address.length; i++) {
result <<= 8;
result |= address[i] & BYTE_MASK;
}
return result;
} | [
"private",
"int",
"toInt",
"(",
"InetAddress",
"inetAddress",
")",
"{",
"byte",
"[",
"]",
"address",
"=",
"inetAddress",
".",
"getAddress",
"(",
")",
";",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"address",
"... | Converts an IP address into an integer | [
"Converts",
"an",
"IP",
"address",
"into",
"an",
"integer"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/firewall/Subnet.java#L67-L75 |
105,586 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java | ExecutorFilter.createDefaultExecutor | private Executor createDefaultExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime,
TimeUnit unit, ThreadFactory threadFactory, IoEventQueueHandler queueHandler) {
// Create a new Executor
Executor executor = new OrderedThreadPoolExecutor(corePoolSize, maximumPoolSize,
... | java | private Executor createDefaultExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime,
TimeUnit unit, ThreadFactory threadFactory, IoEventQueueHandler queueHandler) {
// Create a new Executor
Executor executor = new OrderedThreadPoolExecutor(corePoolSize, maximumPoolSize,
... | [
"private",
"Executor",
"createDefaultExecutor",
"(",
"int",
"corePoolSize",
",",
"int",
"maximumPoolSize",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"unit",
",",
"ThreadFactory",
"threadFactory",
",",
"IoEventQueueHandler",
"queueHandler",
")",
"{",
"// Create a ne... | Create an OrderedThreadPool executor.
@param corePoolSize The initial pool sizePoolSize
@param maximumPoolSize The maximum pool size
@param keepAliveTime Default duration for a thread
@param unit Time unit used for the keepAlive value
@param threadFactory The factory used to create threads
@param queueHandler The queu... | [
"Create",
"an",
"OrderedThreadPool",
"executor",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java#L512-L519 |
105,587 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java | ExecutorFilter.initEventTypes | private void initEventTypes(IoEventType... eventTypes) {
if ((eventTypes == null) || (eventTypes.length == 0)) {
eventTypes = DEFAULT_EVENT_SET;
}
// Copy the list of handled events in the event set
this.eventTypes = EnumSet.of(eventTypes[0], eventTypes);
//... | java | private void initEventTypes(IoEventType... eventTypes) {
if ((eventTypes == null) || (eventTypes.length == 0)) {
eventTypes = DEFAULT_EVENT_SET;
}
// Copy the list of handled events in the event set
this.eventTypes = EnumSet.of(eventTypes[0], eventTypes);
//... | [
"private",
"void",
"initEventTypes",
"(",
"IoEventType",
"...",
"eventTypes",
")",
"{",
"if",
"(",
"(",
"eventTypes",
"==",
"null",
")",
"||",
"(",
"eventTypes",
".",
"length",
"==",
"0",
")",
")",
"{",
"eventTypes",
"=",
"DEFAULT_EVENT_SET",
";",
"}",
"... | Create an EnumSet from an array of EventTypes, and set the associated
eventTypes field.
@param eventTypes The array of handled events | [
"Create",
"an",
"EnumSet",
"from",
"an",
"array",
"of",
"EventTypes",
"and",
"set",
"the",
"associated",
"eventTypes",
"field",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java#L527-L541 |
105,588 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java | ExecutorFilter.init | private void init(Executor executor, boolean manageableExecutor, IoEventType... eventTypes) {
if (executor == null) {
throw new NullPointerException("executor");
}
initEventTypes(eventTypes);
this.executor = executor;
this.manageableExecutor = manageableExecutor;
... | java | private void init(Executor executor, boolean manageableExecutor, IoEventType... eventTypes) {
if (executor == null) {
throw new NullPointerException("executor");
}
initEventTypes(eventTypes);
this.executor = executor;
this.manageableExecutor = manageableExecutor;
... | [
"private",
"void",
"init",
"(",
"Executor",
"executor",
",",
"boolean",
"manageableExecutor",
",",
"IoEventType",
"...",
"eventTypes",
")",
"{",
"if",
"(",
"executor",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"executor\"",
")",
";... | Creates a new instance of ExecutorFilter. This private constructor is called by all
the public constructor.
@param executor The underlying {@link Executor} in charge of managing the Thread pool.
@param manageableExecutor Tells if the Executor's Life Cycle can be managed or not
@param eventTypes The lit of event which ... | [
"Creates",
"a",
"new",
"instance",
"of",
"ExecutorFilter",
".",
"This",
"private",
"constructor",
"is",
"called",
"by",
"all",
"the",
"public",
"constructor",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java#L552-L560 |
105,589 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/CopyOnWriteMap.java | CopyOnWriteMap.putAll | public void putAll(Map<? extends K, ? extends V> newData) {
synchronized (this) {
Map<K, V> newMap = new HashMap<>(internalMap);
newMap.putAll(newData);
internalMap = newMap;
}
} | java | public void putAll(Map<? extends K, ? extends V> newData) {
synchronized (this) {
Map<K, V> newMap = new HashMap<>(internalMap);
newMap.putAll(newData);
internalMap = newMap;
}
} | [
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"newData",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"newMap",
"=",
"new",
"HashMap",
"<>",
"(",
"internalMap",
... | Inserts all the keys and values contained in the
provided map to this map.
@see java.util.Map#putAll(java.util.Map) | [
"Inserts",
"all",
"the",
"keys",
"and",
"values",
"contained",
"in",
"the",
"provided",
"map",
"to",
"this",
"map",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/CopyOnWriteMap.java#L103-L109 |
105,590 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/jmx/JmxSessionManagementListener.java | JmxSessionManagementListener.doSessionCreated | @Override
public void doSessionCreated(SessionManagementBean sessionBean) throws Exception {
SessionMXBean sessionMxBean = managementServiceHandler.getSessionMXBean(sessionBean.getId());
Map<String, String> userPrincipals = sessionBean.getUserPrincipalMap();
// Send a notification for the ... | java | @Override
public void doSessionCreated(SessionManagementBean sessionBean) throws Exception {
SessionMXBean sessionMxBean = managementServiceHandler.getSessionMXBean(sessionBean.getId());
Map<String, String> userPrincipals = sessionBean.getUserPrincipalMap();
// Send a notification for the ... | [
"@",
"Override",
"public",
"void",
"doSessionCreated",
"(",
"SessionManagementBean",
"sessionBean",
")",
"throws",
"Exception",
"{",
"SessionMXBean",
"sessionMxBean",
"=",
"managementServiceHandler",
".",
"getSessionMXBean",
"(",
"sessionBean",
".",
"getId",
"(",
")",
... | All of the following are expected to be OFF any session's IO thread. | [
"All",
"of",
"the",
"following",
"are",
"expected",
"to",
"be",
"OFF",
"any",
"session",
"s",
"IO",
"thread",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/jmx/JmxSessionManagementListener.java#L37-L56 |
105,591 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpSmartProxyHandler.java | HttpSmartProxyHandler.doHandshake | public void doHandshake(final NextFilter nextFilter)
throws ProxyAuthException {
logger.debug(" doHandshake()");
if (authHandler != null) {
authHandler.doHandshake(nextFilter);
} else {
if (requestSent) {
// Safety check
throw ... | java | public void doHandshake(final NextFilter nextFilter)
throws ProxyAuthException {
logger.debug(" doHandshake()");
if (authHandler != null) {
authHandler.doHandshake(nextFilter);
} else {
if (requestSent) {
// Safety check
throw ... | [
"public",
"void",
"doHandshake",
"(",
"final",
"NextFilter",
"nextFilter",
")",
"throws",
"ProxyAuthException",
"{",
"logger",
".",
"debug",
"(",
"\" doHandshake()\"",
")",
";",
"if",
"(",
"authHandler",
"!=",
"null",
")",
"{",
"authHandler",
".",
"doHandshake",... | Performs the handshake processing.
@param nextFilter the next filter | [
"Performs",
"the",
"handshake",
"processing",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpSmartProxyHandler.java#L59-L87 |
105,592 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpSmartProxyHandler.java | HttpSmartProxyHandler.handleResponse | @Override
public void handleResponse(final HttpProxyResponse response)
throws ProxyAuthException {
if (!isHandshakeComplete()
&& ("close".equalsIgnoreCase(StringUtilities
.getSingleValuedHeader(response.getHeaders(),
"Proxy-... | java | @Override
public void handleResponse(final HttpProxyResponse response)
throws ProxyAuthException {
if (!isHandshakeComplete()
&& ("close".equalsIgnoreCase(StringUtilities
.getSingleValuedHeader(response.getHeaders(),
"Proxy-... | [
"@",
"Override",
"public",
"void",
"handleResponse",
"(",
"final",
"HttpProxyResponse",
"response",
")",
"throws",
"ProxyAuthException",
"{",
"if",
"(",
"!",
"isHandshakeComplete",
"(",
")",
"&&",
"(",
"\"close\"",
".",
"equalsIgnoreCase",
"(",
"StringUtilities",
... | Handle a HTTP response from the proxy server.
@param response The proxy response. | [
"Handle",
"a",
"HTTP",
"response",
"from",
"the",
"proxy",
"server",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpSmartProxyHandler.java#L193-L215 |
105,593 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/util/WsUtils.java | WsUtils.acceptHash | public static String acceptHash(String key) {
try {
MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
sha1.update(key.getBytes(UTF_8));
sha1.update(WEBSOCKET_GUID);
byte[] hash = sha1.digest();
byte[] output = Base64.encodeBase64(hash);
... | java | public static String acceptHash(String key) {
try {
MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
sha1.update(key.getBytes(UTF_8));
sha1.update(WEBSOCKET_GUID);
byte[] hash = sha1.digest();
byte[] output = Base64.encodeBase64(hash);
... | [
"public",
"static",
"String",
"acceptHash",
"(",
"String",
"key",
")",
"{",
"try",
"{",
"MessageDigest",
"sha1",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"SHA-1\"",
")",
";",
"sha1",
".",
"update",
"(",
"key",
".",
"getBytes",
"(",
"UTF_8",
")",
... | Compute the Sec-WebSocket-Accept header value as per RFC 6455
@param key Sec-WebSocket-Key header value
@return the expected value for Sec-WebSocket-Accept header value | [
"Compute",
"the",
"Sec",
"-",
"WebSocket",
"-",
"Accept",
"header",
"value",
"as",
"per",
"RFC",
"6455"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/util/WsUtils.java#L185-L198 |
105,594 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/firewall/ConnectionThrottleFilter.java | ConnectionThrottleFilter.isConnectionOk | protected boolean isConnectionOk(IoSession session) {
SocketAddress remoteAddress = session.getRemoteAddress();
if (remoteAddress instanceof InetSocketAddress) {
InetSocketAddress addr = (InetSocketAddress) remoteAddress;
long now = System.currentTimeMillis();
if (cl... | java | protected boolean isConnectionOk(IoSession session) {
SocketAddress remoteAddress = session.getRemoteAddress();
if (remoteAddress instanceof InetSocketAddress) {
InetSocketAddress addr = (InetSocketAddress) remoteAddress;
long now = System.currentTimeMillis();
if (cl... | [
"protected",
"boolean",
"isConnectionOk",
"(",
"IoSession",
"session",
")",
"{",
"SocketAddress",
"remoteAddress",
"=",
"session",
".",
"getRemoteAddress",
"(",
")",
";",
"if",
"(",
"remoteAddress",
"instanceof",
"InetSocketAddress",
")",
"{",
"InetSocketAddress",
"... | Method responsible for deciding if a connection is OK
to continue
@param session
The new session that will be verified
@return
True if the session meets the criteria, otherwise false | [
"Method",
"responsible",
"for",
"deciding",
"if",
"a",
"connection",
"is",
"OK",
"to",
"continue"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/firewall/ConnectionThrottleFilter.java#L85-L114 |
105,595 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/AvailablePortFinder.java | AvailablePortFinder.getNextAvailable | public static int getNextAvailable(int fromPort) {
if (fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER) {
throw new IllegalArgumentException("Invalid start port: "
+ fromPort);
}
for (int i = fromPort; i <= MAX_PORT_NUMBER; i++) {
if (availab... | java | public static int getNextAvailable(int fromPort) {
if (fromPort < MIN_PORT_NUMBER || fromPort > MAX_PORT_NUMBER) {
throw new IllegalArgumentException("Invalid start port: "
+ fromPort);
}
for (int i = fromPort; i <= MAX_PORT_NUMBER; i++) {
if (availab... | [
"public",
"static",
"int",
"getNextAvailable",
"(",
"int",
"fromPort",
")",
"{",
"if",
"(",
"fromPort",
"<",
"MIN_PORT_NUMBER",
"||",
"fromPort",
">",
"MAX_PORT_NUMBER",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid start port: \"",
"+",
"f... | Gets the next available port starting at a port.
@param fromPort the port to scan for availability
@throws NoSuchElementException if there are no ports available | [
"Gets",
"the",
"next",
"available",
"port",
"starting",
"at",
"a",
"port",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/AvailablePortFinder.java#L75-L89 |
105,596 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/AvailablePortFinder.java | AvailablePortFinder.available | public static boolean available(int port) {
if (port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER) {
throw new IllegalArgumentException("Invalid start port: " + port);
}
ServerSocket ss = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port);
... | java | public static boolean available(int port) {
if (port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER) {
throw new IllegalArgumentException("Invalid start port: " + port);
}
ServerSocket ss = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port);
... | [
"public",
"static",
"boolean",
"available",
"(",
"int",
"port",
")",
"{",
"if",
"(",
"port",
"<",
"MIN_PORT_NUMBER",
"||",
"port",
">",
"MAX_PORT_NUMBER",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid start port: \"",
"+",
"port",
")",
... | Checks to see if a specific port is available.
@param port the port to check for availability | [
"Checks",
"to",
"see",
"if",
"a",
"specific",
"port",
"is",
"available",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/AvailablePortFinder.java#L96-L126 |
105,597 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.getHost | public static String getHost(String uriString) {
try {
URI uri = new URI(uriString);
if(uri.getHost()==null) {
throw new IllegalArgumentException("Invalid URI syntax. Scheme and host must be provided (port number is optional): " + uriString);
}
if ... | java | public static String getHost(String uriString) {
try {
URI uri = new URI(uriString);
if(uri.getHost()==null) {
throw new IllegalArgumentException("Invalid URI syntax. Scheme and host must be provided (port number is optional): " + uriString);
}
if ... | [
"public",
"static",
"String",
"getHost",
"(",
"String",
"uriString",
")",
"{",
"try",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"(",
"uriString",
")",
";",
"if",
"(",
"uri",
".",
"getHost",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgume... | Helper method for retrieving host
@param uriString
@return | [
"Helper",
"method",
"for",
"retrieving",
"host"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L57-L76 |
105,598 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.getScheme | public static String getScheme(String uriString) {
try {
return (new URI(uriString)).getScheme();
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uriString)).getScheme();
}
catch (IllegalArgumentException ne) ... | java | public static String getScheme(String uriString) {
try {
return (new URI(uriString)).getScheme();
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uriString)).getScheme();
}
catch (IllegalArgumentException ne) ... | [
"public",
"static",
"String",
"getScheme",
"(",
"String",
"uriString",
")",
"{",
"try",
"{",
"return",
"(",
"new",
"URI",
"(",
"uriString",
")",
")",
".",
"getScheme",
"(",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"try",
"{",
... | Helper method for retrieving scheme
@param uriString
@return | [
"Helper",
"method",
"for",
"retrieving",
"scheme"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L84-L96 |
105,599 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.getPort | public static int getPort(String uriString) {
try {
return (new URI(uriString)).getPort();
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uriString)).getPort();
}
catch (IllegalArgumentException ne) {
... | java | public static int getPort(String uriString) {
try {
return (new URI(uriString)).getPort();
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uriString)).getPort();
}
catch (IllegalArgumentException ne) {
... | [
"public",
"static",
"int",
"getPort",
"(",
"String",
"uriString",
")",
"{",
"try",
"{",
"return",
"(",
"new",
"URI",
"(",
"uriString",
")",
")",
".",
"getPort",
"(",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"try",
"{",
"retur... | Helper method for retrieving port
@param uriString
@return | [
"Helper",
"method",
"for",
"retrieving",
"port"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L179-L191 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.