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_r371502369
##########
File path:
services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAOImpl.java
##########
@@ -65,11 +74,23 @@ 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
+ */
+ @Deprecated //private Bson endpointCondition(String name) { return
eq(ENDPOINT_NAME_FIELD, name); }
+
private Bson endpointCondition(String name) {
- return eq(ENDPOINT_NAME_FIELD, name);
+ //The Pattern interface is used, to avoid case sensitive
endpoint 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) {
+ //The Pattern interface is used, to avoid case sensitive URL
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]