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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.resolve | public static String resolve(String uriInitial, String uriString) {
try {
return uriToString((new URI(uriInitial)).resolve(uriString));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uriInitial)).resolve(uriString);
}
... | java | public static String resolve(String uriInitial, String uriString) {
try {
return uriToString((new URI(uriInitial)).resolve(uriString));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uriInitial)).resolve(uriString);
}
... | [
"public",
"static",
"String",
"resolve",
"(",
"String",
"uriInitial",
",",
"String",
"uriString",
")",
"{",
"try",
"{",
"return",
"uriToString",
"(",
"(",
"new",
"URI",
"(",
"uriInitial",
")",
")",
".",
"resolve",
"(",
"uriString",
")",
")",
";",
"}",
... | Helper method for performing resolve as String
@param uriInitial
@param uriString
@return | [
"Helper",
"method",
"for",
"performing",
"resolve",
"as",
"String"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L262-L274 | train |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.modifyURIScheme | public static String modifyURIScheme(String uri, String newScheme) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIScheme(uriObj, newScheme));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).... | java | public static String modifyURIScheme(String uri, String newScheme) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIScheme(uriObj, newScheme));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).... | [
"public",
"static",
"String",
"modifyURIScheme",
"(",
"String",
"uri",
",",
"String",
"newScheme",
")",
"{",
"try",
"{",
"URI",
"uriObj",
"=",
"new",
"URI",
"(",
"uri",
")",
";",
"return",
"uriToString",
"(",
"URLUtils",
".",
"modifyURIScheme",
"(",
"uriOb... | Helper method for modifying URI scheme
@param uri
@param newScheme
@return | [
"Helper",
"method",
"for",
"modifying",
"URI",
"scheme"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L282-L295 | train |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.modifyURIAuthority | public static String modifyURIAuthority(String uri, String newAuthority) {
try {
URI uriObj = new URI(uri);
// code below modifies new authority considering also network interface syntax
Pattern pattern = Pattern.compile(NETWORK_INTERFACE_AUTHORITY);
Matcher match... | java | public static String modifyURIAuthority(String uri, String newAuthority) {
try {
URI uriObj = new URI(uri);
// code below modifies new authority considering also network interface syntax
Pattern pattern = Pattern.compile(NETWORK_INTERFACE_AUTHORITY);
Matcher match... | [
"public",
"static",
"String",
"modifyURIAuthority",
"(",
"String",
"uri",
",",
"String",
"newAuthority",
")",
"{",
"try",
"{",
"URI",
"uriObj",
"=",
"new",
"URI",
"(",
"uri",
")",
";",
"// code below modifies new authority considering also network interface syntax",
"... | Helper method for modifying URI authority
@param uri
@param newAuthority
@return | [
"Helper",
"method",
"for",
"modifying",
"URI",
"authority"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L303-L327 | train |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.modifyURIPort | public static String modifyURIPort(String uri, int newPort) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIPort(uriObj, newPort));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).modifyURIPo... | java | public static String modifyURIPort(String uri, int newPort) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIPort(uriObj, newPort));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).modifyURIPo... | [
"public",
"static",
"String",
"modifyURIPort",
"(",
"String",
"uri",
",",
"int",
"newPort",
")",
"{",
"try",
"{",
"URI",
"uriObj",
"=",
"new",
"URI",
"(",
"uri",
")",
";",
"return",
"uriToString",
"(",
"URLUtils",
".",
"modifyURIPort",
"(",
"uriObj",
","... | Helper method for modifying URI port
@param uri
@param newPort
@return | [
"Helper",
"method",
"for",
"modifying",
"URI",
"port"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L335-L348 | train |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.modifyURIPath | public static String modifyURIPath(String uri, String newPath) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIPath(uriObj, newPath));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).modifyUR... | java | public static String modifyURIPath(String uri, String newPath) {
try {
URI uriObj = new URI(uri);
return uriToString(URLUtils.modifyURIPath(uriObj, newPath));
}
catch (URISyntaxException e) {
try {
return (new NetworkInterfaceURI(uri)).modifyUR... | [
"public",
"static",
"String",
"modifyURIPath",
"(",
"String",
"uri",
",",
"String",
"newPath",
")",
"{",
"try",
"{",
"URI",
"uriObj",
"=",
"new",
"URI",
"(",
"uri",
")",
";",
"return",
"uriToString",
"(",
"URLUtils",
".",
"modifyURIPath",
"(",
"uriObj",
... | Helper method for modiffying the URI path
@param uri
@param newPath
@return | [
"Helper",
"method",
"for",
"modiffying",
"the",
"URI",
"path"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L356-L369 | train |
kaazing/gateway | transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/cert/VirtualHostKeySelector.java | VirtualHostKeySelector.getCertCN | private String getCertCN(X509Certificate x509)
throws CertificateParsingException {
X500Principal principal = x509.getSubjectX500Principal();
String subjectName = principal.getName();
String[] fields = subjectName.split(",");
for (String field : fields) {
if (field.... | java | private String getCertCN(X509Certificate x509)
throws CertificateParsingException {
X500Principal principal = x509.getSubjectX500Principal();
String subjectName = principal.getName();
String[] fields = subjectName.split(",");
for (String field : fields) {
if (field.... | [
"private",
"String",
"getCertCN",
"(",
"X509Certificate",
"x509",
")",
"throws",
"CertificateParsingException",
"{",
"X500Principal",
"principal",
"=",
"x509",
".",
"getSubjectX500Principal",
"(",
")",
";",
"String",
"subjectName",
"=",
"principal",
".",
"getName",
... | Read the CN out of the cert | [
"Read",
"the",
"CN",
"out",
"of",
"the",
"cert"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/cert/VirtualHostKeySelector.java#L99-L114 | train |
kaazing/gateway | transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/cert/VirtualHostKeySelector.java | VirtualHostKeySelector.getCertServerNames | private Collection<String> getCertServerNames(X509Certificate x509)
throws CertificateParsingException {
Collection<String> serverNames = new LinkedHashSet<>();
/* Add CN for the certificate */
String certCN = getCertCN(x509);
serverNames.add(certCN);
/* Add alternativ... | java | private Collection<String> getCertServerNames(X509Certificate x509)
throws CertificateParsingException {
Collection<String> serverNames = new LinkedHashSet<>();
/* Add CN for the certificate */
String certCN = getCertCN(x509);
serverNames.add(certCN);
/* Add alternativ... | [
"private",
"Collection",
"<",
"String",
">",
"getCertServerNames",
"(",
"X509Certificate",
"x509",
")",
"throws",
"CertificateParsingException",
"{",
"Collection",
"<",
"String",
">",
"serverNames",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"/* Add CN for th... | Build up the list of server names represented by a certificate | [
"Build",
"up",
"the",
"list",
"of",
"server",
"names",
"represented",
"by",
"a",
"certificate"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/cert/VirtualHostKeySelector.java#L117-L150 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.decodeBitString | public static BitSet decodeBitString(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_BIT_STRING_TAG_NUM)
&& !id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED, ASN1_BIT_STRING_TAG_NUM)) {
... | java | public static BitSet decodeBitString(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_BIT_STRING_TAG_NUM)
&& !id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED, ASN1_BIT_STRING_TAG_NUM)) {
... | [
"public",
"static",
"BitSet",
"decodeBitString",
"(",
"ByteBuffer",
"buf",
")",
"{",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"if",
"(",
"!",
"id",
".",
"matches",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
",",
"DerId",
... | Decode an ASN.1 BIT STRING.
@param buf
the buffer containing the DER-encoded BIT STRING.
@return the bits in the BIT STRING | [
"Decode",
"an",
"ASN",
".",
"1",
"BIT",
"STRING",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L56-L87 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.decodeGeneralizedTime | public static Date decodeGeneralizedTime(ByteBuffer buf) {
// GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_GENERALIZED_TIME_TAG_NUM)) {
throw new IllegalArgumentExc... | java | public static Date decodeGeneralizedTime(ByteBuffer buf) {
// GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_GENERALIZED_TIME_TAG_NUM)) {
throw new IllegalArgumentExc... | [
"public",
"static",
"Date",
"decodeGeneralizedTime",
"(",
"ByteBuffer",
"buf",
")",
"{",
"// GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"if",
"(",
"!",
"id",
".",
"matches",
"(",
... | Decode an ASN.1 GeneralizedTime.
@param buf
the DER-encoded GeneralizedTime
@return the data and time | [
"Decode",
"an",
"ASN",
".",
"1",
"GeneralizedTime",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L96-L142 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.decodeIA5String | public static String decodeIA5String(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_IA5STRING_TAG_NUM)) {
throw new IllegalArgumentException("Expected IA5String identifier, received " + id);
}
int l... | java | public static String decodeIA5String(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_IA5STRING_TAG_NUM)) {
throw new IllegalArgumentException("Expected IA5String identifier, received " + id);
}
int l... | [
"public",
"static",
"String",
"decodeIA5String",
"(",
"ByteBuffer",
"buf",
")",
"{",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"if",
"(",
"!",
"id",
".",
"matches",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
",",
"DerId",
... | Decode an ASN.1 IA5String.
@param buf
the DER-encoded IA5String
@return the string | [
"Decode",
"an",
"ASN",
".",
"1",
"IA5String",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L151-L163 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.decodeInteger | public static int decodeInteger(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_INTEGER_TAG_NUM)) {
throw new IllegalArgumentException("Expected INTEGER identifier, received " + id);
}
int len = DerU... | java | public static int decodeInteger(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.PRIMITIVE, ASN1_INTEGER_TAG_NUM)) {
throw new IllegalArgumentException("Expected INTEGER identifier, received " + id);
}
int len = DerU... | [
"public",
"static",
"int",
"decodeInteger",
"(",
"ByteBuffer",
"buf",
")",
"{",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"if",
"(",
"!",
"id",
".",
"matches",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
",",
"DerId",
"."... | Decode an ASN.1 INTEGER.
@param buf
the buffer containing the DER-encoded INTEGER
@return the value of the INTEGER | [
"Decode",
"an",
"ASN",
".",
"1",
"INTEGER",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L172-L186 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.decodeOctetString | public static short[] decodeOctetString(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, ASN1_OCTET_STRING_TAG_NUM)) {
throw new IllegalArgumentException("Expected OCTET STRING identifier, received " + id);
}
int len = DerUtils.decodeL... | java | public static short[] decodeOctetString(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, ASN1_OCTET_STRING_TAG_NUM)) {
throw new IllegalArgumentException("Expected OCTET STRING identifier, received " + id);
}
int len = DerUtils.decodeL... | [
"public",
"static",
"short",
"[",
"]",
"decodeOctetString",
"(",
"ByteBuffer",
"buf",
")",
"{",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"if",
"(",
"!",
"id",
".",
"matches",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
"... | Decode an ASN.1 OCTET STRING.
@param buf
the DER-encoded OCTET STRING
@return the octets | [
"Decode",
"an",
"ASN",
".",
"1",
"OCTET",
"STRING",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L195-L209 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.decodeSequence | public static int decodeSequence(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED, ASN1_SEQUENCE_TAG_NUM)) {
throw new IllegalArgumentException("Expected SEQUENCE identifier, received " + id);
}
int len =... | java | public static int decodeSequence(ByteBuffer buf) {
DerId id = DerId.decode(buf);
if (!id.matches(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED, ASN1_SEQUENCE_TAG_NUM)) {
throw new IllegalArgumentException("Expected SEQUENCE identifier, received " + id);
}
int len =... | [
"public",
"static",
"int",
"decodeSequence",
"(",
"ByteBuffer",
"buf",
")",
"{",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"if",
"(",
"!",
"id",
".",
"matches",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
",",
"DerId",
".... | Decode an ASN.1 SEQUENCE by reading the identifier and length octets. The remaining data in the buffer is the SEQUENCE.
@param buf
the DER-encoded SEQUENCE
@return the length of the SEQUENCE | [
"Decode",
"an",
"ASN",
".",
"1",
"SEQUENCE",
"by",
"reading",
"the",
"identifier",
"and",
"length",
"octets",
".",
"The",
"remaining",
"data",
"in",
"the",
"buffer",
"is",
"the",
"SEQUENCE",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L218-L228 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeBitString | public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) {
if (value == null || nbits < value.length()) {
throw new IllegalArgumentException();
}
int pos = buf.position();
int contentLength = (int) Math.ceil(nbits / 8.0d);
for (int i = contentLength... | java | public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) {
if (value == null || nbits < value.length()) {
throw new IllegalArgumentException();
}
int pos = buf.position();
int contentLength = (int) Math.ceil(nbits / 8.0d);
for (int i = contentLength... | [
"public",
"static",
"int",
"encodeBitString",
"(",
"BitSet",
"value",
",",
"int",
"nbits",
",",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"nbits",
"<",
"value",
".",
"length",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArg... | Encode an ASN.1 BIT STRING.
@param value
the value to be encoded
@param nbits
the number of bits in the bit string
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"BIT",
"STRING",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L241-L268 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeGeneralizedTime | public static int encodeGeneralizedTime(Date date, ByteBuffer buf) {
if (date == null) {
throw new IllegalArgumentException();
}
int pos = buf.position();
SimpleDateFormat format = new SimpleDateFormat(GENERALIZED_TIME_FORMAT);
format.setTimeZone(TimeZone.getTimeZone... | java | public static int encodeGeneralizedTime(Date date, ByteBuffer buf) {
if (date == null) {
throw new IllegalArgumentException();
}
int pos = buf.position();
SimpleDateFormat format = new SimpleDateFormat(GENERALIZED_TIME_FORMAT);
format.setTimeZone(TimeZone.getTimeZone... | [
"public",
"static",
"int",
"encodeGeneralizedTime",
"(",
"Date",
"date",
",",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"int",
"pos",
"=",
"buf",
".",
"positi... | Encode an ASN.1 GeneralizedTime.
@param date
the date value
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"GeneralizedTime",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L279-L297 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeIA5String | public static int encodeIA5String(String value, ByteBuffer buf) {
int pos = buf.position();
byte[] data = (value == null) ? new byte[0] : value.getBytes();
for (int i = data.length - 1; i >= 0; i--) {
pos--;
buf.put(pos, data[i]);
}
buf.position(buf.positi... | java | public static int encodeIA5String(String value, ByteBuffer buf) {
int pos = buf.position();
byte[] data = (value == null) ? new byte[0] : value.getBytes();
for (int i = data.length - 1; i >= 0; i--) {
pos--;
buf.put(pos, data[i]);
}
buf.position(buf.positi... | [
"public",
"static",
"int",
"encodeIA5String",
"(",
"String",
"value",
",",
"ByteBuffer",
"buf",
")",
"{",
"int",
"pos",
"=",
"buf",
".",
"position",
"(",
")",
";",
"byte",
"[",
"]",
"data",
"=",
"(",
"value",
"==",
"null",
")",
"?",
"new",
"byte",
... | Encode an ASN.1 IA5String.
@param value
the value to be encoded
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"IA5String",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L308-L319 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeInteger | public static int encodeInteger(int value, ByteBuffer buf) {
int pos = buf.position();
int contentLength = 0;
do {
pos--;
buf.put(pos, (byte) (value & 0xff));
value >>>= 8;
contentLength++;
} while (value != 0);
buf.position(buf.pos... | java | public static int encodeInteger(int value, ByteBuffer buf) {
int pos = buf.position();
int contentLength = 0;
do {
pos--;
buf.put(pos, (byte) (value & 0xff));
value >>>= 8;
contentLength++;
} while (value != 0);
buf.position(buf.pos... | [
"public",
"static",
"int",
"encodeInteger",
"(",
"int",
"value",
",",
"ByteBuffer",
"buf",
")",
"{",
"int",
"pos",
"=",
"buf",
".",
"position",
"(",
")",
";",
"int",
"contentLength",
"=",
"0",
";",
"do",
"{",
"pos",
"--",
";",
"buf",
".",
"put",
"(... | Encode an ASN.1 INTEGER.
@param value
the value to be encoded
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"INTEGER",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L330-L343 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeOctetString | public static int encodeOctetString(short[] octets, ByteBuffer buf) {
if (octets == null) {
octets = new short[0];
}
int pos = buf.position();
for (int i = octets.length - 1; i >= 0; i--) {
pos--;
buf.put(pos, (byte) octets[i]);
}
buf.p... | java | public static int encodeOctetString(short[] octets, ByteBuffer buf) {
if (octets == null) {
octets = new short[0];
}
int pos = buf.position();
for (int i = octets.length - 1; i >= 0; i--) {
pos--;
buf.put(pos, (byte) octets[i]);
}
buf.p... | [
"public",
"static",
"int",
"encodeOctetString",
"(",
"short",
"[",
"]",
"octets",
",",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"octets",
"==",
"null",
")",
"{",
"octets",
"=",
"new",
"short",
"[",
"0",
"]",
";",
"}",
"int",
"pos",
"=",
"buf",
"."... | Encode an ASN.1 OCTET STRING.
@param octets
the octets
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"OCTET",
"STRING",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L354-L367 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeSequence | public static int encodeSequence(int contentLength, ByteBuffer buf) {
int headerLength = DerUtils.encodeIdAndLength(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED,
ASN1_SEQUENCE_TAG_NUM, contentLength, buf);
return headerLength + contentLength;
} | java | public static int encodeSequence(int contentLength, ByteBuffer buf) {
int headerLength = DerUtils.encodeIdAndLength(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED,
ASN1_SEQUENCE_TAG_NUM, contentLength, buf);
return headerLength + contentLength;
} | [
"public",
"static",
"int",
"encodeSequence",
"(",
"int",
"contentLength",
",",
"ByteBuffer",
"buf",
")",
"{",
"int",
"headerLength",
"=",
"DerUtils",
".",
"encodeIdAndLength",
"(",
"DerId",
".",
"TagClass",
".",
"UNIVERSAL",
",",
"DerId",
".",
"EncodingType",
... | Encode an ASN.1 SEQUENCE.
@param contentLength
the length of the SEQUENCE
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"SEQUENCE",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L378-L382 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.sizeOfBitString | public static int sizeOfBitString(BitSet value, int nbits) {
return DerUtils.sizeOf(ASN1_BIT_STRING_TAG_NUM, (int) Math.ceil(nbits / 8.0d) + 1); // +1 for padding
} | java | public static int sizeOfBitString(BitSet value, int nbits) {
return DerUtils.sizeOf(ASN1_BIT_STRING_TAG_NUM, (int) Math.ceil(nbits / 8.0d) + 1); // +1 for padding
} | [
"public",
"static",
"int",
"sizeOfBitString",
"(",
"BitSet",
"value",
",",
"int",
"nbits",
")",
"{",
"return",
"DerUtils",
".",
"sizeOf",
"(",
"ASN1_BIT_STRING_TAG_NUM",
",",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"nbits",
"/",
"8.0d",
")",
"+",
"1",... | Size of an ASN.1 BIT STRING.
@param value
the BIT STRING value
@param nbits
the number of bits in the bit string
@return the size of the encoded data | [
"Size",
"of",
"an",
"ASN",
".",
"1",
"BIT",
"STRING",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L393-L395 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.sizeOfIA5String | public static int sizeOfIA5String(String value) {
return DerUtils.sizeOf(ASN1_IA5STRING_TAG_NUM, (value == null) ? 0 : value.getBytes().length);
} | java | public static int sizeOfIA5String(String value) {
return DerUtils.sizeOf(ASN1_IA5STRING_TAG_NUM, (value == null) ? 0 : value.getBytes().length);
} | [
"public",
"static",
"int",
"sizeOfIA5String",
"(",
"String",
"value",
")",
"{",
"return",
"DerUtils",
".",
"sizeOf",
"(",
"ASN1_IA5STRING_TAG_NUM",
",",
"(",
"value",
"==",
"null",
")",
"?",
"0",
":",
"value",
".",
"getBytes",
"(",
")",
".",
"length",
")... | Size of an ASN.1 IA5String.
@param value
the string
@return the size of the encoded data | [
"Size",
"of",
"an",
"ASN",
".",
"1",
"IA5String",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L415-L417 | train |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.sizeOfInteger | public static int sizeOfInteger(int value) {
int contentLength = 0;
do {
value >>>= 8;
contentLength++;
} while (value != 0);
return DerUtils.sizeOf(ASN1_INTEGER_TAG_NUM, contentLength);
} | java | public static int sizeOfInteger(int value) {
int contentLength = 0;
do {
value >>>= 8;
contentLength++;
} while (value != 0);
return DerUtils.sizeOf(ASN1_INTEGER_TAG_NUM, contentLength);
} | [
"public",
"static",
"int",
"sizeOfInteger",
"(",
"int",
"value",
")",
"{",
"int",
"contentLength",
"=",
"0",
";",
"do",
"{",
"value",
">>>=",
"8",
";",
"contentLength",
"++",
";",
"}",
"while",
"(",
"value",
"!=",
"0",
")",
";",
"return",
"DerUtils",
... | Size of an ASN.1 INTEGER.
@param value
the integer value
@return the size of the encoded data | [
"Size",
"of",
"an",
"ASN",
".",
"1",
"INTEGER",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L426-L433 | train |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/MD4.java | MD4.pad | private byte[] pad() {
int pos = (int) (msgLength % BYTE_BLOCK_LENGTH);
int padLength = (pos < 56) ? (64 - pos) : (128 - pos);
byte[] pad = new byte[padLength];
// First bit of the padding set to 1
pad[0] = (byte) 0x80;
long bits = msgLength << 3;
int index = pa... | java | private byte[] pad() {
int pos = (int) (msgLength % BYTE_BLOCK_LENGTH);
int padLength = (pos < 56) ? (64 - pos) : (128 - pos);
byte[] pad = new byte[padLength];
// First bit of the padding set to 1
pad[0] = (byte) 0x80;
long bits = msgLength << 3;
int index = pa... | [
"private",
"byte",
"[",
"]",
"pad",
"(",
")",
"{",
"int",
"pos",
"=",
"(",
"int",
")",
"(",
"msgLength",
"%",
"BYTE_BLOCK_LENGTH",
")",
";",
"int",
"padLength",
"=",
"(",
"pos",
"<",
"56",
")",
"?",
"(",
"64",
"-",
"pos",
")",
":",
"(",
"128",
... | Pads the buffer by appending the byte 0x80, then append as many zero
bytes as necessary to make the buffer length a multiple of 64 bytes.
The last 8 bytes will be filled with the length of the buffer in bits.
If there's no room to store the length in bits in the block i.e the block
is larger than 56 bytes then an addit... | [
"Pads",
"the",
"buffer",
"by",
"appending",
"the",
"byte",
"0x80",
"then",
"append",
"as",
"many",
"zero",
"bytes",
"as",
"necessary",
"to",
"make",
"the",
"buffer",
"length",
"a",
"multiple",
"of",
"64",
"bytes",
".",
"The",
"last",
"8",
"bytes",
"will"... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/MD4.java#L189-L204 | train |
kaazing/gateway | server.api/src/main/java/org/kaazing/gateway/server/impl/ProductInfoReader.java | ProductInfoReader.generateProductInfo | private static synchronized ProductInfo generateProductInfo() {
ProductInfo result = new ProductInfo();
boolean foundJar = false;
String[] pathEntries = System.getProperty("java.class.path").split(System.getProperty("path.separator"));
Map<String, Attributes> products = new TreeMap<>(Col... | java | private static synchronized ProductInfo generateProductInfo() {
ProductInfo result = new ProductInfo();
boolean foundJar = false;
String[] pathEntries = System.getProperty("java.class.path").split(System.getProperty("path.separator"));
Map<String, Attributes> products = new TreeMap<>(Col... | [
"private",
"static",
"synchronized",
"ProductInfo",
"generateProductInfo",
"(",
")",
"{",
"ProductInfo",
"result",
"=",
"new",
"ProductInfo",
"(",
")",
";",
"boolean",
"foundJar",
"=",
"false",
";",
"String",
"[",
"]",
"pathEntries",
"=",
"System",
".",
"getPr... | Find the product information from the server JAR MANIFEST files and store it
in static variables here for later retrieval. | [
"Find",
"the",
"product",
"information",
"from",
"the",
"server",
"JAR",
"MANIFEST",
"files",
"and",
"store",
"it",
"in",
"static",
"variables",
"here",
"for",
"later",
"retrieval",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server.api/src/main/java/org/kaazing/gateway/server/impl/ProductInfoReader.java#L59-L92 | train |
kaazing/gateway | service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java | AmqpTable.addInteger | public AmqpTable addInteger(String key, int value) {
this.add(key, value, AmqpType.INT);
return this;
} | java | public AmqpTable addInteger(String key, int value) {
this.add(key, value, AmqpType.INT);
return this;
} | [
"public",
"AmqpTable",
"addInteger",
"(",
"String",
"key",
",",
"int",
"value",
")",
"{",
"this",
".",
"add",
"(",
"key",
",",
"value",
",",
"AmqpType",
".",
"INT",
")",
";",
"return",
"this",
";",
"}"
] | Adds an integer entry to the AmqpTable.
@param key name of an entry
@param value integer value of an entry
@return AmqpTable object that holds the table of entries | [
"Adds",
"an",
"integer",
"entry",
"to",
"the",
"AmqpTable",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java#L130-L133 | train |
kaazing/gateway | service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java | AmqpTable.addLongString | public AmqpTable addLongString(String key, String value) {
this.add(key, value, AmqpType.LONGSTRING);
return this;
} | java | public AmqpTable addLongString(String key, String value) {
this.add(key, value, AmqpType.LONGSTRING);
return this;
} | [
"public",
"AmqpTable",
"addLongString",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"add",
"(",
"key",
",",
"value",
",",
"AmqpType",
".",
"LONGSTRING",
")",
";",
"return",
"this",
";",
"}"
] | Adds a long string entry to the AmqpTable.
@param key name of an entry
@param value long string value of an entry
@return AmqpTable object that holds the table of entries | [
"Adds",
"a",
"long",
"string",
"entry",
"to",
"the",
"AmqpTable",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java#L142-L145 | train |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java | OrderedThreadPoolExecutor.getSessionTasksQueue | private SessionTasksQueue getSessionTasksQueue(IoSession session) {
SessionTasksQueue queue = (SessionTasksQueue) session.getAttribute(TASKS_QUEUE);
if (queue == null) {
queue = new SessionTasksQueue();
SessionTasksQueue oldQueue =
(SessionTasksQueue) session.se... | java | private SessionTasksQueue getSessionTasksQueue(IoSession session) {
SessionTasksQueue queue = (SessionTasksQueue) session.getAttribute(TASKS_QUEUE);
if (queue == null) {
queue = new SessionTasksQueue();
SessionTasksQueue oldQueue =
(SessionTasksQueue) session.se... | [
"private",
"SessionTasksQueue",
"getSessionTasksQueue",
"(",
"IoSession",
"session",
")",
"{",
"SessionTasksQueue",
"queue",
"=",
"(",
"SessionTasksQueue",
")",
"session",
".",
"getAttribute",
"(",
"TASKS_QUEUE",
")",
";",
"if",
"(",
"queue",
"==",
"null",
")",
... | Get the session's tasks queue. | [
"Get",
"the",
"session",
"s",
"tasks",
"queue",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java#L217-L231 | train |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java | OrderedThreadPoolExecutor.print | private void print( Queue<Runnable> queue, IoEvent event) {
StringBuilder sb = new StringBuilder();
sb.append( "Adding event " ).append( event.getType() ).append( " to session " ).append(event.getSession().getId() );
boolean first = true;
sb.append( "\nQueue : [" );
for (Runnable... | java | private void print( Queue<Runnable> queue, IoEvent event) {
StringBuilder sb = new StringBuilder();
sb.append( "Adding event " ).append( event.getType() ).append( " to session " ).append(event.getSession().getId() );
boolean first = true;
sb.append( "\nQueue : [" );
for (Runnable... | [
"private",
"void",
"print",
"(",
"Queue",
"<",
"Runnable",
">",
"queue",
",",
"IoEvent",
"event",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"Adding event \"",
")",
".",
"append",
"(",
"event"... | A Helper class used to print the list of events being queued. | [
"A",
"Helper",
"class",
"used",
"to",
"print",
"the",
"list",
"of",
"events",
"being",
"queued",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java#L424-L440 | train |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/basic/HttpBasicAuthLogicHandler.java | HttpBasicAuthLogicHandler.createAuthorization | public static String createAuthorization(final String username,
final String password) {
return new String(Base64.encodeBase64((username + ":" + password)
.getBytes()));
} | java | public static String createAuthorization(final String username,
final String password) {
return new String(Base64.encodeBase64((username + ":" + password)
.getBytes()));
} | [
"public",
"static",
"String",
"createAuthorization",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"return",
"new",
"String",
"(",
"Base64",
".",
"encodeBase64",
"(",
"(",
"username",
"+",
"\":\"",
"+",
"password",
")",
".... | Computes the authorization header value.
@param username the user name
@param password the user password
@return the authorization header value as a string | [
"Computes",
"the",
"authorization",
"header",
"value",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/basic/HttpBasicAuthLogicHandler.java#L95-L99 | train |
kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/core/service/AbstractIoProcessor.java | AbstractIoProcessor.add | @Override
public final void add(final T session) {
// note: alignment is optional before 4.0
if (session.isIoAligned()) {
verifyInIoThread(session, session.getIoThread());
}
add0(session);
} | java | @Override
public final void add(final T session) {
// note: alignment is optional before 4.0
if (session.isIoAligned()) {
verifyInIoThread(session, session.getIoThread());
}
add0(session);
} | [
"@",
"Override",
"public",
"final",
"void",
"add",
"(",
"final",
"T",
"session",
")",
"{",
"// note: alignment is optional before 4.0",
"if",
"(",
"session",
".",
"isIoAligned",
"(",
")",
")",
"{",
"verifyInIoThread",
"(",
"session",
",",
"session",
".",
"getI... | until the processor is created and started | [
"until",
"the",
"processor",
"is",
"created",
"and",
"started"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/core/service/AbstractIoProcessor.java#L36-L43 | train |
lalyos/jfiglet | src/main/java/com/github/lalyos/jfiglet/Smushing.java | Smushing.getRulesToApply | static SmushingRulesToApply getRulesToApply(Integer oldLayout, Integer fullLayout){
List<SmushingRule> horizontalSmushingRules = new ArrayList<SmushingRule>();
List<SmushingRule> verticalSmushingRules = new ArrayList<SmushingRule>();
SmushingRule.Layout horizontalLayout = null;
SmushingRule.Layout verti... | java | static SmushingRulesToApply getRulesToApply(Integer oldLayout, Integer fullLayout){
List<SmushingRule> horizontalSmushingRules = new ArrayList<SmushingRule>();
List<SmushingRule> verticalSmushingRules = new ArrayList<SmushingRule>();
SmushingRule.Layout horizontalLayout = null;
SmushingRule.Layout verti... | [
"static",
"SmushingRulesToApply",
"getRulesToApply",
"(",
"Integer",
"oldLayout",
",",
"Integer",
"fullLayout",
")",
"{",
"List",
"<",
"SmushingRule",
">",
"horizontalSmushingRules",
"=",
"new",
"ArrayList",
"<",
"SmushingRule",
">",
"(",
")",
";",
"List",
"<",
... | Return definition of smushing logic to be applied.
@param oldLayout Old_Layout describes horizontal layout, older fonts may only provide this.
@param fullLayout Full_Layout describes ALL information about horizontal and vertical layout.
@return Smushing logic to be applied | [
"Return",
"definition",
"of",
"smushing",
"logic",
"to",
"be",
"applied",
"."
] | fc98c13622d753219267a2a8b5800cead198ebc9 | https://github.com/lalyos/jfiglet/blob/fc98c13622d753219267a2a8b5800cead198ebc9/src/main/java/com/github/lalyos/jfiglet/Smushing.java#L13-L48 | train |
lalyos/jfiglet | src/main/java/com/github/lalyos/jfiglet/Smushing.java | Smushing.calculateOverlay | @SuppressWarnings("StatementWithEmptyBody")
private static int calculateOverlay(FigletFont figletFont, char[][] char1, char[][] char2){
if (figletFont.smushingRulesToApply.getHorizontalLayout() == SmushingRule.Layout.FULL_WIDTH){
return 0;
}
int maxPotentialOverlay = figletFont.maxLine;
for(int ... | java | @SuppressWarnings("StatementWithEmptyBody")
private static int calculateOverlay(FigletFont figletFont, char[][] char1, char[][] char2){
if (figletFont.smushingRulesToApply.getHorizontalLayout() == SmushingRule.Layout.FULL_WIDTH){
return 0;
}
int maxPotentialOverlay = figletFont.maxLine;
for(int ... | [
"@",
"SuppressWarnings",
"(",
"\"StatementWithEmptyBody\"",
")",
"private",
"static",
"int",
"calculateOverlay",
"(",
"FigletFont",
"figletFont",
",",
"char",
"[",
"]",
"[",
"]",
"char1",
",",
"char",
"[",
"]",
"[",
"]",
"char2",
")",
"{",
"if",
"(",
"figl... | Workouts the amount of characters that can be smushed across all lines.
@param figletFont Font definition
@param char1 Message so far
@param char2 Char to be added
@return Maximum overlay across all lines | [
"Workouts",
"the",
"amount",
"of",
"characters",
"that",
"can",
"be",
"smushed",
"across",
"all",
"lines",
"."
] | fc98c13622d753219267a2a8b5800cead198ebc9 | https://github.com/lalyos/jfiglet/blob/fc98c13622d753219267a2a8b5800cead198ebc9/src/main/java/com/github/lalyos/jfiglet/Smushing.java#L105-L137 | train |
lalyos/jfiglet | src/main/java/com/github/lalyos/jfiglet/FigletFont.java | FigletFont.getCharLineString | public String getCharLineString(int c, int l) {
if (font[c][l] == null)
return null;
else {
return new String(font[c][l]).replace(hardblank, ' ');
}
} | java | public String getCharLineString(int c, int l) {
if (font[c][l] == null)
return null;
else {
return new String(font[c][l]).replace(hardblank, ' ');
}
} | [
"public",
"String",
"getCharLineString",
"(",
"int",
"c",
",",
"int",
"l",
")",
"{",
"if",
"(",
"font",
"[",
"c",
"]",
"[",
"l",
"]",
"==",
"null",
")",
"return",
"null",
";",
"else",
"{",
"return",
"new",
"String",
"(",
"font",
"[",
"c",
"]",
... | Selects a single line from a character.
@param c Character id
@param l Line number
@return The selected line from the character | [
"Selects",
"a",
"single",
"line",
"from",
"a",
"character",
"."
] | fc98c13622d753219267a2a8b5800cead198ebc9 | https://github.com/lalyos/jfiglet/blob/fc98c13622d753219267a2a8b5800cead198ebc9/src/main/java/com/github/lalyos/jfiglet/FigletFont.java#L68-L74 | train |
lucastheisen/jsch-extension | src/main/java/com/pastdev/jsch/tunnel/TunnelConnection.java | TunnelConnection.close | public void close() throws IOException {
if ( session != null && session.isConnected() ) {
session.disconnect();
}
session = null;
// unnecessary, but seems right to undo what we did
for ( Tunnel tunnel : tunnels ) {
tunnel.setAssignedLocalPort( 0 );
... | java | public void close() throws IOException {
if ( session != null && session.isConnected() ) {
session.disconnect();
}
session = null;
// unnecessary, but seems right to undo what we did
for ( Tunnel tunnel : tunnels ) {
tunnel.setAssignedLocalPort( 0 );
... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"session",
"!=",
"null",
"&&",
"session",
".",
"isConnected",
"(",
")",
")",
"{",
"session",
".",
"disconnect",
"(",
")",
";",
"}",
"session",
"=",
"null",
";",
"// unnecessa... | Closes the underlying ssh session causing all tunnels to be closed. | [
"Closes",
"the",
"underlying",
"ssh",
"session",
"causing",
"all",
"tunnels",
"to",
"be",
"closed",
"."
] | 3c5bfae84d63e8632828a10721f2e605b68d749a | https://github.com/lucastheisen/jsch-extension/blob/3c5bfae84d63e8632828a10721f2e605b68d749a/src/main/java/com/pastdev/jsch/tunnel/TunnelConnection.java#L90-L100 | train |
lucastheisen/jsch-extension | src/main/java/com/pastdev/jsch/tunnel/TunnelConnection.java | TunnelConnection.open | public void open() throws JSchException {
if ( isOpen() ) {
return;
}
session = sessionFactory.newSession();
logger.debug( "connecting session" );
session.connect();
for ( Tunnel tunnel : tunnels ) {
int assignedPort = 0;
if ( tunnel.... | java | public void open() throws JSchException {
if ( isOpen() ) {
return;
}
session = sessionFactory.newSession();
logger.debug( "connecting session" );
session.connect();
for ( Tunnel tunnel : tunnels ) {
int assignedPort = 0;
if ( tunnel.... | [
"public",
"void",
"open",
"(",
")",
"throws",
"JSchException",
"{",
"if",
"(",
"isOpen",
"(",
")",
")",
"{",
"return",
";",
"}",
"session",
"=",
"sessionFactory",
".",
"newSession",
"(",
")",
";",
"logger",
".",
"debug",
"(",
"\"connecting session\"",
")... | Opens a session and connects all of the tunnels.
@throws JSchException
If unable to connect | [
"Opens",
"a",
"session",
"and",
"connects",
"all",
"of",
"the",
"tunnels",
"."
] | 3c5bfae84d63e8632828a10721f2e605b68d749a | https://github.com/lucastheisen/jsch-extension/blob/3c5bfae84d63e8632828a10721f2e605b68d749a/src/main/java/com/pastdev/jsch/tunnel/TunnelConnection.java#L142-L170 | train |
lucastheisen/jsch-extension | src/main/java/com/pastdev/jsch/SessionManager.java | SessionManager.getSession | public Session getSession() throws JSchException {
if ( session == null || !session.isConnected() ) {
logger.debug( "getting new session from factory session" );
session = sessionFactory.newSession();
logger.debug( "connecting session" );
session.connect();
... | java | public Session getSession() throws JSchException {
if ( session == null || !session.isConnected() ) {
logger.debug( "getting new session from factory session" );
session = sessionFactory.newSession();
logger.debug( "connecting session" );
session.connect();
... | [
"public",
"Session",
"getSession",
"(",
")",
"throws",
"JSchException",
"{",
"if",
"(",
"session",
"==",
"null",
"||",
"!",
"session",
".",
"isConnected",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"getting new session from factory session\"",
")",
";"... | Returns a connected session.
@return A connected session
@throws JSchException
If unable to connect the session | [
"Returns",
"a",
"connected",
"session",
"."
] | 3c5bfae84d63e8632828a10721f2e605b68d749a | https://github.com/lucastheisen/jsch-extension/blob/3c5bfae84d63e8632828a10721f2e605b68d749a/src/main/java/com/pastdev/jsch/SessionManager.java#L54-L62 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java | InputFactory.decompressWith7Zip | private static InputStreamReader decompressWith7Zip(final String archivePath)
throws ConfigurationException
{
PATH_PROGRAM_7ZIP = (String) config
.getConfigParameter(ConfigurationKeys.PATH_PROGRAM_7ZIP);
if (PATH_PROGRAM_7ZIP == null) {
throw ErrorFactory
.createConfigurationException(ErrorKeys.CON... | java | private static InputStreamReader decompressWith7Zip(final String archivePath)
throws ConfigurationException
{
PATH_PROGRAM_7ZIP = (String) config
.getConfigParameter(ConfigurationKeys.PATH_PROGRAM_7ZIP);
if (PATH_PROGRAM_7ZIP == null) {
throw ErrorFactory
.createConfigurationException(ErrorKeys.CON... | [
"private",
"static",
"InputStreamReader",
"decompressWith7Zip",
"(",
"final",
"String",
"archivePath",
")",
"throws",
"ConfigurationException",
"{",
"PATH_PROGRAM_7ZIP",
"=",
"(",
"String",
")",
"config",
".",
"getConfigParameter",
"(",
"ConfigurationKeys",
".",
"PATH_P... | Starts a decompression process using the 7Zip program.
@param archivePath
path to the archive
@return InputStreamReader
@throws ConfigurationException
if an error occurred while accessing the configuration | [
"Starts",
"a",
"decompression",
"process",
"using",
"the",
"7Zip",
"program",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java#L92-L114 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java | InputFactory.decompressWithBZip2 | private static InputStreamReader decompressWithBZip2(
final String archivePath)
throws ConfigurationException
{
Bzip2Archiver archiver = new Bzip2Archiver();
InputStreamReader reader = null;
try {
reader = archiver.getDecompressionStream(archivePath, WIKIPEDIA_ENCODING);
}
catch (IOException e) {
... | java | private static InputStreamReader decompressWithBZip2(
final String archivePath)
throws ConfigurationException
{
Bzip2Archiver archiver = new Bzip2Archiver();
InputStreamReader reader = null;
try {
reader = archiver.getDecompressionStream(archivePath, WIKIPEDIA_ENCODING);
}
catch (IOException e) {
... | [
"private",
"static",
"InputStreamReader",
"decompressWithBZip2",
"(",
"final",
"String",
"archivePath",
")",
"throws",
"ConfigurationException",
"{",
"Bzip2Archiver",
"archiver",
"=",
"new",
"Bzip2Archiver",
"(",
")",
";",
"InputStreamReader",
"reader",
"=",
"null",
"... | Starts a decompression process using the BZip2 program.
@param archivePath
path to the archive
@return InputStreamReader
@throws ConfigurationException
if an error occurred while accessing the configuration | [
"Starts",
"a",
"decompression",
"process",
"using",
"the",
"BZip2",
"program",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java#L126-L142 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java | InputFactory.readXMLFile | private static InputStreamReader readXMLFile(final String archivePath)
{
try {
return new InputStreamReader(new BufferedInputStream(new FileInputStream(archivePath)),
WIKIPEDIA_ENCODING);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | java | private static InputStreamReader readXMLFile(final String archivePath)
{
try {
return new InputStreamReader(new BufferedInputStream(new FileInputStream(archivePath)),
WIKIPEDIA_ENCODING);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"private",
"static",
"InputStreamReader",
"readXMLFile",
"(",
"final",
"String",
"archivePath",
")",
"{",
"try",
"{",
"return",
"new",
"InputStreamReader",
"(",
"new",
"BufferedInputStream",
"(",
"new",
"FileInputStream",
"(",
"archivePath",
")",
")",
",",
"WIKIPE... | Creates a reader for the xml file.
@param archivePath
path to the xml file
@return InputStreamReader | [
"Creates",
"a",
"reader",
"for",
"the",
"xml",
"file",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java#L151-L162 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java | InputFactory.getTaskReader | public static ArticleReaderInterface getTaskReader(
final ArchiveDescription archive)
throws ConfigurationException, ArticleReaderException
{
Reader reader = null;
switch (archive.getType()) {
case XML:
reader = readXMLFile(archive.getPath());
break;
case SEVENZIP:
reader = decompressWith7Zip(ar... | java | public static ArticleReaderInterface getTaskReader(
final ArchiveDescription archive)
throws ConfigurationException, ArticleReaderException
{
Reader reader = null;
switch (archive.getType()) {
case XML:
reader = readXMLFile(archive.getPath());
break;
case SEVENZIP:
reader = decompressWith7Zip(ar... | [
"public",
"static",
"ArticleReaderInterface",
"getTaskReader",
"(",
"final",
"ArchiveDescription",
"archive",
")",
"throws",
"ConfigurationException",
",",
"ArticleReaderException",
"{",
"Reader",
"reader",
"=",
"null",
";",
"switch",
"(",
"archive",
".",
"getType",
"... | Returns an ArticleReader which reads the specified input file.
@param archive
input file
@return ArticleReaderInterface
@throws ConfigurationException
if an error occurred while accessing the configuration
@throws ArticleReaderException
if an error occurred while parsing the file | [
"Returns",
"an",
"ArticleReader",
"which",
"reads",
"the",
"specified",
"input",
"file",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/InputFactory.java#L176-L201 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/ConfigMenuBar.java | ConfigMenuBar.createSystemMenu | private void createSystemMenu()
{
JMenu system = new JMenu("System");
JMenuItem importConfig = new JMenuItem("Import Configuration");
importConfig.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(final ActionEvent e)
{
controller.loadConfiguration();
}
});
s... | java | private void createSystemMenu()
{
JMenu system = new JMenu("System");
JMenuItem importConfig = new JMenuItem("Import Configuration");
importConfig.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(final ActionEvent e)
{
controller.loadConfiguration();
}
});
s... | [
"private",
"void",
"createSystemMenu",
"(",
")",
"{",
"JMenu",
"system",
"=",
"new",
"JMenu",
"(",
"\"System\"",
")",
";",
"JMenuItem",
"importConfig",
"=",
"new",
"JMenuItem",
"(",
"\"Import Configuration\"",
")",
";",
"importConfig",
".",
"addActionListener",
... | Creates the System menu and its menu items. | [
"Creates",
"the",
"System",
"menu",
"and",
"its",
"menu",
"items",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/ConfigMenuBar.java#L60-L119 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java | ConfigSettings.setConfigParameter | public void setConfigParameter(final ConfigurationKeys key, Object value)
{
// before setting parameter, check if paths have trailing File.separator
if (key == ConfigurationKeys.LOGGING_PATH_DEBUG
|| key == ConfigurationKeys.LOGGING_PATH_DIFFTOOL
|| key == ConfigurationKeys.PATH_OUTPUT_SQL_FILES) {
Str... | java | public void setConfigParameter(final ConfigurationKeys key, Object value)
{
// before setting parameter, check if paths have trailing File.separator
if (key == ConfigurationKeys.LOGGING_PATH_DEBUG
|| key == ConfigurationKeys.LOGGING_PATH_DIFFTOOL
|| key == ConfigurationKeys.PATH_OUTPUT_SQL_FILES) {
Str... | [
"public",
"void",
"setConfigParameter",
"(",
"final",
"ConfigurationKeys",
"key",
",",
"Object",
"value",
")",
"{",
"// before setting parameter, check if paths have trailing File.separator",
"if",
"(",
"key",
"==",
"ConfigurationKeys",
".",
"LOGGING_PATH_DEBUG",
"||",
"key... | Assigns the given value to the the given key.
@param key
configuration key
@param value
value | [
"Assigns",
"the",
"given",
"value",
"to",
"the",
"the",
"given",
"key",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java#L138-L155 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java | ConfigSettings.getConfigParameter | public Object getConfigParameter(final ConfigurationKeys configParameter)
{
if (this.parameterMap.containsKey(configParameter)) {
return this.parameterMap.get(configParameter);
}
return null;
} | java | public Object getConfigParameter(final ConfigurationKeys configParameter)
{
if (this.parameterMap.containsKey(configParameter)) {
return this.parameterMap.get(configParameter);
}
return null;
} | [
"public",
"Object",
"getConfigParameter",
"(",
"final",
"ConfigurationKeys",
"configParameter",
")",
"{",
"if",
"(",
"this",
".",
"parameterMap",
".",
"containsKey",
"(",
"configParameter",
")",
")",
"{",
"return",
"this",
".",
"parameterMap",
".",
"get",
"(",
... | Returns the value related to the configuration key or null if the key is
not contained.
@param configParameter
configuration key
@return value or null | [
"Returns",
"the",
"value",
"related",
"to",
"the",
"configuration",
"key",
"or",
"null",
"if",
"the",
"key",
"is",
"not",
"contained",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java#L165-L172 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java | ConfigSettings.defaultConfiguration | public void defaultConfiguration()
{
clear();
setConfigParameter(ConfigurationKeys.VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING, 12);
setConfigParameter(ConfigurationKeys.COUNTER_FULL_REVISION, 1000);
setConfigParameter(ConfigurationKeys.LIMIT_TASK_SIZE_REVISIONS, 5000000l);
setConfigParameter(ConfigurationKey... | java | public void defaultConfiguration()
{
clear();
setConfigParameter(ConfigurationKeys.VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING, 12);
setConfigParameter(ConfigurationKeys.COUNTER_FULL_REVISION, 1000);
setConfigParameter(ConfigurationKeys.LIMIT_TASK_SIZE_REVISIONS, 5000000l);
setConfigParameter(ConfigurationKey... | [
"public",
"void",
"defaultConfiguration",
"(",
")",
"{",
"clear",
"(",
")",
";",
"setConfigParameter",
"(",
"ConfigurationKeys",
".",
"VALUE_MINIMUM_LONGEST_COMMON_SUBSTRING",
",",
"12",
")",
";",
"setConfigParameter",
"(",
"ConfigurationKeys",
".",
"COUNTER_FULL_REVISI... | Applies the default single thread configuration of the DiffTool to this
settings. | [
"Applies",
"the",
"default",
"single",
"thread",
"configuration",
"of",
"the",
"DiffTool",
"to",
"this",
"settings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java#L178-L222 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java | ConfigSettings.loadConfig | public void loadConfig(final String path)
{
try {
ConfigurationReader reader = new ConfigurationReader(path);
ConfigSettings settings = reader.read();
clear();
this.type = settings.type;
this.parameterMap = settings.parameterMap;
this.archives = settings.archives;
}
catch (Exception e) {
... | java | public void loadConfig(final String path)
{
try {
ConfigurationReader reader = new ConfigurationReader(path);
ConfigSettings settings = reader.read();
clear();
this.type = settings.type;
this.parameterMap = settings.parameterMap;
this.archives = settings.archives;
}
catch (Exception e) {
... | [
"public",
"void",
"loadConfig",
"(",
"final",
"String",
"path",
")",
"{",
"try",
"{",
"ConfigurationReader",
"reader",
"=",
"new",
"ConfigurationReader",
"(",
"path",
")",
";",
"ConfigSettings",
"settings",
"=",
"reader",
".",
"read",
"(",
")",
";",
"clear",... | Loads the configuration settings from a file.
@param path
path to the configuration file | [
"Loads",
"the",
"configuration",
"settings",
"from",
"a",
"file",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigSettings.java#L250-L267 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/exceptions/ErrorFactory.java | ErrorFactory.createConfigurationException | public static ConfigurationException createConfigurationException(
final ErrorKeys errorId, final String message)
{
return new ConfigurationException(errorId.toString() + ":\r\n"
+ message);
} | java | public static ConfigurationException createConfigurationException(
final ErrorKeys errorId, final String message)
{
return new ConfigurationException(errorId.toString() + ":\r\n"
+ message);
} | [
"public",
"static",
"ConfigurationException",
"createConfigurationException",
"(",
"final",
"ErrorKeys",
"errorId",
",",
"final",
"String",
"message",
")",
"{",
"return",
"new",
"ConfigurationException",
"(",
"errorId",
".",
"toString",
"(",
")",
"+",
"\":\\r\\n\"",
... | Creates a ConfigurationException object.
@param errorId
reference to the error identifier
@param message
additional error message
@return ConfigurationException | [
"Creates",
"a",
"ConfigurationException",
"object",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/exceptions/ErrorFactory.java#L97-L103 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/exceptions/ErrorFactory.java | ErrorFactory.createLoggingException | public static LoggingException createLoggingException(
final ErrorKeys errorId, final Exception e)
{
return new LoggingException(errorId.toString(), e);
} | java | public static LoggingException createLoggingException(
final ErrorKeys errorId, final Exception e)
{
return new LoggingException(errorId.toString(), e);
} | [
"public",
"static",
"LoggingException",
"createLoggingException",
"(",
"final",
"ErrorKeys",
"errorId",
",",
"final",
"Exception",
"e",
")",
"{",
"return",
"new",
"LoggingException",
"(",
"errorId",
".",
"toString",
"(",
")",
",",
"e",
")",
";",
"}"
] | Creates a LoggingException object.
@param errorId
reference to the error identifier
@param e
inner exception
@return LoggingException | [
"Creates",
"a",
"LoggingException",
"object",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/exceptions/ErrorFactory.java#L153-L158 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.read | public ConfigSettings read()
{
ConfigSettings config = new ConfigSettings(ConfigEnum.IMPORT);
String name;
Node node;
NodeList list = root.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
node = list.item(i);
name = node.getNodeName().toUpperCase();
if (name.... | java | public ConfigSettings read()
{
ConfigSettings config = new ConfigSettings(ConfigEnum.IMPORT);
String name;
Node node;
NodeList list = root.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
node = list.item(i);
name = node.getNodeName().toUpperCase();
if (name.... | [
"public",
"ConfigSettings",
"read",
"(",
")",
"{",
"ConfigSettings",
"config",
"=",
"new",
"ConfigSettings",
"(",
"ConfigEnum",
".",
"IMPORT",
")",
";",
"String",
"name",
";",
"Node",
"node",
";",
"NodeList",
"list",
"=",
"root",
".",
"getChildNodes",
"(",
... | Reads the input of the configuration file and parses the into the
ConfigSettings object.
@return ConfigSettings | [
"Reads",
"the",
"input",
"of",
"the",
"configuration",
"file",
"and",
"parses",
"the",
"into",
"the",
"ConfigSettings",
"object",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L212-L254 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseFilterConfig | private void parseFilterConfig(final Node node, final ConfigSettings config)
{
String name;
Node nnode;
final NodeList list = node.getChildNodes();
final int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equ... | java | private void parseFilterConfig(final Node node, final ConfigSettings config)
{
String name;
Node nnode;
final NodeList list = node.getChildNodes();
final int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equ... | [
"private",
"void",
"parseFilterConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Node",
"nnode",
";",
"final",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"final",
"... | Parses the filter parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"filter",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L265-L283 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseNamespaceFilterConfig | private void parseNamespaceFilterConfig(final Node node, final ConfigSettings config) {
String name;
Integer value;
Node nnode;
final NodeList list = node.getChildNodes();
final int length = list.getLength();
final Set<Integer> namespaces = new HashSet<Integer>();
for (int i = 0; i < length; i++) {
nn... | java | private void parseNamespaceFilterConfig(final Node node, final ConfigSettings config) {
String name;
Integer value;
Node nnode;
final NodeList list = node.getChildNodes();
final int length = list.getLength();
final Set<Integer> namespaces = new HashSet<Integer>();
for (int i = 0; i < length; i++) {
nn... | [
"private",
"void",
"parseNamespaceFilterConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Integer",
"value",
";",
"Node",
"nnode",
";",
"final",
"NodeList",
"list",
"=",
"node",
".",
"getChildNod... | Parses the namespaces parameter section. This is the subsection of filter.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"namespaces",
"parameter",
"section",
".",
"This",
"is",
"the",
"subsection",
"of",
"filter",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L293-L320 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseModeConfig | private void parseModeConfig(final Node node, final ConfigSettings config)
{
String name;
Integer value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.e... | java | private void parseModeConfig(final Node node, final ConfigSettings config)
{
String name;
Integer value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.e... | [
"private",
"void",
"parseModeConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Integer",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
"... | Parses the mode parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"mode",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L331-L362 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseExternalsConfig | private void parseExternalsConfig(final Node node,
final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equ... | java | private void parseExternalsConfig(final Node node,
final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equ... | [
"private",
"void",
"parseExternalsConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
",",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"i... | Parses the externals parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"externals",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L372-L395 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseInputConfig | private void parseInputConfig(final Node node, final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equals(KEY... | java | private void parseInputConfig(final Node node, final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equals(KEY... | [
"private",
"void",
"parseInputConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
",",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"int",... | Parses the input parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"input",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L405-L438 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseInputArchive | private void parseInputArchive(final Node node, final ConfigSettings config)
{
String name;
InputType type = null;
String path = null;
long startPosition = 0;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);... | java | private void parseInputArchive(final Node node, final ConfigSettings config)
{
String name;
InputType type = null;
String path = null;
long startPosition = 0;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);... | [
"private",
"void",
"parseInputArchive",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"InputType",
"type",
"=",
"null",
";",
"String",
"path",
"=",
"null",
";",
"long",
"startPosition",
"=",
"0",
"... | Parses the input archive subsection.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"input",
"archive",
"subsection",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L448-L495 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseOutputConfig | private void parseOutputConfig(final Node node, final ConfigSettings config)
{
String name;
Long lValue;
Boolean bValue;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCas... | java | private void parseOutputConfig(final Node node, final ConfigSettings config)
{
String name;
Long lValue;
Boolean bValue;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCas... | [
"private",
"void",
"parseOutputConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Long",
"lValue",
";",
"Boolean",
"bValue",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"g... | Parses the output parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"output",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L505-L579 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseSQLConfig | private void parseSQLConfig(final Node node, final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equals(KEY_H... | java | private void parseSQLConfig(final Node node, final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equals(KEY_H... | [
"private",
"void",
"parseSQLConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
",",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"int",
... | Parses the sql parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"sql",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L589-L625 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseCacheConfig | private void parseCacheConfig(final Node node, final ConfigSettings config)
{
String name;
Long lValue;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.eq... | java | private void parseCacheConfig(final Node node, final ConfigSettings config)
{
String name;
Long lValue;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.eq... | [
"private",
"void",
"parseCacheConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Long",
"lValue",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";... | Parses the cache parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"cache",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L635-L674 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseLoggingConfig | private void parseLoggingConfig(final Node node, final ConfigSettings config)
{
String name;
String value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name... | java | private void parseLoggingConfig(final Node node, final ConfigSettings config)
{
String name;
String value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name... | [
"private",
"void",
"parseLoggingConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"String",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
... | Parses the logging parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"logging",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L684-L713 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseLoggerConfig | private void parseLoggerConfig(final Node node,
final ConfigSettings config, final ConfigurationKeys logPath,
final ConfigurationKeys logLevel)
{
String name, value;
Level level;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
n... | java | private void parseLoggerConfig(final Node node,
final ConfigSettings config, final ConfigurationKeys logPath,
final ConfigurationKeys logLevel)
{
String name, value;
Level level;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
n... | [
"private",
"void",
"parseLoggerConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
",",
"final",
"ConfigurationKeys",
"logPath",
",",
"final",
"ConfigurationKeys",
"logLevel",
")",
"{",
"String",
"name",
",",
"value",
";",
"Level",
"... | Parses the information for a logger.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings
@param logPath
Key for the path of this logger.
@param logLevel
Key for the level of this logger. | [
"Parses",
"the",
"information",
"for",
"a",
"logger",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L727-L756 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseDebugConfig | private void parseDebugConfig(final Node node, final ConfigSettings config)
{
String name;
Boolean value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.... | java | private void parseDebugConfig(final Node node, final ConfigSettings config)
{
String name;
Boolean value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.... | [
"private",
"void",
"parseDebugConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Boolean",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
... | Parses the debug parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"debug",
"parameter",
"section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L766-L809 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseDebugOutputConfig | private void parseDebugOutputConfig(final Node node,
final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.e... | java | private void parseDebugOutputConfig(final Node node,
final ConfigSettings config)
{
String name, value;
Node nnode;
NodeList list = node.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.e... | [
"private",
"void",
"parseDebugOutputConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
",",
"value",
";",
"Node",
"nnode",
";",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
... | Parses the debug output parameter subsection.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"debug",
"output",
"parameter",
"subsection",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L819-L849 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/NestedListContainer.java | NestedListContainer.getNestedList | public NestedList getNestedList(int i){
if( i<lists.size() ) return lists.get(i);
else return null;
} | java | public NestedList getNestedList(int i){
if( i<lists.size() ) return lists.get(i);
else return null;
} | [
"public",
"NestedList",
"getNestedList",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"i",
"<",
"lists",
".",
"size",
"(",
")",
")",
"return",
"lists",
".",
"get",
"(",
"i",
")",
";",
"else",
"return",
"null",
";",
"}"
] | Returns the NestedListContainer or NestedListElement at Positon i. | [
"Returns",
"the",
"NestedListContainer",
"or",
"NestedListElement",
"at",
"Positon",
"i",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/NestedListContainer.java#L46-L49 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/LetterNode.java | LetterNode.add | public void add(final String word, final V value)
{
char c = word.charAt(0);
LetterNode<V> node = get(c);
if (node == null) {
node = new LetterNode<V>(this.word + c);
}
this.nodes.put(c, node);
if (word.length() == 1) {
node.isKeyword = true;
node.value = value;
return;
}
node.add(word.... | java | public void add(final String word, final V value)
{
char c = word.charAt(0);
LetterNode<V> node = get(c);
if (node == null) {
node = new LetterNode<V>(this.word + c);
}
this.nodes.put(c, node);
if (word.length() == 1) {
node.isKeyword = true;
node.value = value;
return;
}
node.add(word.... | [
"public",
"void",
"add",
"(",
"final",
"String",
"word",
",",
"final",
"V",
"value",
")",
"{",
"char",
"c",
"=",
"word",
".",
"charAt",
"(",
"0",
")",
";",
"LetterNode",
"<",
"V",
">",
"node",
"=",
"get",
"(",
"c",
")",
";",
"if",
"(",
"node",
... | Adds a word and its related value.
@param word
keyword
@param value
related value | [
"Adds",
"a",
"word",
"and",
"its",
"related",
"value",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/LetterNode.java#L77-L95 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffBlock.java | DiffBlock.compareTo | public int compareTo(final DiffBlock b)
{
if (ab) {
return this.revAStart - b.revAStart;
}
else {
return this.revBStart - b.revBStart;
}
} | java | public int compareTo(final DiffBlock b)
{
if (ab) {
return this.revAStart - b.revAStart;
}
else {
return this.revBStart - b.revBStart;
}
} | [
"public",
"int",
"compareTo",
"(",
"final",
"DiffBlock",
"b",
")",
"{",
"if",
"(",
"ab",
")",
"{",
"return",
"this",
".",
"revAStart",
"-",
"b",
".",
"revAStart",
";",
"}",
"else",
"{",
"return",
"this",
".",
"revBStart",
"-",
"b",
".",
"revBStart",
... | Compares the positions of both blocks.
@param b
Block | [
"Compares",
"the",
"positions",
"of",
"both",
"blocks",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffBlock.java#L84-L92 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationManager.java | ConfigurationManager.getInstance | public static ConfigurationManager getInstance()
throws ConfigurationException
{
if (instance == null) {
throw ErrorFactory
.createConfigurationException(ErrorKeys.CONFIGURATION_CONFIGURATIONMANAGER_NOT_INITIALIZED);
}
return instance;
} | java | public static ConfigurationManager getInstance()
throws ConfigurationException
{
if (instance == null) {
throw ErrorFactory
.createConfigurationException(ErrorKeys.CONFIGURATION_CONFIGURATIONMANAGER_NOT_INITIALIZED);
}
return instance;
} | [
"public",
"static",
"ConfigurationManager",
"getInstance",
"(",
")",
"throws",
"ConfigurationException",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"throw",
"ErrorFactory",
".",
"createConfigurationException",
"(",
"ErrorKeys",
".",
"CONFIGURATION_CONFIGURATION... | Returns the reference to the instance of the ConfigurationManager.
@return ConfigurationManager
@throws ConfigurationException
if the ConfigurationManager has not been created during the
startup of the application. | [
"Returns",
"the",
"reference",
"to",
"the",
"instance",
"of",
"the",
"ConfigurationManager",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationManager.java#L50-L59 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationManager.java | ConfigurationManager.getConfigParameter | public Object getConfigParameter(final ConfigurationKeys configParameter)
throws ConfigurationException
{
Object o = this.config.getConfigParameter(configParameter);
if (o != null) {
return o;
}
//return standard values for some of the parameters if they
//are not set in the configuration
//this is ... | java | public Object getConfigParameter(final ConfigurationKeys configParameter)
throws ConfigurationException
{
Object o = this.config.getConfigParameter(configParameter);
if (o != null) {
return o;
}
//return standard values for some of the parameters if they
//are not set in the configuration
//this is ... | [
"public",
"Object",
"getConfigParameter",
"(",
"final",
"ConfigurationKeys",
"configParameter",
")",
"throws",
"ConfigurationException",
"{",
"Object",
"o",
"=",
"this",
".",
"config",
".",
"getConfigParameter",
"(",
"configParameter",
")",
";",
"if",
"(",
"o",
"!... | Returns the value of the configuration parameter.
@param configParameter
Key for the configuration parameter.
@return Value of the configuration parameter
@throws ConfigurationException
if the configuration value was not defined or was not set. | [
"Returns",
"the",
"value",
"of",
"the",
"configuration",
"parameter",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationManager.java#L97-L143 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.