id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
48,800
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.getCanonicalFileFromFileUrl
public static File getCanonicalFileFromFileUrl(final URL url) { File file = null; if (url == null) { throw new NullPointerException("The URL cannot be null."); } if ("file".equals(url.getProtocol())) { final String fileName = url.getFile(); final Strin...
java
public static File getCanonicalFileFromFileUrl(final URL url) { File file = null; if (url == null) { throw new NullPointerException("The URL cannot be null."); } if ("file".equals(url.getProtocol())) { final String fileName = url.getFile(); final Strin...
[ "public", "static", "File", "getCanonicalFileFromFileUrl", "(", "final", "URL", "url", ")", "{", "File", "file", "=", "null", ";", "if", "(", "url", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"The URL cannot be null.\"", ")", ";", ...
On Windows names of files from network neighborhood must be corrected before open. @param url The file URL. @return The canonical or absolute file, or null if the protocol is not file.
[ "On", "Windows", "names", "of", "files", "from", "network", "neighborhood", "must", "be", "corrected", "before", "open", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L179-L198
48,801
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.correct
private static String correct(String url, final boolean forceCorrection) { if (url == null) { return null; } final String initialUrl = url; // If there is a % that means the URL was already corrected. if (!forceCorrection && url.contains("%")) { return i...
java
private static String correct(String url, final boolean forceCorrection) { if (url == null) { return null; } final String initialUrl = url; // If there is a % that means the URL was already corrected. if (!forceCorrection && url.contains("%")) { return i...
[ "private", "static", "String", "correct", "(", "String", "url", ",", "final", "boolean", "forceCorrection", ")", "{", "if", "(", "url", "==", "null", ")", "{", "return", "null", ";", "}", "final", "String", "initialUrl", "=", "url", ";", "// If there is a ...
Method introduced to correct the URLs in the default machine encoding. @param url The URL to be corrected. If it contains a % char, it means it already was corrected, so it will be returned. Take care at composing URLs from a corrected part and an uncorrected part. Correcting the result will not work. Try to correct fi...
[ "Method", "introduced", "to", "correct", "the", "URLs", "in", "the", "default", "machine", "encoding", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L216-L273
48,802
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.getURL
public static String getURL(final String fileName) { if (fileName.startsWith("file:/")) { return fileName; } else { final File file = new File(fileName); return file.toURI().toString(); } }
java
public static String getURL(final String fileName) { if (fileName.startsWith("file:/")) { return fileName; } else { final File file = new File(fileName); return file.toURI().toString(); } }
[ "public", "static", "String", "getURL", "(", "final", "String", "fileName", ")", "{", "if", "(", "fileName", ".", "startsWith", "(", "\"file:/\"", ")", ")", "{", "return", "fileName", ";", "}", "else", "{", "final", "File", "file", "=", "new", "File", ...
Convert a file name to url. @param fileName - The file name string. @return string - URL
[ "Convert", "a", "file", "name", "to", "url", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L282-L291
48,803
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.isAbsolute
public static boolean isAbsolute(final URI uri) { final String p = uri.getPath(); return p != null && p.startsWith(URI_SEPARATOR); }
java
public static boolean isAbsolute(final URI uri) { final String p = uri.getPath(); return p != null && p.startsWith(URI_SEPARATOR); }
[ "public", "static", "boolean", "isAbsolute", "(", "final", "URI", "uri", ")", "{", "final", "String", "p", "=", "uri", ".", "getPath", "(", ")", ";", "return", "p", "!=", "null", "&&", "p", ".", "startsWith", "(", "URI_SEPARATOR", ")", ";", "}" ]
Test if URI path is absolute.
[ "Test", "if", "URI", "path", "is", "absolute", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L427-L430
48,804
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.toFile
public static File toFile(final URI filename) { if (filename == null) { return null; } final URI f = stripFragment(filename); if ("file".equals(f.getScheme()) && f.getPath() != null && f.isAbsolute()) { return new File(f); } else { return toFil...
java
public static File toFile(final URI filename) { if (filename == null) { return null; } final URI f = stripFragment(filename); if ("file".equals(f.getScheme()) && f.getPath() != null && f.isAbsolute()) { return new File(f); } else { return toFil...
[ "public", "static", "File", "toFile", "(", "final", "URI", "filename", ")", "{", "if", "(", "filename", "==", "null", ")", "{", "return", "null", ";", "}", "final", "URI", "f", "=", "stripFragment", "(", "filename", ")", ";", "if", "(", "\"file\"", "...
Convert URI reference to system file path. @param filename URI to convert to system file path, may be relative or absolute @return file path, {@code null} if input was {@code null}
[ "Convert", "URI", "reference", "to", "system", "file", "path", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L438-L448
48,805
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.toFile
public static File toFile(final String filename) { if (filename == null) { return null; } String f; try { f = URLDecoder.decode(filename, UTF8); } catch (final UnsupportedEncodingException e) { throw new RuntimeException(e); } f...
java
public static File toFile(final String filename) { if (filename == null) { return null; } String f; try { f = URLDecoder.decode(filename, UTF8); } catch (final UnsupportedEncodingException e) { throw new RuntimeException(e); } f...
[ "public", "static", "File", "toFile", "(", "final", "String", "filename", ")", "{", "if", "(", "filename", "==", "null", ")", "{", "return", "null", ";", "}", "String", "f", ";", "try", "{", "f", "=", "URLDecoder", ".", "decode", "(", "filename", ","...
Convert URI or chimera references to file paths. @param filename file reference @return file path, {@code null} if input was {@code null}
[ "Convert", "URI", "or", "chimera", "references", "to", "file", "paths", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L456-L468
48,806
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.toURI
public static URI toURI(final String file) { if (file == null) { return null; } if (File.separatorChar == '\\' && file.indexOf('\\') != -1) { return toURI(new File(file)); } try { return new URI(file); } catch (final URISyntaxException ...
java
public static URI toURI(final String file) { if (file == null) { return null; } if (File.separatorChar == '\\' && file.indexOf('\\') != -1) { return toURI(new File(file)); } try { return new URI(file); } catch (final URISyntaxException ...
[ "public", "static", "URI", "toURI", "(", "final", "String", "file", ")", "{", "if", "(", "file", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "File", ".", "separatorChar", "==", "'", "'", "&&", "file", ".", "indexOf", "(", "'", ...
Covert file reference to URI. Fixes directory separators and escapes characters. @param file The string to be parsed into a URI, may be {@code null} @return URI from parsing the given string, {@code null} if input was {@code null}
[ "Covert", "file", "reference", "to", "URI", ".", "Fixes", "directory", "separators", "and", "escapes", "characters", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L499-L515
48,807
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.setFragment
public static URI setFragment(final URI path, final String fragment) { try { if (path.getPath() != null) { return new URI(path.getScheme(), path.getUserInfo(), path.getHost(), path.getPort(), path.getPath(), path.getQuery(), fragment); } else { return new ...
java
public static URI setFragment(final URI path, final String fragment) { try { if (path.getPath() != null) { return new URI(path.getScheme(), path.getUserInfo(), path.getHost(), path.getPort(), path.getPath(), path.getQuery(), fragment); } else { return new ...
[ "public", "static", "URI", "setFragment", "(", "final", "URI", "path", ",", "final", "String", "fragment", ")", "{", "try", "{", "if", "(", "path", ".", "getPath", "(", ")", "!=", "null", ")", "{", "return", "new", "URI", "(", "path", ".", "getScheme...
Create new URI with a given fragment. @param path URI to set fragment on @param fragment new fragment, {@code null} for no fragment @return new URI instance with given fragment
[ "Create", "new", "URI", "with", "a", "given", "fragment", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L551-L561
48,808
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.setPath
public static URI setPath(final URI orig, final String path) { try { return new URI(orig.getScheme(), orig.getUserInfo(), orig.getHost(), orig.getPort(), path, orig.getQuery(), orig.getFragment()); } catch (final URISyntaxException e) { throw new RuntimeException(e.getMessage(), ...
java
public static URI setPath(final URI orig, final String path) { try { return new URI(orig.getScheme(), orig.getUserInfo(), orig.getHost(), orig.getPort(), path, orig.getQuery(), orig.getFragment()); } catch (final URISyntaxException e) { throw new RuntimeException(e.getMessage(), ...
[ "public", "static", "URI", "setPath", "(", "final", "URI", "orig", ",", "final", "String", "path", ")", "{", "try", "{", "return", "new", "URI", "(", "orig", ".", "getScheme", "(", ")", ",", "orig", ".", "getUserInfo", "(", ")", ",", "orig", ".", "...
Create new URI with a given path. @param orig URI to set path on @param path new path, {@code null} for no path @return new URI instance with given path
[ "Create", "new", "URI", "with", "a", "given", "path", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L570-L576
48,809
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.setScheme
public static URI setScheme(final URI orig, final String scheme) { try { return new URI(scheme, orig.getUserInfo(), orig.getHost(), orig.getPort(), orig.getPath(), orig.getQuery(), orig.getFragment()); } catch (final URISyntaxException e) { throw new RuntimeException(e.getMessage...
java
public static URI setScheme(final URI orig, final String scheme) { try { return new URI(scheme, orig.getUserInfo(), orig.getHost(), orig.getPort(), orig.getPath(), orig.getQuery(), orig.getFragment()); } catch (final URISyntaxException e) { throw new RuntimeException(e.getMessage...
[ "public", "static", "URI", "setScheme", "(", "final", "URI", "orig", ",", "final", "String", "scheme", ")", "{", "try", "{", "return", "new", "URI", "(", "scheme", ",", "orig", ".", "getUserInfo", "(", ")", ",", "orig", ".", "getHost", "(", ")", ",",...
Create new URI with a given scheme. @param orig URI to set scheme on @param scheme new scheme, {@code null} for no scheme @return new URI instance with given path
[ "Create", "new", "URI", "with", "a", "given", "scheme", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L585-L591
48,810
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.getRelativePath
public static URI getRelativePath(final URI base, final URI ref) { final String baseScheme = base.getScheme(); final String refScheme = ref.getScheme(); final String baseAuth = base.getAuthority(); final String refAuth = ref.getAuthority(); if (!(((baseScheme == null && refScheme...
java
public static URI getRelativePath(final URI base, final URI ref) { final String baseScheme = base.getScheme(); final String refScheme = ref.getScheme(); final String baseAuth = base.getAuthority(); final String refAuth = ref.getAuthority(); if (!(((baseScheme == null && refScheme...
[ "public", "static", "URI", "getRelativePath", "(", "final", "URI", "base", ",", "final", "URI", "ref", ")", "{", "final", "String", "baseScheme", "=", "base", ".", "getScheme", "(", ")", ";", "final", "String", "refScheme", "=", "ref", ".", "getScheme", ...
Resolves absolute URI against another absolute URI. @param base absolute base file URI @param ref absolute reference file URI @return relative URI if possible, otherwise original reference file URI argument
[ "Resolves", "absolute", "URI", "against", "another", "absolute", "URI", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L600-L666
48,811
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.setElementID
public static URI setElementID(final URI relativePath, final String id) { String topic = getTopicID(relativePath); if (topic != null) { return setFragment(relativePath, topic + (id != null ? SLASH + id : "")); } else if (id == null) { return stripFragment(relativePath); ...
java
public static URI setElementID(final URI relativePath, final String id) { String topic = getTopicID(relativePath); if (topic != null) { return setFragment(relativePath, topic + (id != null ? SLASH + id : "")); } else if (id == null) { return stripFragment(relativePath); ...
[ "public", "static", "URI", "setElementID", "(", "final", "URI", "relativePath", ",", "final", "String", "id", ")", "{", "String", "topic", "=", "getTopicID", "(", "relativePath", ")", ";", "if", "(", "topic", "!=", "null", ")", "{", "return", "setFragment"...
Set the element ID from the path @param relativePath path @param id element ID @return element ID, may be {@code null}
[ "Set", "the", "element", "ID", "from", "the", "path" ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L722-L731
48,812
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.getElementID
public static String getElementID(final String relativePath) { final String fragment = FileUtils.getFragment(relativePath); if (fragment != null) { if (fragment.lastIndexOf(SLASH) != -1) { final String id = fragment.substring(fragment.lastIndexOf(SLASH) + 1); ...
java
public static String getElementID(final String relativePath) { final String fragment = FileUtils.getFragment(relativePath); if (fragment != null) { if (fragment.lastIndexOf(SLASH) != -1) { final String id = fragment.substring(fragment.lastIndexOf(SLASH) + 1); ...
[ "public", "static", "String", "getElementID", "(", "final", "String", "relativePath", ")", "{", "final", "String", "fragment", "=", "FileUtils", ".", "getFragment", "(", "relativePath", ")", ";", "if", "(", "fragment", "!=", "null", ")", "{", "if", "(", "f...
Retrieve the element ID from the path @param relativePath path @return element ID, may be {@code null}
[ "Retrieve", "the", "element", "ID", "from", "the", "path" ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L739-L748
48,813
dita-ot/dita-ot
src/main/java/org/dita/dost/util/URLUtils.java
URLUtils.getTopicID
public static String getTopicID(final URI relativePath) { final String fragment = relativePath.getFragment(); if (fragment != null) { final String id = fragment.lastIndexOf(SLASH) != -1 ? fragment.substring(0, fragment.lastIndexOf(SLASH)) ...
java
public static String getTopicID(final URI relativePath) { final String fragment = relativePath.getFragment(); if (fragment != null) { final String id = fragment.lastIndexOf(SLASH) != -1 ? fragment.substring(0, fragment.lastIndexOf(SLASH)) ...
[ "public", "static", "String", "getTopicID", "(", "final", "URI", "relativePath", ")", "{", "final", "String", "fragment", "=", "relativePath", ".", "getFragment", "(", ")", ";", "if", "(", "fragment", "!=", "null", ")", "{", "final", "String", "id", "=", ...
Retrieve the topic ID from the path @param relativePath path @return topic ID, may be {@code null}
[ "Retrieve", "the", "topic", "ID", "from", "the", "path" ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L756-L765
48,814
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.join
@SuppressWarnings("rawtypes") public static String join(final Collection coll, final String delim) { final StringBuilder buff = new StringBuilder(256); Iterator iter; if ((coll == null) || coll.isEmpty()) { return ""; } iter = coll.iterator(); while (ite...
java
@SuppressWarnings("rawtypes") public static String join(final Collection coll, final String delim) { final StringBuilder buff = new StringBuilder(256); Iterator iter; if ((coll == null) || coll.isEmpty()) { return ""; } iter = coll.iterator(); while (ite...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "public", "static", "String", "join", "(", "final", "Collection", "coll", ",", "final", "String", "delim", ")", "{", "final", "StringBuilder", "buff", "=", "new", "StringBuilder", "(", "256", ")", ";", "Iter...
Assemble all elements in collection to a string. @param coll - java.util.List @param delim - Description of the Parameter @return java.lang.String
[ "Assemble", "all", "elements", "in", "collection", "to", "a", "string", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L42-L61
48,815
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.join
@SuppressWarnings({ "rawtypes", "unchecked" }) public static String join(final Map value, final String delim) { if (value == null || value.isEmpty()) { return ""; } final StringBuilder buf = new StringBuilder(); for (final Iterator<Map.Entry<String, String>> i = value.ent...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public static String join(final Map value, final String delim) { if (value == null || value.isEmpty()) { return ""; } final StringBuilder buf = new StringBuilder(); for (final Iterator<Map.Entry<String, String>> i = value.ent...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "static", "String", "join", "(", "final", "Map", "value", ",", "final", "String", "delim", ")", "{", "if", "(", "value", "==", "null", "||", "value", ".", "isEmp...
Assemble all elements in map to a string. @param value map to serializer @param delim entry delimiter @return concatenated map
[ "Assemble", "all", "elements", "in", "map", "to", "a", "string", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L70-L84
48,816
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.replaceAll
public static String replaceAll(final String input, final String pattern, final String replacement) { final StringBuilder result = new StringBuilder(); int startIndex = 0; int newIndex; while ((newIndex = input.indexOf(pattern, startIndex)) >= 0) { result.append(...
java
public static String replaceAll(final String input, final String pattern, final String replacement) { final StringBuilder result = new StringBuilder(); int startIndex = 0; int newIndex; while ((newIndex = input.indexOf(pattern, startIndex)) >= 0) { result.append(...
[ "public", "static", "String", "replaceAll", "(", "final", "String", "input", ",", "final", "String", "pattern", ",", "final", "String", "replacement", ")", "{", "final", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "int", "startIndex"...
Replaces each substring of this string that matches the given string with the given replacement. Differ from the JDK String.replaceAll function, this method does not support regular expression based replacement on purpose. @param input input string @param pattern This pattern is recognized as it is. It will not solve ...
[ "Replaces", "each", "substring", "of", "this", "string", "that", "matches", "the", "given", "string", "with", "the", "given", "replacement", ".", "Differ", "from", "the", "JDK", "String", ".", "replaceAll", "function", "this", "method", "does", "not", "support...
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L98-L113
48,817
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.setOrAppend
public static String setOrAppend(final String target, final String value, final boolean withSpace) { if (target == null) { return value; }if(value == null) { return target; } else { if (withSpace && !target.endsWith(STRING_BLANK)) { return targ...
java
public static String setOrAppend(final String target, final String value, final boolean withSpace) { if (target == null) { return value; }if(value == null) { return target; } else { if (withSpace && !target.endsWith(STRING_BLANK)) { return targ...
[ "public", "static", "String", "setOrAppend", "(", "final", "String", "target", ",", "final", "String", "value", ",", "final", "boolean", "withSpace", ")", "{", "if", "(", "target", "==", "null", ")", "{", "return", "value", ";", "}", "if", "(", "value", ...
If target is null, return the value; else append value to target. If withSpace is true, insert a blank between them. @param target target to be appended @param value value to append @param withSpace whether insert a blank @return processed string
[ "If", "target", "is", "null", "return", "the", "value", ";", "else", "append", "value", "to", "target", ".", "If", "withSpace", "is", "true", "insert", "a", "blank", "between", "them", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L179-L191
48,818
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.getLocale
public static Locale getLocale(final String anEncoding) { Locale aLocale = null; String country = null; String language = null; String variant; //Tokenize the string using "-" as the token string as per IETF RFC4646 (superceeds RFC3066). final StringTokenizer tokenizer ...
java
public static Locale getLocale(final String anEncoding) { Locale aLocale = null; String country = null; String language = null; String variant; //Tokenize the string using "-" as the token string as per IETF RFC4646 (superceeds RFC3066). final StringTokenizer tokenizer ...
[ "public", "static", "Locale", "getLocale", "(", "final", "String", "anEncoding", ")", "{", "Locale", "aLocale", "=", "null", ";", "String", "country", "=", "null", ";", "String", "language", "=", "null", ";", "String", "variant", ";", "//Tokenize the string us...
Return a Java Locale object. @param anEncoding encoding @return locale @throws NullPointerException when anEncoding parameter is {@code null}
[ "Return", "a", "Java", "Locale", "object", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L200-L275
48,819
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.escapeRegExp
public static String escapeRegExp(final String value) { final StringBuilder buff = new StringBuilder(); if (value == null || value.length() == 0) { return ""; } int index = 0; // $( )+.[^{\ while (index < value.length()) { final char current = valu...
java
public static String escapeRegExp(final String value) { final StringBuilder buff = new StringBuilder(); if (value == null || value.length() == 0) { return ""; } int index = 0; // $( )+.[^{\ while (index < value.length()) { final char current = valu...
[ "public", "static", "String", "escapeRegExp", "(", "final", "String", "value", ")", "{", "final", "StringBuilder", "buff", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "value", "==", "null", "||", "value", ".", "length", "(", ")", "==", "0", ...
Escape regular expression special characters. @param value input @return input with regular expression special characters escaped
[ "Escape", "regular", "expression", "special", "characters", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L283-L334
48,820
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.normalizeAndCollapseWhitespace
public static void normalizeAndCollapseWhitespace(final StringBuilder strBuffer) { WhiteSpaceState currentState = WhiteSpaceState.WORD; for (int i = strBuffer.length() - 1; i >= 0; i--) { final char currentChar = strBuffer.charAt(i); if (Character.isWhitespace(currentChar)) { ...
java
public static void normalizeAndCollapseWhitespace(final StringBuilder strBuffer) { WhiteSpaceState currentState = WhiteSpaceState.WORD; for (int i = strBuffer.length() - 1; i >= 0; i--) { final char currentChar = strBuffer.charAt(i); if (Character.isWhitespace(currentChar)) { ...
[ "public", "static", "void", "normalizeAndCollapseWhitespace", "(", "final", "StringBuilder", "strBuffer", ")", "{", "WhiteSpaceState", "currentState", "=", "WhiteSpaceState", ".", "WORD", ";", "for", "(", "int", "i", "=", "strBuffer", ".", "length", "(", ")", "-...
Normalize and collapse whitespaces from string buffer. @param strBuffer The string buffer.
[ "Normalize", "and", "collapse", "whitespaces", "from", "string", "buffer", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L344-L359
48,821
dita-ot/dita-ot
src/main/java/org/dita/dost/util/StringUtils.java
StringUtils.split
public static Collection<String> split(final String value) { if (value == null) { return Collections.emptyList(); } final String[] tokens = value.trim().split("\\s+"); return asList(tokens); }
java
public static Collection<String> split(final String value) { if (value == null) { return Collections.emptyList(); } final String[] tokens = value.trim().split("\\s+"); return asList(tokens); }
[ "public", "static", "Collection", "<", "String", ">", "split", "(", "final", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "final", "String", "[", "]", "tokens", ...
Split string by whitespace. @param value string to split @return list of tokens
[ "Split", "string", "by", "whitespace", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/StringUtils.java#L367-L373
48,822
dita-ot/dita-ot
src/main/java/org/dita/dost/module/ImageMetadataModule.java
ImageMetadataModule.execute
@Override public AbstractPipelineOutput execute(final AbstractPipelineInput input) throws DITAOTException { if (logger == null) { throw new IllegalStateException("Logger not set"); } final Collection<FileInfo> images = job.getFileInfo(f -> ATTR_FORMAT_VALUE_IMAGE.equa...
java
@Override public AbstractPipelineOutput execute(final AbstractPipelineInput input) throws DITAOTException { if (logger == null) { throw new IllegalStateException("Logger not set"); } final Collection<FileInfo> images = job.getFileInfo(f -> ATTR_FORMAT_VALUE_IMAGE.equa...
[ "@", "Override", "public", "AbstractPipelineOutput", "execute", "(", "final", "AbstractPipelineInput", "input", ")", "throws", "DITAOTException", "{", "if", "(", "logger", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Logger not set\"", ")...
Entry point of image metadata ModuleElem. @param input Input parameters and resources. @return null @throws DITAOTException exception
[ "Entry", "point", "of", "image", "metadata", "ModuleElem", "." ]
ea776b3c60c03d9f033b6f7ea072349e49dbcdd2
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/ImageMetadataModule.java#L43-L72
48,823
apiman/apiman
manager/api/beans/src/main/java/io/apiman/manager/api/beans/BeanUtils.java
BeanUtils.idFromName
public static final String idFromName(String name) { Transliterator tr = Transliterator.getInstance("Any-Latin; Latin-ASCII"); //$NON-NLS-1$ return removeNonWord(tr.transliterate(name)); }
java
public static final String idFromName(String name) { Transliterator tr = Transliterator.getInstance("Any-Latin; Latin-ASCII"); //$NON-NLS-1$ return removeNonWord(tr.transliterate(name)); }
[ "public", "static", "final", "String", "idFromName", "(", "String", "name", ")", "{", "Transliterator", "tr", "=", "Transliterator", ".", "getInstance", "(", "\"Any-Latin; Latin-ASCII\"", ")", ";", "//$NON-NLS-1$", "return", "removeNonWord", "(", "tr", ".", "trans...
Creates a bean id from the given bean name. @param name the name @return the id
[ "Creates", "a", "bean", "id", "from", "the", "given", "bean", "name", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/beans/src/main/java/io/apiman/manager/api/beans/BeanUtils.java#L35-L38
48,824
apiman/apiman
gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ok/HttpURLConnectionImpl.java
HttpURLConnectionImpl.getResponse
private HttpEngine getResponse() throws IOException { initHttpEngine(); if (httpEngine.hasResponse()) { return httpEngine; } while (true) { if (!execute(true)) { continue; } Response response = httpEngine.getResponse(); Request followUp = httpEngine.followUpReque...
java
private HttpEngine getResponse() throws IOException { initHttpEngine(); if (httpEngine.hasResponse()) { return httpEngine; } while (true) { if (!execute(true)) { continue; } Response response = httpEngine.getResponse(); Request followUp = httpEngine.followUpReque...
[ "private", "HttpEngine", "getResponse", "(", ")", "throws", "IOException", "{", "initHttpEngine", "(", ")", ";", "if", "(", "httpEngine", ".", "hasResponse", "(", ")", ")", "{", "return", "httpEngine", ";", "}", "while", "(", "true", ")", "{", "if", "(",...
Aggressively tries to get the final HTTP response, potentially making many HTTP requests in the process in order to cope with redirects and authentication.
[ "Aggressively", "tries", "to", "get", "the", "final", "HTTP", "response", "potentially", "making", "many", "HTTP", "requests", "in", "the", "process", "in", "order", "to", "cope", "with", "redirects", "and", "authentication", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ok/HttpURLConnectionImpl.java#L378-L426
48,825
apiman/apiman
gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ok/HttpURLConnectionImpl.java
HttpURLConnectionImpl.execute
private boolean execute(boolean readResponse) throws IOException { try { httpEngine.sendRequest(); route = httpEngine.getRoute(); handshake = httpEngine.getConnection() != null ? httpEngine.getConnection().getHandshake() : null; if (readResponse) { httpEngine.read...
java
private boolean execute(boolean readResponse) throws IOException { try { httpEngine.sendRequest(); route = httpEngine.getRoute(); handshake = httpEngine.getConnection() != null ? httpEngine.getConnection().getHandshake() : null; if (readResponse) { httpEngine.read...
[ "private", "boolean", "execute", "(", "boolean", "readResponse", ")", "throws", "IOException", "{", "try", "{", "httpEngine", ".", "sendRequest", "(", ")", ";", "route", "=", "httpEngine", ".", "getRoute", "(", ")", ";", "handshake", "=", "httpEngine", ".", ...
Sends a request and optionally reads a response. Returns true if the request was successfully executed, and false if the request can be retried. Throws an exception if the request failed permanently.
[ "Sends", "a", "request", "and", "optionally", "reads", "a", "response", ".", "Returns", "true", "if", "the", "request", "was", "successfully", "executed", "and", "false", "if", "the", "request", "can", "be", "retried", ".", "Throws", "an", "exception", "if",...
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/ok/HttpURLConnectionImpl.java#L433-L474
48,826
apiman/apiman
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/components/ldap/LdapClientConnectionImpl.java
LdapClientConnectionImpl.close
@Override public void close(IAsyncResultHandler<Void> result) { vertx.executeBlocking(blocking -> { super.close(result); }, res -> { if (res.failed()) result.handle(AsyncResultImpl.create(res.cause())); }); }
java
@Override public void close(IAsyncResultHandler<Void> result) { vertx.executeBlocking(blocking -> { super.close(result); }, res -> { if (res.failed()) result.handle(AsyncResultImpl.create(res.cause())); }); }
[ "@", "Override", "public", "void", "close", "(", "IAsyncResultHandler", "<", "Void", ">", "result", ")", "{", "vertx", ".", "executeBlocking", "(", "blocking", "->", "{", "super", ".", "close", "(", "result", ")", ";", "}", ",", "res", "->", "{", "if",...
Indicates whether connection was successfully closed. @param result the result
[ "Indicates", "whether", "connection", "was", "successfully", "closed", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/components/ldap/LdapClientConnectionImpl.java#L51-L59
48,827
apiman/apiman
gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/URILoadingRegistry.java
URILoadingRegistry.reloadData
public static void reloadData(IAsyncHandler<Void> doneHandler) { synchronized(URILoadingRegistry.class) { if (instance == null) { doneHandler.handle((Void) null); return; } Map<URILoadingRegistry, IAsyncResultHandler<Void>> regs = instance.hand...
java
public static void reloadData(IAsyncHandler<Void> doneHandler) { synchronized(URILoadingRegistry.class) { if (instance == null) { doneHandler.handle((Void) null); return; } Map<URILoadingRegistry, IAsyncResultHandler<Void>> regs = instance.hand...
[ "public", "static", "void", "reloadData", "(", "IAsyncHandler", "<", "Void", ">", "doneHandler", ")", "{", "synchronized", "(", "URILoadingRegistry", ".", "class", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "doneHandler", ".", "handle", "(", ...
For testing only. Reloads rather than full restart.
[ "For", "testing", "only", ".", "Reloads", "rather", "than", "full", "restart", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/vertx-polling/src/main/java/io/apiman/gateway/engine/vertx/polling/URILoadingRegistry.java#L103-L127
48,828
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/TransferQuotaPolicy.java
TransferQuotaPolicy.doQuotaExceededFailure
protected void doQuotaExceededFailure(final IPolicyContext context, final TransferQuotaConfig config, final IPolicyChain<?> chain, RateLimitResponse rtr) { Map<String, String> responseHeaders = RateLimitingPolicy.responseHeaders(config, rtr, defaultLimitHeader(), defaultRemainingHead...
java
protected void doQuotaExceededFailure(final IPolicyContext context, final TransferQuotaConfig config, final IPolicyChain<?> chain, RateLimitResponse rtr) { Map<String, String> responseHeaders = RateLimitingPolicy.responseHeaders(config, rtr, defaultLimitHeader(), defaultRemainingHead...
[ "protected", "void", "doQuotaExceededFailure", "(", "final", "IPolicyContext", "context", ",", "final", "TransferQuotaConfig", "config", ",", "final", "IPolicyChain", "<", "?", ">", "chain", ",", "RateLimitResponse", "rtr", ")", "{", "Map", "<", "String", ",", "...
Called to send a 'quota exceeded' failure. @param context @param config @param chain @param rtr
[ "Called", "to", "send", "a", "quota", "exceeded", "failure", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/TransferQuotaPolicy.java#L268-L277
48,829
apiman/apiman
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaUtil.java
JpaUtil.isConstraintViolation
public static boolean isConstraintViolation(Exception e) { Throwable cause = e; while (cause != cause.getCause() && cause.getCause() != null) { if (cause.getClass().getSimpleName().equals("ConstraintViolationException")) //$NON-NLS-1$ return true; cause = cause.ge...
java
public static boolean isConstraintViolation(Exception e) { Throwable cause = e; while (cause != cause.getCause() && cause.getCause() != null) { if (cause.getClass().getSimpleName().equals("ConstraintViolationException")) //$NON-NLS-1$ return true; cause = cause.ge...
[ "public", "static", "boolean", "isConstraintViolation", "(", "Exception", "e", ")", "{", "Throwable", "cause", "=", "e", ";", "while", "(", "cause", "!=", "cause", ".", "getCause", "(", ")", "&&", "cause", ".", "getCause", "(", ")", "!=", "null", ")", ...
Returns true if the given exception is a unique constraint violation. This is useful to detect whether someone is trying to persist an entity that already exists. It allows us to simply assume that persisting a new entity will work, without first querying the DB for the existence of that entity. Note that my underst...
[ "Returns", "true", "if", "the", "given", "exception", "is", "a", "unique", "constraint", "violation", ".", "This", "is", "useful", "to", "detect", "whether", "someone", "is", "trying", "to", "persist", "an", "entity", "that", "already", "exists", ".", "It", ...
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaUtil.java#L49-L57
48,830
apiman/apiman
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaUtil.java
JpaUtil.rollbackQuietly
public static void rollbackQuietly(EntityManager entityManager) { if (entityManager.getTransaction().isActive()/* && entityManager.getTransaction().getRollbackOnly()*/) { try { entityManager.getTransaction().rollback(); } catch (Exception e) { logger.error...
java
public static void rollbackQuietly(EntityManager entityManager) { if (entityManager.getTransaction().isActive()/* && entityManager.getTransaction().getRollbackOnly()*/) { try { entityManager.getTransaction().rollback(); } catch (Exception e) { logger.error...
[ "public", "static", "void", "rollbackQuietly", "(", "EntityManager", "entityManager", ")", "{", "if", "(", "entityManager", ".", "getTransaction", "(", ")", ".", "isActive", "(", ")", "/* && entityManager.getTransaction().getRollbackOnly()*/", ")", "{", "try", "{", ...
Rolls back a transaction. Tries to be smart and quiet about it. @param entityManager the entity manager
[ "Rolls", "back", "a", "transaction", ".", "Tries", "to", "be", "smart", "and", "quiet", "about", "it", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaUtil.java#L63-L71
48,831
apiman/apiman
gateway/platforms/war/src/main/java/io/apiman/gateway/platforms/war/WarEngineConfig.java
WarEngineConfig.getConfigProperty
public String getConfigProperty(String propertyName, String defaultValue) { return getConfig().getString(propertyName, defaultValue); }
java
public String getConfigProperty(String propertyName, String defaultValue) { return getConfig().getString(propertyName, defaultValue); }
[ "public", "String", "getConfigProperty", "(", "String", "propertyName", ",", "String", "defaultValue", ")", "{", "return", "getConfig", "(", ")", ".", "getString", "(", "propertyName", ",", "defaultValue", ")", ";", "}" ]
Returns the given configuration property name or the provided default value if not found. @param propertyName the property name @param defaultValue the default value @return the config property
[ "Returns", "the", "given", "configuration", "property", "name", "or", "the", "provided", "default", "value", "if", "not", "found", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/war/src/main/java/io/apiman/gateway/platforms/war/WarEngineConfig.java#L86-L88
48,832
apiman/apiman
manager/api/security/src/main/java/io/apiman/manager/api/security/impl/AbstractSecurityContext.java
AbstractSecurityContext.loadPermissions
private IndexedPermissions loadPermissions() { String userId = getCurrentUser(); try { return new IndexedPermissions(getQuery().getPermissions(userId)); } catch (StorageException e) { logger.error(Messages.getString("AbstractSecurityContext.ErrorLoadingPermissions") + use...
java
private IndexedPermissions loadPermissions() { String userId = getCurrentUser(); try { return new IndexedPermissions(getQuery().getPermissions(userId)); } catch (StorageException e) { logger.error(Messages.getString("AbstractSecurityContext.ErrorLoadingPermissions") + use...
[ "private", "IndexedPermissions", "loadPermissions", "(", ")", "{", "String", "userId", "=", "getCurrentUser", "(", ")", ";", "try", "{", "return", "new", "IndexedPermissions", "(", "getQuery", "(", ")", ".", "getPermissions", "(", "userId", ")", ")", ";", "}...
Loads the current user's permissions into a thread local variable.
[ "Loads", "the", "current", "user", "s", "permissions", "into", "a", "thread", "local", "variable", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/security/src/main/java/io/apiman/manager/api/security/impl/AbstractSecurityContext.java#L97-L105
48,833
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultJdbcComponent.java
DefaultJdbcComponent.datasourceFromConfig
@SuppressWarnings("nls") protected DataSource datasourceFromConfig(JdbcOptionsBean config) { Properties props = new Properties(); props.putAll(config.getDsProperties()); setConfigProperty(props, "jdbcUrl", config.getJdbcUrl()); setConfigProperty(props, "username", config.getUsername(...
java
@SuppressWarnings("nls") protected DataSource datasourceFromConfig(JdbcOptionsBean config) { Properties props = new Properties(); props.putAll(config.getDsProperties()); setConfigProperty(props, "jdbcUrl", config.getJdbcUrl()); setConfigProperty(props, "username", config.getUsername(...
[ "@", "SuppressWarnings", "(", "\"nls\"", ")", "protected", "DataSource", "datasourceFromConfig", "(", "JdbcOptionsBean", "config", ")", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "props", ".", "putAll", "(", "config", ".", "getDsPropert...
Creates a datasource from the given jdbc config info.
[ "Creates", "a", "datasource", "from", "the", "given", "jdbc", "config", "info", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultJdbcComponent.java#L84-L102
48,834
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultJdbcComponent.java
DefaultJdbcComponent.setConfigProperty
private void setConfigProperty(Properties props, String propName, Object value) { if (value != null) { props.setProperty(propName, String.valueOf(value)); } }
java
private void setConfigProperty(Properties props, String propName, Object value) { if (value != null) { props.setProperty(propName, String.valueOf(value)); } }
[ "private", "void", "setConfigProperty", "(", "Properties", "props", ",", "String", "propName", ",", "Object", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "props", ".", "setProperty", "(", "propName", ",", "String", ".", "valueOf", "(", ...
Sets a configuration property, but only if it's not null.
[ "Sets", "a", "configuration", "property", "but", "only", "if", "it", "s", "not", "null", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultJdbcComponent.java#L107-L111
48,835
apiman/apiman
common/util/src/main/java/io/apiman/common/util/AbstractMessages.java
AbstractMessages.getBundle
private ResourceBundle getBundle() { String bundleKey = getBundleKey(); if (bundles.containsKey(bundleKey)) { return bundles.get(bundleKey); } else { ResourceBundle bundle = loadBundle(); bundles.put(bundleKey, bundle); return bundle; } ...
java
private ResourceBundle getBundle() { String bundleKey = getBundleKey(); if (bundles.containsKey(bundleKey)) { return bundles.get(bundleKey); } else { ResourceBundle bundle = loadBundle(); bundles.put(bundleKey, bundle); return bundle; } ...
[ "private", "ResourceBundle", "getBundle", "(", ")", "{", "String", "bundleKey", "=", "getBundleKey", "(", ")", ";", "if", "(", "bundles", ".", "containsKey", "(", "bundleKey", ")", ")", "{", "return", "bundles", ".", "get", "(", "bundleKey", ")", ";", "}...
Gets a bundle. First tries to find one in the cache, then loads it if it can't find one.
[ "Gets", "a", "bundle", ".", "First", "tries", "to", "find", "one", "in", "the", "cache", "then", "loads", "it", "if", "it", "can", "t", "find", "one", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/AbstractMessages.java#L61-L70
48,836
apiman/apiman
common/util/src/main/java/io/apiman/common/util/AbstractMessages.java
AbstractMessages.loadBundle
private ResourceBundle loadBundle() { String pkg = clazz.getPackage().getName(); Locale locale = getLocale(); return PropertyResourceBundle.getBundle(pkg + ".messages", locale, clazz.getClassLoader(), new ResourceBundle.Control() { //$NON-NLS-1$ @Override public List<Stri...
java
private ResourceBundle loadBundle() { String pkg = clazz.getPackage().getName(); Locale locale = getLocale(); return PropertyResourceBundle.getBundle(pkg + ".messages", locale, clazz.getClassLoader(), new ResourceBundle.Control() { //$NON-NLS-1$ @Override public List<Stri...
[ "private", "ResourceBundle", "loadBundle", "(", ")", "{", "String", "pkg", "=", "clazz", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ";", "Locale", "locale", "=", "getLocale", "(", ")", ";", "return", "PropertyResourceBundle", ".", "getBundle", ...
Loads the resource bundle. @param c
[ "Loads", "the", "resource", "bundle", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/AbstractMessages.java#L85-L94
48,837
apiman/apiman
common/util/src/main/java/io/apiman/common/util/AbstractMessages.java
AbstractMessages.format
public String format(String key, Object ... params) { ResourceBundle bundle = getBundle(); if (bundle.containsKey(key)) { String msg = bundle.getString(key); return MessageFormat.format(msg, params); } else { return MessageFormat.format("!!{0}!!", key); //$NON...
java
public String format(String key, Object ... params) { ResourceBundle bundle = getBundle(); if (bundle.containsKey(key)) { String msg = bundle.getString(key); return MessageFormat.format(msg, params); } else { return MessageFormat.format("!!{0}!!", key); //$NON...
[ "public", "String", "format", "(", "String", "key", ",", "Object", "...", "params", ")", "{", "ResourceBundle", "bundle", "=", "getBundle", "(", ")", ";", "if", "(", "bundle", ".", "containsKey", "(", "key", ")", ")", "{", "String", "msg", "=", "bundle...
Look up a message in the i18n resource message bundle by key, then format the message with the given params and return the result. @param key the key @param params the parameters @return formatted string
[ "Look", "up", "a", "message", "in", "the", "i18n", "resource", "message", "bundle", "by", "key", "then", "format", "the", "message", "with", "the", "given", "params", "and", "return", "the", "result", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/AbstractMessages.java#L116-L124
48,838
apiman/apiman
gateway/engine/influxdb/src/main/java/io/apiman/gateway/engine/influxdb/InfluxDb09Driver.java
InfluxDb09Driver.listDatabases
@SuppressWarnings("nls") public void listDatabases(final IAsyncResultHandler<List<String>> handler) { IHttpClientRequest request = httpClient.request(queryUrl.toString(), HttpMethod.GET, result -> { try { if (result.isError() || result.getResult()...
java
@SuppressWarnings("nls") public void listDatabases(final IAsyncResultHandler<List<String>> handler) { IHttpClientRequest request = httpClient.request(queryUrl.toString(), HttpMethod.GET, result -> { try { if (result.isError() || result.getResult()...
[ "@", "SuppressWarnings", "(", "\"nls\"", ")", "public", "void", "listDatabases", "(", "final", "IAsyncResultHandler", "<", "List", "<", "String", ">", ">", "handler", ")", "{", "IHttpClientRequest", "request", "=", "httpClient", ".", "request", "(", "queryUrl", ...
List all databases @param handler the result handler
[ "List", "all", "databases" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/influxdb/src/main/java/io/apiman/gateway/engine/influxdb/InfluxDb09Driver.java#L111-L141
48,839
apiman/apiman
manager/api/war/src/main/java/io/apiman/manager/api/war/WarCdiFactory.java
WarCdiFactory.createCustomComponent
@SuppressWarnings("unchecked") private static <T> T createCustomComponent(Class<T> componentType, Class<?> componentClass, Map<String, String> configProperties) throws Exception { if (componentClass == null) { throw new IllegalArgumentException("Invalid component spec (class not foun...
java
@SuppressWarnings("unchecked") private static <T> T createCustomComponent(Class<T> componentType, Class<?> componentClass, Map<String, String> configProperties) throws Exception { if (componentClass == null) { throw new IllegalArgumentException("Invalid component spec (class not foun...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "T", ">", "T", "createCustomComponent", "(", "Class", "<", "T", ">", "componentType", ",", "Class", "<", "?", ">", "componentClass", ",", "Map", "<", "String", ",", "String", ">"...
Creates a custom component from a loaded class. @param componentType @param componentClass @param configProperties
[ "Creates", "a", "custom", "component", "from", "a", "loaded", "class", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/war/src/main/java/io/apiman/manager/api/war/WarCdiFactory.java#L370-L382
48,840
apiman/apiman
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaStorageInitializer.java
JpaStorageInitializer.lookupDS
private static DataSource lookupDS(String dsJndiLocation) { DataSource ds; try { InitialContext ctx = new InitialContext(); ds = (DataSource) ctx.lookup(dsJndiLocation); } catch (Exception e) { throw new RuntimeException(e); } if (ds == null) ...
java
private static DataSource lookupDS(String dsJndiLocation) { DataSource ds; try { InitialContext ctx = new InitialContext(); ds = (DataSource) ctx.lookup(dsJndiLocation); } catch (Exception e) { throw new RuntimeException(e); } if (ds == null) ...
[ "private", "static", "DataSource", "lookupDS", "(", "String", "dsJndiLocation", ")", "{", "DataSource", "ds", ";", "try", "{", "InitialContext", "ctx", "=", "new", "InitialContext", "(", ")", ";", "ds", "=", "(", "DataSource", ")", "ctx", ".", "lookup", "(...
Lookup the datasource in JNDI. @param dsJndiLocation
[ "Lookup", "the", "datasource", "in", "JNDI", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaStorageInitializer.java#L102-L115
48,841
apiman/apiman
common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java
PluginClassLoader.createWorkDir
protected File createWorkDir(File pluginArtifactFile) throws IOException { File tempDir = File.createTempFile(pluginArtifactFile.getName(), ""); tempDir.delete(); tempDir.mkdirs(); return tempDir; }
java
protected File createWorkDir(File pluginArtifactFile) throws IOException { File tempDir = File.createTempFile(pluginArtifactFile.getName(), ""); tempDir.delete(); tempDir.mkdirs(); return tempDir; }
[ "protected", "File", "createWorkDir", "(", "File", "pluginArtifactFile", ")", "throws", "IOException", "{", "File", "tempDir", "=", "File", ".", "createTempFile", "(", "pluginArtifactFile", ".", "getName", "(", ")", ",", "\"\"", ")", ";", "tempDir", ".", "dele...
Creates a work directory into which various resources discovered in the plugin artifact can be extracted. @param pluginArtifactFile plugin artifact @throws IOException if an I/O error has occurred
[ "Creates", "a", "work", "directory", "into", "which", "various", "resources", "discovered", "in", "the", "plugin", "artifact", "can", "be", "extracted", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java#L81-L86
48,842
apiman/apiman
common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java
PluginClassLoader.indexPluginArtifact
private void indexPluginArtifact() throws IOException { dependencyZips = new ArrayList<>(); Enumeration<? extends ZipEntry> entries = this.pluginArtifactZip.entries(); while (entries.hasMoreElements()) { ZipEntry zipEntry = entries.nextElement(); if (zipEntry.getName().st...
java
private void indexPluginArtifact() throws IOException { dependencyZips = new ArrayList<>(); Enumeration<? extends ZipEntry> entries = this.pluginArtifactZip.entries(); while (entries.hasMoreElements()) { ZipEntry zipEntry = entries.nextElement(); if (zipEntry.getName().st...
[ "private", "void", "indexPluginArtifact", "(", ")", "throws", "IOException", "{", "dependencyZips", "=", "new", "ArrayList", "<>", "(", ")", ";", "Enumeration", "<", "?", "extends", "ZipEntry", ">", "entries", "=", "this", ".", "pluginArtifactZip", ".", "entri...
Indexes the content of the plugin artifact. This includes discovering all of the dependency JARs as well as any configuration resources such as plugin definitions. @throws IOException if an I/O error has occurred
[ "Indexes", "the", "content", "of", "the", "plugin", "artifact", ".", "This", "includes", "discovering", "all", "of", "the", "dependency", "JARs", "as", "well", "as", "any", "configuration", "resources", "such", "as", "plugin", "definitions", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java#L93-L105
48,843
apiman/apiman
common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java
PluginClassLoader.findClassContent
protected InputStream findClassContent(String className) throws IOException { String primaryArtifactEntryName = "WEB-INF/classes/" + className.replace('.', '/') + ".class"; String dependencyEntryName = className.replace('.', '/') + ".class"; ZipEntry entry = this.pluginArtifactZip.getEntry(prima...
java
protected InputStream findClassContent(String className) throws IOException { String primaryArtifactEntryName = "WEB-INF/classes/" + className.replace('.', '/') + ".class"; String dependencyEntryName = className.replace('.', '/') + ".class"; ZipEntry entry = this.pluginArtifactZip.getEntry(prima...
[ "protected", "InputStream", "findClassContent", "(", "String", "className", ")", "throws", "IOException", "{", "String", "primaryArtifactEntryName", "=", "\"WEB-INF/classes/\"", "+", "className", ".", "replace", "(", "'", "'", ",", "'", "'", ")", "+", "\".class\""...
Searches the plugin artifact ZIP and all dependency ZIPs for a zip entry for the given fully qualified class name. @param className name of class @throws IOException if an I/O error has occurred
[ "Searches", "the", "plugin", "artifact", "ZIP", "and", "all", "dependency", "ZIPs", "for", "a", "zip", "entry", "for", "the", "given", "fully", "qualified", "class", "name", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java#L206-L220
48,844
apiman/apiman
common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java
PluginClassLoader.close
public void close() throws IOException { if (closed) { return; } this.pluginArtifactZip.close(); for (ZipFile zipFile : this.dependencyZips) { zipFile.close(); } closed = true; }
java
public void close() throws IOException { if (closed) { return; } this.pluginArtifactZip.close(); for (ZipFile zipFile : this.dependencyZips) { zipFile.close(); } closed = true; }
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "if", "(", "closed", ")", "{", "return", ";", "}", "this", ".", "pluginArtifactZip", ".", "close", "(", ")", ";", "for", "(", "ZipFile", "zipFile", ":", "this", ".", "dependencyZips", "...
Closes any resources the plugin classloader is holding open. @throws IOException if an I/O error has occurred
[ "Closes", "any", "resources", "the", "plugin", "classloader", "is", "holding", "open", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java#L322-L329
48,845
apiman/apiman
manager/api/core/src/main/java/io/apiman/manager/api/core/plugin/AbstractPluginRegistry.java
AbstractPluginRegistry.createPluginClassLoader
protected PluginClassLoader createPluginClassLoader(final File pluginFile) throws IOException { return new PluginClassLoader(pluginFile, Thread.currentThread().getContextClassLoader()) { @Override protected File createWorkDir(File pluginArtifactFile) throws IOException { ...
java
protected PluginClassLoader createPluginClassLoader(final File pluginFile) throws IOException { return new PluginClassLoader(pluginFile, Thread.currentThread().getContextClassLoader()) { @Override protected File createWorkDir(File pluginArtifactFile) throws IOException { ...
[ "protected", "PluginClassLoader", "createPluginClassLoader", "(", "final", "File", "pluginFile", ")", "throws", "IOException", "{", "return", "new", "PluginClassLoader", "(", "pluginFile", ",", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(...
Creates a plugin classloader for the given plugin file.
[ "Creates", "a", "plugin", "classloader", "for", "the", "given", "plugin", "file", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/plugin/AbstractPluginRegistry.java#L133-L142
48,846
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/InMemoryRegistry.java
InMemoryRegistry.getClientInternal
protected Client getClientInternal(String idx) { Client client; synchronized (mutex) { client = (Client) getMap().get(idx); } return client; }
java
protected Client getClientInternal(String idx) { Client client; synchronized (mutex) { client = (Client) getMap().get(idx); } return client; }
[ "protected", "Client", "getClientInternal", "(", "String", "idx", ")", "{", "Client", "client", ";", "synchronized", "(", "mutex", ")", "{", "client", "=", "(", "Client", ")", "getMap", "(", ")", ".", "get", "(", "idx", ")", ";", "}", "return", "client...
Gets the client and returns it. @param apiKey
[ "Gets", "the", "client", "and", "returns", "it", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/InMemoryRegistry.java#L169-L175
48,847
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/InMemoryRegistry.java
InMemoryRegistry.getClientIndex
private String getClientIndex(Client client) { return getClientIndex(client.getOrganizationId(), client.getClientId(), client.getVersion()); }
java
private String getClientIndex(Client client) { return getClientIndex(client.getOrganizationId(), client.getClientId(), client.getVersion()); }
[ "private", "String", "getClientIndex", "(", "Client", "client", ")", "{", "return", "getClientIndex", "(", "client", ".", "getOrganizationId", "(", ")", ",", "client", ".", "getClientId", "(", ")", ",", "client", ".", "getVersion", "(", ")", ")", ";", "}" ...
Generates an in-memory key for an client, used to index the client for later quick retrieval. @param client an client @return a client key
[ "Generates", "an", "in", "-", "memory", "key", "for", "an", "client", "used", "to", "index", "the", "client", "for", "later", "quick", "retrieval", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/InMemoryRegistry.java#L349-L351
48,848
apiman/apiman
manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaStorage.java
JpaStorage.getClientContractsInternal
protected List<ContractSummaryBean> getClientContractsInternal(String organizationId, String clientId, String version) throws StorageException { List<ContractSummaryBean> rval = new ArrayList<>(); EntityManager entityManager = getActiveEntityManager(); String jpql = "...
java
protected List<ContractSummaryBean> getClientContractsInternal(String organizationId, String clientId, String version) throws StorageException { List<ContractSummaryBean> rval = new ArrayList<>(); EntityManager entityManager = getActiveEntityManager(); String jpql = "...
[ "protected", "List", "<", "ContractSummaryBean", ">", "getClientContractsInternal", "(", "String", "organizationId", ",", "String", "clientId", ",", "String", "version", ")", "throws", "StorageException", "{", "List", "<", "ContractSummaryBean", ">", "rval", "=", "n...
Returns a list of all contracts for the given client. @param organizationId @param clientId @param version @throws StorageException
[ "Returns", "a", "list", "of", "all", "contracts", "for", "the", "given", "client", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/JpaStorage.java#L1382-L1429
48,849
apiman/apiman
manager/api/migrator/src/main/java/io/apiman/manager/api/migrator/DataMigrator.java
DataMigrator.main
public static void main(String[] args) { File from; File to; if (args.length < 2) { System.out.println("Usage: DataMigrator <pathToSourceFile> <pathToDestFile>"); //$NON-NLS-1$ return; } String frompath = args[0]; String topath =...
java
public static void main(String[] args) { File from; File to; if (args.length < 2) { System.out.println("Usage: DataMigrator <pathToSourceFile> <pathToDestFile>"); //$NON-NLS-1$ return; } String frompath = args[0]; String topath =...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "File", "from", ";", "File", "to", ";", "if", "(", "args", ".", "length", "<", "2", ")", "{", "System", ".", "out", ".", "println", "(", "\"Usage: DataMigrator <pathToSourc...
Main method - used when running the data migrator in standalone mode. @param args
[ "Main", "method", "-", "used", "when", "running", "the", "data", "migrator", "in", "standalone", "mode", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/migrator/src/main/java/io/apiman/manager/api/migrator/DataMigrator.java#L102-L126
48,850
apiman/apiman
gateway/engine/storage-common/src/main/java/io/apiman/gateway/engine/storage/util/BackingStoreUtil.java
BackingStoreUtil.readPrimitive
public static Object readPrimitive(Class<?> clazz, String value) throws Exception { if (clazz == String.class) { return value; } else if (clazz == Long.class) { return Long.parseLong(value); } else if (clazz == Integer.class) { return Integer.parseInt(value); ...
java
public static Object readPrimitive(Class<?> clazz, String value) throws Exception { if (clazz == String.class) { return value; } else if (clazz == Long.class) { return Long.parseLong(value); } else if (clazz == Integer.class) { return Integer.parseInt(value); ...
[ "public", "static", "Object", "readPrimitive", "(", "Class", "<", "?", ">", "clazz", ",", "String", "value", ")", "throws", "Exception", "{", "if", "(", "clazz", "==", "String", ".", "class", ")", "{", "return", "value", ";", "}", "else", "if", "(", ...
Parses the String value as a primitive or a String, depending on its type. @param clazz the destination type @param value the value to parse @return the parsed value @throws Exception
[ "Parses", "the", "String", "value", "as", "a", "primitive", "or", "a", "String", "depending", "on", "its", "type", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/storage-common/src/main/java/io/apiman/gateway/engine/storage/util/BackingStoreUtil.java#L41-L61
48,851
apiman/apiman
gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESSharedStateComponent.java
ESSharedStateComponent.readPrimitive
protected Object readPrimitive(JestResult result) throws Exception { PrimitiveBean pb = result.getSourceAsObject(PrimitiveBean.class); String value = pb.getValue(); Class<?> c = Class.forName(pb.getType()); return BackingStoreUtil.readPrimitive(c, value); }
java
protected Object readPrimitive(JestResult result) throws Exception { PrimitiveBean pb = result.getSourceAsObject(PrimitiveBean.class); String value = pb.getValue(); Class<?> c = Class.forName(pb.getType()); return BackingStoreUtil.readPrimitive(c, value); }
[ "protected", "Object", "readPrimitive", "(", "JestResult", "result", ")", "throws", "Exception", "{", "PrimitiveBean", "pb", "=", "result", ".", "getSourceAsObject", "(", "PrimitiveBean", ".", "class", ")", ";", "String", "value", "=", "pb", ".", "getValue", "...
Reads a stored primitive. @param result
[ "Reads", "a", "stored", "primitive", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESSharedStateComponent.java#L150-L155
48,852
apiman/apiman
gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/components/HttpClientRequestImpl.java
HttpClientRequestImpl.connect
private void connect() { try { URL url = new URL(this.endpoint); connection = (HttpURLConnection) url.openConnection(); connection.setReadTimeout(this.readTimeoutMs); connection.setConnectTimeout(this.connectTimeoutMs); connection.setRequestMethod(this...
java
private void connect() { try { URL url = new URL(this.endpoint); connection = (HttpURLConnection) url.openConnection(); connection.setReadTimeout(this.readTimeoutMs); connection.setConnectTimeout(this.connectTimeoutMs); connection.setRequestMethod(this...
[ "private", "void", "connect", "(", ")", "{", "try", "{", "URL", "url", "=", "new", "URL", "(", "this", ".", "endpoint", ")", ";", "connection", "=", "(", "HttpURLConnection", ")", "url", ".", "openConnection", "(", ")", ";", "connection", ".", "setRead...
Connect to the remote server.
[ "Connect", "to", "the", "remote", "server", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/components/HttpClientRequestImpl.java#L151-L173
48,853
apiman/apiman
gateway/engine/3scale/src/main/java/io/apiman/gateway/engine/threescale/beans/ProxyRule.java
ProxyRule.convertPattern
private static String convertPattern(ProxyRule bean) { String str = bean.getPattern().replaceAll("\\{.+?\\}", "([^/&?]*)"); // /foo/{bar}/{baz} => /foo/([^\/&?]*)/([^/&?]*).* return str.endsWith("$") ? str : str + ".*"; // Implicitly other stuff on end unless $ explicitly specified (see description) ...
java
private static String convertPattern(ProxyRule bean) { String str = bean.getPattern().replaceAll("\\{.+?\\}", "([^/&?]*)"); // /foo/{bar}/{baz} => /foo/([^\/&?]*)/([^/&?]*).* return str.endsWith("$") ? str : str + ".*"; // Implicitly other stuff on end unless $ explicitly specified (see description) ...
[ "private", "static", "String", "convertPattern", "(", "ProxyRule", "bean", ")", "{", "String", "str", "=", "bean", ".", "getPattern", "(", ")", ".", "replaceAll", "(", "\"\\\\{.+?\\\\}\"", ",", "\"([^/&?]*)\"", ")", ";", "// /foo/{bar}/{baz} => /foo/([^\\/&?]*)/([^/...
slash, ampersand or question mark.
[ "slash", "ampersand", "or", "question", "mark", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/3scale/src/main/java/io/apiman/gateway/engine/threescale/beans/ProxyRule.java#L82-L85
48,854
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/SearchCriteriaUtil.java
SearchCriteriaUtil.validateSearchCriteria
public static final void validateSearchCriteria(SearchCriteriaBean criteria) throws InvalidSearchCriteriaException { if (criteria.getPaging() != null) { if (criteria.getPaging().getPage() < 1) { throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.Missing...
java
public static final void validateSearchCriteria(SearchCriteriaBean criteria) throws InvalidSearchCriteriaException { if (criteria.getPaging() != null) { if (criteria.getPaging().getPage() < 1) { throw new InvalidSearchCriteriaException(Messages.i18n.format("SearchCriteriaUtil.Missing...
[ "public", "static", "final", "void", "validateSearchCriteria", "(", "SearchCriteriaBean", "criteria", ")", "throws", "InvalidSearchCriteriaException", "{", "if", "(", "criteria", ".", "getPaging", "(", ")", "!=", "null", ")", "{", "if", "(", "criteria", ".", "ge...
Validates that the search criteria bean is complete and makes sense. @param criteria the search criteria @throws InvalidSearchCriteriaException when the search criteria is not valid
[ "Validates", "that", "the", "search", "criteria", "bean", "is", "complete", "and", "makes", "sense", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/SearchCriteriaUtil.java#L53-L78
48,855
apiman/apiman
common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java
ReflectionUtils.callIfExists
public static <T> void callIfExists(T object, String methodName) throws SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { try { Method method = object.getClass().getMethod(methodName); method.invoke(object); } catch (NoSu...
java
public static <T> void callIfExists(T object, String methodName) throws SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { try { Method method = object.getClass().getMethod(methodName); method.invoke(object); } catch (NoSu...
[ "public", "static", "<", "T", ">", "void", "callIfExists", "(", "T", "object", ",", "String", "methodName", ")", "throws", "SecurityException", ",", "IllegalAccessException", ",", "IllegalArgumentException", ",", "InvocationTargetException", "{", "try", "{", "Method...
Call a method if it exists. Use very sparingly and generally prefer interfaces. @param object The object @param methodName Method name to call on the object @throws SecurityException reflection - security manager to indicate a security violation @throws IllegalAccessException reflection - does not allow access @throws ...
[ "Call", "a", "method", "if", "it", "exists", ".", "Use", "very", "sparingly", "and", "generally", "prefer", "interfaces", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java#L39-L46
48,856
apiman/apiman
common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java
ReflectionUtils.loadClass
public static Class<?> loadClass(String classname) { Class<?> c = null; // First try a simple Class.forName() try { c = Class.forName(classname); } catch (ClassNotFoundException e) { } // Didn't work? Try using this class's classloader. if (c == null) { try { c = Re...
java
public static Class<?> loadClass(String classname) { Class<?> c = null; // First try a simple Class.forName() try { c = Class.forName(classname); } catch (ClassNotFoundException e) { } // Didn't work? Try using this class's classloader. if (c == null) { try { c = Re...
[ "public", "static", "Class", "<", "?", ">", "loadClass", "(", "String", "classname", ")", "{", "Class", "<", "?", ">", "c", "=", "null", ";", "// First try a simple Class.forName()", "try", "{", "c", "=", "Class", ".", "forName", "(", "classname", ")", "...
Loads a class. @param classname
[ "Loads", "a", "class", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java#L52-L67
48,857
apiman/apiman
common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java
ReflectionUtils.findSetter
public static Method findSetter(Class<?> onClass, Class<?> targetClass) { Method[] methods = onClass.getMethods(); for (Method method : methods) { Class<?>[] ptypes = method.getParameterTypes(); if (method.getName().startsWith("set") && ptypes.length == 1 && ptypes[0] == targetCl...
java
public static Method findSetter(Class<?> onClass, Class<?> targetClass) { Method[] methods = onClass.getMethods(); for (Method method : methods) { Class<?>[] ptypes = method.getParameterTypes(); if (method.getName().startsWith("set") && ptypes.length == 1 && ptypes[0] == targetCl...
[ "public", "static", "Method", "findSetter", "(", "Class", "<", "?", ">", "onClass", ",", "Class", "<", "?", ">", "targetClass", ")", "{", "Method", "[", "]", "methods", "=", "onClass", ".", "getMethods", "(", ")", ";", "for", "(", "Method", "method", ...
Squishy way to find a setter method. @param onClass, targetClass
[ "Squishy", "way", "to", "find", "a", "setter", "method", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java#L73-L82
48,858
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/auth/JDBCIdentityValidator.java
JDBCIdentityValidator.createClient
private IJdbcClient createClient(IPolicyContext context, JDBCIdentitySource config) throws Throwable { IJdbcComponent jdbcComponent = context.getComponent(IJdbcComponent.class); if (config.getType() == JDBCType.datasource || config.getType() == null) { DataSource ds = lookupDatasource(confi...
java
private IJdbcClient createClient(IPolicyContext context, JDBCIdentitySource config) throws Throwable { IJdbcComponent jdbcComponent = context.getComponent(IJdbcComponent.class); if (config.getType() == JDBCType.datasource || config.getType() == null) { DataSource ds = lookupDatasource(confi...
[ "private", "IJdbcClient", "createClient", "(", "IPolicyContext", "context", ",", "JDBCIdentitySource", "config", ")", "throws", "Throwable", "{", "IJdbcComponent", "jdbcComponent", "=", "context", ".", "getComponent", "(", "IJdbcComponent", ".", "class", ")", ";", "...
Creates the appropriate jdbc client. @param context @param config
[ "Creates", "the", "appropriate", "jdbc", "client", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/auth/JDBCIdentityValidator.java#L113-L129
48,859
apiman/apiman
common/util/src/main/java/io/apiman/common/util/ServiceRegistryUtil.java
ServiceRegistryUtil.getSingleService
@SuppressWarnings("javadoc") public static <T> T getSingleService(Class<T> serviceInterface) throws IllegalStateException { // Cached single service values are derived from the values cached when checking // for multiple services T rval = null; Set<T> services = getServices(serviceIn...
java
@SuppressWarnings("javadoc") public static <T> T getSingleService(Class<T> serviceInterface) throws IllegalStateException { // Cached single service values are derived from the values cached when checking // for multiple services T rval = null; Set<T> services = getServices(serviceIn...
[ "@", "SuppressWarnings", "(", "\"javadoc\"", ")", "public", "static", "<", "T", ">", "T", "getSingleService", "(", "Class", "<", "T", ">", "serviceInterface", ")", "throws", "IllegalStateException", "{", "// Cached single service values are derived from the values cached ...
Gets a single service by its interface. @param serviceInterface the service interface @throws IllegalStateException method has been invoked at an illegal or inappropriate time
[ "Gets", "a", "single", "service", "by", "its", "interface", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ServiceRegistryUtil.java#L42-L55
48,860
apiman/apiman
common/util/src/main/java/io/apiman/common/util/ServiceRegistryUtil.java
ServiceRegistryUtil.getServices
@SuppressWarnings("unchecked") public static <T> Set<T> getServices(Class<T> serviceInterface) { synchronized(servicesCache) { if (servicesCache.containsKey(serviceInterface)) { return (Set<T>) servicesCache.get(serviceInterface); } Set<T> services = ...
java
@SuppressWarnings("unchecked") public static <T> Set<T> getServices(Class<T> serviceInterface) { synchronized(servicesCache) { if (servicesCache.containsKey(serviceInterface)) { return (Set<T>) servicesCache.get(serviceInterface); } Set<T> services = ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Set", "<", "T", ">", "getServices", "(", "Class", "<", "T", ">", "serviceInterface", ")", "{", "synchronized", "(", "servicesCache", ")", "{", "if", "(", "servicesCache...
Get a set of service implementations for a given interface. @param serviceInterface the service interface @return the set of services
[ "Get", "a", "set", "of", "service", "implementations", "for", "a", "given", "interface", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ServiceRegistryUtil.java#L62-L80
48,861
apiman/apiman
common/config/src/main/java/io/apiman/common/config/ConfigFileConfiguration.java
ConfigFileConfiguration.findConfigUrlInDirectory
protected static URL findConfigUrlInDirectory(File directory, String configName) { if (directory.isDirectory()) { File cfile = new File(directory, configName); if (cfile.isFile()) { try { return cfile.toURI().toURL(); } catch (Malformed...
java
protected static URL findConfigUrlInDirectory(File directory, String configName) { if (directory.isDirectory()) { File cfile = new File(directory, configName); if (cfile.isFile()) { try { return cfile.toURI().toURL(); } catch (Malformed...
[ "protected", "static", "URL", "findConfigUrlInDirectory", "(", "File", "directory", ",", "String", "configName", ")", "{", "if", "(", "directory", ".", "isDirectory", "(", ")", ")", "{", "File", "cfile", "=", "new", "File", "(", "directory", ",", "configName...
Returns a URL to a file with the given name inside the given directory.
[ "Returns", "a", "URL", "to", "a", "file", "with", "the", "given", "name", "inside", "the", "given", "directory", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/config/src/main/java/io/apiman/common/config/ConfigFileConfiguration.java#L46-L58
48,862
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/TimeRestrictedAccessPolicy.java
TimeRestrictedAccessPolicy.canProcessRequest
private boolean canProcessRequest(TimeRestrictedAccessConfig config, String destination) { if (destination == null || destination.trim().length() == 0) { destination = "/"; //$NON-NLS-1$ } List<TimeRestrictedAccess> rulesEnabledForPath = getRulesMatchingPath(config, destination);...
java
private boolean canProcessRequest(TimeRestrictedAccessConfig config, String destination) { if (destination == null || destination.trim().length() == 0) { destination = "/"; //$NON-NLS-1$ } List<TimeRestrictedAccess> rulesEnabledForPath = getRulesMatchingPath(config, destination);...
[ "private", "boolean", "canProcessRequest", "(", "TimeRestrictedAccessConfig", "config", ",", "String", "destination", ")", "{", "if", "(", "destination", "==", "null", "||", "destination", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "0", ")", "{", ...
Evaluates whether the destination provided matches any of the configured pathsToIgnore and matches specified time range. @param config The {@link IgnoredResourcesConfig} containing the pathsToIgnore @param destination The destination to evaluate @return true if any path matches the destination. false otherwise
[ "Evaluates", "whether", "the", "destination", "provided", "matches", "any", "of", "the", "configured", "pathsToIgnore", "and", "matches", "specified", "time", "range", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/TimeRestrictedAccessPolicy.java#L90-L109
48,863
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractIPListPolicy.java
AbstractIPListPolicy.getRemoteAddr
protected String getRemoteAddr(ApiRequest request, IPListConfig config) { String httpHeader = config.getHttpHeader(); if (httpHeader != null && httpHeader.trim().length() > 0) { String value = (String) request.getHeaders().get(httpHeader); if (value != null) { ret...
java
protected String getRemoteAddr(ApiRequest request, IPListConfig config) { String httpHeader = config.getHttpHeader(); if (httpHeader != null && httpHeader.trim().length() > 0) { String value = (String) request.getHeaders().get(httpHeader); if (value != null) { ret...
[ "protected", "String", "getRemoteAddr", "(", "ApiRequest", "request", ",", "IPListConfig", "config", ")", "{", "String", "httpHeader", "=", "config", ".", "getHttpHeader", "(", ")", ";", "if", "(", "httpHeader", "!=", "null", "&&", "httpHeader", ".", "trim", ...
Gets the remote address for comparison. @param request the request @param config the config
[ "Gets", "the", "remote", "address", "for", "comparison", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractIPListPolicy.java#L35-L44
48,864
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractIPListPolicy.java
AbstractIPListPolicy.isMatch
protected boolean isMatch(IPListConfig config, String remoteAddr) { if (config.getIpList().contains(remoteAddr)) { return true; } try { String [] remoteAddrSplit = remoteAddr.split("\\."); //$NON-NLS-1$ for (String ip : config.getIpList()) { St...
java
protected boolean isMatch(IPListConfig config, String remoteAddr) { if (config.getIpList().contains(remoteAddr)) { return true; } try { String [] remoteAddrSplit = remoteAddr.split("\\."); //$NON-NLS-1$ for (String ip : config.getIpList()) { St...
[ "protected", "boolean", "isMatch", "(", "IPListConfig", "config", ",", "String", "remoteAddr", ")", "{", "if", "(", "config", ".", "getIpList", "(", ")", ".", "contains", "(", "remoteAddr", ")", ")", "{", "return", "true", ";", "}", "try", "{", "String",...
Returns true if the remote address is a match for the configured values in the IP List. @param config the config @param remoteAddr the remote address
[ "Returns", "true", "if", "the", "remote", "address", "is", "a", "match", "for", "the", "configured", "values", "in", "the", "IP", "List", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractIPListPolicy.java#L52-L80
48,865
apiman/apiman
manager/api/war/tomcat8/src/main/java/io/apiman/manager/api/war/tomcat8/Tomcat8PluginRegistry.java
Tomcat8PluginRegistry.getPluginDir
private static File getPluginDir() { String dataDirPath = System.getProperty("catalina.home"); //$NON-NLS-1$ File dataDir = new File(dataDirPath, "data"); //$NON-NLS-1$ if (!dataDir.getParentFile().isDirectory()) { throw new RuntimeException("Failed to find Tomcat home at: " + dataDi...
java
private static File getPluginDir() { String dataDirPath = System.getProperty("catalina.home"); //$NON-NLS-1$ File dataDir = new File(dataDirPath, "data"); //$NON-NLS-1$ if (!dataDir.getParentFile().isDirectory()) { throw new RuntimeException("Failed to find Tomcat home at: " + dataDi...
[ "private", "static", "File", "getPluginDir", "(", ")", "{", "String", "dataDirPath", "=", "System", ".", "getProperty", "(", "\"catalina.home\"", ")", ";", "//$NON-NLS-1$", "File", "dataDir", "=", "new", "File", "(", "dataDirPath", ",", "\"data\"", ")", ";", ...
Creates the directory to use for the plugin registry. The location of the plugin registry is in the tomcat data directory.
[ "Creates", "the", "directory", "to", "use", "for", "the", "plugin", "registry", ".", "The", "location", "of", "the", "plugin", "registry", "is", "in", "the", "tomcat", "data", "directory", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/war/tomcat8/src/main/java/io/apiman/manager/api/war/tomcat8/Tomcat8PluginRegistry.java#L48-L59
48,866
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.wrapResultHandler
private IAsyncResultHandler<IEngineResult> wrapResultHandler(final IAsyncResultHandler<IEngineResult> handler) { return (IAsyncResult<IEngineResult> result) -> { boolean doRecord = true; if (result.isError()) { recordErrorMetrics(result.getError()); } else { ...
java
private IAsyncResultHandler<IEngineResult> wrapResultHandler(final IAsyncResultHandler<IEngineResult> handler) { return (IAsyncResult<IEngineResult> result) -> { boolean doRecord = true; if (result.isError()) { recordErrorMetrics(result.getError()); } else { ...
[ "private", "IAsyncResultHandler", "<", "IEngineResult", ">", "wrapResultHandler", "(", "final", "IAsyncResultHandler", "<", "IEngineResult", ">", "handler", ")", "{", "return", "(", "IAsyncResult", "<", "IEngineResult", ">", "result", ")", "->", "{", "boolean", "d...
Wraps the result handler so that metrics can be properly recorded.
[ "Wraps", "the", "result", "handler", "so", "that", "metrics", "can", "be", "properly", "recorded", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L172-L192
48,867
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.recordSuccessMetrics
protected void recordSuccessMetrics(ApiResponse response) { requestMetric.setResponseCode(response.getCode()); requestMetric.setResponseMessage(response.getMessage()); }
java
protected void recordSuccessMetrics(ApiResponse response) { requestMetric.setResponseCode(response.getCode()); requestMetric.setResponseMessage(response.getMessage()); }
[ "protected", "void", "recordSuccessMetrics", "(", "ApiResponse", "response", ")", "{", "requestMetric", ".", "setResponseCode", "(", "response", ".", "getCode", "(", ")", ")", ";", "requestMetric", ".", "setResponseMessage", "(", "response", ".", "getMessage", "("...
Record success metrics
[ "Record", "success", "metrics" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L197-L200
48,868
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.recordFailureMetrics
protected void recordFailureMetrics(PolicyFailure failure) { requestMetric.setResponseCode(failure.getResponseCode()); requestMetric.setFailure(true); requestMetric.setFailureCode(failure.getFailureCode()); requestMetric.setFailureReason(failure.getMessage()); }
java
protected void recordFailureMetrics(PolicyFailure failure) { requestMetric.setResponseCode(failure.getResponseCode()); requestMetric.setFailure(true); requestMetric.setFailureCode(failure.getFailureCode()); requestMetric.setFailureReason(failure.getMessage()); }
[ "protected", "void", "recordFailureMetrics", "(", "PolicyFailure", "failure", ")", "{", "requestMetric", ".", "setResponseCode", "(", "failure", ".", "getResponseCode", "(", ")", ")", ";", "requestMetric", ".", "setFailure", "(", "true", ")", ";", "requestMetric",...
Record failure metrics
[ "Record", "failure", "metrics" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L205-L210
48,869
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.resolvePropertyReplacements
protected void resolvePropertyReplacements(Api api) { if (api == null) { return; } String endpoint = api.getEndpoint(); endpoint = resolveProperties(endpoint); api.setEndpoint(endpoint); Map<String, String> properties = api.getEndpointProperties(); fo...
java
protected void resolvePropertyReplacements(Api api) { if (api == null) { return; } String endpoint = api.getEndpoint(); endpoint = resolveProperties(endpoint); api.setEndpoint(endpoint); Map<String, String> properties = api.getEndpointProperties(); fo...
[ "protected", "void", "resolvePropertyReplacements", "(", "Api", "api", ")", "{", "if", "(", "api", "==", "null", ")", "{", "return", ";", "}", "String", "endpoint", "=", "api", ".", "getEndpoint", "(", ")", ";", "endpoint", "=", "resolveProperties", "(", ...
Response API property replacements
[ "Response", "API", "property", "replacements" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L537-L553
48,870
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.resolvePropertyReplacements
protected void resolvePropertyReplacements(ApiContract apiContract) { if (apiContract == null) { return; } Api api = apiContract.getApi(); if (api != null) { resolvePropertyReplacements(api); } resolvePropertyReplacements(apiContract.getPolicies())...
java
protected void resolvePropertyReplacements(ApiContract apiContract) { if (apiContract == null) { return; } Api api = apiContract.getApi(); if (api != null) { resolvePropertyReplacements(api); } resolvePropertyReplacements(apiContract.getPolicies())...
[ "protected", "void", "resolvePropertyReplacements", "(", "ApiContract", "apiContract", ")", "{", "if", "(", "apiContract", "==", "null", ")", "{", "return", ";", "}", "Api", "api", "=", "apiContract", ".", "getApi", "(", ")", ";", "if", "(", "api", "!=", ...
Resolve contract property replacements
[ "Resolve", "contract", "property", "replacements" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L558-L567
48,871
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.resolvePropertyReplacements
private void resolvePropertyReplacements(List<Policy> apiPolicies) { if (apiPolicies != null) { for (Policy policy : apiPolicies) { String config = policy.getPolicyJsonConfig(); config = resolveProperties(config); policy.setPolicyJsonConfig(config); ...
java
private void resolvePropertyReplacements(List<Policy> apiPolicies) { if (apiPolicies != null) { for (Policy policy : apiPolicies) { String config = policy.getPolicyJsonConfig(); config = resolveProperties(config); policy.setPolicyJsonConfig(config); ...
[ "private", "void", "resolvePropertyReplacements", "(", "List", "<", "Policy", ">", "apiPolicies", ")", "{", "if", "(", "apiPolicies", "!=", "null", ")", "{", "for", "(", "Policy", "policy", ":", "apiPolicies", ")", "{", "String", "config", "=", "policy", "...
Resolve property replacements for list of policies
[ "Resolve", "property", "replacements", "for", "list", "of", "policies" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L572-L580
48,872
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.resolveProperties
private String resolveProperties(String value) { if (value.contains("${")) { //$NON-NLS-1$ return PROPERTY_SUBSTITUTOR.replace(value); } else { return value; } }
java
private String resolveProperties(String value) { if (value.contains("${")) { //$NON-NLS-1$ return PROPERTY_SUBSTITUTOR.replace(value); } else { return value; } }
[ "private", "String", "resolveProperties", "(", "String", "value", ")", "{", "if", "(", "value", ".", "contains", "(", "\"${\"", ")", ")", "{", "//$NON-NLS-1$", "return", "PROPERTY_SUBSTITUTOR", ".", "replace", "(", "value", ")", ";", "}", "else", "{", "ret...
Resolve a property
[ "Resolve", "a", "property" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L585-L591
48,873
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.validateRequest
protected void validateRequest(ApiRequest request) throws InvalidContractException { ApiContract contract = request.getContract(); boolean matches = true; if (!contract.getApi().getOrganizationId().equals(request.getApiOrgId())) { matches = false; } if (!contract.get...
java
protected void validateRequest(ApiRequest request) throws InvalidContractException { ApiContract contract = request.getContract(); boolean matches = true; if (!contract.getApi().getOrganizationId().equals(request.getApiOrgId())) { matches = false; } if (!contract.get...
[ "protected", "void", "validateRequest", "(", "ApiRequest", "request", ")", "throws", "InvalidContractException", "{", "ApiContract", "contract", "=", "request", ".", "getContract", "(", ")", ";", "boolean", "matches", "=", "true", ";", "if", "(", "!", "contract"...
Validates that the contract being used for the request is valid against the api information included in the request. Basically the request includes information indicating which specific api is being invoked. This method ensures that the api information in the contract matches the requested api. @param request the req...
[ "Validates", "that", "the", "contract", "being", "used", "for", "the", "request", "is", "valid", "against", "the", "api", "information", "included", "in", "the", "request", ".", "Basically", "the", "request", "includes", "information", "indicating", "which", "sp...
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L601-L618
48,874
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.createApiConnectionResponseHandler
private IAsyncResultHandler<IApiConnectionResponse> createApiConnectionResponseHandler() { return (IAsyncResult<IApiConnectionResponse> result) -> { if (result.isSuccess()) { requestMetric.setApiEnd(new Date()); // The result came back. NB: still need to put it throug...
java
private IAsyncResultHandler<IApiConnectionResponse> createApiConnectionResponseHandler() { return (IAsyncResult<IApiConnectionResponse> result) -> { if (result.isSuccess()) { requestMetric.setApiEnd(new Date()); // The result came back. NB: still need to put it throug...
[ "private", "IAsyncResultHandler", "<", "IApiConnectionResponse", ">", "createApiConnectionResponseHandler", "(", ")", "{", "return", "(", "IAsyncResult", "<", "IApiConnectionResponse", ">", "result", ")", "->", "{", "if", "(", "result", ".", "isSuccess", "(", ")", ...
Creates a response handler that is called by the api connector once a connection to the back end api has been made and a response received.
[ "Creates", "a", "response", "handler", "that", "is", "called", "by", "the", "api", "connector", "once", "a", "connection", "to", "the", "back", "end", "api", "has", "been", "made", "and", "a", "response", "received", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L686-L730
48,875
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.handleStream
protected void handleStream() { inboundStreamHandler.handle(new ISignalWriteStream() { boolean streamFinished = false; @Override public void write(IApimanBuffer buffer) { if (streamFinished) { throw new IllegalStateException("Attempted wri...
java
protected void handleStream() { inboundStreamHandler.handle(new ISignalWriteStream() { boolean streamFinished = false; @Override public void write(IApimanBuffer buffer) { if (streamFinished) { throw new IllegalStateException("Attempted wri...
[ "protected", "void", "handleStream", "(", ")", "{", "inboundStreamHandler", ".", "handle", "(", "new", "ISignalWriteStream", "(", ")", "{", "boolean", "streamFinished", "=", "false", ";", "@", "Override", "public", "void", "write", "(", "IApimanBuffer", "buffer"...
Called when the api connector is ready to receive data from the inbound client request.
[ "Called", "when", "the", "api", "connector", "is", "ready", "to", "receive", "data", "from", "the", "inbound", "client", "request", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L736-L784
48,876
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.createRequestChain
private Chain<ApiRequest> createRequestChain(IAsyncHandler<ApiRequest> requestHandler) { RequestChain chain = new RequestChain(policyImpls, context); chain.headHandler(requestHandler); chain.policyFailureHandler(failure -> { // Jump straight to the response leg. // It wil...
java
private Chain<ApiRequest> createRequestChain(IAsyncHandler<ApiRequest> requestHandler) { RequestChain chain = new RequestChain(policyImpls, context); chain.headHandler(requestHandler); chain.policyFailureHandler(failure -> { // Jump straight to the response leg. // It wil...
[ "private", "Chain", "<", "ApiRequest", ">", "createRequestChain", "(", "IAsyncHandler", "<", "ApiRequest", ">", "requestHandler", ")", "{", "RequestChain", "chain", "=", "new", "RequestChain", "(", "policyImpls", ",", "context", ")", ";", "chain", ".", "headHand...
Creates the chain used to apply policies in order to the api request.
[ "Creates", "the", "chain", "used", "to", "apply", "policies", "in", "order", "to", "the", "api", "request", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L805-L819
48,877
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.createResponseChain
private Chain<ApiResponse> createResponseChain(IAsyncHandler<ApiResponse> responseHandler) { ResponseChain chain = new ResponseChain(policyImpls, context); chain.headHandler(responseHandler); chain.policyFailureHandler(result -> { if (apiConnectionResponse != null) { apiC...
java
private Chain<ApiResponse> createResponseChain(IAsyncHandler<ApiResponse> responseHandler) { ResponseChain chain = new ResponseChain(policyImpls, context); chain.headHandler(responseHandler); chain.policyFailureHandler(result -> { if (apiConnectionResponse != null) { apiC...
[ "private", "Chain", "<", "ApiResponse", ">", "createResponseChain", "(", "IAsyncHandler", "<", "ApiResponse", ">", "responseHandler", ")", "{", "ResponseChain", "chain", "=", "new", "ResponseChain", "(", "policyImpls", ",", "context", ")", ";", "chain", ".", "he...
Creates the chain used to apply policies in reverse order to the api response.
[ "Creates", "the", "chain", "used", "to", "apply", "policies", "in", "reverse", "order", "to", "the", "api", "response", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L824-L840
48,878
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.createPolicyFailureHandler
private IAsyncHandler<PolicyFailure> createPolicyFailureHandler() { return policyFailure -> { // One of the policies has triggered a failure. At this point we should stop processing and // send the failure to the client for appropriate handling. EngineResultImpl engineResult ...
java
private IAsyncHandler<PolicyFailure> createPolicyFailureHandler() { return policyFailure -> { // One of the policies has triggered a failure. At this point we should stop processing and // send the failure to the client for appropriate handling. EngineResultImpl engineResult ...
[ "private", "IAsyncHandler", "<", "PolicyFailure", ">", "createPolicyFailureHandler", "(", ")", "{", "return", "policyFailure", "->", "{", "// One of the policies has triggered a failure. At this point we should stop processing and", "// send the failure to the client for appropriate hand...
Creates the handler to use when a policy failure occurs during processing of a chain.
[ "Creates", "the", "handler", "to", "use", "when", "a", "policy", "failure", "occurs", "during", "processing", "of", "a", "chain", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L846-L853
48,879
apiman/apiman
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java
ApiRequestExecutorImpl.createPolicyErrorHandler
private IAsyncHandler<Throwable> createPolicyErrorHandler() { return error -> resultHandler.handle(AsyncResultImpl.<IEngineResult> create(error)); }
java
private IAsyncHandler<Throwable> createPolicyErrorHandler() { return error -> resultHandler.handle(AsyncResultImpl.<IEngineResult> create(error)); }
[ "private", "IAsyncHandler", "<", "Throwable", ">", "createPolicyErrorHandler", "(", ")", "{", "return", "error", "->", "resultHandler", ".", "handle", "(", "AsyncResultImpl", ".", "<", "IEngineResult", ">", "create", "(", "error", ")", ")", ";", "}" ]
Creates the handler to use when an error is detected during the processing of a chain.
[ "Creates", "the", "handler", "to", "use", "when", "an", "error", "is", "detected", "during", "the", "processing", "of", "a", "chain", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L859-L861
48,880
apiman/apiman
manager/api/war/src/main/java/io/apiman/manager/api/war/WarApiManagerBootstrapperServlet.java
WarApiManagerBootstrapperServlet.getDataDir
private static File getDataDir() { File rval = null; // First check to see if a data directory has been explicitly configured via system property String dataDir = System.getProperty("apiman.bootstrap.data_dir"); //$NON-NLS-1$ if (dataDir != null) { rval = new File(dataDir); ...
java
private static File getDataDir() { File rval = null; // First check to see if a data directory has been explicitly configured via system property String dataDir = System.getProperty("apiman.bootstrap.data_dir"); //$NON-NLS-1$ if (dataDir != null) { rval = new File(dataDir); ...
[ "private", "static", "File", "getDataDir", "(", ")", "{", "File", "rval", "=", "null", ";", "// First check to see if a data directory has been explicitly configured via system property", "String", "dataDir", "=", "System", ".", "getProperty", "(", "\"apiman.bootstrap.data_di...
Get the data directory
[ "Get", "the", "data", "directory" ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/war/src/main/java/io/apiman/manager/api/war/WarApiManagerBootstrapperServlet.java#L112-L139
48,881
apiman/apiman
manager/api/gateway/src/main/java/io/apiman/manager/api/gateway/rest/RestGatewayLink.java
RestGatewayLink.configureBasicAuth
protected void configureBasicAuth(HttpRequest request) { try { String username = getConfig().getUsername(); String password = getConfig().getPassword(); String up = username + ":" + password; //$NON-NLS-1$ String base64 = new String(Base64.encodeBase64(up.getBytes...
java
protected void configureBasicAuth(HttpRequest request) { try { String username = getConfig().getUsername(); String password = getConfig().getPassword(); String up = username + ":" + password; //$NON-NLS-1$ String base64 = new String(Base64.encodeBase64(up.getBytes...
[ "protected", "void", "configureBasicAuth", "(", "HttpRequest", "request", ")", "{", "try", "{", "String", "username", "=", "getConfig", "(", ")", ".", "getUsername", "(", ")", ";", "String", "password", "=", "getConfig", "(", ")", ".", "getPassword", "(", ...
Configures BASIC authentication for the request. @param request
[ "Configures", "BASIC", "authentication", "for", "the", "request", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/gateway/src/main/java/io/apiman/manager/api/gateway/rest/RestGatewayLink.java#L207-L218
48,882
apiman/apiman
manager/api/beans/src/main/java/io/apiman/manager/api/beans/search/SearchCriteriaBean.java
SearchCriteriaBean.addFilter
public void addFilter(String name, String value, SearchCriteriaFilterOperator operator) { SearchCriteriaFilterBean filter = new SearchCriteriaFilterBean(); filter.setName(name); filter.setValue(value); filter.setOperator(operator); filters.add(filter); }
java
public void addFilter(String name, String value, SearchCriteriaFilterOperator operator) { SearchCriteriaFilterBean filter = new SearchCriteriaFilterBean(); filter.setName(name); filter.setValue(value); filter.setOperator(operator); filters.add(filter); }
[ "public", "void", "addFilter", "(", "String", "name", ",", "String", "value", ",", "SearchCriteriaFilterOperator", "operator", ")", "{", "SearchCriteriaFilterBean", "filter", "=", "new", "SearchCriteriaFilterBean", "(", ")", ";", "filter", ".", "setName", "(", "na...
Adds a single filter to the criteria. @param name the filter name @param value the filter value @param operator the operator type
[ "Adds", "a", "single", "filter", "to", "the", "criteria", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/beans/src/main/java/io/apiman/manager/api/beans/search/SearchCriteriaBean.java#L47-L53
48,883
apiman/apiman
common/config/src/main/java/io/apiman/common/config/options/AbstractOptions.java
AbstractOptions.getSubmap
public static Map<String, String> getSubmap(Map<String, String> mapIn, String subkey) { if (mapIn == null || mapIn.isEmpty()) { return Collections.emptyMap(); } // Get map sub-element. return mapIn.entrySet().stream() .filter(entry -> entry.getKey().toLowerCas...
java
public static Map<String, String> getSubmap(Map<String, String> mapIn, String subkey) { if (mapIn == null || mapIn.isEmpty()) { return Collections.emptyMap(); } // Get map sub-element. return mapIn.entrySet().stream() .filter(entry -> entry.getKey().toLowerCas...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getSubmap", "(", "Map", "<", "String", ",", "String", ">", "mapIn", ",", "String", "subkey", ")", "{", "if", "(", "mapIn", "==", "null", "||", "mapIn", ".", "isEmpty", "(", ")", ")", "{...
Takes map and produces a submap using a key. For example, all foo.bar elements are inserted into the new map. @param mapIn config map in @param subkey subkey to determine the submap @return the submap
[ "Takes", "map", "and", "produces", "a", "submap", "using", "a", "key", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/config/src/main/java/io/apiman/common/config/options/AbstractOptions.java#L102-L114
48,884
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.valueChanged
public static boolean valueChanged(Set<?> before, Set<?> after) { if ((before == null && after == null) || after == null) { return false; } if (before == null) { if (after.isEmpty()) { return false; } else { return true; ...
java
public static boolean valueChanged(Set<?> before, Set<?> after) { if ((before == null && after == null) || after == null) { return false; } if (before == null) { if (after.isEmpty()) { return false; } else { return true; ...
[ "public", "static", "boolean", "valueChanged", "(", "Set", "<", "?", ">", "before", ",", "Set", "<", "?", ">", "after", ")", "{", "if", "(", "(", "before", "==", "null", "&&", "after", "==", "null", ")", "||", "after", "==", "null", ")", "{", "re...
Returns true only if the set has changed. @param before the value before change @param after the value after change @return true if value changed, else false
[ "Returns", "true", "only", "if", "the", "set", "has", "changed", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L104-L125
48,885
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.valueChanged
public static boolean valueChanged(Map<String, String> before, Map<String, String> after) { if ((before == null && after == null) || after == null) { return false; } if (before == null) { if (after.isEmpty()) { return false; } else { ...
java
public static boolean valueChanged(Map<String, String> before, Map<String, String> after) { if ((before == null && after == null) || after == null) { return false; } if (before == null) { if (after.isEmpty()) { return false; } else { ...
[ "public", "static", "boolean", "valueChanged", "(", "Map", "<", "String", ",", "String", ">", "before", ",", "Map", "<", "String", ",", "String", ">", "after", ")", "{", "if", "(", "(", "before", "==", "null", "&&", "after", "==", "null", ")", "||", ...
Returns true only if the map has changed. @param before the value before change @param after the value after change @return true if value changed, else false
[ "Returns", "true", "only", "if", "the", "map", "has", "changed", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L134-L161
48,886
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.organizationUpdated
public static AuditEntryBean organizationUpdated(OrganizationBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getId(), AuditEntityType.Organization, securityContex...
java
public static AuditEntryBean organizationUpdated(OrganizationBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getId(), AuditEntityType.Organization, securityContex...
[ "public", "static", "AuditEntryBean", "organizationUpdated", "(", "OrganizationBean", "bean", ",", "EntityUpdatedData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "if", "(", "data", ".", "getChanges", "(", ")", ".", "isEmpty", "(", ")", ")", "...
Creates an audit entry for the 'organization updated' event. @param bean the bean @param data the update @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "organization", "updated", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L203-L214
48,887
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.membershipGranted
public static AuditEntryBean membershipGranted(String organizationId, MembershipData data, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(organizationId, AuditEntityType.Organization, securityContext); entry.setEntityId(null); entry.setEntityVersion(null); ...
java
public static AuditEntryBean membershipGranted(String organizationId, MembershipData data, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(organizationId, AuditEntityType.Organization, securityContext); entry.setEntityId(null); entry.setEntityVersion(null); ...
[ "public", "static", "AuditEntryBean", "membershipGranted", "(", "String", "organizationId", ",", "MembershipData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "organizationId", ",", "AuditEntityType", "....
Creates an audit entry for the 'membership granted' even. @param organizationId the organization id @param data the membership data @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "membership", "granted", "even", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L223-L231
48,888
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.apiCreated
public static AuditEntryBean apiCreated(ApiBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Api, securityContext); entry.setEntityId(bean.getId()); entry.setEntityVersion(null); entry.setData(null); ent...
java
public static AuditEntryBean apiCreated(ApiBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Api, securityContext); entry.setEntityId(bean.getId()); entry.setEntityVersion(null); entry.setData(null); ent...
[ "public", "static", "AuditEntryBean", "apiCreated", "(", "ApiBean", "bean", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getOrganization", "(", ")", ".", "getId", "(", ")", ",", "AuditEntity...
Creates an audit entry for the 'API created' event. @param bean the bean @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "API", "created", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L256-L263
48,889
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.apiUpdated
public static AuditEntryBean apiUpdated(ApiBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Api, securityContext); ...
java
public static AuditEntryBean apiUpdated(ApiBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Api, securityContext); ...
[ "public", "static", "AuditEntryBean", "apiUpdated", "(", "ApiBean", "bean", ",", "EntityUpdatedData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "if", "(", "data", ".", "getChanges", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", ...
Creates an audit entry for the 'API updated' event. @param bean the bean @param data the updated data @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "API", "updated", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L272-L283
48,890
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.apiVersionUpdated
public static AuditEntryBean apiVersionUpdated(ApiVersionBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getApi().getOrganization().getId(), AuditEntityType.Api, ...
java
public static AuditEntryBean apiVersionUpdated(ApiVersionBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getApi().getOrganization().getId(), AuditEntityType.Api, ...
[ "public", "static", "AuditEntryBean", "apiVersionUpdated", "(", "ApiVersionBean", "bean", ",", "EntityUpdatedData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "if", "(", "data", ".", "getChanges", "(", ")", ".", "isEmpty", "(", ")", ")", "{", ...
Creates an audit entry for the 'API version updated' event. @param bean the bean @param data the updated data @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "API", "version", "updated", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L307-L318
48,891
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.clientCreated
public static AuditEntryBean clientCreated(ClientBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Client, securityContext); entry.setEntityId(bean.getId()); entry.setEntityVersion(null); entry.setData(null); ...
java
public static AuditEntryBean clientCreated(ClientBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Client, securityContext); entry.setEntityId(bean.getId()); entry.setEntityVersion(null); entry.setData(null); ...
[ "public", "static", "AuditEntryBean", "clientCreated", "(", "ClientBean", "bean", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getOrganization", "(", ")", ".", "getId", "(", ")", ",", "Audit...
Creates an audit entry for the 'client created' event. @param bean the bean @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "client", "created", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L354-L361
48,892
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.clientUpdated
public static AuditEntryBean clientUpdated(ClientBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Client, securityContex...
java
public static AuditEntryBean clientUpdated(ClientBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Client, securityContex...
[ "public", "static", "AuditEntryBean", "clientUpdated", "(", "ClientBean", "bean", ",", "EntityUpdatedData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "if", "(", "data", ".", "getChanges", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "retur...
Creates an audit entry for the 'client updated' event. @param bean the bean @param data the updated data @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "client", "updated", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L370-L381
48,893
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.clientVersionUpdated
public static AuditEntryBean clientVersionUpdated(ClientVersionBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getClient().getOrganization().getId(), AuditEntityT...
java
public static AuditEntryBean clientVersionUpdated(ClientVersionBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getClient().getOrganization().getId(), AuditEntityT...
[ "public", "static", "AuditEntryBean", "clientVersionUpdated", "(", "ClientVersionBean", "bean", ",", "EntityUpdatedData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "if", "(", "data", ".", "getChanges", "(", ")", ".", "isEmpty", "(", ")", ")", ...
Creates an audit entry for the 'client version updated' event. @param bean the bean @param data the updated data @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "client", "version", "updated", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L405-L416
48,894
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.contractCreatedToApi
public static AuditEntryBean contractCreatedToApi(ContractBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getApi().getApi().getOrganization().getId(), AuditEntityType.Api, securityContext); // Ensure the order of contract-created events are deterministic by adding 1 m...
java
public static AuditEntryBean contractCreatedToApi(ContractBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getApi().getApi().getOrganization().getId(), AuditEntityType.Api, securityContext); // Ensure the order of contract-created events are deterministic by adding 1 m...
[ "public", "static", "AuditEntryBean", "contractCreatedToApi", "(", "ContractBean", "bean", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getApi", "(", ")", ".", "getApi", "(", ")", ".", "getO...
Creates an audit entry for the 'contract created' event. @param bean the bean @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "contract", "created", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L440-L450
48,895
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.policyAdded
public static AuditEntryBean policyAdded(PolicyBean bean, PolicyType type, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganizationId(), null, securityContext); entry.setWhat(AuditEntryType.AddPolicy); entry.setEntityId(bean.getEntityId()); ent...
java
public static AuditEntryBean policyAdded(PolicyBean bean, PolicyType type, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganizationId(), null, securityContext); entry.setWhat(AuditEntryType.AddPolicy); entry.setEntityId(bean.getEntityId()); ent...
[ "public", "static", "AuditEntryBean", "policyAdded", "(", "PolicyBean", "bean", ",", "PolicyType", "type", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getOrganizationId", "(", ")", ",", "null...
Creates an audit entry for the 'policy added' event. Works for all three kinds of policies. @param bean the bean @param type the policy type @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "policy", "added", "event", ".", "Works", "for", "all", "three", "kinds", "of", "policies", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L492-L513
48,896
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.toJSON
private static String toJSON(Object data) { try { return mapper.writeValueAsString(data); } catch (Exception e) { throw new RuntimeException(e); } }
java
private static String toJSON(Object data) { try { return mapper.writeValueAsString(data); } catch (Exception e) { throw new RuntimeException(e); } }
[ "private", "static", "String", "toJSON", "(", "Object", "data", ")", "{", "try", "{", "return", "mapper", ".", "writeValueAsString", "(", "data", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ...
Writes the data object as a JSON string. @param data
[ "Writes", "the", "data", "object", "as", "a", "JSON", "string", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L581-L587
48,897
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.planCreated
public static AuditEntryBean planCreated(PlanBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Plan, securityContext); entry.setEntityId(bean.getId()); entry.setEntityVersion(null); entry.setData(null); ...
java
public static AuditEntryBean planCreated(PlanBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Plan, securityContext); entry.setEntityId(bean.getId()); entry.setEntityVersion(null); entry.setData(null); ...
[ "public", "static", "AuditEntryBean", "planCreated", "(", "PlanBean", "bean", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getOrganization", "(", ")", ".", "getId", "(", ")", ",", "AuditEnti...
Creates an audit entry for the 'plan created' event. @param bean the bean @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "plan", "created", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L595-L602
48,898
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.planUpdated
public static AuditEntryBean planUpdated(PlanBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Plan, securityContext); ...
java
public static AuditEntryBean planUpdated(PlanBean bean, EntityUpdatedData data, ISecurityContext securityContext) { if (data.getChanges().isEmpty()) { return null; } AuditEntryBean entry = newEntry(bean.getOrganization().getId(), AuditEntityType.Plan, securityContext); ...
[ "public", "static", "AuditEntryBean", "planUpdated", "(", "PlanBean", "bean", ",", "EntityUpdatedData", "data", ",", "ISecurityContext", "securityContext", ")", "{", "if", "(", "data", ".", "getChanges", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", ...
Creates an audit entry for the 'plan updated' event. @param bean the bean @param data the updated data @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "plan", "updated", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L611-L622
48,899
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.planVersionCreated
public static AuditEntryBean planVersionCreated(PlanVersionBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getPlan().getOrganization().getId(), AuditEntityType.Plan, securityContext); entry.setEntityId(bean.getPlan().getId()); entry.setEntityVersio...
java
public static AuditEntryBean planVersionCreated(PlanVersionBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getPlan().getOrganization().getId(), AuditEntityType.Plan, securityContext); entry.setEntityId(bean.getPlan().getId()); entry.setEntityVersio...
[ "public", "static", "AuditEntryBean", "planVersionCreated", "(", "PlanVersionBean", "bean", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getPlan", "(", ")", ".", "getOrganization", "(", ")", "...
Creates an audit entry for the 'plan version created' event. @param bean the bean @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "plan", "version", "created", "event", "." ]
8c049c2a2f2e4a69bbb6125686a15edd26f29c21
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L630-L637