001    /**
002     *   GRANITE DATA SERVICES
003     *   Copyright (C) 2006-2013 GRANITE DATA SERVICES S.A.S.
004     *
005     *   This file is part of the Granite Data Services Platform.
006     *
007     *   Granite Data Services is free software; you can redistribute it and/or
008     *   modify it under the terms of the GNU Lesser General Public
009     *   License as published by the Free Software Foundation; either
010     *   version 2.1 of the License, or (at your option) any later version.
011     *
012     *   Granite Data Services is distributed in the hope that it will be useful,
013     *   but WITHOUT ANY WARRANTY; without even the implied warranty of
014     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
015     *   General Public License for more details.
016     *
017     *   You should have received a copy of the GNU Lesser General Public
018     *   License along with this library; if not, write to the Free Software
019     *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
020     *   USA, or see <http://www.gnu.org/licenses/>.
021     */
022    package org.granite.clustering;
023    
024    import java.util.List;
025    import java.util.Set;
026    
027    import flex.messaging.messages.CommandMessage;
028    
029    /**
030     * @author Franck WOLFF
031     */
032    public interface DistributedData {
033    
034            // SecurityService credentials.
035            
036            public Object getCredentials();
037            public boolean hasCredentials();
038            public void setCredentials(Object credentials);
039            public void removeCredentials();
040            
041            public String getCredentialsCharset();
042            public boolean hasCredentialsCharset();
043            public void setCredentialsCharset(String credentialsCharset);
044            public void removeCredentialsCharset();
045            
046            // Gravity channels/subscriptions.
047            
048            public void addChannelId(String channelId, String channelFactoryClassName, String clientType);
049            public boolean hasChannelId(String channelId);
050            public String getChannelFactoryClassName(String channelId);
051        public String getChannelClientType(String channelId);
052            public void removeChannelId(String channelId);
053            public Set<String> getChannelIds();
054            public void clearChannelIds();
055            
056            public void addSubcription(String channelId, CommandMessage message);
057            public boolean hasSubcription(String channelId, String subscriptionId);
058            public void removeSubcription(String channelId, String subscriptionId);
059            public List<CommandMessage> getSubscriptions(String channelId);
060            public void clearSubscriptions(String channelId);
061            
062            // Gravity/Tide data management
063            
064            public String getDestinationClientId(String destination);
065            public void setDestinationClientId(String destination, String clientId);
066            
067            public String getDestinationSubscriptionId(String destination);
068            public void setDestinationSubscriptionId(String destination, String subscriptionId);
069            
070            public Object[] getDestinationDataSelectors(String destination);
071            public void setDestinationDataSelectors(String destination, Object[] selectors);
072            
073            public String getDestinationSelector(String destination);
074            public void setDestinationSelector(String destination, String selector);
075    }