Back to index

d-push  2.0
istatemachine.php
Go to the documentation of this file.
00001 <?php
00002 /***********************************************
00003 * File      :   istatemachine.php
00004 * Project   :   Z-Push
00005 * Descr     :   Interface called from the Device and
00006 *               StateManager to save states for a user/device/folder.
00007  *              Z-Push implements the FileStateMachine which
00008  *              saves states to disk.
00009  *              Backends provide their own IStateMachine
00010                 implementation of this interface and return
00011  *              an IStateMachine instance with IBackend->GetStateMachine().
00012  *              Old sync states are not deleted until a new sync state
00013  *              is requested.
00014  *              At that moment, the PIM is apparently requesting an update
00015  *              since sync key X, so any sync states before X are already on
00016  *              the PIM, and can therefore be removed. This algorithm should be
00017  *              automatically enforced by the IStateMachine implementation.
00018 *
00019 * Created   :   02.01.2012
00020 *
00021 * Copyright 2007 - 2012 Zarafa Deutschland GmbH
00022 *
00023 * This program is free software: you can redistribute it and/or modify
00024 * it under the terms of the GNU Affero General Public License, version 3,
00025 * as published by the Free Software Foundation with the following additional
00026 * term according to sec. 7:
00027 *
00028 * According to sec. 7 of the GNU Affero General Public License, version 3,
00029 * the terms of the AGPL are supplemented with the following terms:
00030 *
00031 * "Zarafa" is a registered trademark of Zarafa B.V.
00032 * "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
00033 * The licensing of the Program under the AGPL does not imply a trademark license.
00034 * Therefore any rights, title and interest in our trademarks remain entirely with us.
00035 *
00036 * However, if you propagate an unmodified version of the Program you are
00037 * allowed to use the term "Z-Push" to indicate that you distribute the Program.
00038 * Furthermore you may use our trademarks where it is necessary to indicate
00039 * the intended purpose of a product or service provided you use it in accordance
00040 * with honest practices in industrial or commercial matters.
00041 * If you want to propagate modified versions of the Program under the name "Z-Push",
00042 * you may only do so if you have a written permission by Zarafa Deutschland GmbH
00043 * (to acquire a permission please contact Zarafa at trademark@zarafa.com).
00044 *
00045 * This program is distributed in the hope that it will be useful,
00046 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00047 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00048 * GNU Affero General Public License for more details.
00049 *
00050 * You should have received a copy of the GNU Affero General Public License
00051 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00052 *
00053 * Consult LICENSE file for details
00054 ************************************************/
00055 
00056 interface IStateMachine {
00057     const DEFTYPE = "";
00058     const DEVICEDATA = "devicedata";
00059     const FOLDERDATA = "fd";
00060     const FAILSAVE = "fs";
00061     const HIERARCHY = "hc";
00062     const BACKENDSTORAGE = "bs";
00063 
00084     public function GetStateHash($devid, $type, $key = false, $counter = false);
00085 
00101     public function GetState($devid, $type, $key = false, $counter = false, $cleanstates = true);
00102 
00116     public function SetState($state, $devid, $type, $key = false, $counter = false);
00117 
00132     public function CleanStates($devid, $type, $key, $counter = false);
00133 
00143     public function LinkUserDevice($username, $devid);
00144 
00154     public function UnLinkUserDevice($username, $devid);
00155 
00165     public function GetAllDevices($username = false);
00166 }
00167 
00168 ?>