001    /**
002     * Copyright (c) 2000-2013 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.ExecutingClassLoaders;
018    import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
019    import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
020    
021    import java.util.List;
022    import java.util.Map;
023    
024    /**
025     * @author Michael C. Han
026     * @author Vihang Pathak
027     */
028    public interface RulesEngine {
029    
030            @MessagingProxy(mode = ProxyMode.SYNC)
031            public void add(
032                            String domainName, RulesResourceRetriever rulesResourceRetriever,
033                            @ExecutingClassLoaders ClassLoader... classloaders)
034                    throws RulesEngineException;
035    
036            @MessagingProxy(mode = ProxyMode.SYNC)
037            public boolean containsRuleDomain(String domainName)
038                    throws RulesEngineException;
039    
040            @MessagingProxy(mode = ProxyMode.ASYNC)
041            public void execute(
042                            RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
043                            @ExecutingClassLoaders ClassLoader... classloaders)
044                    throws RulesEngineException;
045    
046            @MessagingProxy(mode = ProxyMode.SYNC)
047            public Map<String, ?> execute(
048                            RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
049                            Query query, @ExecutingClassLoaders ClassLoader... classloaders)
050                    throws RulesEngineException;
051    
052            @MessagingProxy(mode = ProxyMode.ASYNC)
053            public void execute(
054                            String domainName, List<Fact<?>> facts,
055                            @ExecutingClassLoaders ClassLoader... classloaders)
056                    throws RulesEngineException;
057    
058            @MessagingProxy(mode = ProxyMode.SYNC)
059            public Map<String, ?> execute(
060                            String domainName, List<Fact<?>> facts, Query query,
061                            @ExecutingClassLoaders ClassLoader... classloaders)
062                    throws RulesEngineException;
063    
064            @MessagingProxy(mode = ProxyMode.SYNC)
065            public void remove(String domainName) throws RulesEngineException;
066    
067            @MessagingProxy(mode = ProxyMode.SYNC)
068            public void update(
069                            String domainName, RulesResourceRetriever rulesResourceRetriever,
070                            @ExecutingClassLoaders ClassLoader... classloaders)
071                    throws RulesEngineException;
072    
073    }