ppapou commented on a change in pull request #542: [DLAB-1447] Verification of
the enpoint url field
URL: https://github.com/apache/incubator-dlab/pull/542#discussion_r371988179
##########
File path:
services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAOImpl.java
##########
@@ -65,11 +74,19 @@ public void remove(String name) {
deleteOne(ENDPOINTS_COLLECTION, endpointCondition(name));
}
+ /**
+ * According the functional requirement, the EndPoint name should be
case-insensitive.
+ * A New method use the regex interface of the MongoDB driver
+ */
private Bson endpointCondition(String name) {
- return eq(ENDPOINT_NAME_FIELD, name);
+ Pattern endPointName = Pattern.compile(name,
Pattern.CASE_INSENSITIVE);
+ return regex(ENDPOINT_URL_FIELD, endPointName);
}
- private Bson endpointStatusCondition(String status) {
- return eq(ENDPOINT_STATUS_FIELD, status);
+ private Bson endpointUrlCondition(String url) {
+ Pattern endPointUrl = Pattern.compile(url,
Pattern.CASE_INSENSITIVE);
+ return regex(ENDPOINT_URL_FIELD, endPointUrl);
}
+
+ private Bson endpointStatusCondition(String status) { return
eq(ENDPOINT_STATUS_FIELD, status); }
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]