/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.gravitee.management.repository.proxy;

import io.gravitee.repository.exceptions.TechnicalException;
import io.gravitee.repository.media.api.MediaRepository;
import io.gravitee.repository.media.model.Media;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * @author Guillaume GILLON
 */
@Component
public class MediaRepositoryProxy extends AbstractProxy<MediaRepository> implements MediaRepository {
    @Override
    public String save(Media media) throws TechnicalException {
        return target.save(media);
    }

    @Override
    public Optional<Media> findByHash(String hash, String mediaType) {
        return target.findByHash(hash, mediaType);
    }

    @Override
    public Optional<Media> findByHash(String hash, String api, String mediaType) {
        return target.findByHash(hash, api, mediaType);
    }

    @Override
    public void delete(String hash, String mediaType) {
        target.delete(hash, mediaType);
    }

    @Override
    public void deleteApiFor(String hash, String api, String mediaType) {
        target.deleteApiFor(hash, api, mediaType);
    }

    @Override
    public long totalSizeFor(String api, String mediaType) {
        return target.totalSizeFor(api, mediaType);
    }
}

/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.gravitee.management.repository.proxy;

import io.gravitee.repository.exceptions.TechnicalException;
import io.gravitee.repository.media.api.MediaRepository;
import io.gravitee.repository.media.model.Media;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * @author Guillaume GILLON
 * @author GraviteeSource Team
 */
@Component
public class MediaRepositoryProxy extends AbstractProxy<MediaRepository> implements MediaRepository {
    @Override
    public String save(Media media) throws TechnicalException {
        return target.save(media);
    }

    @Override
    public Optional<Media> findByHash(String hash, String mediaType) {
        return target.findByHash(hash, mediaType);
    }

    @Override
    public Optional<Media> findByHash(String hash, String api, String mediaType) {
        return target.findByHash(hash, api, mediaType);
    }
}

remove unecessary methods