All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.terrestris.shogun2.service.InterceptorRuleService Maven / Gradle / Ivy

The newest version!
package de.terrestris.shogun2.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import de.terrestris.shogun2.dao.InterceptorRuleDao;
import de.terrestris.shogun2.model.interceptor.InterceptorRule;

/**
 * @param 
 * @param 
 * @author Daniel Koch
 * @author Kai Volland
 * @author terrestris GmbH & Co. KG
 */
@Service("interceptorRuleService")
public class InterceptorRuleService>
    extends PermissionAwareCrudService {

    /**
     * Default constructor, which calls the type-constructor
     */
    @SuppressWarnings("unchecked")
    public InterceptorRuleService() {
        this((Class) InterceptorRule.class);
    }

    /**
     * Constructor that sets the concrete entity class for the service.
     * Subclasses MUST call this constructor.
     */
    protected InterceptorRuleService(Class entityClass) {
        super(entityClass);
    }

    /**
     * @param service
     * @param event
     * @return
     */
    @Transactional(readOnly = true)
    public List findAllRulesForServiceAndEvent(String service, String event) {
        return this.dao.findAllRulesForServiceAndEvent(service, event);
    }

    /**
     * We have to use {@link Qualifier} to define the correct dao here.
     * Otherwise, spring can not decide which dao has to be autowired here
     * as there are multiple candidates.
     */
    @Override
    @Autowired
    @Qualifier("interceptorRuleDao")
    public void setDao(D dao) {
        this.dao = dao;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy