id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
48,900 | 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 |
48,901 | 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 |
48,902 | 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 |
48,903 | 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 |
48,904 | 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 |
48,905 | 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 |
48,906 | 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 |
48,907 | 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 |
48,908 | 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 |
48,909 | 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 |
48,910 | 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 |
48,911 | 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 |
48,912 | 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 |
48,913 | 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 |
48,914 | 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 |
48,915 | 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 |
48,916 | 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 |
48,917 | 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 |
48,918 | 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 |
48,919 | 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 |
48,920 | 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 |
48,921 | 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 |
48,922 | 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 |
48,923 | 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 |
48,924 | 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 |
48,925 | 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 |
48,926 | 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 |
48,927 | 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 |
48,928 | 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 |
48,929 | 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 |
48,930 | 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 |
48,931 | 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 |
48,932 | 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 |
48,933 | 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 |
48,934 | 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 |
48,935 | 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 |
48,936 | 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 |
48,937 | 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 |
48,938 | 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 |
48,939 | 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 |
48,940 | 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 |
48,941 | 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 |
48,942 | 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 |
48,943 | 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 |
48,944 | 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 |
48,945 | 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 |
48,946 | 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 |
48,947 | 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 |
48,948 | 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 |
48,949 | 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 |
48,950 | 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 |
48,951 | 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 |
48,952 | 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 |
48,953 | apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.getApiId | private String getApiId(Contract contract) {
return getApiId(contract.getApiOrgId(), contract.getApiId(), contract.getApiVersion());
} | java | private String getApiId(Contract contract) {
return getApiId(contract.getApiOrgId(), contract.getApiId(), contract.getApiVersion());
} | [
"private",
"String",
"getApiId",
"(",
"Contract",
"contract",
")",
"{",
"return",
"getApiId",
"(",
"contract",
".",
"getApiOrgId",
"(",
")",
",",
"contract",
".",
"getApiId",
"(",
")",
",",
"contract",
".",
"getApiVersion",
"(",
")",
")",
";",
"}"
] | Generates a valid document ID for a api referenced by a contract, used to
retrieve the api from ES.
@param contract | [
"Generates",
"a",
"valid",
"document",
"ID",
"for",
"a",
"api",
"referenced",
"by",
"a",
"contract",
"used",
"to",
"retrieve",
"the",
"api",
"from",
"ES",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L617-L619 |
48,954 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.produceToken | public static final String produceToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken authToken = createAuthToken(principal, roles, expiresInMillis);
String json = toJSON(authToken);
return StringUtils.newStringUtf8(Base64.encodeBase64(StringUtils.getBytesUtf8(json)));
... | java | public static final String produceToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken authToken = createAuthToken(principal, roles, expiresInMillis);
String json = toJSON(authToken);
return StringUtils.newStringUtf8(Base64.encodeBase64(StringUtils.getBytesUtf8(json)));
... | [
"public",
"static",
"final",
"String",
"produceToken",
"(",
"String",
"principal",
",",
"Set",
"<",
"String",
">",
"roles",
",",
"int",
"expiresInMillis",
")",
"{",
"AuthToken",
"authToken",
"=",
"createAuthToken",
"(",
"principal",
",",
"roles",
",",
"expires... | Produce a token suitable for transmission. This will generate the auth token,
then serialize it to a JSON string, then Base64 encode the JSON.
@param principal the auth principal
@param roles the auth roles
@param expiresInMillis the number of millis to expiry
@return the token | [
"Produce",
"a",
"token",
"suitable",
"for",
"transmission",
".",
"This",
"will",
"generate",
"the",
"auth",
"token",
"then",
"serialize",
"it",
"to",
"a",
"JSON",
"string",
"then",
"Base64",
"encode",
"the",
"JSON",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L74-L78 |
48,955 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.validateToken | public static final void validateToken(AuthToken token) throws IllegalArgumentException {
if (token.getExpiresOn().before(new Date())) {
throw new IllegalArgumentException("Authentication token expired: " + token.getExpiresOn()); //$NON-NLS-1$
}
String validSig = generateSignature(to... | java | public static final void validateToken(AuthToken token) throws IllegalArgumentException {
if (token.getExpiresOn().before(new Date())) {
throw new IllegalArgumentException("Authentication token expired: " + token.getExpiresOn()); //$NON-NLS-1$
}
String validSig = generateSignature(to... | [
"public",
"static",
"final",
"void",
"validateToken",
"(",
"AuthToken",
"token",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"token",
".",
"getExpiresOn",
"(",
")",
".",
"before",
"(",
"new",
"Date",
"(",
")",
")",
")",
"{",
"throw",
"new",
... | Validates an auth token. This checks the expiration time of the token against
the current system time. It also checks the validity of the signature.
@param token the authentication token
@throws IllegalArgumentException when the token is invalid | [
"Validates",
"an",
"auth",
"token",
".",
"This",
"checks",
"the",
"expiration",
"time",
"of",
"the",
"token",
"against",
"the",
"current",
"system",
"time",
".",
"It",
"also",
"checks",
"the",
"validity",
"of",
"the",
"signature",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L103-L111 |
48,956 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.createAuthToken | public static final AuthToken createAuthToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken token = new AuthToken();
token.setIssuedOn(new Date());
token.setExpiresOn(new Date(System.currentTimeMillis() + expiresInMillis));
token.setPrincipal(principal);
t... | java | public static final AuthToken createAuthToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken token = new AuthToken();
token.setIssuedOn(new Date());
token.setExpiresOn(new Date(System.currentTimeMillis() + expiresInMillis));
token.setPrincipal(principal);
t... | [
"public",
"static",
"final",
"AuthToken",
"createAuthToken",
"(",
"String",
"principal",
",",
"Set",
"<",
"String",
">",
"roles",
",",
"int",
"expiresInMillis",
")",
"{",
"AuthToken",
"token",
"=",
"new",
"AuthToken",
"(",
")",
";",
"token",
".",
"setIssuedO... | Creates an auth token.
@param principal the auth principal
@param roles the auth roles
@param expiresInMillis the number of millis to expiry
@return the auth token | [
"Creates",
"an",
"auth",
"token",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L120-L128 |
48,957 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.signAuthToken | public static final void signAuthToken(AuthToken token) {
String signature = generateSignature(token);
token.setSignature(signature);
} | java | public static final void signAuthToken(AuthToken token) {
String signature = generateSignature(token);
token.setSignature(signature);
} | [
"public",
"static",
"final",
"void",
"signAuthToken",
"(",
"AuthToken",
"token",
")",
"{",
"String",
"signature",
"=",
"generateSignature",
"(",
"token",
")",
";",
"token",
".",
"setSignature",
"(",
"signature",
")",
";",
"}"
] | Adds a digital signature to the auth token.
@param token the auth token | [
"Adds",
"a",
"digital",
"signature",
"to",
"the",
"auth",
"token",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L134-L137 |
48,958 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.generateSignature | private static String generateSignature(AuthToken token) {
StringBuilder builder = new StringBuilder();
builder.append(token.getPrincipal());
builder.append("||"); //$NON-NLS-1$
builder.append(token.getExpiresOn().getTime());
builder.append("||"); //$NON-NLS-1$
builder.ap... | java | private static String generateSignature(AuthToken token) {
StringBuilder builder = new StringBuilder();
builder.append(token.getPrincipal());
builder.append("||"); //$NON-NLS-1$
builder.append(token.getExpiresOn().getTime());
builder.append("||"); //$NON-NLS-1$
builder.ap... | [
"private",
"static",
"String",
"generateSignature",
"(",
"AuthToken",
"token",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"token",
".",
"getPrincipal",
"(",
")",
")",
";",
"builder",
".",
... | Generates a signature for the given token.
@param token | [
"Generates",
"a",
"signature",
"for",
"the",
"given",
"token",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L143-L164 |
48,959 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.toJSON | public static final String toJSON(AuthToken token) {
try {
return mapper.writer().writeValueAsString(token);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static final String toJSON(AuthToken token) {
try {
return mapper.writer().writeValueAsString(token);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"final",
"String",
"toJSON",
"(",
"AuthToken",
"token",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"writer",
"(",
")",
".",
"writeValueAsString",
"(",
"token",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"n... | Convert the auth token to a JSON string.
@param token the auth token
@return the token as json | [
"Convert",
"the",
"auth",
"token",
"to",
"a",
"JSON",
"string",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L171-L177 |
48,960 | apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.fromJSON | public static final AuthToken fromJSON(String json) {
try {
return mapper.reader(AuthToken.class).readValue(json);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static final AuthToken fromJSON(String json) {
try {
return mapper.reader(AuthToken.class).readValue(json);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"final",
"AuthToken",
"fromJSON",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"reader",
"(",
"AuthToken",
".",
"class",
")",
".",
"readValue",
"(",
"json",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")"... | Read the auth token from the JSON string.
@param json the token as a json string
@return the token | [
"Read",
"the",
"auth",
"token",
"from",
"the",
"JSON",
"string",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L184-L190 |
48,961 | apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/AbstractEngineFactory.java | AbstractEngineFactory.createEngine | @Override
public final IEngine createEngine() {
IPluginRegistry pluginRegistry = createPluginRegistry();
IDataEncrypter encrypter = createDataEncrypter(pluginRegistry);
CurrentDataEncrypter.instance = encrypter;
IRegistry registry = createRegistry(pluginRegistry, encrypter);
... | java | @Override
public final IEngine createEngine() {
IPluginRegistry pluginRegistry = createPluginRegistry();
IDataEncrypter encrypter = createDataEncrypter(pluginRegistry);
CurrentDataEncrypter.instance = encrypter;
IRegistry registry = createRegistry(pluginRegistry, encrypter);
... | [
"@",
"Override",
"public",
"final",
"IEngine",
"createEngine",
"(",
")",
"{",
"IPluginRegistry",
"pluginRegistry",
"=",
"createPluginRegistry",
"(",
")",
";",
"IDataEncrypter",
"encrypter",
"=",
"createDataEncrypter",
"(",
"pluginRegistry",
")",
";",
"CurrentDataEncry... | Call this to create a new engine. This method uses the engine
config singleton to create the engine. | [
"Call",
"this",
"to",
"create",
"a",
"new",
"engine",
".",
"This",
"method",
"uses",
"the",
"engine",
"config",
"singleton",
"to",
"create",
"the",
"engine",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/AbstractEngineFactory.java#L51-L71 |
48,962 | apiman/apiman | manager/api/core/src/main/java/io/apiman/manager/api/core/config/ApiManagerConfig.java | ApiManagerConfig.getPrefixedProperties | protected Map<String, String> getPrefixedProperties(String prefix) {
Map<String, String> rval = new HashMap<>();
Iterator<String> keys = getConfig().getKeys();
while (keys.hasNext()) {
String key = keys.next();
if (key.startsWith(prefix)) {
String value = ... | java | protected Map<String, String> getPrefixedProperties(String prefix) {
Map<String, String> rval = new HashMap<>();
Iterator<String> keys = getConfig().getKeys();
while (keys.hasNext()) {
String key = keys.next();
if (key.startsWith(prefix)) {
String value = ... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"getPrefixedProperties",
"(",
"String",
"prefix",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"rval",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"keys",
"="... | Gets a map of properties prefixed by the given string. | [
"Gets",
"a",
"map",
"of",
"properties",
"prefixed",
"by",
"the",
"given",
"string",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/core/src/main/java/io/apiman/manager/api/core/config/ApiManagerConfig.java#L335-L347 |
48,963 | apiman/apiman | gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/RateLimitingPolicy.java | RateLimitingPolicy.getPeriod | protected static RateBucketPeriod getPeriod(RateLimitingConfig config) {
RateLimitingPeriod period = config.getPeriod();
switch (period) {
case Second:
return RateBucketPeriod.Second;
case Day:
return RateBucketPeriod.Day;
case Hour:
return Rat... | java | protected static RateBucketPeriod getPeriod(RateLimitingConfig config) {
RateLimitingPeriod period = config.getPeriod();
switch (period) {
case Second:
return RateBucketPeriod.Second;
case Day:
return RateBucketPeriod.Day;
case Hour:
return Rat... | [
"protected",
"static",
"RateBucketPeriod",
"getPeriod",
"(",
"RateLimitingConfig",
"config",
")",
"{",
"RateLimitingPeriod",
"period",
"=",
"config",
".",
"getPeriod",
"(",
")",
";",
"switch",
"(",
"period",
")",
"{",
"case",
"Second",
":",
"return",
"RateBucket... | Gets the appropriate bucket period from the config.
@param config | [
"Gets",
"the",
"appropriate",
"bucket",
"period",
"from",
"the",
"config",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/RateLimitingPolicy.java#L211-L229 |
48,964 | apiman/apiman | gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/HttpApiConnection.java | HttpApiConnection.setConnectTimeout | private void setConnectTimeout(HttpURLConnection connection) {
try {
Map<String, String> endpointProperties = this.api.getEndpointProperties();
if (endpointProperties.containsKey("timeouts.connect")) { //$NON-NLS-1$
int connectTimeoutMs = new Integer(endpointProperties.ge... | java | private void setConnectTimeout(HttpURLConnection connection) {
try {
Map<String, String> endpointProperties = this.api.getEndpointProperties();
if (endpointProperties.containsKey("timeouts.connect")) { //$NON-NLS-1$
int connectTimeoutMs = new Integer(endpointProperties.ge... | [
"private",
"void",
"setConnectTimeout",
"(",
"HttpURLConnection",
"connection",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"endpointProperties",
"=",
"this",
".",
"api",
".",
"getEndpointProperties",
"(",
")",
";",
"if",
"(",
"endpointProp... | If the endpoint properties includes a connect timeout override, then
set it here.
@param connection | [
"If",
"the",
"endpoint",
"properties",
"includes",
"a",
"connect",
"timeout",
"override",
"then",
"set",
"it",
"here",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/platforms/servlet/src/main/java/io/apiman/gateway/platforms/servlet/connectors/HttpApiConnection.java#L212-L221 |
48,965 | apiman/apiman | manager/api/micro/src/main/java/io/apiman/manager/api/micro/Starter.java | Starter.main | public static final void main(String [] args) throws Exception {
ManagerApiMicroService microService = new ManagerApiMicroService();
microService.start();
microService.join();
} | java | public static final void main(String [] args) throws Exception {
ManagerApiMicroService microService = new ManagerApiMicroService();
microService.start();
microService.join();
} | [
"public",
"static",
"final",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"ManagerApiMicroService",
"microService",
"=",
"new",
"ManagerApiMicroService",
"(",
")",
";",
"microService",
".",
"start",
"(",
")",
";",
"microSer... | Main entry point for the API Manager micro service.
@param args the arguments
@throws Exception when any unhandled exception occurs | [
"Main",
"entry",
"point",
"for",
"the",
"API",
"Manager",
"micro",
"service",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/micro/src/main/java/io/apiman/manager/api/micro/Starter.java#L30-L34 |
48,966 | apiman/apiman | common/util/src/main/java/io/apiman/common/util/SimpleStringUtils.java | SimpleStringUtils.length | public static int length(String... args) {
if (args == null)
return 0;
int acc = 0;
for (String arg : args) {
acc += arg.length();
}
return acc;
} | java | public static int length(String... args) {
if (args == null)
return 0;
int acc = 0;
for (String arg : args) {
acc += arg.length();
}
return acc;
} | [
"public",
"static",
"int",
"length",
"(",
"String",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
"return",
"0",
";",
"int",
"acc",
"=",
"0",
";",
"for",
"(",
"String",
"arg",
":",
"args",
")",
"{",
"acc",
"+=",
"arg",
".",
"le... | Cumulative length of strings in varargs
@param args vararg strings
@return cumulative length of strings | [
"Cumulative",
"length",
"of",
"strings",
"in",
"varargs"
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/SimpleStringUtils.java#L69-L78 |
48,967 | apiman/apiman | tools/i18n/src/main/java/io/apiman/tools/i18n/TemplateScanner.java | TemplateScanner.outputMessages | private static void outputMessages(TreeMap<String, String> strings, File outputFile) throws FileNotFoundException {
PrintWriter writer = new PrintWriter(new FileOutputStream(outputFile));
for (Entry<String, String> entry : strings.entrySet()) {
String key = entry.getKey();
String... | java | private static void outputMessages(TreeMap<String, String> strings, File outputFile) throws FileNotFoundException {
PrintWriter writer = new PrintWriter(new FileOutputStream(outputFile));
for (Entry<String, String> entry : strings.entrySet()) {
String key = entry.getKey();
String... | [
"private",
"static",
"void",
"outputMessages",
"(",
"TreeMap",
"<",
"String",
",",
"String",
">",
"strings",
",",
"File",
"outputFile",
")",
"throws",
"FileNotFoundException",
"{",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"new",
"FileOutputStream",... | Output the sorted map of strings to the specified output file.
@param strings
@param outputFile
@throws FileNotFoundException | [
"Output",
"the",
"sorted",
"map",
"of",
"strings",
"to",
"the",
"specified",
"output",
"file",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/tools/i18n/src/main/java/io/apiman/tools/i18n/TemplateScanner.java#L220-L232 |
48,968 | apiman/apiman | manager/api/war/wildfly8/src/main/java/io/apiman/manager/api/war/wildfly8/Wildfly8PluginRegistry.java | Wildfly8PluginRegistry.getPluginDir | private static File getPluginDir() {
String dataDirPath = System.getProperty("jboss.server.data.dir"); //$NON-NLS-1$
File dataDir = new File(dataDirPath);
if (!dataDir.isDirectory()) {
throw new RuntimeException("Failed to find WildFly data directory at: " + dataDirPath); //$NON-NLS-... | java | private static File getPluginDir() {
String dataDirPath = System.getProperty("jboss.server.data.dir"); //$NON-NLS-1$
File dataDir = new File(dataDirPath);
if (!dataDir.isDirectory()) {
throw new RuntimeException("Failed to find WildFly data directory at: " + dataDirPath); //$NON-NLS-... | [
"private",
"static",
"File",
"getPluginDir",
"(",
")",
"{",
"String",
"dataDirPath",
"=",
"System",
".",
"getProperty",
"(",
"\"jboss.server.data.dir\"",
")",
";",
"//$NON-NLS-1$",
"File",
"dataDir",
"=",
"new",
"File",
"(",
"dataDirPath",
")",
";",
"if",
"(",... | Creates the directory to use for the plugin registry. The location of
the plugin registry is in the Wildfly data directory. | [
"Creates",
"the",
"directory",
"to",
"use",
"for",
"the",
"plugin",
"registry",
".",
"The",
"location",
"of",
"the",
"plugin",
"registry",
"is",
"in",
"the",
"Wildfly",
"data",
"directory",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/war/wildfly8/src/main/java/io/apiman/manager/api/war/wildfly8/Wildfly8PluginRegistry.java#L48-L56 |
48,969 | apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java | LocalClientFactory.createClient | public JestClient createClient(Map<String, String> config, String defaultIndexName) {
JestClient client;
String indexName = config.get("client.index"); //$NON-NLS-1$
if (indexName == null) {
indexName = defaultIndexName;
}
client = createLocalClient(config, indexName,... | java | public JestClient createClient(Map<String, String> config, String defaultIndexName) {
JestClient client;
String indexName = config.get("client.index"); //$NON-NLS-1$
if (indexName == null) {
indexName = defaultIndexName;
}
client = createLocalClient(config, indexName,... | [
"public",
"JestClient",
"createClient",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"config",
",",
"String",
"defaultIndexName",
")",
"{",
"JestClient",
"client",
";",
"String",
"indexName",
"=",
"config",
".",
"get",
"(",
"\"client.index\"",
")",
";",
"/... | Creates a client from information in the config map.
@param config the configuration
@param defaultIndexName the default index to use if not specified in the config
@return the ES client | [
"Creates",
"a",
"client",
"from",
"information",
"in",
"the",
"config",
"map",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java#L42-L50 |
48,970 | apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java | LocalClientFactory.createLocalClient | public JestClient createLocalClient(Map<String, String> config, String indexName, String defaultIndexName) {
String clientLocClassName = config.get("client.class"); //$NON-NLS-1$
String clientLocFieldName = config.get("client.field"); //$NON-NLS-1$
return createLocalClient(clientLocClassName, cl... | java | public JestClient createLocalClient(Map<String, String> config, String indexName, String defaultIndexName) {
String clientLocClassName = config.get("client.class"); //$NON-NLS-1$
String clientLocFieldName = config.get("client.field"); //$NON-NLS-1$
return createLocalClient(clientLocClassName, cl... | [
"public",
"JestClient",
"createLocalClient",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"config",
",",
"String",
"indexName",
",",
"String",
"defaultIndexName",
")",
"{",
"String",
"clientLocClassName",
"=",
"config",
".",
"get",
"(",
"\"client.class\"",
")"... | Creates a local client from a configuration map.
@param config the config from apiman.properties
@param indexName the name of the ES index
@param defaultIndexName the default ES index name
@return the ES client | [
"Creates",
"a",
"local",
"client",
"from",
"a",
"configuration",
"map",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java#L59-L63 |
48,971 | apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java | LocalClientFactory.createLocalClient | public JestClient createLocalClient(String className, String fieldName, String indexName, String defaultIndexName) {
String clientKey = "local:" + className + '/' + fieldName; //$NON-NLS-1$
synchronized (clients) {
if (clients.containsKey(clientKey)) {
return clients.get(clie... | java | public JestClient createLocalClient(String className, String fieldName, String indexName, String defaultIndexName) {
String clientKey = "local:" + className + '/' + fieldName; //$NON-NLS-1$
synchronized (clients) {
if (clients.containsKey(clientKey)) {
return clients.get(clie... | [
"public",
"JestClient",
"createLocalClient",
"(",
"String",
"className",
",",
"String",
"fieldName",
",",
"String",
"indexName",
",",
"String",
"defaultIndexName",
")",
"{",
"String",
"clientKey",
"=",
"\"local:\"",
"+",
"className",
"+",
"'",
"'",
"+",
"fieldNa... | Creates a cache by looking it up in a static field. Typically used for
testing.
@param className the class name
@param fieldName the field name
@param indexName the name of the ES index
@param defaultIndexName the name of the default ES index
@return the ES client | [
"Creates",
"a",
"cache",
"by",
"looking",
"it",
"up",
"in",
"a",
"static",
"field",
".",
"Typically",
"used",
"for",
"testing",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java#L74-L93 |
48,972 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.createClientVersionInternal | protected ClientVersionBean createClientVersionInternal(NewClientVersionBean bean,
ClientBean client) throws StorageException {
if (!BeanUtils.isValidVersion(bean.getVersion())) {
throw new StorageException("Invalid/illegal client version: " + bean.getVersion()); //$NON-NLS-1$
}
... | java | protected ClientVersionBean createClientVersionInternal(NewClientVersionBean bean,
ClientBean client) throws StorageException {
if (!BeanUtils.isValidVersion(bean.getVersion())) {
throw new StorageException("Invalid/illegal client version: " + bean.getVersion()); //$NON-NLS-1$
}
... | [
"protected",
"ClientVersionBean",
"createClientVersionInternal",
"(",
"NewClientVersionBean",
"bean",
",",
"ClientBean",
"client",
")",
"throws",
"StorageException",
"{",
"if",
"(",
"!",
"BeanUtils",
".",
"isValidVersion",
"(",
"bean",
".",
"getVersion",
"(",
")",
"... | Creates a new client version.
@param bean
@param client
@throws StorageException | [
"Creates",
"a",
"new",
"client",
"version",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L786-L810 |
48,973 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.createContractInternal | protected ContractBean createContractInternal(String organizationId, String clientId,
String version, NewContractBean bean) throws StorageException, Exception {
ContractBean contract;
ClientVersionBean cvb;
cvb = storage.getClientVersion(organizationId, clientId, version);
if... | java | protected ContractBean createContractInternal(String organizationId, String clientId,
String version, NewContractBean bean) throws StorageException, Exception {
ContractBean contract;
ClientVersionBean cvb;
cvb = storage.getClientVersion(organizationId, clientId, version);
if... | [
"protected",
"ContractBean",
"createContractInternal",
"(",
"String",
"organizationId",
",",
"String",
"clientId",
",",
"String",
"version",
",",
"NewContractBean",
"bean",
")",
"throws",
"StorageException",
",",
"Exception",
"{",
"ContractBean",
"contract",
";",
"Cli... | Creates a contract.
@param organizationId
@param clientId
@param version
@param bean
@throws StorageException
@throws Exception | [
"Creates",
"a",
"contract",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L976-L1036 |
48,974 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.contractAlreadyExists | private boolean contractAlreadyExists(String organizationId, String clientId, String version,
NewContractBean bean) {
try {
List<ContractSummaryBean> contracts = query.getClientContracts(organizationId, clientId, version);
for (ContractSummaryBean contract : contracts) {
... | java | private boolean contractAlreadyExists(String organizationId, String clientId, String version,
NewContractBean bean) {
try {
List<ContractSummaryBean> contracts = query.getClientContracts(organizationId, clientId, version);
for (ContractSummaryBean contract : contracts) {
... | [
"private",
"boolean",
"contractAlreadyExists",
"(",
"String",
"organizationId",
",",
"String",
"clientId",
",",
"String",
"version",
",",
"NewContractBean",
"bean",
")",
"{",
"try",
"{",
"List",
"<",
"ContractSummaryBean",
">",
"contracts",
"=",
"query",
".",
"g... | Check to see if the contract already exists, by getting a list of all the
client's contracts and comparing with the one being created.
@param organizationId
@param clientId
@param version
@param bean | [
"Check",
"to",
"see",
"if",
"the",
"contract",
"already",
"exists",
"by",
"getting",
"a",
"list",
"of",
"all",
"the",
"client",
"s",
"contracts",
"and",
"comparing",
"with",
"the",
"one",
"being",
"created",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L1046-L1063 |
48,975 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.getApiRegistry | protected ApiRegistryBean getApiRegistry(String organizationId, String clientId, String version,
boolean hasPermission) throws ClientNotFoundException, NotAuthorizedException {
// Try to get the client first - will throw a ClientNotFoundException if not found.
ClientVersionBean clientVersion... | java | protected ApiRegistryBean getApiRegistry(String organizationId, String clientId, String version,
boolean hasPermission) throws ClientNotFoundException, NotAuthorizedException {
// Try to get the client first - will throw a ClientNotFoundException if not found.
ClientVersionBean clientVersion... | [
"protected",
"ApiRegistryBean",
"getApiRegistry",
"(",
"String",
"organizationId",
",",
"String",
"clientId",
",",
"String",
"version",
",",
"boolean",
"hasPermission",
")",
"throws",
"ClientNotFoundException",
",",
"NotAuthorizedException",
"{",
"// Try to get the client f... | Gets the API registry.
@param organizationId
@param clientId
@param version
@param hasPermission
@throws ClientNotFoundException
@throws NotAuthorizedException | [
"Gets",
"the",
"API",
"registry",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L1245-L1296 |
48,976 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.createPlanVersionInternal | protected PlanVersionBean createPlanVersionInternal(NewPlanVersionBean bean, PlanBean plan)
throws StorageException {
if (!BeanUtils.isValidVersion(bean.getVersion())) {
throw new StorageException("Invalid/illegal plan version: " + bean.getVersion()); //$NON-NLS-1$
}
Pla... | java | protected PlanVersionBean createPlanVersionInternal(NewPlanVersionBean bean, PlanBean plan)
throws StorageException {
if (!BeanUtils.isValidVersion(bean.getVersion())) {
throw new StorageException("Invalid/illegal plan version: " + bean.getVersion()); //$NON-NLS-1$
}
Pla... | [
"protected",
"PlanVersionBean",
"createPlanVersionInternal",
"(",
"NewPlanVersionBean",
"bean",
",",
"PlanBean",
"plan",
")",
"throws",
"StorageException",
"{",
"if",
"(",
"!",
"BeanUtils",
".",
"isValidVersion",
"(",
"bean",
".",
"getVersion",
"(",
")",
")",
")",... | Creates a plan version.
@param bean
@param plan
@throws StorageException | [
"Creates",
"a",
"plan",
"version",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L2892-L2909 |
48,977 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.doGetPolicy | protected PolicyBean doGetPolicy(PolicyType type, String organizationId, String entityId,
String entityVersion, long policyId) throws PolicyNotFoundException {
try {
storage.beginTx();
PolicyBean policy = storage.getPolicy(type, organizationId, entityId, entityVersion, policy... | java | protected PolicyBean doGetPolicy(PolicyType type, String organizationId, String entityId,
String entityVersion, long policyId) throws PolicyNotFoundException {
try {
storage.beginTx();
PolicyBean policy = storage.getPolicy(type, organizationId, entityId, entityVersion, policy... | [
"protected",
"PolicyBean",
"doGetPolicy",
"(",
"PolicyType",
"type",
",",
"String",
"organizationId",
",",
"String",
"entityId",
",",
"String",
"entityVersion",
",",
"long",
"policyId",
")",
"throws",
"PolicyNotFoundException",
"{",
"try",
"{",
"storage",
".",
"be... | Gets a policy by its id. Also verifies that the policy really does belong to
the entity indicated.
@param type the policy type
@param organizationId the org id
@param entityId the entity id
@param entityVersion the entity version
@param policyId the policy id
@return a policy bean
@throws PolicyNotFoundException | [
"Gets",
"a",
"policy",
"by",
"its",
"id",
".",
"Also",
"verifies",
"that",
"the",
"policy",
"really",
"does",
"belong",
"to",
"the",
"entity",
"indicated",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3443-L3473 |
48,978 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.decryptEndpointProperties | private void decryptEndpointProperties(ApiVersionBean versionBean) {
Map<String, String> endpointProperties = versionBean.getEndpointProperties();
if (endpointProperties != null) {
for (Entry<String, String> entry : endpointProperties.entrySet()) {
DataEncryptionContext ctx =... | java | private void decryptEndpointProperties(ApiVersionBean versionBean) {
Map<String, String> endpointProperties = versionBean.getEndpointProperties();
if (endpointProperties != null) {
for (Entry<String, String> entry : endpointProperties.entrySet()) {
DataEncryptionContext ctx =... | [
"private",
"void",
"decryptEndpointProperties",
"(",
"ApiVersionBean",
"versionBean",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"endpointProperties",
"=",
"versionBean",
".",
"getEndpointProperties",
"(",
")",
";",
"if",
"(",
"endpointProperties",
"!=",
... | Decrypt the endpoint properties | [
"Decrypt",
"the",
"endpoint",
"properties"
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3491-L3503 |
48,979 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.parseFromDate | private DateTime parseFromDate(String fromDate) {
// Default to the last 30 days
DateTime defaultFrom = new DateTime().withZone(DateTimeZone.UTC).minusDays(30).withHourOfDay(0)
.withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
return parseDate(fromDate, defaultFro... | java | private DateTime parseFromDate(String fromDate) {
// Default to the last 30 days
DateTime defaultFrom = new DateTime().withZone(DateTimeZone.UTC).minusDays(30).withHourOfDay(0)
.withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
return parseDate(fromDate, defaultFro... | [
"private",
"DateTime",
"parseFromDate",
"(",
"String",
"fromDate",
")",
"{",
"// Default to the last 30 days",
"DateTime",
"defaultFrom",
"=",
"new",
"DateTime",
"(",
")",
".",
"withZone",
"(",
"DateTimeZone",
".",
"UTC",
")",
".",
"minusDays",
"(",
"30",
")",
... | Parse the to date query param. | [
"Parse",
"the",
"to",
"date",
"query",
"param",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3651-L3656 |
48,980 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.parseToDate | private DateTime parseToDate(String toDate) {
// Default to now
return parseDate(toDate, new DateTime().withZone(DateTimeZone.UTC), false);
} | java | private DateTime parseToDate(String toDate) {
// Default to now
return parseDate(toDate, new DateTime().withZone(DateTimeZone.UTC), false);
} | [
"private",
"DateTime",
"parseToDate",
"(",
"String",
"toDate",
")",
"{",
"// Default to now",
"return",
"parseDate",
"(",
"toDate",
",",
"new",
"DateTime",
"(",
")",
".",
"withZone",
"(",
"DateTimeZone",
".",
"UTC",
")",
",",
"false",
")",
";",
"}"
] | Parse the from date query param. | [
"Parse",
"the",
"from",
"date",
"query",
"param",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3661-L3664 |
48,981 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.parseDate | private static DateTime parseDate(String dateStr, DateTime defaultDate, boolean floor) {
if ("now".equals(dateStr)) { //$NON-NLS-1$
return new DateTime();
}
if (dateStr.length() == 10) {
DateTime parsed = ISODateTimeFormat.date().withZone(DateTimeZone.UTC).parseDateTime(d... | java | private static DateTime parseDate(String dateStr, DateTime defaultDate, boolean floor) {
if ("now".equals(dateStr)) { //$NON-NLS-1$
return new DateTime();
}
if (dateStr.length() == 10) {
DateTime parsed = ISODateTimeFormat.date().withZone(DateTimeZone.UTC).parseDateTime(d... | [
"private",
"static",
"DateTime",
"parseDate",
"(",
"String",
"dateStr",
",",
"DateTime",
"defaultDate",
",",
"boolean",
"floor",
")",
"{",
"if",
"(",
"\"now\"",
".",
"equals",
"(",
"dateStr",
")",
")",
"{",
"//$NON-NLS-1$",
"return",
"new",
"DateTime",
"(",
... | Parses a query param representing a date into an actual date object. | [
"Parses",
"a",
"query",
"param",
"representing",
"a",
"date",
"into",
"an",
"actual",
"date",
"object",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3669-L3689 |
48,982 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.validateMetricRange | private void validateMetricRange(DateTime from, DateTime to) throws InvalidMetricCriteriaException {
if (from.isAfter(to)) {
throw ExceptionFactory.invalidMetricCriteriaException(Messages.i18n.format("OrganizationResourceImpl.InvalidMetricDateRange")); //$NON-NLS-1$
}
} | java | private void validateMetricRange(DateTime from, DateTime to) throws InvalidMetricCriteriaException {
if (from.isAfter(to)) {
throw ExceptionFactory.invalidMetricCriteriaException(Messages.i18n.format("OrganizationResourceImpl.InvalidMetricDateRange")); //$NON-NLS-1$
}
} | [
"private",
"void",
"validateMetricRange",
"(",
"DateTime",
"from",
",",
"DateTime",
"to",
")",
"throws",
"InvalidMetricCriteriaException",
"{",
"if",
"(",
"from",
".",
"isAfter",
"(",
"to",
")",
")",
"{",
"throw",
"ExceptionFactory",
".",
"invalidMetricCriteriaExc... | Ensures that the given date range is valid. | [
"Ensures",
"that",
"the",
"given",
"date",
"range",
"is",
"valid",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3694-L3698 |
48,983 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.validateTimeSeriesMetric | private void validateTimeSeriesMetric(DateTime from, DateTime to, HistogramIntervalType interval)
throws InvalidMetricCriteriaException {
long millis = to.getMillis() - from.getMillis();
long divBy = ONE_DAY_MILLIS;
switch (interval) {
case day:
divBy = ONE_DAY_MI... | java | private void validateTimeSeriesMetric(DateTime from, DateTime to, HistogramIntervalType interval)
throws InvalidMetricCriteriaException {
long millis = to.getMillis() - from.getMillis();
long divBy = ONE_DAY_MILLIS;
switch (interval) {
case day:
divBy = ONE_DAY_MI... | [
"private",
"void",
"validateTimeSeriesMetric",
"(",
"DateTime",
"from",
",",
"DateTime",
"to",
",",
"HistogramIntervalType",
"interval",
")",
"throws",
"InvalidMetricCriteriaException",
"{",
"long",
"millis",
"=",
"to",
".",
"getMillis",
"(",
")",
"-",
"from",
"."... | Ensures that a time series can be created for the given date range and
interval, and that the | [
"Ensures",
"that",
"a",
"time",
"series",
"can",
"be",
"created",
"for",
"the",
"given",
"date",
"range",
"and",
"interval",
"and",
"that",
"the"
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3704-L3731 |
48,984 | apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.validateEndpoint | private void validateEndpoint(String endpoint) {
try {
new URL(endpoint);
} catch (MalformedURLException e) {
throw new InvalidParameterException(Messages.i18n.format("OrganizationResourceImpl.InvalidEndpointURL")); //$NON-NLS-1$
}
} | java | private void validateEndpoint(String endpoint) {
try {
new URL(endpoint);
} catch (MalformedURLException e) {
throw new InvalidParameterException(Messages.i18n.format("OrganizationResourceImpl.InvalidEndpointURL")); //$NON-NLS-1$
}
} | [
"private",
"void",
"validateEndpoint",
"(",
"String",
"endpoint",
")",
"{",
"try",
"{",
"new",
"URL",
"(",
"endpoint",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"(",
"Messages",
".",
"i1... | Make sure we've got a valid URL. | [
"Make",
"sure",
"we",
"ve",
"got",
"a",
"valid",
"URL",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3736-L3742 |
48,985 | apiman/apiman | manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java | AbstractJpaStorage.delete | public <T> void delete(T bean) throws StorageException {
EntityManager entityManager = getActiveEntityManager();
try {
entityManager.remove(bean);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
throw new StorageException(t);
}
} | java | public <T> void delete(T bean) throws StorageException {
EntityManager entityManager = getActiveEntityManager();
try {
entityManager.remove(bean);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
throw new StorageException(t);
}
} | [
"public",
"<",
"T",
">",
"void",
"delete",
"(",
"T",
"bean",
")",
"throws",
"StorageException",
"{",
"EntityManager",
"entityManager",
"=",
"getActiveEntityManager",
"(",
")",
";",
"try",
"{",
"entityManager",
".",
"remove",
"(",
"bean",
")",
";",
"}",
"ca... | Delete using bean
@param bean the bean to delete
@throws StorageException if a storage problem occurs while storing a bean | [
"Delete",
"using",
"bean"
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java#L175-L183 |
48,986 | apiman/apiman | manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java | AbstractJpaStorage.find | protected <T> SearchResultsBean<T> find(SearchCriteriaBean criteria, Class<T> type) throws StorageException {
SearchResultsBean<T> results = new SearchResultsBean<>();
EntityManager entityManager = getActiveEntityManager();
try {
// Set some default in the case that paging informatio... | java | protected <T> SearchResultsBean<T> find(SearchCriteriaBean criteria, Class<T> type) throws StorageException {
SearchResultsBean<T> results = new SearchResultsBean<>();
EntityManager entityManager = getActiveEntityManager();
try {
// Set some default in the case that paging informatio... | [
"protected",
"<",
"T",
">",
"SearchResultsBean",
"<",
"T",
">",
"find",
"(",
"SearchCriteriaBean",
"criteria",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"StorageException",
"{",
"SearchResultsBean",
"<",
"T",
">",
"results",
"=",
"new",
"SearchResu... | Get a list of entities based on the provided criteria and entity type.
@param criteria
@param type
@throws StorageException if a storage problem occurs while storing a bean | [
"Get",
"a",
"list",
"of",
"entities",
"based",
"on",
"the",
"provided",
"criteria",
"and",
"entity",
"type",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java#L259-L305 |
48,987 | apiman/apiman | manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java | AbstractJpaStorage.executeCountQuery | protected <T> int executeCountQuery(SearchCriteriaBean criteria, EntityManager entityManager, Class<T> type) {
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> countQuery = builder.createQuery(Long.class);
Root<T> from = countQuery.from(type);
countQuery.... | java | protected <T> int executeCountQuery(SearchCriteriaBean criteria, EntityManager entityManager, Class<T> type) {
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> countQuery = builder.createQuery(Long.class);
Root<T> from = countQuery.from(type);
countQuery.... | [
"protected",
"<",
"T",
">",
"int",
"executeCountQuery",
"(",
"SearchCriteriaBean",
"criteria",
",",
"EntityManager",
"entityManager",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"CriteriaBuilder",
"builder",
"=",
"entityManager",
".",
"getCriteriaBuilder",
"(",... | Gets a count of the number of rows that would be returned by the search.
@param criteria
@param entityManager
@param type | [
"Gets",
"a",
"count",
"of",
"the",
"number",
"of",
"rows",
"that",
"would",
"be",
"returned",
"by",
"the",
"search",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/jpa/src/main/java/io/apiman/manager/api/jpa/AbstractJpaStorage.java#L313-L321 |
48,988 | apiman/apiman | manager/api/security/src/main/java/io/apiman/manager/api/security/impl/IndexedPermissions.java | IndexedPermissions.hasQualifiedPermission | public boolean hasQualifiedPermission(PermissionType permissionName, String orgQualifier) {
String key = createQualifiedPermissionKey(permissionName, orgQualifier);
return qualifiedPermissions.contains(key);
} | java | public boolean hasQualifiedPermission(PermissionType permissionName, String orgQualifier) {
String key = createQualifiedPermissionKey(permissionName, orgQualifier);
return qualifiedPermissions.contains(key);
} | [
"public",
"boolean",
"hasQualifiedPermission",
"(",
"PermissionType",
"permissionName",
",",
"String",
"orgQualifier",
")",
"{",
"String",
"key",
"=",
"createQualifiedPermissionKey",
"(",
"permissionName",
",",
"orgQualifier",
")",
";",
"return",
"qualifiedPermissions",
... | Returns true if the qualified permission exists.
@param permissionName the permission name
@param orgQualifier the org qualifier
@return true if has qualified permission | [
"Returns",
"true",
"if",
"the",
"qualified",
"permission",
"exists",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/security/src/main/java/io/apiman/manager/api/security/impl/IndexedPermissions.java#L55-L58 |
48,989 | apiman/apiman | manager/api/security/src/main/java/io/apiman/manager/api/security/impl/IndexedPermissions.java | IndexedPermissions.getOrgQualifiers | public Set<String> getOrgQualifiers(PermissionType permissionName) {
Set<String> orgs = permissionToOrgsMap.get(permissionName);
if (orgs == null)
orgs = Collections.EMPTY_SET;
return Collections.unmodifiableSet(orgs);
} | java | public Set<String> getOrgQualifiers(PermissionType permissionName) {
Set<String> orgs = permissionToOrgsMap.get(permissionName);
if (orgs == null)
orgs = Collections.EMPTY_SET;
return Collections.unmodifiableSet(orgs);
} | [
"public",
"Set",
"<",
"String",
">",
"getOrgQualifiers",
"(",
"PermissionType",
"permissionName",
")",
"{",
"Set",
"<",
"String",
">",
"orgs",
"=",
"permissionToOrgsMap",
".",
"get",
"(",
"permissionName",
")",
";",
"if",
"(",
"orgs",
"==",
"null",
")",
"o... | Given a permission name, returns all organization qualifiers.
@param permissionName the permission type
@return set of org qualifiers | [
"Given",
"a",
"permission",
"name",
"returns",
"all",
"organization",
"qualifiers",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/security/src/main/java/io/apiman/manager/api/security/impl/IndexedPermissions.java#L73-L78 |
48,990 | apiman/apiman | manager/api/security/src/main/java/io/apiman/manager/api/security/impl/IndexedPermissions.java | IndexedPermissions.index | private void index(Set<PermissionBean> permissions) {
for (PermissionBean permissionBean : permissions) {
PermissionType permissionName = permissionBean.getName();
String orgQualifier = permissionBean.getOrganizationId();
String qualifiedPermission = createQualifiedPermission... | java | private void index(Set<PermissionBean> permissions) {
for (PermissionBean permissionBean : permissions) {
PermissionType permissionName = permissionBean.getName();
String orgQualifier = permissionBean.getOrganizationId();
String qualifiedPermission = createQualifiedPermission... | [
"private",
"void",
"index",
"(",
"Set",
"<",
"PermissionBean",
">",
"permissions",
")",
"{",
"for",
"(",
"PermissionBean",
"permissionBean",
":",
"permissions",
")",
"{",
"PermissionType",
"permissionName",
"=",
"permissionBean",
".",
"getName",
"(",
")",
";",
... | Index the permissions.
@param bean | [
"Index",
"the",
"permissions",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/security/src/main/java/io/apiman/manager/api/security/impl/IndexedPermissions.java#L84-L98 |
48,991 | apiman/apiman | manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/ExportImportConfigParser.java | ExportImportConfigParser.isOverwrite | public boolean isOverwrite() {
Boolean booleanObject = BooleanUtils.toBooleanObject(System.getProperty(OVERWRITE));
if (booleanObject == null) {
booleanObject = Boolean.FALSE;
}
return booleanObject;
} | java | public boolean isOverwrite() {
Boolean booleanObject = BooleanUtils.toBooleanObject(System.getProperty(OVERWRITE));
if (booleanObject == null) {
booleanObject = Boolean.FALSE;
}
return booleanObject;
} | [
"public",
"boolean",
"isOverwrite",
"(",
")",
"{",
"Boolean",
"booleanObject",
"=",
"BooleanUtils",
".",
"toBooleanObject",
"(",
"System",
".",
"getProperty",
"(",
"OVERWRITE",
")",
")",
";",
"if",
"(",
"booleanObject",
"==",
"null",
")",
"{",
"booleanObject",... | apiman.migrate.overwrite= | [
"apiman",
".",
"migrate",
".",
"overwrite",
"="
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/ExportImportConfigParser.java#L101-L107 |
48,992 | apiman/apiman | manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java | StorageImportDispatcher.start | public void start() {
logger.info("----------------------------"); //$NON-NLS-1$
logger.info(Messages.i18n.format("StorageImportDispatcher.StartingImport")); //$NON-NLS-1$
policyDefIndex.clear();
currentOrg = null;
currentPlan = null;
currentApi = null;
currentCl... | java | public void start() {
logger.info("----------------------------"); //$NON-NLS-1$
logger.info(Messages.i18n.format("StorageImportDispatcher.StartingImport")); //$NON-NLS-1$
policyDefIndex.clear();
currentOrg = null;
currentPlan = null;
currentApi = null;
currentCl... | [
"public",
"void",
"start",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"----------------------------\"",
")",
";",
"//$NON-NLS-1$",
"logger",
".",
"info",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"StorageImportDispatcher.StartingImport\"",
")",
")",
... | Starts the import. | [
"Starts",
"the",
"import",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java#L115-L135 |
48,993 | apiman/apiman | manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java | StorageImportDispatcher.updatePluginIdInPolicyDefinition | private PolicyDefinitionBean updatePluginIdInPolicyDefinition(PolicyDefinitionBean policyDef) {
if (pluginBeanIdMap.containsKey(policyDef.getPluginId())){
try {
Map.Entry<String, String> pluginCoordinates = pluginBeanIdMap.get(policyDef.getPluginId());
PluginBean plug... | java | private PolicyDefinitionBean updatePluginIdInPolicyDefinition(PolicyDefinitionBean policyDef) {
if (pluginBeanIdMap.containsKey(policyDef.getPluginId())){
try {
Map.Entry<String, String> pluginCoordinates = pluginBeanIdMap.get(policyDef.getPluginId());
PluginBean plug... | [
"private",
"PolicyDefinitionBean",
"updatePluginIdInPolicyDefinition",
"(",
"PolicyDefinitionBean",
"policyDef",
")",
"{",
"if",
"(",
"pluginBeanIdMap",
".",
"containsKey",
"(",
"policyDef",
".",
"getPluginId",
"(",
")",
")",
")",
"{",
"try",
"{",
"Map",
".",
"Ent... | Update the pluginID in the policyDefinition to the new generated pluginID
@param policyDef
@return updated PolicyDefinitionBean policyDef | [
"Update",
"the",
"pluginID",
"in",
"the",
"policyDefinition",
"to",
"the",
"new",
"generated",
"pluginID"
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java#L245-L256 |
48,994 | apiman/apiman | manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java | StorageImportDispatcher.publishApis | private void publishApis() throws StorageException {
logger.info(Messages.i18n.format("StorageExporter.PublishingApis")); //$NON-NLS-1$
try {
for (EntityInfo info : apisToPublish) {
logger.info(Messages.i18n.format("StorageExporter.PublishingApi", info)); //$NON-NLS-1$
... | java | private void publishApis() throws StorageException {
logger.info(Messages.i18n.format("StorageExporter.PublishingApis")); //$NON-NLS-1$
try {
for (EntityInfo info : apisToPublish) {
logger.info(Messages.i18n.format("StorageExporter.PublishingApi", info)); //$NON-NLS-1$
... | [
"private",
"void",
"publishApis",
"(",
")",
"throws",
"StorageException",
"{",
"logger",
".",
"info",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
"\"StorageExporter.PublishingApis\"",
")",
")",
";",
"//$NON-NLS-1$",
"try",
"{",
"for",
"(",
"EntityInfo",
... | Publishes any apis that were imported in the "Published" state.
@throws StorageException | [
"Publishes",
"any",
"apis",
"that",
"were",
"imported",
"in",
"the",
"Published",
"state",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java#L485-L529 |
48,995 | apiman/apiman | manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java | StorageImportDispatcher.aggregateContractPolicies | private List<Policy> aggregateContractPolicies(ContractBean contractBean, EntityInfo clientInfo) throws StorageException {
List<Policy> policies = new ArrayList<>();
PolicyType [] types = new PolicyType[] {
PolicyType.Client, PolicyType.Plan, PolicyType.Api
};
for (Policy... | java | private List<Policy> aggregateContractPolicies(ContractBean contractBean, EntityInfo clientInfo) throws StorageException {
List<Policy> policies = new ArrayList<>();
PolicyType [] types = new PolicyType[] {
PolicyType.Client, PolicyType.Plan, PolicyType.Api
};
for (Policy... | [
"private",
"List",
"<",
"Policy",
">",
"aggregateContractPolicies",
"(",
"ContractBean",
"contractBean",
",",
"EntityInfo",
"clientInfo",
")",
"throws",
"StorageException",
"{",
"List",
"<",
"Policy",
">",
"policies",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";"... | Aggregates the api, client, and plan policies into a single ordered list.
@param contractBean
@param clientInfo | [
"Aggregates",
"the",
"api",
"client",
"and",
"plan",
"policies",
"into",
"a",
"single",
"ordered",
"list",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java#L601-L642 |
48,996 | apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/PolicyFactoryImpl.java | PolicyFactoryImpl.doLoadFromClasspath | protected void doLoadFromClasspath(String policyImpl, IAsyncResultHandler<IPolicy> handler) {
IPolicy rval;
String classname = policyImpl.substring(6);
Class<?> c = null;
// First try a simple Class.forName()
try { c = Class.forName(classname); } catch (ClassNotFoundException e)... | java | protected void doLoadFromClasspath(String policyImpl, IAsyncResultHandler<IPolicy> handler) {
IPolicy rval;
String classname = policyImpl.substring(6);
Class<?> c = null;
// First try a simple Class.forName()
try { c = Class.forName(classname); } catch (ClassNotFoundException e)... | [
"protected",
"void",
"doLoadFromClasspath",
"(",
"String",
"policyImpl",
",",
"IAsyncResultHandler",
"<",
"IPolicy",
">",
"handler",
")",
"{",
"IPolicy",
"rval",
";",
"String",
"classname",
"=",
"policyImpl",
".",
"substring",
"(",
"6",
")",
";",
"Class",
"<",... | Loads a policy from a class on the classpath.
@param policyImpl
@param handler | [
"Loads",
"a",
"policy",
"from",
"a",
"class",
"on",
"the",
"classpath",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/PolicyFactoryImpl.java#L115-L145 |
48,997 | apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/PolicyFactoryImpl.java | PolicyFactoryImpl.doLoadFromPlugin | private void doLoadFromPlugin(final String policyImpl, final IAsyncResultHandler<IPolicy> handler) {
PluginCoordinates coordinates = PluginCoordinates.fromPolicySpec(policyImpl);
if (coordinates == null) {
handler.handle(AsyncResultImpl.<IPolicy>create(new PolicyNotFoundException(policyImpl)... | java | private void doLoadFromPlugin(final String policyImpl, final IAsyncResultHandler<IPolicy> handler) {
PluginCoordinates coordinates = PluginCoordinates.fromPolicySpec(policyImpl);
if (coordinates == null) {
handler.handle(AsyncResultImpl.<IPolicy>create(new PolicyNotFoundException(policyImpl)... | [
"private",
"void",
"doLoadFromPlugin",
"(",
"final",
"String",
"policyImpl",
",",
"final",
"IAsyncResultHandler",
"<",
"IPolicy",
">",
"handler",
")",
"{",
"PluginCoordinates",
"coordinates",
"=",
"PluginCoordinates",
".",
"fromPolicySpec",
"(",
"policyImpl",
")",
"... | Loads a policy from a plugin.
@param policyImpl
@param handler | [
"Loads",
"a",
"policy",
"from",
"a",
"plugin",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/PolicyFactoryImpl.java#L152-L190 |
48,998 | apiman/apiman | gateway/engine/ispn/src/main/java/io/apiman/gateway/engine/ispn/io/RegistryCacheMapWrapper.java | RegistryCacheMapWrapper.unmarshalAs | private <T> T unmarshalAs(String valueAsString, Class<T> asClass) throws IOException {
return mapper.reader(asClass).readValue(valueAsString);
} | java | private <T> T unmarshalAs(String valueAsString, Class<T> asClass) throws IOException {
return mapper.reader(asClass).readValue(valueAsString);
} | [
"private",
"<",
"T",
">",
"T",
"unmarshalAs",
"(",
"String",
"valueAsString",
",",
"Class",
"<",
"T",
">",
"asClass",
")",
"throws",
"IOException",
"{",
"return",
"mapper",
".",
"reader",
"(",
"asClass",
")",
".",
"readValue",
"(",
"valueAsString",
")",
... | Unmarshall the given type of object.
@param valueAsString
@param asClass
@throws IOException | [
"Unmarshall",
"the",
"given",
"type",
"of",
"object",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/ispn/src/main/java/io/apiman/gateway/engine/ispn/io/RegistryCacheMapWrapper.java#L188-L190 |
48,999 | apiman/apiman | gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractMappedPolicy.java | AbstractMappedPolicy.doApply | protected void doApply(ApiResponse response, IPolicyContext context, C config, IPolicyChain<ApiResponse> chain) {
chain.doApply(response);
} | java | protected void doApply(ApiResponse response, IPolicyContext context, C config, IPolicyChain<ApiResponse> chain) {
chain.doApply(response);
} | [
"protected",
"void",
"doApply",
"(",
"ApiResponse",
"response",
",",
"IPolicyContext",
"context",
",",
"C",
"config",
",",
"IPolicyChain",
"<",
"ApiResponse",
">",
"chain",
")",
"{",
"chain",
".",
"doApply",
"(",
"response",
")",
";",
"}"
] | Apply the policy to the response.
@param response
@param context
@param config
@param chain | [
"Apply",
"the",
"policy",
"to",
"the",
"response",
"."
] | 8c049c2a2f2e4a69bbb6125686a15edd26f29c21 | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractMappedPolicy.java#L101-L103 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.