You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dlab.apache.org by GitBox <gi...@apache.org> on 2020/01/22 03:23:38 UTC

[GitHub] [incubator-dlab] ppapou opened a new pull request #542: [Endpoints] Verificationof the enpoint url field

ppapou opened a new pull request #542: [Endpoints] Verificationof the enpoint url field
URL: https://github.com/apache/incubator-dlab/pull/542
 
 
   The EndPoint objects should contain Unique values of the 'url' and 'name' fields

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [Endpoints] Verificationof the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #542: [Endpoints] Verificationof the enpoint url field
URL: https://github.com/apache/incubator-dlab/pull/542#discussion_r369564192
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -68,13 +68,21 @@ public EndpointDTO get(String name) {
 				.orElseThrow(() -> new ResourceNotFoundException("Endpoint with name " + name + " not found"));
 	}
 
+	/**
+	 * Create new endpoint object in the System.
+	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
+	 * i.e two objects with same URLs should not be created in the system
+	 * @param userInfo user properties
+	 * @param endpointDTO object with endpoint fields
+	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
+		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) throw new ResourceConflictException("A Duplication of the Endpoint URL!");
 
 Review comment:
   Also, please throw an exception inside `if` body

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371502449
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -76,8 +77,18 @@ public EndpointDTO get(String name) {
 				.orElseThrow(() -> new ResourceNotFoundException("Endpoint with name " + name + " not found"));
 	}
 
+	/**
+	 * Create new endpoint object in the System.
+	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
 
 Review comment:
   Fixed

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371311030
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,14 +23,28 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/*** Retrieve the Endpoint entity according required name
+	 * @param name - the Endpoint regular title
+	 * @return the Optional interface
+	 */
 	Optional<EndpointDTO> get(String name);
 
+	/*** Retrieve the Endpoint entity according required Endpoint URL
+	 * @param url - the Endpoint web address
+	 * @return the Optional object
 
 Review comment:
   Optional **interface** or Optional **object**?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371023904
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,15 +23,33 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/***
+	 * @param name - The Pattern interface is used, to avoid case sensitive Name
+	 * @return
+	 */
+	Optional<EndpointDTO> get(Pattern name);
+
+	/***
+	 * @param name - case sensitive EnaPoint Name
+	 * @return
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371851040
 
 

 ##########
 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:
   Please do not inline the method

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370363897
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
 
 Review comment:
   Pls remove the comment, it is a good smell to write it

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371502119
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,14 +23,28 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/*** Retrieve the Endpoint entity according required name
+	 * @param name - the Endpoint regular title
+	 * @return the Optional interface
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371501989
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,14 +23,28 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 
 Review comment:
   I have updated the interface description

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r370832188
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
+		Pattern endPointUrl = Pattern.compile(endpointDTO.getUrl(), Pattern.CASE_INSENSITIVE);
 
 Review comment:
   It is a nice idea, becide we cau use the String interface

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371847753
 
 

 ##########
 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.
 
 Review comment:
   EndPoint -> Endpoint

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370363478
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
+		Pattern endPointUrl = Pattern.compile(endpointDTO.getUrl(), Pattern.CASE_INSENSITIVE);
 
 Review comment:
   simply endpointUrl

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371988316
 
 

 ##########
 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
 
 Review comment:
   The comment has been deleted

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r370893370
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,15 +23,33 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/***
+	 * @param name - The Pattern interface is used, to avoid case sensitive Name
+	 * @return
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370369383
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
+		Pattern endPointUrl = Pattern.compile(endpointDTO.getUrl(), Pattern.CASE_INSENSITIVE);
+		if(endpointDAO.getEndpointWithUrl(endPointUrl).isPresent()) {
 			throw new ResourceConflictException("The Endpoint URL with this address already exists in system!");
 		}
+		//Verify if the Cloud provider, ensure that URL does not exist in the DataBase
 		CloudProvider cloudProvider = checkUrl(userInfo, endpointDTO.getUrl());
-		if (!endpointDAO.get(endpointDTO.getName()).isPresent()) {
+		Pattern endPointName = Pattern.compile(endpointDTO.getName(), Pattern.CASE_INSENSITIVE);
 
 Review comment:
   the same

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [Endpoints] Verificationof the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #542: [Endpoints] Verificationof the enpoint url field
URL: https://github.com/apache/incubator-dlab/pull/542#discussion_r369529185
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -68,13 +68,21 @@ public EndpointDTO get(String name) {
 				.orElseThrow(() -> new ResourceNotFoundException("Endpoint with name " + name + " not found"));
 	}
 
+	/**
+	 * Create new endpoint object in the System.
+	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
+	 * i.e two objects with same URLs should not be created in the system
+	 * @param userInfo user properties
+	 * @param endpointDTO object with endpoint fields
+	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
+		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) throw new ResourceConflictException("A Duplication of the Endpoint URL!");
 
 Review comment:
   We do a call to mongo [here](https://github.com/apache/incubator-dlab/pull/542/files#diff-bd755c21a7b74a54525de3eeaea2efecR82) and we already have an endpoint entity. There is no need to call mongo again

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371310967
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,14 +23,28 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/*** Retrieve the Endpoint entity according required name
+	 * @param name - the Endpoint regular title
+	 * @return the Optional interface
 
 Review comment:
   Optional **interface** or Optional **object**?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371502273
 
 

 ##########
 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
 
 Review comment:
   Sure)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371502203
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,14 +23,28 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/*** Retrieve the Endpoint entity according required name
+	 * @param name - the Endpoint regular title
+	 * @return the Optional interface
+	 */
 	Optional<EndpointDTO> get(String name);
 
