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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]