service-registry/src/main/java/de/evoila/osb/service/registry/manager/ServiceBrokerManager.java
public ServiceBroker searchForServiceBrokerWithServiceDefinitionId(String serviceDefinitionId, HttpStatus resourceNotFoundExceptionCustomStatusCode) throws ResourceNotFoundException {
        log.debug("Searching for service broker via service definition id.");
        Iterator<ServiceBroker> iterator = getAll().iterator();
        ServiceBroker sb = null;
        while (iterator.hasNext()) {
            sb = iterator.next();
            if (!cacheManager.exists(sb.getId())) {
                log.debug("Invoke soft update on service definitions for " + sb.getLoggingNameString() + " due to no cached definitions yet.");
                updateServiceBrokerCatalog(sb, false);
            }

            List<ServiceDefinition> definitions = cacheManager.getUnmodifiableDefinitions(sb.getId());
            log.debug("Found following definitions for " + sb.getLoggingNameString() + " : " + definitions);
            for (int i = 0; definitions != null && i < definitions.size(); i++) {
                if (definitions.get(i).getId().equals(serviceDefinitionId)) {
                    log.debug("Found following matching service broker for " + serviceDefinitionId + " -> " + sb.getLoggingNameString());
                    return sb;
                }
            }
        }
        log.debug("No matching service broker found for " + serviceDefinitionId);
        throw new ResourceNotFoundException("service definition", resourceNotFoundExceptionCustomStatusCode);
    }
/**
     * Searches for a service broker by one of its service definitions.
     *
     * @param serviceDefinitionId                       id to identify the definition with
     * @param resourceNotFoundExceptionCustomStatusCode custom {@linkplain HttpStatus} for the potential thrown {@linkplain ResourceNotFoundException}
     * @return the service broker with the matching definition, guaranteed to not be null
     * @throws ResourceNotFoundException if no matching definition was found
     */
Searches for a service broker by one of its service definitions.
@param serviceDefinitionId                       id to identify the definition with
@param resourceNotFoundExceptionCustomStatusCode custom  HttpStatus for the potential thrown  ResourceNotFoundException
@return the service broker with the matching definition, guaranteed to not be null
@throws ResourceNotFoundException if no matching definition was found
Searches for a service broker by one of its service definitions . @param serviceDefinitionId id to identify the definition with @param resourceNotFoundExceptionCustomStatusCode custom HttpStatus for the potential thrown ResourceNotFoundException @return the service broker with the matching definition guaranteed to not be null @throws ResourceNotFoundException if no matching definition was found
public ServiceBroker searchForServiceBrokerWithServiceDefinitionId(String serviceDefinitionId, HttpStatus resourceNotFoundExceptionCustomStatusCode) throws ResourceNotFoundException {
        log.debug("Searching for service broker via service definition id.");
        Iterator<ServiceBroker> iterator = getAll().iterator();
        ServiceBroker sb = null;
        while (iterator.hasNext()) {
            sb = iterator.next();
            if (!cacheManager.exists(sb.getId())) {
                log.debug("Invoke soft update on service definitions for " + sb.getLoggingNameString() + " due to no cached definitions yet.");
                updateServiceBrokerCatalog(sb, false);
            }
            List<ServiceDefinition> definitions = cacheManager.getUnmodifiableDefinitions(sb.getId());
            log.debug("Found following definitions for " + sb.getLoggingNameString() + " : " + definitions);
            for (int i = 0; definitions != null && i < definitions.size(); i++) {
                if (definitions.get(i).getId().equals(serviceDefinitionId)) {
                    log.debug("Found following matching service broker for " + serviceDefinitionId + " -> " + sb.getLoggingNameString());
                    return sb;
                }
            }
        }
        log.debug("No matching service broker found for " + serviceDefinitionId);
        throw new ResourceNotFoundException("service definition", resourceNotFoundExceptionCustomStatusCode);
    }
public ServiceBroker searchForServiceBrokerWithServiceDefinitionId ( String serviceDefinitionId , HttpStatus resourceNotFoundExceptionCustomStatusCode ) throws ResourceNotFoundException { log . debug ( "Searching for service broker via service definition id." ) ; Iterator < ServiceBroker > iterator = getAll ( ) . iterator ( ) ; ServiceBroker sb = null ; while ( iterator . hasNext ( ) ) { sb = iterator . next ( ) ; if ( ! cacheManager . exists ( sb . getId ( ) ) ) { log . debug ( "Invoke soft update on service definitions for " + sb . getLoggingNameString ( ) + " due to no cached definitions yet." ) ; updateServiceBrokerCatalog ( sb , false ) ; } List < ServiceDefinition > definitions = cacheManager . getUnmodifiableDefinitions ( sb . getId ( ) ) ; log . debug ( "Found following definitions for " + sb . getLoggingNameString ( ) + " : " + definitions ) ; for ( int i = 0 ; definitions != null && i < definitions . size ( ) ; i ++ ) { if ( definitions . get ( i ) . getId ( ) . equals ( serviceDefinitionId ) ) { log . debug ( "Found following matching service broker for " + serviceDefinitionId + " -> " + sb . getLoggingNameString ( ) ) ; return sb ; } } } log . debug ( "No matching service broker found for " + serviceDefinitionId ) ; throw new ResourceNotFoundException ( "service definition" , resourceNotFoundExceptionCustomStatusCode ) ; }
Searches for a service broker by one of its service definitions.
Searches for a service broker by one of its service definitions .