Apache Zeta Components Manual :: File Source for meta_data_storage.php

Source for file meta_data_storage.php

Documentation is available at meta_data_storage.php

  1. <?php
  2. /**
  3.  * File containing the ezcCacheStackMetaDataStorage interface.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @package Cache
  23.  * @version //autogentag//
  24.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25.  * @filesource
  26.  */
  27.  
  28. /**
  29.  * Interface that must be implemented by stack meta data storages.
  30.  *
  31.  * If a storage is capable to store meta data used by an {@link ezcCacheStack},
  32.  * it must implement this interface. Beside the store and restore methods for
  33.  * the meta data itself, it must implement methods to lock and unlock the
  34.  * complete storage, to ensure that meta data is kept consistent and not
  35.  * affected by race conditions of concurring requests.
  36.  * 
  37.  * @package Cache
  38.  * @version //autogentag//
  39.  */
  40. {
  41.     /**
  42.      * Restores and returns the meta data struct.
  43.      *
  44.      * This method fetches the meta data stored in the storage and returns the
  45.      * according object implementing {@link ezcCacheStackMetaData}, that was
  46.      * stored using {@link storeMetaData()}. The meta data must be stored
  47.      * inside the storage, but should not be visible as normal cache items to
  48.      * the user. If no meta data is found, null must be returned.
  49.      * 
  50.      * @return ezcCacheStackMetaData|null
  51.      */
  52.     public function restoreMetaData();
  53.  
  54.     /**
  55.      * Stores the given meta data struct.
  56.      *
  57.      * This method stores the given $metaData inside the storage. The data must
  58.      * be stored with the same mechanism that the storage itself uses. However,
  59.      * it should not be stored as a normal cache item, if possible, to avoid
  60.      * accedental user manipulation. The class of $metaData must be stored in
  61.      * addition, to reconstruct the correct {@link ezcCacheStackMetaData}
  62.      * implementing class on {@link restoreMetaData}.
  63.      * 
  64.      * @param ezcCacheStackMetaData $metaData 
  65.      */
  66.     public function storeMetaDataezcCacheStackMetaData $metaData );
  67.  
  68.     /**
  69.      * Acquire a lock on the storage.
  70.      *
  71.      * This method acquires a lock on the storage. If locked, the storage must
  72.      * block all other method calls until the lock is freed again using {@link }
  73.      * ezcCacheStackMetaDataStorage::unlock()}. Methods that are called within
  74.      * the request that successfully acquired the lock must succeed as usual.
  75.      * 
  76.      * @return void 
  77.      */
  78.     public function lock();
  79.  
  80.     /**
  81.      * Release a lock on the storage.
  82.      *
  83.      * This method releases the lock of the storage, that has been acquired via
  84.      * {@link ezcCacheStackMetaDataStorage::lock()}. After this method has been
  85.      * called, blocked method calls (including calls to lock()) can suceed
  86.      * again.
  87.      * 
  88.      * @return void 
  89.      */
  90.     public function unlock();
  91. }
  92.  
  93. ?>
Documentation generated by phpDocumentor 1.4.3