Skip to content

Commit

Permalink
fix: Minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BLasan committed Oct 26, 2023
1 parent e8643aa commit f157b87
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,6 @@ private void attachURlMappingDetailsOfApiProduct(Connection connection, API api)
}

public API getAPIByContextAndVersion(String context, String version, String deployment, boolean isExpand) {
long start = System.nanoTime();
String sql = SubscriptionValidationSQLConstants.GET_API_BY_CONTEXT_AND_VERSION_SQL;
try (Connection connection = APIMgtDBUtil.getConnection()) {
try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
Expand Down Expand Up @@ -1188,9 +1187,6 @@ public API getAPIByContextAndVersion(String context, String version, String depl
} else {
api.setPolicy(null);
}
long end = System.nanoTime();
log.info("Time taken to execute query : " + (end - start) + " ns");
log.debug("Time taken to execute query : " + (end - start) + " ns");
return api;
}
}
Expand All @@ -1214,10 +1210,6 @@ private void attachURLMappingDetails(Connection connection, String revisionId, A
String urlPattern = resultSet.getString("URL_PATTERN");
String throttlingTier = resultSet.getString("THROTTLING_TIER");
String scopeName = resultSet.getString("SCOPE_NAME");
// String policyName = resultSet.getString("POLICY_NAME");
// String policyVersion = resultSet.getString("POLICY_VERSION");
// String direction = resultSet.getString("DIRECTION");
// String policyID = resultSet.getString("POLICY_UUID");
URLMapping urlMapping = api.getResource(urlPattern, httpMethod);
if (urlMapping == null) {
urlMapping = new URLMapping();
Expand All @@ -1226,15 +1218,6 @@ private void attachURLMappingDetails(Connection connection, String revisionId, A
urlMapping.setThrottlingPolicy(throttlingTier);
urlMapping.setUrlPattern(urlPattern);
}
// if (StringUtils.isNotEmpty(policyID) && StringUtils.isNotEmpty(policyName)
// && StringUtils.isNotEmpty(policyVersion) && StringUtils.isNotEmpty(direction)) {
// OperationPolicy operationPolicy = new OperationPolicy();
// operationPolicy.setPolicyId(policyID);
// operationPolicy.setPolicyName(policyName);
// operationPolicy.setPolicyVersion(policyVersion);
// operationPolicy.setDirection(direction);
// urlMapping.setOperationPolicies(operationPolicy);
// }
if (StringUtils.isNotEmpty(scopeName)) {
urlMapping.addScope(scopeName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public boolean validateScopes(TokenValidationContext validationContext) throws A
scopesValidated = true;
continue;
}
List<String> mappingScopes = new ArrayList<>(urlMapping.getScopes());
List<String> mappingScopes = urlMapping.getScopes();
boolean validate = false;
for (String scope : mappingScopes) {
if (scopesSet.contains(scope)) {
Expand Down

0 comments on commit f157b87

Please sign in to comment.