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 */ 022package org.granite.tide.data; 023 024 025/** 026 * Interface for data update dispatchers. 027 * The dispatch is a three step process : 028 * 029 * <ul> 030 * <li>Initialization in the constructor (specific for each implementation), at initialization of <code>DataContext</code></li> 031 * <li><code>observe()</code> builds the server selector depending on the data that are processed</li> 032 * <li><code>publish()</code> handles the actual publishing</li> 033 * </ul> 034 * 035 * @see DataContext 036 * 037 * @author William Drai 038 */ 039public interface DataDispatcher { 040 041 public static final String TIDE_DATA_SUBTOPIC = "tideDataTopic"; 042 public static final String GDS_SESSION_ID = "GDSSessionID"; 043 public static final String TIDE_DATA_TYPE_KEY = "type"; 044 public static final String TIDE_DATA_TYPE_VALUE = "DATA"; 045 public static final String SERVER_DISPATCHER_GDS_SESSION_ID = "__GDS_SERVER_DISPATCHER__"; 046 047 public void observe(); 048 049 public void publish(Object[][] dataUpdates); 050}