001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.bi.rules;
016    
017    import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
018    import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
019    
020    import java.util.List;
021    import java.util.Map;
022    
023    /**
024     * @author Michael C. Han
025     * @author Vihang Pathak
026     */
027    public interface RulesEngine {
028    
029            @MessagingProxy(mode = ProxyMode.SYNC)
030            public void add(
031                            String domainName, RulesResourceRetriever rulesResourceRetriever,
032                            ClassLoader... classloaders)
033                    throws RulesEngineException;
034    
035            @MessagingProxy(mode = ProxyMode.SYNC)
036            public boolean containsRuleDomain(String domainName)
037                    throws RulesEngineException;
038    
039            @MessagingProxy(mode = ProxyMode.ASYNC)
040            public void execute(
041                            RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
042                            ClassLoader... classloaders)
043                    throws RulesEngineException;
044    
045            @MessagingProxy(mode = ProxyMode.SYNC)
046            public Map<String, ?> execute(
047                            RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
048                            Query query, ClassLoader... classloaders)
049                    throws RulesEngineException;
050    
051            @MessagingProxy(mode = ProxyMode.ASYNC)
052            public void execute(
053                            String domainName, List<Fact<?>> facts, ClassLoader... classloaders)
054                    throws RulesEngineException;
055    
056            @MessagingProxy(mode = ProxyMode.SYNC)
057            public Map<String, ?> execute(
058                            String domainName, List<Fact<?>> facts, Query query,
059                            ClassLoader... classloaders)
060                    throws RulesEngineException;
061    
062            @MessagingProxy(mode = ProxyMode.SYNC)
063            public void remove(String domainName) throws RulesEngineException;
064    
065            @MessagingProxy(mode = ProxyMode.SYNC)
066            public void update(
067                            String domainName, RulesResourceRetriever rulesResourceRetriever,
068                            ClassLoader... classloaders)
069                    throws RulesEngineException;
070    
071    }