4 * Licensed to Jasig under one or more contributor license
5 * agreements. See the NOTICE file distributed with this work for
6 * additional information regarding copyright ownership.
8 * Jasig licenses this file to you under the Apache License,
9 * Version 2.0 (the "License"); you may not use this file except in
10 * compliance with the License. You may obtain a copy of the License at:
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 * @file CAS/PGTStorage/AbstractStorage.php
23 * @category Authentication
25 * @author Pascal Aubry <pascal.aubry@univ-rennes1.fr>
26 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
27 * @link https://wiki.jasig.org/display/CASC/phpCAS
31 * Basic class for PGT storage
32 * The CAS_PGTStorage_AbstractStorage class is a generic class for PGT storage.
33 * This class should not be instanciated itself but inherited by specific PGT
36 * @class CAS_PGTStorage_AbstractStorage
37 * @category Authentication
39 * @author Pascal Aubry <pascal.aubry@univ-rennes1.fr>
40 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
41 * @link https://wiki.jasig.org/display/CASC/phpCAS
43 * @ingroup internalPGTStorage
46 abstract class CAS_PGTStorage_AbstractStorage
49 * @addtogroup internalPGTStorage
53 // ########################################################################
55 // ########################################################################
58 * The constructor of the class, should be called only by inherited classes.
60 * @param CAS_Client $cas_parent the CAS _client instance that creates the
67 function __construct($cas_parent)
70 if ( !$cas_parent->isProxy() ) {
71 phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
76 // ########################################################################
78 // ########################################################################
81 * This virtual method returns an informational string giving the type of storage
82 * used by the object (used for debugging purposes).
88 function getStorageType()
90 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
94 * This virtual method returns an informational string giving informations on the
95 * parameters of the storage.(used for debugging purposes).
101 function getStorageInfo()
103 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
106 // ########################################################################
108 // ########################################################################
111 * string used to store an error message. Written by
112 * PGTStorage::setErrorMessage(), read by PGTStorage::getErrorMessage().
115 * @deprecated not used.
117 var $_error_message=false;
120 * This method sets en error message, which can be read later by
121 * PGTStorage::getErrorMessage().
123 * @param string $error_message an error message
127 * @deprecated not used.
129 function setErrorMessage($error_message)
131 $this->_error_message = $error_message;
135 * This method returns an error message set by PGTStorage::setErrorMessage().
137 * @return an error message when set by PGTStorage::setErrorMessage(), FALSE
140 * @deprecated not used.
142 function getErrorMessage()
144 return $this->_error_message;
147 // ########################################################################
149 // ########################################################################
152 * a boolean telling if the storage has already been initialized. Written by
153 * PGTStorage::init(), read by PGTStorage::isInitialized().
157 var $_initialized = false;
160 * This method tells if the storage has already been intialized.
166 function isInitialized()
168 return $this->_initialized;
172 * This virtual method initializes the object.
178 $this->_initialized = true;
181 // ########################################################################
183 // ########################################################################
186 * This virtual method stores a PGT and its corresponding PGT Iuo.
188 * @param string $pgt the PGT
189 * @param string $pgt_iou the PGT iou
193 * @note Should never be called.
196 function write($pgt,$pgt_iou)
198 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
202 * This virtual method reads a PGT corresponding to a PGT Iou and deletes
203 * the corresponding storage entry.
205 * @param string $pgt_iou the PGT iou
209 * @note Should never be called.
211 function read($pgt_iou)
213 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');