repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.planVersionUpdated | public static AuditEntryBean planVersionUpdated(PlanVersionBean bean, EntityUpdatedData data,
ISecurityContext securityContext) {
if (data.getChanges().isEmpty()) {
return null;
}
AuditEntryBean entry = newEntry(bean.getPlan().getOrganization().getId(), AuditEntityType.Pl... | java | public static AuditEntryBean planVersionUpdated(PlanVersionBean bean, EntityUpdatedData data,
ISecurityContext securityContext) {
if (data.getChanges().isEmpty()) {
return null;
}
AuditEntryBean entry = newEntry(bean.getPlan().getOrganization().getId(), AuditEntityType.Pl... | [
"public",
"static",
"AuditEntryBean",
"planVersionUpdated",
"(",
"PlanVersionBean",
"bean",
",",
"EntityUpdatedData",
"data",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"if",
"(",
"data",
".",
"getChanges",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{"... | Creates an audit entry for the 'plan 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",
"plan",
"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#L646-L657 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.apiPublished | public static AuditEntryBean apiPublished(ApiVersionBean bean,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setEntityId(bean.getApi().getId());
entry.setEntityVersion(bean.get... | java | public static AuditEntryBean apiPublished(ApiVersionBean bean,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setEntityId(bean.getApi().getId());
entry.setEntityVersion(bean.get... | [
"public",
"static",
"AuditEntryBean",
"apiPublished",
"(",
"ApiVersionBean",
"bean",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"bean",
".",
"getApi",
"(",
")",
".",
"getOrganization",
"(",
")",
".",
"g... | Creates an audit entry for the 'API published' event.
@param bean the bean
@param securityContext the security context
@return the audit entry | [
"Creates",
"an",
"audit",
"entry",
"for",
"the",
"API",
"published",
"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#L665-L672 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.clientRegistered | public static AuditEntryBean clientRegistered(ClientVersionBean bean,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getClient().getOrganization().getId(), AuditEntityType.Client, securityContext);
entry.setEntityId(bean.getClient().getId());
entry.setEntity... | java | public static AuditEntryBean clientRegistered(ClientVersionBean bean,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getClient().getOrganization().getId(), AuditEntityType.Client, securityContext);
entry.setEntityId(bean.getClient().getId());
entry.setEntity... | [
"public",
"static",
"AuditEntryBean",
"clientRegistered",
"(",
"ClientVersionBean",
"bean",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"bean",
".",
"getClient",
"(",
")",
".",
"getOrganization",
"(",
")",
... | Creates an audit entry for the 'client registered' event.
@param bean the bean
@param securityContext the security context
@return the audit entry | [
"Creates",
"an",
"audit",
"entry",
"for",
"the",
"client",
"registered",
"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#L695-L702 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.policiesReordered | public static AuditEntryBean policiesReordered(ApiVersionBean apiVersion, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(apiVersion.getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setEntityId(apiVersion.getApi().get... | java | public static AuditEntryBean policiesReordered(ApiVersionBean apiVersion, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(apiVersion.getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setEntityId(apiVersion.getApi().get... | [
"public",
"static",
"AuditEntryBean",
"policiesReordered",
"(",
"ApiVersionBean",
"apiVersion",
",",
"PolicyType",
"policyType",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"apiVersion",
".",
"getApi",
"(",
")... | Called when the user reorders the policies in a API.
@param apiVersion the API version
@param policyType the policy type
@param securityContext the security context
@return the audit entry | [
"Called",
"when",
"the",
"user",
"reorders",
"the",
"policies",
"in",
"a",
"API",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L740-L747 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.policiesReordered | public static AuditEntryBean policiesReordered(ClientVersionBean cvb, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(cvb.getClient().getOrganization().getId(), AuditEntityType.Client, securityContext);
entry.setEntityId(cvb.getClient().getId());
... | java | public static AuditEntryBean policiesReordered(ClientVersionBean cvb, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(cvb.getClient().getOrganization().getId(), AuditEntityType.Client, securityContext);
entry.setEntityId(cvb.getClient().getId());
... | [
"public",
"static",
"AuditEntryBean",
"policiesReordered",
"(",
"ClientVersionBean",
"cvb",
",",
"PolicyType",
"policyType",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"cvb",
".",
"getClient",
"(",
")",
"."... | Called when the user reorders the policies in an client.
@param cvb the client and version
@param policyType the policy type
@param securityContext the security context
@return the audit entry | [
"Called",
"when",
"the",
"user",
"reorders",
"the",
"policies",
"in",
"an",
"client",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L756-L763 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.policiesReordered | public static AuditEntryBean policiesReordered(PlanVersionBean pvb, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(pvb.getPlan().getOrganization().getId(), AuditEntityType.Plan, securityContext);
entry.setEntityId(pvb.getPlan().getId());
en... | java | public static AuditEntryBean policiesReordered(PlanVersionBean pvb, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(pvb.getPlan().getOrganization().getId(), AuditEntityType.Plan, securityContext);
entry.setEntityId(pvb.getPlan().getId());
en... | [
"public",
"static",
"AuditEntryBean",
"policiesReordered",
"(",
"PlanVersionBean",
"pvb",
",",
"PolicyType",
"policyType",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"AuditEntryBean",
"entry",
"=",
"newEntry",
"(",
"pvb",
".",
"getPlan",
"(",
")",
".",
... | Called when the user reorders the policies in a plan.
@param pvb the plan and version
@param policyType the policy type
@param securityContext the security context
@return the audit entry | [
"Called",
"when",
"the",
"user",
"reorders",
"the",
"policies",
"in",
"a",
"plan",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L772-L779 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java | AuditUtils.newEntry | private static AuditEntryBean newEntry(String orgId, AuditEntityType type, ISecurityContext securityContext) {
// Wait for 1 ms to guarantee that two audit entries are never created at the same moment in time (which would
// result in non-deterministic sorting by the storage layer)
try { Thread.... | java | private static AuditEntryBean newEntry(String orgId, AuditEntityType type, ISecurityContext securityContext) {
// Wait for 1 ms to guarantee that two audit entries are never created at the same moment in time (which would
// result in non-deterministic sorting by the storage layer)
try { Thread.... | [
"private",
"static",
"AuditEntryBean",
"newEntry",
"(",
"String",
"orgId",
",",
"AuditEntityType",
"type",
",",
"ISecurityContext",
"securityContext",
")",
"{",
"// Wait for 1 ms to guarantee that two audit entries are never created at the same moment in time (which would",
"// resul... | Creates an audit entry.
@param orgId the organization id
@param type
@param securityContext the security context
@return the audit entry | [
"Creates",
"an",
"audit",
"entry",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L788-L799 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.clientVersionAlreadyExistsException | public static final ClientVersionAlreadyExistsException clientVersionAlreadyExistsException(String clientName, String version) {
return new ClientVersionAlreadyExistsException(Messages.i18n.format("clientVersionAlreadyExists", clientName, version)); //$NON-NLS-1$
} | java | public static final ClientVersionAlreadyExistsException clientVersionAlreadyExistsException(String clientName, String version) {
return new ClientVersionAlreadyExistsException(Messages.i18n.format("clientVersionAlreadyExists", clientName, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"ClientVersionAlreadyExistsException",
"clientVersionAlreadyExistsException",
"(",
"String",
"clientName",
",",
"String",
"version",
")",
"{",
"return",
"new",
"ClientVersionAlreadyExistsException",
"(",
"Messages",
".",
"i18n",
".",
"format",
... | Creates an exception from an client name.
@param clientName the client name
@param version the version
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"client",
"name",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L147-L149 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.clientVersionNotFoundException | public static final ClientVersionNotFoundException clientVersionNotFoundException(String clientId, String version) {
return new ClientVersionNotFoundException(Messages.i18n.format("clientVersionDoesNotExist", clientId, version)); //$NON-NLS-1$
} | java | public static final ClientVersionNotFoundException clientVersionNotFoundException(String clientId, String version) {
return new ClientVersionNotFoundException(Messages.i18n.format("clientVersionDoesNotExist", clientId, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"ClientVersionNotFoundException",
"clientVersionNotFoundException",
"(",
"String",
"clientId",
",",
"String",
"version",
")",
"{",
"return",
"new",
"ClientVersionNotFoundException",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"client... | Creates an exception from an client id and version.
@param clientId the client id
@param version the client version
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"client",
"id",
"and",
"version",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L183-L185 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.apiVersionAlreadyExistsException | public static final ApiVersionAlreadyExistsException apiVersionAlreadyExistsException(String apiName, String version) {
return new ApiVersionAlreadyExistsException(Messages.i18n.format("ApiVersionAlreadyExists", apiName, version)); //$NON-NLS-1$
} | java | public static final ApiVersionAlreadyExistsException apiVersionAlreadyExistsException(String apiName, String version) {
return new ApiVersionAlreadyExistsException(Messages.i18n.format("ApiVersionAlreadyExists", apiName, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"ApiVersionAlreadyExistsException",
"apiVersionAlreadyExistsException",
"(",
"String",
"apiName",
",",
"String",
"version",
")",
"{",
"return",
"new",
"ApiVersionAlreadyExistsException",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"A... | Creates an exception from an API name.
@param apiName the API name
@param version the version
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"API",
"name",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L210-L212 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.invalidPlanStatusException | public static InvalidPlanStatusException invalidPlanStatusException(List<PlanVersionSummaryBean> lockedPlans) {
return new InvalidPlanStatusException(Messages.i18n.format("InvalidPlanStatus") + " " + joinList(lockedPlans)); //$NON-NLS-1$ //$NON-NLS-2$
} | java | public static InvalidPlanStatusException invalidPlanStatusException(List<PlanVersionSummaryBean> lockedPlans) {
return new InvalidPlanStatusException(Messages.i18n.format("InvalidPlanStatus") + " " + joinList(lockedPlans)); //$NON-NLS-1$ //$NON-NLS-2$
} | [
"public",
"static",
"InvalidPlanStatusException",
"invalidPlanStatusException",
"(",
"List",
"<",
"PlanVersionSummaryBean",
">",
"lockedPlans",
")",
"{",
"return",
"new",
"InvalidPlanStatusException",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"InvalidPlanStatus\... | Creates an invalid plan status exception.
@param lockedPlans the list of locked plans
@return the exception | [
"Creates",
"an",
"invalid",
"plan",
"status",
"exception",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L264-L266 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.planVersionAlreadyExistsException | public static final PlanVersionAlreadyExistsException planVersionAlreadyExistsException(String planName, String version) {
return new PlanVersionAlreadyExistsException(Messages.i18n.format("PlanVersionAlreadyExists", planName, version)); //$NON-NLS-1$
} | java | public static final PlanVersionAlreadyExistsException planVersionAlreadyExistsException(String planName, String version) {
return new PlanVersionAlreadyExistsException(Messages.i18n.format("PlanVersionAlreadyExists", planName, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"PlanVersionAlreadyExistsException",
"planVersionAlreadyExistsException",
"(",
"String",
"planName",
",",
"String",
"version",
")",
"{",
"return",
"new",
"PlanVersionAlreadyExistsException",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
... | Creates an exception from an plan name.
@param planName the plan name
@param version the version
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"plan",
"name",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L292-L294 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.planVersionNotFoundException | public static final PlanVersionNotFoundException planVersionNotFoundException(String planId, String version) {
return new PlanVersionNotFoundException(Messages.i18n.format("PlanVersionDoesNotExist", planId, version)); //$NON-NLS-1$
} | java | public static final PlanVersionNotFoundException planVersionNotFoundException(String planId, String version) {
return new PlanVersionNotFoundException(Messages.i18n.format("PlanVersionDoesNotExist", planId, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"PlanVersionNotFoundException",
"planVersionNotFoundException",
"(",
"String",
"planId",
",",
"String",
"version",
")",
"{",
"return",
"new",
"PlanVersionNotFoundException",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"PlanVersionDoe... | Creates an exception from an plan id and version.
@param planId the plan id
@param version the version id
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"plan",
"id",
"and",
"version",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L311-L313 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.pluginResourceNotFoundException | public static final PluginResourceNotFoundException pluginResourceNotFoundException(String resourceName,
PluginCoordinates coordinates) {
return new PluginResourceNotFoundException(Messages.i18n.format(
"PluginResourceNotFound", resourceName, coordinates.toString())); //$NON-NLS-1$
... | java | public static final PluginResourceNotFoundException pluginResourceNotFoundException(String resourceName,
PluginCoordinates coordinates) {
return new PluginResourceNotFoundException(Messages.i18n.format(
"PluginResourceNotFound", resourceName, coordinates.toString())); //$NON-NLS-1$
... | [
"public",
"static",
"final",
"PluginResourceNotFoundException",
"pluginResourceNotFoundException",
"(",
"String",
"resourceName",
",",
"PluginCoordinates",
"coordinates",
")",
"{",
"return",
"new",
"PluginResourceNotFoundException",
"(",
"Messages",
".",
"i18n",
".",
"forma... | Creates an exception.
@param resourceName the resource name
@param coordinates the maven coordinates
@return the exception | [
"Creates",
"an",
"exception",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L411-L415 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/HttpConnectorFactory.java | HttpConnectorFactory.getSslStrategy | protected SSLSessionStrategy getSslStrategy(RequiredAuthType authType) {
try {
if (authType == RequiredAuthType.MTLS) {
if (mutualAuthSslStrategy == null) {
mutualAuthSslStrategy = SSLSessionStrategyFactory.buildMutual(tlsOptions);
}
... | java | protected SSLSessionStrategy getSslStrategy(RequiredAuthType authType) {
try {
if (authType == RequiredAuthType.MTLS) {
if (mutualAuthSslStrategy == null) {
mutualAuthSslStrategy = SSLSessionStrategyFactory.buildMutual(tlsOptions);
}
... | [
"protected",
"SSLSessionStrategy",
"getSslStrategy",
"(",
"RequiredAuthType",
"authType",
")",
"{",
"try",
"{",
"if",
"(",
"authType",
"==",
"RequiredAuthType",
".",
"MTLS",
")",
"{",
"if",
"(",
"mutualAuthSslStrategy",
"==",
"null",
")",
"{",
"mutualAuthSslStrate... | Creates the SSL strategy based on configured TLS options.
@param authType
@return an appropriate SSL strategy | [
"Creates",
"the",
"SSL",
"strategy",
"based",
"on",
"configured",
"TLS",
"options",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/HttpConnectorFactory.java#L131-L151 | train |
apiman/apiman | common/util/src/main/java/io/apiman/common/util/AesEncrypter.java | AesEncrypter.main | public static final void main(String [] args) {
if (args.length != 2) {
printUsage();
return;
}
String cmd = args[0];
String input = args[1];
if ("encrypt".equals(cmd)) { //$NON-NLS-1$
System.out.println(AesEncrypter.encrypt(input).substring("$... | java | public static final void main(String [] args) {
if (args.length != 2) {
printUsage();
return;
}
String cmd = args[0];
String input = args[1];
if ("encrypt".equals(cmd)) { //$NON-NLS-1$
System.out.println(AesEncrypter.encrypt(input).substring("$... | [
"public",
"static",
"final",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"2",
")",
"{",
"printUsage",
"(",
")",
";",
"return",
";",
"}",
"String",
"cmd",
"=",
"args",
"[",
"0",
"]",
";",
"S... | Main entry point for the encrypter. Allows encryption and decryption of text
from the command line.
@param args | [
"Main",
"entry",
"point",
"for",
"the",
"encrypter",
".",
"Allows",
"encryption",
"and",
"decryption",
"of",
"text",
"from",
"the",
"command",
"line",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/AesEncrypter.java#L151-L166 | train |
apiman/apiman | manager/ui/war/src/main/java/io/apiman/manager/ui/server/servlets/AbstractUIServlet.java | AbstractUIServlet.getTokenGenerator | protected ITokenGenerator getTokenGenerator() throws ServletException {
if (tokenGenerator == null) {
String tokenGeneratorClassName = getConfig().getManagementApiAuthTokenGenerator();
if (tokenGeneratorClassName == null)
throw new ServletException("No token generator cla... | java | protected ITokenGenerator getTokenGenerator() throws ServletException {
if (tokenGenerator == null) {
String tokenGeneratorClassName = getConfig().getManagementApiAuthTokenGenerator();
if (tokenGeneratorClassName == null)
throw new ServletException("No token generator cla... | [
"protected",
"ITokenGenerator",
"getTokenGenerator",
"(",
")",
"throws",
"ServletException",
"{",
"if",
"(",
"tokenGenerator",
"==",
"null",
")",
"{",
"String",
"tokenGeneratorClassName",
"=",
"getConfig",
"(",
")",
".",
"getManagementApiAuthTokenGenerator",
"(",
")",... | Gets an instance of the configured token generator. | [
"Gets",
"an",
"instance",
"of",
"the",
"configured",
"token",
"generator",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/ui/war/src/main/java/io/apiman/manager/ui/server/servlets/AbstractUIServlet.java#L57-L70 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/soap/SoapHeaderScanner.java | SoapHeaderScanner.scan | public boolean scan(IApimanBuffer buffer) throws SoapEnvelopeNotFoundException {
if (this.buffer == null) {
this.buffer = buffer;
} else {
this.buffer.append(buffer);
}
boolean scanComplete = doScan();
// If our buffer is already "max size" but we haven't ... | java | public boolean scan(IApimanBuffer buffer) throws SoapEnvelopeNotFoundException {
if (this.buffer == null) {
this.buffer = buffer;
} else {
this.buffer.append(buffer);
}
boolean scanComplete = doScan();
// If our buffer is already "max size" but we haven't ... | [
"public",
"boolean",
"scan",
"(",
"IApimanBuffer",
"buffer",
")",
"throws",
"SoapEnvelopeNotFoundException",
"{",
"if",
"(",
"this",
".",
"buffer",
"==",
"null",
")",
"{",
"this",
".",
"buffer",
"=",
"buffer",
";",
"}",
"else",
"{",
"this",
".",
"buffer",
... | Append the given data to any existing buffer, then scan the buffer
looking for the soap headers. If scanning is complete, this method
will return true. If more data is required, then the method will return
false. If an error condition is detected, then an exception will be
thrown.
@param buffer | [
"Append",
"the",
"given",
"data",
"to",
"any",
"existing",
"buffer",
"then",
"scan",
"the",
"buffer",
"looking",
"for",
"the",
"soap",
"headers",
".",
"If",
"scanning",
"is",
"complete",
"this",
"method",
"will",
"return",
"true",
".",
"If",
"more",
"data"... | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/soap/SoapHeaderScanner.java#L72-L85 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/soap/SoapHeaderScanner.java | SoapHeaderScanner.findFrom | private int findFrom(char c, int index) {
int currentIdx = index;
while (currentIdx < buffer.length()) {
if (buffer.get(currentIdx) == c) {
return currentIdx;
}
currentIdx++;
}
return -1;
} | java | private int findFrom(char c, int index) {
int currentIdx = index;
while (currentIdx < buffer.length()) {
if (buffer.get(currentIdx) == c) {
return currentIdx;
}
currentIdx++;
}
return -1;
} | [
"private",
"int",
"findFrom",
"(",
"char",
"c",
",",
"int",
"index",
")",
"{",
"int",
"currentIdx",
"=",
"index",
";",
"while",
"(",
"currentIdx",
"<",
"buffer",
".",
"length",
"(",
")",
")",
"{",
"if",
"(",
"buffer",
".",
"get",
"(",
"currentIdx",
... | Search for the given character in the buffer, starting at the
given index. If not found, return -1. If found, return the
index of the character.
@param c
@param index | [
"Search",
"for",
"the",
"given",
"character",
"in",
"the",
"buffer",
"starting",
"at",
"the",
"given",
"index",
".",
"If",
"not",
"found",
"return",
"-",
"1",
".",
"If",
"found",
"return",
"the",
"index",
"of",
"the",
"character",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/soap/SoapHeaderScanner.java#L269-L278 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/io/ByteBuffer.java | ByteBuffer.readFrom | public int readFrom(InputStream stream) throws IOException {
int bytesRead = stream.read(buffer);
if (bytesRead < 0) {
bytesInBuffer = 0;
} else {
bytesInBuffer = bytesRead;
}
return bytesRead;
} | java | public int readFrom(InputStream stream) throws IOException {
int bytesRead = stream.read(buffer);
if (bytesRead < 0) {
bytesInBuffer = 0;
} else {
bytesInBuffer = bytesRead;
}
return bytesRead;
} | [
"public",
"int",
"readFrom",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"int",
"bytesRead",
"=",
"stream",
".",
"read",
"(",
"buffer",
")",
";",
"if",
"(",
"bytesRead",
"<",
"0",
")",
"{",
"bytesInBuffer",
"=",
"0",
";",
"}",
"els... | Reads from the input stream.
@param stream the input stream to read from
@throws IOException I/O error when reading from buffer
@return bytes read from buffer | [
"Reads",
"from",
"the",
"input",
"stream",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/io/ByteBuffer.java#L328-L336 | train |
apiman/apiman | manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageExporter.java | StorageExporter.export | public void export() {
logger.info("----------------------------"); //$NON-NLS-1$
logger.info(Messages.i18n.format("StorageExporter.StartingExport")); //$NON-NLS-1$
try {
storage.beginTx();
try {
exportMetadata();
exportUsers();
... | java | public void export() {
logger.info("----------------------------"); //$NON-NLS-1$
logger.info(Messages.i18n.format("StorageExporter.StartingExport")); //$NON-NLS-1$
try {
storage.beginTx();
try {
exportMetadata();
exportUsers();
... | [
"public",
"void",
"export",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"----------------------------\"",
")",
";",
"//$NON-NLS-1$",
"logger",
".",
"info",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"StorageExporter.StartingExport\"",
")",
")",
";",
... | Called begin the export process. | [
"Called",
"begin",
"the",
"export",
"process",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageExporter.java#L78-L101 | train |
apiman/apiman | manager/api/core/src/main/java/io/apiman/manager/api/core/util/PolicyTemplateUtil.java | PolicyTemplateUtil.generatePolicyDescription | public static void generatePolicyDescription(PolicyBean policy) throws Exception {
PolicyDefinitionBean def = policy.getDefinition();
PolicyDefinitionTemplateBean templateBean = getTemplateBean(def);
if (templateBean == null) {
return;
}
String cacheKey = def.getId() ... | java | public static void generatePolicyDescription(PolicyBean policy) throws Exception {
PolicyDefinitionBean def = policy.getDefinition();
PolicyDefinitionTemplateBean templateBean = getTemplateBean(def);
if (templateBean == null) {
return;
}
String cacheKey = def.getId() ... | [
"public",
"static",
"void",
"generatePolicyDescription",
"(",
"PolicyBean",
"policy",
")",
"throws",
"Exception",
"{",
"PolicyDefinitionBean",
"def",
"=",
"policy",
".",
"getDefinition",
"(",
")",
";",
"PolicyDefinitionTemplateBean",
"templateBean",
"=",
"getTemplateBea... | Generates a dynamic description for the given policy and stores the
result on the policy bean instance. This should be done prior
to returning the policybean back to the user for a REST call to the
management API.
@param policy the policy
@throws Exception any exception | [
"Generates",
"a",
"dynamic",
"description",
"for",
"the",
"given",
"policy",
"and",
"stores",
"the",
"result",
"on",
"the",
"policy",
"bean",
"instance",
".",
"This",
"should",
"be",
"done",
"prior",
"to",
"returning",
"the",
"policybean",
"back",
"to",
"the... | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/util/PolicyTemplateUtil.java#L68-L103 | train |
apiman/apiman | manager/api/core/src/main/java/io/apiman/manager/api/core/util/PolicyTemplateUtil.java | PolicyTemplateUtil.getTemplateBean | private static PolicyDefinitionTemplateBean getTemplateBean(PolicyDefinitionBean def) {
Locale currentLocale = Messages.i18n.getLocale();
String lang = currentLocale.getLanguage();
String country = lang + "_" + currentLocale.getCountry(); //$NON-NLS-1$
PolicyDefinitionTemplateBean nullB... | java | private static PolicyDefinitionTemplateBean getTemplateBean(PolicyDefinitionBean def) {
Locale currentLocale = Messages.i18n.getLocale();
String lang = currentLocale.getLanguage();
String country = lang + "_" + currentLocale.getCountry(); //$NON-NLS-1$
PolicyDefinitionTemplateBean nullB... | [
"private",
"static",
"PolicyDefinitionTemplateBean",
"getTemplateBean",
"(",
"PolicyDefinitionBean",
"def",
")",
"{",
"Locale",
"currentLocale",
"=",
"Messages",
".",
"i18n",
".",
"getLocale",
"(",
")",
";",
"String",
"lang",
"=",
"currentLocale",
".",
"getLanguage"... | Determines the appropriate template bean to use given the current locale.
@param def | [
"Determines",
"the",
"appropriate",
"template",
"bean",
"to",
"use",
"given",
"the",
"current",
"locale",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/util/PolicyTemplateUtil.java#L109-L137 | train |
apiman/apiman | common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java | PluginUtils.getUserM2Repository | public static File getUserM2Repository() {
// if there is m2override system propery, use it.
String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$
if (m2Override != null) {
return new File(m2Override).getAbsoluteFile();
}
String userH... | java | public static File getUserM2Repository() {
// if there is m2override system propery, use it.
String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$
if (m2Override != null) {
return new File(m2Override).getAbsoluteFile();
}
String userH... | [
"public",
"static",
"File",
"getUserM2Repository",
"(",
")",
"{",
"// if there is m2override system propery, use it.",
"String",
"m2Override",
"=",
"System",
".",
"getProperty",
"(",
"\"apiman.gateway.m2-repository-path\"",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"m2Override"... | Gets the user's local m2 directory or null if not found.
@return user's M2 repo | [
"Gets",
"the",
"user",
"s",
"local",
"m2",
"directory",
"or",
"null",
"if",
"not",
"found",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java#L100-L118 | train |
apiman/apiman | common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java | PluginUtils.getM2Path | public static File getM2Path(File m2Dir, PluginCoordinates coordinates) {
String artifactSubPath = getMavenPath(coordinates);
return new File(m2Dir, artifactSubPath);
} | java | public static File getM2Path(File m2Dir, PluginCoordinates coordinates) {
String artifactSubPath = getMavenPath(coordinates);
return new File(m2Dir, artifactSubPath);
} | [
"public",
"static",
"File",
"getM2Path",
"(",
"File",
"m2Dir",
",",
"PluginCoordinates",
"coordinates",
")",
"{",
"String",
"artifactSubPath",
"=",
"getMavenPath",
"(",
"coordinates",
")",
";",
"return",
"new",
"File",
"(",
"m2Dir",
",",
"artifactSubPath",
")",
... | Find the plugin artifact in the local .m2 directory.
@param m2Dir the maven m2 directory
@param coordinates the coordinates
@return the M2 path | [
"Find",
"the",
"plugin",
"artifact",
"in",
"the",
"local",
".",
"m2",
"directory",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java#L126-L129 | train |
apiman/apiman | common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java | PluginUtils.getMavenPath | public static String getMavenPath(PluginCoordinates coordinates) {
StringBuilder artifactSubPath = new StringBuilder();
artifactSubPath.append(coordinates.getGroupId().replace('.', '/'));
artifactSubPath.append('/');
artifactSubPath.append(coordinates.getArtifactId());
artifactSu... | java | public static String getMavenPath(PluginCoordinates coordinates) {
StringBuilder artifactSubPath = new StringBuilder();
artifactSubPath.append(coordinates.getGroupId().replace('.', '/'));
artifactSubPath.append('/');
artifactSubPath.append(coordinates.getArtifactId());
artifactSu... | [
"public",
"static",
"String",
"getMavenPath",
"(",
"PluginCoordinates",
"coordinates",
")",
"{",
"StringBuilder",
"artifactSubPath",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"artifactSubPath",
".",
"append",
"(",
"coordinates",
".",
"getGroupId",
"(",
")",
".",... | Calculates the relative path of the artifact from the given coordinates.
@param coordinates the coordinates
@return the maven path | [
"Calculates",
"the",
"relative",
"path",
"of",
"the",
"artifact",
"from",
"the",
"given",
"coordinates",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java#L136-L154 | train |
apiman/apiman | manager/api/core/src/main/java/io/apiman/manager/api/core/logging/JsonLoggerImpl.java | JsonLoggerImpl.createLogger | @Override
public IApimanLogger createLogger(Class <?> klazz) {
delegatedLogger = LogManager.getLogger(klazz);
this.klazz = klazz;
return this;
} | java | @Override
public IApimanLogger createLogger(Class <?> klazz) {
delegatedLogger = LogManager.getLogger(klazz);
this.klazz = klazz;
return this;
} | [
"@",
"Override",
"public",
"IApimanLogger",
"createLogger",
"(",
"Class",
"<",
"?",
">",
"klazz",
")",
"{",
"delegatedLogger",
"=",
"LogManager",
".",
"getLogger",
"(",
"klazz",
")",
";",
"this",
".",
"klazz",
"=",
"klazz",
";",
"return",
"this",
";",
"}... | Instantiate a JsonLogger
@param klazz the class instantiating logger | [
"Instantiate",
"a",
"JsonLogger"
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/logging/JsonLoggerImpl.java#L137-L142 | train |
apiman/apiman | gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/CachingPolicy.java | CachingPolicy.buildCacheID | private static String buildCacheID(ApiRequest request) {
StringBuilder req = new StringBuilder();
if (request.getContract() != null) {
req.append(request.getApiKey());
} else {
req.append(request.getApiOrgId()).append(KEY_SEPARATOR).append(request.getApiId())
... | java | private static String buildCacheID(ApiRequest request) {
StringBuilder req = new StringBuilder();
if (request.getContract() != null) {
req.append(request.getApiKey());
} else {
req.append(request.getApiOrgId()).append(KEY_SEPARATOR).append(request.getApiId())
... | [
"private",
"static",
"String",
"buildCacheID",
"(",
"ApiRequest",
"request",
")",
"{",
"StringBuilder",
"req",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"request",
".",
"getContract",
"(",
")",
"!=",
"null",
")",
"{",
"req",
".",
"append",
"... | Builds a cached request id composed by the API key followed by the HTTP
verb and the destination. In the case where there's no API key the ID
will contain ApiOrgId + ApiId + ApiVersion | [
"Builds",
"a",
"cached",
"request",
"id",
"composed",
"by",
"the",
"API",
"key",
"followed",
"by",
"the",
"HTTP",
"verb",
"and",
"the",
"destination",
".",
"In",
"the",
"case",
"where",
"there",
"s",
"no",
"API",
"key",
"the",
"ID",
"will",
"contain",
... | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/CachingPolicy.java#L177-L188 | train |
apiman/apiman | gateway/engine/redis/src/main/java/io/apiman/gateway/engine/redis/common/RedisClientManager.java | RedisClientManager.reset | public void reset() {
if (nonNull(client)) {
synchronized (mutex) {
if (nonNull(client)) { // double-guard
client.shutdown();
client = null;
}
}
}
} | java | public void reset() {
if (nonNull(client)) {
synchronized (mutex) {
if (nonNull(client)) { // double-guard
client.shutdown();
client = null;
}
}
}
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"nonNull",
"(",
"client",
")",
")",
"{",
"synchronized",
"(",
"mutex",
")",
"{",
"if",
"(",
"nonNull",
"(",
"client",
")",
")",
"{",
"// double-guard",
"client",
".",
"shutdown",
"(",
")",
";",
"... | Shut down the Redis client. | [
"Shut",
"down",
"the",
"Redis",
"client",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/redis/src/main/java/io/apiman/gateway/engine/redis/common/RedisClientManager.java#L103-L112 | train |
apiman/apiman | gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/ApimanLauncher.java | ApimanLauncher.handleDeployFailed | @Override
public void handleDeployFailed(Vertx vertx, String mainVerticle, DeploymentOptions deploymentOptions, Throwable cause) {
// Default behaviour is to close Vert.x if the deploy failed
vertx.close();
} | java | @Override
public void handleDeployFailed(Vertx vertx, String mainVerticle, DeploymentOptions deploymentOptions, Throwable cause) {
// Default behaviour is to close Vert.x if the deploy failed
vertx.close();
} | [
"@",
"Override",
"public",
"void",
"handleDeployFailed",
"(",
"Vertx",
"vertx",
",",
"String",
"mainVerticle",
",",
"DeploymentOptions",
"deploymentOptions",
",",
"Throwable",
"cause",
")",
"{",
"// Default behaviour is to close Vert.x if the deploy failed",
"vertx",
".",
... | A deployment failure has been encountered. You can override this method to customize the behavior.
By default it closes the `vertx` instance.
@param vertx the vert.x instance
@param mainVerticle the verticle
@param deploymentOptions the verticle deployment options
@param cause the cause of... | [
"A",
"deployment",
"failure",
"has",
"been",
"encountered",
".",
"You",
"can",
"override",
"this",
"method",
"to",
"customize",
"the",
"behavior",
".",
"By",
"default",
"it",
"closes",
"the",
"vertx",
"instance",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/ApimanLauncher.java#L109-L113 | train |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.preMarshall | private static void preMarshall(Object bean) {
try {
Method method = bean.getClass().getDeclaredMethod("encryptData");
if (method != null) {
method.invoke(bean);
}
} catch (NoSuchMethodException | SecurityException | IllegalAccessException
... | java | private static void preMarshall(Object bean) {
try {
Method method = bean.getClass().getDeclaredMethod("encryptData");
if (method != null) {
method.invoke(bean);
}
} catch (NoSuchMethodException | SecurityException | IllegalAccessException
... | [
"private",
"static",
"void",
"preMarshall",
"(",
"Object",
"bean",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"bean",
".",
"getClass",
"(",
")",
".",
"getDeclaredMethod",
"(",
"\"encryptData\"",
")",
";",
"if",
"(",
"method",
"!=",
"null",
")",
"{",
... | Called before marshalling the bean to a form that will be used
for storage in the DB.
@param bean | [
"Called",
"before",
"marshalling",
"the",
"bean",
"to",
"a",
"form",
"that",
"will",
"be",
"used",
"for",
"storage",
"in",
"the",
"DB",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1437-L1446 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.getApiKey | protected String getApiKey(HttpServletRequest request, QueryMap queryParams) {
String apiKey = request.getHeader("X-API-Key"); //$NON-NLS-1$
if (apiKey == null || apiKey.trim().length() == 0) {
apiKey = queryParams.get("apikey"); //$NON-NLS-1$
}
return apiKey;
} | java | protected String getApiKey(HttpServletRequest request, QueryMap queryParams) {
String apiKey = request.getHeader("X-API-Key"); //$NON-NLS-1$
if (apiKey == null || apiKey.trim().length() == 0) {
apiKey = queryParams.get("apikey"); //$NON-NLS-1$
}
return apiKey;
} | [
"protected",
"String",
"getApiKey",
"(",
"HttpServletRequest",
"request",
",",
"QueryMap",
"queryParams",
")",
"{",
"String",
"apiKey",
"=",
"request",
".",
"getHeader",
"(",
"\"X-API-Key\"",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"apiKey",
"==",
"null",
"||",
... | Gets the API Key from the request. The API key can be passed either via
a custom http request header called X-API-Key or else by a query parameter
in the URL called apikey.
@param request the inbound request
@param queryParams the inbound request query params
@return the api key or null if not found | [
"Gets",
"the",
"API",
"Key",
"from",
"the",
"request",
".",
"The",
"API",
"key",
"can",
"be",
"passed",
"either",
"via",
"a",
"custom",
"http",
"request",
"header",
"called",
"X",
"-",
"API",
"-",
"Key",
"or",
"else",
"by",
"a",
"query",
"parameter",
... | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L250-L256 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.writeResponse | protected void writeResponse(HttpServletResponse response, ApiResponse sresponse) {
response.setStatus(sresponse.getCode());
for (Entry<String, String> entry : sresponse.getHeaders()) {
response.addHeader(entry.getKey(), entry.getValue());
}
} | java | protected void writeResponse(HttpServletResponse response, ApiResponse sresponse) {
response.setStatus(sresponse.getCode());
for (Entry<String, String> entry : sresponse.getHeaders()) {
response.addHeader(entry.getKey(), entry.getValue());
}
} | [
"protected",
"void",
"writeResponse",
"(",
"HttpServletResponse",
"response",
",",
"ApiResponse",
"sresponse",
")",
"{",
"response",
".",
"setStatus",
"(",
"sresponse",
".",
"getCode",
"(",
")",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">... | Writes the API response to the HTTP servlet response object.
@param response
@param sresponse | [
"Writes",
"the",
"API",
"response",
"to",
"the",
"HTTP",
"servlet",
"response",
"object",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L293-L298 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.writeFailure | protected void writeFailure(final ApiRequest request, final HttpServletResponse resp, final PolicyFailure policyFailure) {
getFailureWriter().write(request, policyFailure, new IApiClientResponse() {
@Override
public void write(StringBuffer buffer) {
write(buffer.toString(... | java | protected void writeFailure(final ApiRequest request, final HttpServletResponse resp, final PolicyFailure policyFailure) {
getFailureWriter().write(request, policyFailure, new IApiClientResponse() {
@Override
public void write(StringBuffer buffer) {
write(buffer.toString(... | [
"protected",
"void",
"writeFailure",
"(",
"final",
"ApiRequest",
"request",
",",
"final",
"HttpServletResponse",
"resp",
",",
"final",
"PolicyFailure",
"policyFailure",
")",
"{",
"getFailureWriter",
"(",
")",
".",
"write",
"(",
"request",
",",
"policyFailure",
","... | Writes a policy failure to the http response.
@param request
@param resp
@param policyFailure | [
"Writes",
"a",
"policy",
"failure",
"to",
"the",
"http",
"response",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L306-L341 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.writeError | protected void writeError(final ApiRequest request, final HttpServletResponse resp, final Throwable error) {
getErrorWriter().write(request, error, new IApiClientResponse() {
@Override
public void write(StringBuffer buffer) {
write(buffer.toString());
}
... | java | protected void writeError(final ApiRequest request, final HttpServletResponse resp, final Throwable error) {
getErrorWriter().write(request, error, new IApiClientResponse() {
@Override
public void write(StringBuffer buffer) {
write(buffer.toString());
}
... | [
"protected",
"void",
"writeError",
"(",
"final",
"ApiRequest",
"request",
",",
"final",
"HttpServletResponse",
"resp",
",",
"final",
"Throwable",
"error",
")",
"{",
"getErrorWriter",
"(",
")",
".",
"write",
"(",
"request",
",",
"error",
",",
"new",
"IApiClient... | Writes an error to the servlet response object.
@param request
@param resp
@param error | [
"Writes",
"an",
"error",
"to",
"the",
"servlet",
"response",
"object",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L349-L384 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.parseApiRequestPath | protected static final ApiRequestPathInfo parseApiRequestPath(HttpServletRequest request) {
return ApimanPathUtils.parseApiRequestPath(request.getHeader(ApimanPathUtils.X_API_VERSION_HEADER),
request.getHeader(ApimanPathUtils.ACCEPT_HEADER),
request.getPathInfo());
} | java | protected static final ApiRequestPathInfo parseApiRequestPath(HttpServletRequest request) {
return ApimanPathUtils.parseApiRequestPath(request.getHeader(ApimanPathUtils.X_API_VERSION_HEADER),
request.getHeader(ApimanPathUtils.ACCEPT_HEADER),
request.getPathInfo());
} | [
"protected",
"static",
"final",
"ApiRequestPathInfo",
"parseApiRequestPath",
"(",
"HttpServletRequest",
"request",
")",
"{",
"return",
"ApimanPathUtils",
".",
"parseApiRequestPath",
"(",
"request",
".",
"getHeader",
"(",
"ApimanPathUtils",
".",
"X_API_VERSION_HEADER",
")"... | Parse a API request path from servlet path info.
@param pathInfo
@return the path info parsed into its component parts | [
"Parse",
"a",
"API",
"request",
"path",
"from",
"servlet",
"path",
"info",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L391-L395 | train |
apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java | GatewayServlet.parseApiRequestQueryParams | protected static final QueryMap parseApiRequestQueryParams(String queryString) {
QueryMap rval = new QueryMap();
if (queryString != null) {
try {
String[] pairSplit = queryString.split("&"); //$NON-NLS-1$
for (String paramPair : pairSplit) {
... | java | protected static final QueryMap parseApiRequestQueryParams(String queryString) {
QueryMap rval = new QueryMap();
if (queryString != null) {
try {
String[] pairSplit = queryString.split("&"); //$NON-NLS-1$
for (String paramPair : pairSplit) {
... | [
"protected",
"static",
"final",
"QueryMap",
"parseApiRequestQueryParams",
"(",
"String",
"queryString",
")",
"{",
"QueryMap",
"rval",
"=",
"new",
"QueryMap",
"(",
")",
";",
"if",
"(",
"queryString",
"!=",
"null",
")",
"{",
"try",
"{",
"String",
"[",
"]",
"... | Parses the query string into a map.
@param queryString | [
"Parses",
"the",
"query",
"string",
"into",
"a",
"map",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/GatewayServlet.java#L401-L426 | train |
apiman/apiman | gateway/engine/hazelcast/src/main/java/io/apiman/gateway/engine/hazelcast/common/HazelcastInstanceManager.java | HazelcastInstanceManager.reset | public void reset() {
if (null != hazelcastInstance) {
synchronized (mutex) {
if (null == hazelcastInstance) {
hazelcastInstance.shutdown();
hazelcastInstance = null;
}
}
}
if (!stores.isEmpty()) {
... | java | public void reset() {
if (null != hazelcastInstance) {
synchronized (mutex) {
if (null == hazelcastInstance) {
hazelcastInstance.shutdown();
hazelcastInstance = null;
}
}
}
if (!stores.isEmpty()) {
... | [
"public",
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"hazelcastInstance",
")",
"{",
"synchronized",
"(",
"mutex",
")",
"{",
"if",
"(",
"null",
"==",
"hazelcastInstance",
")",
"{",
"hazelcastInstance",
".",
"shutdown",
"(",
")",
";",
"hazelc... | Shut down the Hazelcast instance and clear stores references. | [
"Shut",
"down",
"the",
"Hazelcast",
"instance",
"and",
"clear",
"stores",
"references",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/hazelcast/src/main/java/io/apiman/gateway/engine/hazelcast/common/HazelcastInstanceManager.java#L76-L90 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/FieldValidator.java | FieldValidator.validateName | public static void validateName(String name) throws InvalidNameException {
if (StringUtils.isEmpty(name)) {
throw ExceptionFactory.invalidNameException(Messages.i18n.format("FieldValidator.EmptyNameError")); //$NON-NLS-1$
}
} | java | public static void validateName(String name) throws InvalidNameException {
if (StringUtils.isEmpty(name)) {
throw ExceptionFactory.invalidNameException(Messages.i18n.format("FieldValidator.EmptyNameError")); //$NON-NLS-1$
}
} | [
"public",
"static",
"void",
"validateName",
"(",
"String",
"name",
")",
"throws",
"InvalidNameException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"name",
")",
")",
"{",
"throw",
"ExceptionFactory",
".",
"invalidNameException",
"(",
"Messages",
".",
... | Validates an entity name.
@param name
@throws InvalidNameException | [
"Validates",
"an",
"entity",
"name",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/FieldValidator.java#L38-L42 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/FieldValidator.java | FieldValidator.validateVersion | public static void validateVersion(String name) throws InvalidNameException {
if (StringUtils.isEmpty(name)) {
throw ExceptionFactory.invalidVersionException(Messages.i18n.format("FieldValidator.EmptyVersionError")); //$NON-NLS-1$
}
} | java | public static void validateVersion(String name) throws InvalidNameException {
if (StringUtils.isEmpty(name)) {
throw ExceptionFactory.invalidVersionException(Messages.i18n.format("FieldValidator.EmptyVersionError")); //$NON-NLS-1$
}
} | [
"public",
"static",
"void",
"validateVersion",
"(",
"String",
"name",
")",
"throws",
"InvalidNameException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"name",
")",
")",
"{",
"throw",
"ExceptionFactory",
".",
"invalidVersionException",
"(",
"Messages",
... | Validates an version.
@param name
@throws InvalidNameException | [
"Validates",
"an",
"version",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/FieldValidator.java#L49-L53 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/SingleNodeRateLimiterComponent.java | SingleNodeRateLimiterComponent.saveBuckets | private void saveBuckets() {
if (lastModifiedOn > lastSavedOn) {
System.out.println("Persisting current rates to: " + savedRates); //$NON-NLS-1$
Properties props = new Properties();
for (Entry<String, RateLimiterBucket> entry : buckets.entrySet()) {
String val... | java | private void saveBuckets() {
if (lastModifiedOn > lastSavedOn) {
System.out.println("Persisting current rates to: " + savedRates); //$NON-NLS-1$
Properties props = new Properties();
for (Entry<String, RateLimiterBucket> entry : buckets.entrySet()) {
String val... | [
"private",
"void",
"saveBuckets",
"(",
")",
"{",
"if",
"(",
"lastModifiedOn",
">",
"lastSavedOn",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Persisting current rates to: \"",
"+",
"savedRates",
")",
";",
"//$NON-NLS-1$",
"Properties",
"props",
"=",
... | Saves the current list of buckets into a file. | [
"Saves",
"the",
"current",
"list",
"of",
"buckets",
"into",
"a",
"file",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/SingleNodeRateLimiterComponent.java#L140-L155 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/SingleNodeRateLimiterComponent.java | SingleNodeRateLimiterComponent.loadBuckets | private void loadBuckets() {
Properties props = new Properties();
try (FileReader reader = new FileReader(savedRates)) {
props.load(reader);
} catch (IOException e) {
throw new RuntimeException(e);
}
for (Entry<Object, Object> entry : props.entrySet()) {
... | java | private void loadBuckets() {
Properties props = new Properties();
try (FileReader reader = new FileReader(savedRates)) {
props.load(reader);
} catch (IOException e) {
throw new RuntimeException(e);
}
for (Entry<Object, Object> entry : props.entrySet()) {
... | [
"private",
"void",
"loadBuckets",
"(",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"(",
"FileReader",
"reader",
"=",
"new",
"FileReader",
"(",
"savedRates",
")",
")",
"{",
"props",
".",
"load",
"(",
"reader",
")",
"... | Loads the saved rates from a file. Done only on startup. | [
"Loads",
"the",
"saved",
"rates",
"from",
"a",
"file",
".",
"Done",
"only",
"on",
"startup",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/SingleNodeRateLimiterComponent.java#L160-L178 | train |
apiman/apiman | gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/auth/LDAPIdentityValidator.java | LDAPIdentityValidator.formatDn | private String formatDn(String dnPattern, String username, ApiRequest request) {
Map<String, String> valuesMap = request.getHeaders().toMap();
valuesMap.put("username", username); //$NON-NLS-1$
StrSubstitutor sub = new StrSubstitutor(valuesMap);
return sub.replace(dnPattern);
} | java | private String formatDn(String dnPattern, String username, ApiRequest request) {
Map<String, String> valuesMap = request.getHeaders().toMap();
valuesMap.put("username", username); //$NON-NLS-1$
StrSubstitutor sub = new StrSubstitutor(valuesMap);
return sub.replace(dnPattern);
} | [
"private",
"String",
"formatDn",
"(",
"String",
"dnPattern",
",",
"String",
"username",
",",
"ApiRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"valuesMap",
"=",
"request",
".",
"getHeaders",
"(",
")",
".",
"toMap",
"(",
")",
";... | Formats the configured DN by replacing any properties it finds.
@param dnPattern
@param username
@param request | [
"Formats",
"the",
"configured",
"DN",
"by",
"replacing",
"any",
"properties",
"it",
"finds",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/auth/LDAPIdentityValidator.java#L269-L274 | train |
apiman/apiman | common/es/src/main/java/io/apiman/common/es/util/ESUtils.java | ESUtils.rootCause | public static Throwable rootCause(Throwable e) {
Throwable cause = e;
while (cause.getCause() != null) {
cause = e.getCause();
}
return cause;
} | java | public static Throwable rootCause(Throwable e) {
Throwable cause = e;
while (cause.getCause() != null) {
cause = e.getCause();
}
return cause;
} | [
"public",
"static",
"Throwable",
"rootCause",
"(",
"Throwable",
"e",
")",
"{",
"Throwable",
"cause",
"=",
"e",
";",
"while",
"(",
"cause",
".",
"getCause",
"(",
")",
"!=",
"null",
")",
"{",
"cause",
"=",
"e",
".",
"getCause",
"(",
")",
";",
"}",
"r... | Gets the root cause of an exception.
@param e the root cause
@return the throwable | [
"Gets",
"the",
"root",
"cause",
"of",
"an",
"exception",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/es/src/main/java/io/apiman/common/es/util/ESUtils.java#L36-L42 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java | ActionResourceImpl.retireApi | private void retireApi(ActionBean action) throws ActionException {
if (!securityContext.hasPermission(PermissionType.apiAdmin, action.getOrganizationId()))
throw ExceptionFactory.notAuthorizedException();
ApiVersionBean versionBean;
try {
versionBean = orgs.getApiVersion... | java | private void retireApi(ActionBean action) throws ActionException {
if (!securityContext.hasPermission(PermissionType.apiAdmin, action.getOrganizationId()))
throw ExceptionFactory.notAuthorizedException();
ApiVersionBean versionBean;
try {
versionBean = orgs.getApiVersion... | [
"private",
"void",
"retireApi",
"(",
"ActionBean",
"action",
")",
"throws",
"ActionException",
"{",
"if",
"(",
"!",
"securityContext",
".",
"hasPermission",
"(",
"PermissionType",
".",
"apiAdmin",
",",
"action",
".",
"getOrganizationId",
"(",
")",
")",
")",
"t... | Retires an API that is currently published to the Gateway.
@param action | [
"Retires",
"an",
"API",
"that",
"is",
"currently",
"published",
"to",
"the",
"Gateway",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java#L260-L321 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java | ActionResourceImpl.aggregateContractPolicies | private List<Policy> aggregateContractPolicies(ContractSummaryBean contractBean) {
try {
List<Policy> policies = new ArrayList<>();
PolicyType [] types = new PolicyType[] {
PolicyType.Client, PolicyType.Plan, PolicyType.Api
};
for (PolicyType p... | java | private List<Policy> aggregateContractPolicies(ContractSummaryBean contractBean) {
try {
List<Policy> policies = new ArrayList<>();
PolicyType [] types = new PolicyType[] {
PolicyType.Client, PolicyType.Plan, PolicyType.Api
};
for (PolicyType p... | [
"private",
"List",
"<",
"Policy",
">",
"aggregateContractPolicies",
"(",
"ContractSummaryBean",
"contractBean",
")",
"{",
"try",
"{",
"List",
"<",
"Policy",
">",
"policies",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"PolicyType",
"[",
"]",
"types",
"=",
... | Aggregates the API, client, and plan policies into a single ordered list.
@param contractBean | [
"Aggregates",
"the",
"API",
"client",
"and",
"plan",
"policies",
"into",
"a",
"single",
"ordered",
"list",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java#L451-L501 | train |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java | ActionResourceImpl.lockPlan | private void lockPlan(ActionBean action) throws ActionException {
if (!securityContext.hasPermission(PermissionType.planAdmin, action.getOrganizationId()))
throw ExceptionFactory.notAuthorizedException();
PlanVersionBean versionBean;
try {
versionBean = orgs.getPlanVersi... | java | private void lockPlan(ActionBean action) throws ActionException {
if (!securityContext.hasPermission(PermissionType.planAdmin, action.getOrganizationId()))
throw ExceptionFactory.notAuthorizedException();
PlanVersionBean versionBean;
try {
versionBean = orgs.getPlanVersi... | [
"private",
"void",
"lockPlan",
"(",
"ActionBean",
"action",
")",
"throws",
"ActionException",
"{",
"if",
"(",
"!",
"securityContext",
".",
"hasPermission",
"(",
"PermissionType",
".",
"planAdmin",
",",
"action",
".",
"getOrganizationId",
"(",
")",
")",
")",
"t... | Locks the plan.
@param action | [
"Locks",
"the",
"plan",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java#L585-L616 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java | DefaultPluginRegistry.readPluginFile | protected Plugin readPluginFile(PluginCoordinates coordinates, File pluginFile) throws Exception {
try {
PluginClassLoader pluginClassLoader = createPluginClassLoader(pluginFile);
URL specFile = pluginClassLoader.getResource(PluginUtils.PLUGIN_SPEC_PATH);
if (specFile == null... | java | protected Plugin readPluginFile(PluginCoordinates coordinates, File pluginFile) throws Exception {
try {
PluginClassLoader pluginClassLoader = createPluginClassLoader(pluginFile);
URL specFile = pluginClassLoader.getResource(PluginUtils.PLUGIN_SPEC_PATH);
if (specFile == null... | [
"protected",
"Plugin",
"readPluginFile",
"(",
"PluginCoordinates",
"coordinates",
",",
"File",
"pluginFile",
")",
"throws",
"Exception",
"{",
"try",
"{",
"PluginClassLoader",
"pluginClassLoader",
"=",
"createPluginClassLoader",
"(",
"pluginFile",
")",
";",
"URL",
"spe... | Reads the plugin into an object. This method will fail if the plugin is not valid.
This could happen if the file is not a java archive, or if the plugin spec file is
missing from the archive, etc. | [
"Reads",
"the",
"plugin",
"into",
"an",
"object",
".",
"This",
"method",
"will",
"fail",
"if",
"the",
"plugin",
"is",
"not",
"valid",
".",
"This",
"could",
"happen",
"if",
"the",
"file",
"is",
"not",
"a",
"java",
"archive",
"or",
"if",
"the",
"plugin",... | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java#L298-L314 | train |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java | DefaultPluginRegistry.downloadArtifactTo | protected void downloadArtifactTo(URL artifactUrl, File pluginFile, IAsyncResultHandler<File> handler) {
InputStream istream = null;
OutputStream ostream = null;
try {
URLConnection connection = artifactUrl.openConnection();
connection.connect();
if (connectio... | java | protected void downloadArtifactTo(URL artifactUrl, File pluginFile, IAsyncResultHandler<File> handler) {
InputStream istream = null;
OutputStream ostream = null;
try {
URLConnection connection = artifactUrl.openConnection();
connection.connect();
if (connectio... | [
"protected",
"void",
"downloadArtifactTo",
"(",
"URL",
"artifactUrl",
",",
"File",
"pluginFile",
",",
"IAsyncResultHandler",
"<",
"File",
">",
"handler",
")",
"{",
"InputStream",
"istream",
"=",
"null",
";",
"OutputStream",
"ostream",
"=",
"null",
";",
"try",
... | Download the artifact at the given URL and store it locally into the given
plugin file path. | [
"Download",
"the",
"artifact",
"at",
"the",
"given",
"URL",
"and",
"store",
"it",
"locally",
"into",
"the",
"given",
"plugin",
"file",
"path",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/DefaultPluginRegistry.java#L375-L399 | train |
apiman/apiman | gateway/platforms/war/src/main/java/io/apiman/gateway/platforms/war/WarGateway.java | WarGateway.init | public static void init() {
config = new WarEngineConfig();
// Surface the max-payload-buffer-size property as a system property, if it exists in the apiman.properties file
if (System.getProperty(GatewayConfigProperties.MAX_PAYLOAD_BUFFER_SIZE) == null) {
String propVal = config.getC... | java | public static void init() {
config = new WarEngineConfig();
// Surface the max-payload-buffer-size property as a system property, if it exists in the apiman.properties file
if (System.getProperty(GatewayConfigProperties.MAX_PAYLOAD_BUFFER_SIZE) == null) {
String propVal = config.getC... | [
"public",
"static",
"void",
"init",
"(",
")",
"{",
"config",
"=",
"new",
"WarEngineConfig",
"(",
")",
";",
"// Surface the max-payload-buffer-size property as a system property, if it exists in the apiman.properties file",
"if",
"(",
"System",
".",
"getProperty",
"(",
"Gate... | Initialize the gateway. | [
"Initialize",
"the",
"gateway",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/war/src/main/java/io/apiman/gateway/platforms/war/WarGateway.java#L44-L58 | train |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.validateClient | private void validateClient(Client client) throws RegistrationException {
Set<Contract> contracts = client.getContracts();
if (contracts.isEmpty()) {
throw new NoContractFoundException(Messages.i18n.format("ESRegistry.NoContracts")); //$NON-NLS-1$
}
for (Contract contract : c... | java | private void validateClient(Client client) throws RegistrationException {
Set<Contract> contracts = client.getContracts();
if (contracts.isEmpty()) {
throw new NoContractFoundException(Messages.i18n.format("ESRegistry.NoContracts")); //$NON-NLS-1$
}
for (Contract contract : c... | [
"private",
"void",
"validateClient",
"(",
"Client",
"client",
")",
"throws",
"RegistrationException",
"{",
"Set",
"<",
"Contract",
">",
"contracts",
"=",
"client",
".",
"getContracts",
"(",
")",
";",
"if",
"(",
"contracts",
".",
"isEmpty",
"(",
")",
")",
"... | Validate that the client should be registered.
@param client | [
"Validate",
"that",
"the",
"client",
"should",
"be",
"registered",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L145-L153 | train |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.getApi | protected Api getApi(String id) throws IOException {
Get get = new Get.Builder(getIndexName(), id).type("api").build(); //$NON-NLS-1$
JestResult result = getClient().execute(get);
if (result.isSucceeded()) {
Api api = result.getSourceAsObject(Api.class);
return api;
... | java | protected Api getApi(String id) throws IOException {
Get get = new Get.Builder(getIndexName(), id).type("api").build(); //$NON-NLS-1$
JestResult result = getClient().execute(get);
if (result.isSucceeded()) {
Api api = result.getSourceAsObject(Api.class);
return api;
... | [
"protected",
"Api",
"getApi",
"(",
"String",
"id",
")",
"throws",
"IOException",
"{",
"Get",
"get",
"=",
"new",
"Get",
".",
"Builder",
"(",
"getIndexName",
"(",
")",
",",
"id",
")",
".",
"type",
"(",
"\"api\"",
")",
".",
"build",
"(",
")",
";",
"//... | Gets the api synchronously.
@param id
@throws IOException | [
"Gets",
"the",
"api",
"synchronously",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L283-L292 | train |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.getClient | protected Client getClient(String id) throws IOException {
Get get = new Get.Builder(getIndexName(), id).type("client").build(); //$NON-NLS-1$
JestResult result = getClient().execute(get);
if (result.isSucceeded()) {
Client client = result.getSourceAsObject(Client.class);
... | java | protected Client getClient(String id) throws IOException {
Get get = new Get.Builder(getIndexName(), id).type("client").build(); //$NON-NLS-1$
JestResult result = getClient().execute(get);
if (result.isSucceeded()) {
Client client = result.getSourceAsObject(Client.class);
... | [
"protected",
"Client",
"getClient",
"(",
"String",
"id",
")",
"throws",
"IOException",
"{",
"Get",
"get",
"=",
"new",
"Get",
".",
"Builder",
"(",
"getIndexName",
"(",
")",
",",
"id",
")",
".",
"type",
"(",
"\"client\"",
")",
".",
"build",
"(",
")",
"... | Gets the client synchronously.
@param id
@throws IOException | [
"Gets",
"the",
"client",
"synchronously",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L313-L322 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.