コード例 #1
0
 private Connection getConnectionOrFail(String connectionId) throws ServiceException {
   final Connection connection = connectionRepo.findByConnectionId(connectionId);
   if (connection == null) {
     throw createInvalidParameterServiceException("connectionId");
   }
   return connection;
 }
コード例 #2
0
 private void validateConnectionId(String connectionId) throws ServiceException {
   if (StringUtils.hasText(connectionId)) {
     if (connectionRepo.findByConnectionId(connectionId) != null) {
       log.warn("ConnectionId {} was not unique", connectionId);
       throw createAlreadyExistsServiceException("connectionId");
     }
   } else {
     log.warn("ConnectionId was empty", connectionId);
     throw createInvalidParameterServiceException("connectionId");
   }
 }