@Override
    public List<URI> registerServices(URI sourceDocumentUri, String mediaType) throws SalException {

        boolean isNativeFormat = MediaType.NATIVE_MEDIATYPE_SYNTAX_MAP.containsKey(mediaType);
        // Throw error if Format Unsupported
        if (!isNativeFormat && !this.serviceTransformationEngine.canTransform(mediaType)) {
            log.error("The media type {} is not natively supported and has no suitable transformer.", mediaType);
            throw new ServiceException("Unable to import service. Format unsupported.");
        }

        List<URI> registeredServices = new ArrayList<URI>();

        log.debug("Registering services from document: {}", sourceDocumentUri.toASCIIString());
        // 1st Obtain the document and parse/transform it
        List<Service> services = getServicesFromRemoteLocation(mediaType, isNativeFormat, sourceDocumentUri);

        if (services != null && !services.isEmpty()) {
            log.debug("Services found: {}. Registering ...", services.size());
            URI serviceUri;
            for (Service service : services) {
                // 2nd Add the service
                serviceUri = this.serviceManager.addService(service);
                if (serviceUri != null) {
                    registeredServices.add(serviceUri);
                }
            }
        }

        if (registeredServices.size() != services.size()) {
            log.warn("Found {} services in document {} but only imported {} services", services.size(),
                    sourceDocumentUri, registeredServices.size());
        }

        return registeredServices;
    }
@ Override public List < URI > registerServices ( URI sourceDocumentUri , String mediaType ) throws SalException { boolean isNativeFormat = MediaType . NATIVE_MEDIATYPE_SYNTAX_MAP . containsKey ( mediaType ) ; if ( ! isNativeFormat && ! this . serviceTransformationEngine . canTransform ( mediaType ) ) { log . error ( "The media type {} is not natively supported and has no suitable transformer." , mediaType ) ; throw new ServiceException ( "Unable to import service. Format unsupported." ) ; } List < URI > registeredServices = new ArrayList < URI > ( ) ; log . debug ( "Registering services from document: {}" , sourceDocumentUri . toASCIIString ( ) ) ; List < Service > services = getServicesFromRemoteLocation ( mediaType , isNativeFormat , sourceDocumentUri ) ; if ( services != null && ! services . isEmpty ( ) ) { log . debug ( "Services found: {}. Registering ..." , services . size ( ) ) ; URI serviceUri ; for ( Service service : services ) { serviceUri = this . serviceManager . addService ( service ) ; if ( serviceUri != null ) { registeredServices . add ( serviceUri ) ; } } } if ( registeredServices . size ( ) != services . size ( ) ) { log . warn ( "Found {} services in document {} but only imported {} services" , services . size ( ) , sourceDocumentUri , registeredServices . size ( ) ) ; } return registeredServices ; }
Registers all the services found on a given source document. This operation takes care of performing the
appropriate format transformation. The source document is not stored on the server. For keeping a copy of the
source document within the server use @see importServices instead.

@param sourceDocumentUri
@param mediaType
@return the List of URIs of the services registered
@throws SalException