+	/*** Retrieve the Endpoint entity according required Endpoint URL
+	 * @param url - the Endpoint web address
+	 * @return the Optional object
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks merged pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks merged pull request #542: [DLAB-1447] Verification of the enpoint url field
URL: https://github.com/apache/incubator-dlab/pull/542
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370366522
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,15 +23,33 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/***
+	 * @param name - The Pattern interface is used, to avoid case sensitive Name
+	 * @return
+	 */
+	Optional<EndpointDTO> get(Pattern name);
+
+	/***
+	 * @param name - case sensitive EnaPoint Name
+	 * @return
+	 */
 	Optional<EndpointDTO> get(String name);
 
-	Optional<EndpointDTO> getEndpointWithUrl(String url);
+	/***
+	 * @param url - The Pattern interface is used, to avoid case sensitive URL
+	 * @return
 
 Review comment:
   the same

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r370160100
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -68,13 +68,21 @@ public EndpointDTO get(String name) {
 				.orElseThrow(() -> new ResourceNotFoundException("Endpoint with name " + name + " not found"));
 	}
 
+	/**
+	 * Create new endpoint object in the System.
+	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
+	 * i.e two objects with same URLs should not be created in the system
+	 * @param userInfo user properties
+	 * @param endpointDTO object with endpoint fields
+	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
+		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) throw new ResourceConflictException("A Duplication of the Endpoint URL!");
 
 Review comment:
   The Exception has been thrown in the 'if' instruction.
   The error messages has been updated according requirements

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371314779
 
 

 ##########
 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); }
 
 Review comment:
   Why do you use '@Deprecated' here?
   I think we should not leave the old code in our code base

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371308254
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,14 +23,28 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 
 Review comment:
   I wonder whether this comment is informative here. How do you think?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371311909
 
 

 ##########
 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:
   The same here

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371311803
 
 

 ##########
 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
 
 Review comment:
   Please do not you any comment inside java code)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371848647
 
 

 ##########
 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
 
 Review comment:
   There is no need to mention "new method" because we don't have an old one)
   I assume to delete this line at all.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371501676
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r370893347
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
+		Pattern endPointUrl = Pattern.compile(endpointDTO.getUrl(), Pattern.CASE_INSENSITIVE);
+		if(endpointDAO.getEndpointWithUrl(endPointUrl).isPresent()) {
 			throw new ResourceConflictException("The Endpoint URL with this address already exists in system!");
 		}
+		//Verify if the Cloud provider, ensure that URL does not exist in the DataBase
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371311803
 
 

 ##########
 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
 
 Review comment:
   Please do not use any comment inside java code)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370366434
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,15 +23,33 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/***
+	 * @param name - The Pattern interface is used, to avoid case sensitive Name
+	 * @return
 
 Review comment:
   complete docs. Add info about return as well

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r371312351
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -76,8 +77,18 @@ public EndpointDTO get(String name) {
 				.orElseThrow(() -> new ResourceNotFoundException("Endpoint with name " + name + " not found"));
 	}
 
+	/**
+	 * Create new endpoint object in the System.
+	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
 
 Review comment:
   EndPoint -> Endpoint

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ppapou commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
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_r371502693
 
 

 ##########
 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); }
 
 Review comment:
   The depricated method has been removed

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370369292
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
+		Pattern endPointUrl = Pattern.compile(endpointDTO.getUrl(), Pattern.CASE_INSENSITIVE);
 
 Review comment:
   I wonder we can move this line to the DAO layer, how do you think?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370363963
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java
 ##########
 @@ -79,17 +80,21 @@ public EndpointDTO get(String name) {
 	/**
 	 * Create new endpoint object in the System.
 	 * The EndPoint objects should contain Unique values of the 'url' and 'name' fields,
-	 * i.e two objects with same URLs should not be created in the system
+	 * i.e two objects with same URLs should not be created in the system.
 	 * @param userInfo user properties
 	 * @param endpointDTO object with endpoint fields
 	 */
 	@Override
 	public void create(UserInfo userInfo, EndpointDTO endpointDTO) {
-		if(endpointDAO.getEndpointWithUrl(endpointDTO.getUrl()).isPresent()) {
+		//Verify if the Endpoint URL exists in the DataBase
+		Pattern endPointUrl = Pattern.compile(endpointDTO.getUrl(), Pattern.CASE_INSENSITIVE);
+		if(endpointDAO.getEndpointWithUrl(endPointUrl).isPresent()) {
 			throw new ResourceConflictException("The Endpoint URL with this address already exists in system!");
 		}
+		//Verify if the Cloud provider, ensure that URL does not exist in the DataBase
 
 Review comment:
   the same here

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org


[GitHub] [incubator-dlab] ofuks commented on a change in pull request #542: [DLAB-1447] Verification of the enpoint url field

Posted by GitBox <gi...@apache.org>.
ofuks 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_r370366490
 
 

 ##########
 File path: services/self-service/src/main/java/com/epam/dlab/backendapi/dao/EndpointDAO.java
 ##########
 @@ -23,15 +23,33 @@
 
 import java.util.List;
 import java.util.Optional;
+import java.util.regex.Pattern;
 
+/**
+ * Interface of Endpoint entities.
+ */
 public interface EndpointDAO {
 	List<EndpointDTO> getEndpoints();
 
 	List<EndpointDTO> getEndpointsWithStatus(String status);
 
+	/***
+	 * @param name - The Pattern interface is used, to avoid case sensitive Name
+	 * @return
+	 */
+	Optional<EndpointDTO> get(Pattern name);
+
+	/***
+	 * @param name - case sensitive EnaPoint Name
+	 * @return
 
 Review comment:
   the same

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org