Source for file Cabinet.php

Documentation is available at Cabinet.php

  1. <?php
  2. include_once(dirname(__FILE__)."/../filing/CabinetEntry.php");
  3. /**
  4. * Cabinets contain other Cabinets and ByteStores, and have
  5. * implementation-dependent properties.
  6. *
  7. * <p>
  8. * They may manage quotas, that is, if the implementation supports quotas, each
  9. * Agent may be assigned a quota of space used in the Cabinet.
  10. * </p>
  11. *
  12. * <p>
  13. * Cabinets contain CabinetEntries, each of which may be a ByteStore or a
  14. * Cabinet. They are known by their IDs and name, where the name is a string
  15. * which does not include the implementation-dependent separationCharacter,
  16. * and may represent a filename.
  17. * </p>
  18. *
  19. * <p>
  20. * ByteStores and Cabinets are added to Cabinets. Cabinets are created in
  21. * CabinetFactories or Cabinets, and ByteStores are created in Cabinets.
  22. * </p>
  23. *
  24. * <p>
  25. * OSID Version: 2.0
  26. * </p>
  27. *
  28. * <p>
  29. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  30. * O.K.I&#46; OSID Definition License}.
  31. * </p>
  32. *
  33. * @package org.osid.filing
  34. */
  35. class Cabinet
  36. extends CabinetEntry
  37. {
  38. /**
  39. * Create a new ByteStore and add it to this Cabinet under the given name.
  40. * The name must not include this Cabinet's separationCharacter.
  41. *
  42. * @param string $displayName
  43. *
  44. * @return object ByteStore
  45. *
  46. * @throws object FilingException An exception with one of the
  47. * following messages defined in org.osid.filing.FilingException
  48. * may be thrown: {@link }
  49. * org.osid.filing.FilingException#PERMISSION_DENIED
  50. * PERMISSION_DENIED}, {@link }
  51. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  52. * org.osid.filing.FilingException#ITEM_ALREADY_EXISTS
  53. * ITEM_ALREADY_EXISTS}
  54. *
  55. * @access public
  56. */
  57. function createByteStore ( $displayName ) {
  58. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  59. }
  60.  
  61. /**
  62. * Create a new Cabinet and add it to this Cabinet under the given name.
  63. * The name must not include this Cabinet's separationCharacter.
  64. *
  65. * @param string $displayName
  66. *
  67. * @return object Cabinet
  68. *
  69. * @throws object FilingException An exception with one of the
  70. * following messages defined in org.osid.filing.FilingException
  71. * may be thrown: {@link }
  72. * org.osid.filing.FilingException#PERMISSION_DENIED
  73. * PERMISSION_DENIED}, {@link }
  74. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  75. * org.osid.filing.FilingException#ITEM_ALREADY_EXISTS
  76. * ITEM_ALREADY_EXISTS}, {@link }
  77. * org.osid.filing.FilingException#NAME_CONTAINS_ILLEGAL_CHARS
  78. * NAME_CONTAINS_ILLEGAL_CHARS}
  79. *
  80. * @access public
  81. */
  82. function createCabinet ( $displayName ) {
  83. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  84. }
  85.  
  86. /**
  87. * Copy an existing ByteStore in this Cabinet by copying contents and the
  88. * appropriate attributes of another ByteStore.
  89. *
  90. * @param string $displayName
  91. * @param object ByteStore $oldByteStore
  92. *
  93. * @return object ByteStore
  94. *
  95. * @throws object FilingException An exception with one of the
  96. * following messages defined in org.osid.filing.FilingException
  97. * may be thrown: {@link }
  98. * org.osid.filing.FilingException#PERMISSION_DENIED
  99. * PERMISSION_DENIED}, {@link }
  100. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  101. * org.osid.filing.FilingException#ITEM_ALREADY_EXISTS
  102. * ITEM_ALREADY_EXISTS}, {@link }
  103. * org.osid.filing.FilingException#UNIMPLEMENTED UNIMPLEMENTED}
  104. *
  105. * @access public
  106. */
  107. function copyByteStore ( $displayName, $oldByteStore ) {
  108. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  109. }
  110.  
  111. /**
  112. * Add a CabinetEntry, it must be from same Manager.
  113. *
  114. * @param object CabinetEntry $entry
  115. * @param string $displayName
  116. *
  117. * @throws object FilingException An exception with one of the
  118. * following messages defined in org.osid.filing.FilingException
  119. * may be thrown: {@link }
  120. * org.osid.filing.FilingException#PERMISSION_DENIED
  121. * PERMISSION_DENIED}, {@link }
  122. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  123. * org.osid.filing.FilingException#NAME_CONTAINS_ILLEGAL_CHARS
  124. * NAME_CONTAINS_ILLEGAL_CHARS}, {@link }
  125. * org.osid.filing.FilingException#ITEM_ALREADY_EXISTS
  126. * ITEM_ALREADY_EXISTS}, {@link }
  127. * org.osid.filing.FilingException#UNIMPLEMENTED UNIMPLEMENTED}
  128. *
  129. * @access public
  130. */
  131. function add ( $entry, $displayName ) {
  132. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  133. }
  134.  
  135. /**
  136. * Remove a CabinetEntry. Does not destroy the CabinetEntry.
  137. *
  138. * @param object CabinetEntry $entry
  139. *
  140. * @throws object FilingException An exception with one of the
  141. * following messages defined in org.osid.filing.FilingException
  142. * may be thrown: {@link }
  143. * org.osid.filing.FilingException#PERMISSION_DENIED
  144. * PERMISSION_DENIED}, {@link }
  145. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  146. * org.osid.filing.FilingException#UNIMPLEMENTED UNIMPLEMENTED}
  147. *
  148. * @access public
  149. */
  150. function remove ( $entry ) {
  151. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  152. }
  153.  
  154. /**
  155. * Get a CabinetEntry from a Cabinet by its ID.
  156. *
  157. * @param object Id $id
  158. *
  159. * @return object CabinetEntry
  160. *
  161. * @throws object FilingException An exception with one of the
  162. * following messages defined in org.osid.filing.FilingException
  163. * may be thrown: {@link }
  164. * org.osid.filing.FilingException#PERMISSION_DENIED
  165. * PERMISSION_DENIED}, {@link }
  166. * org.osid.filing.FilingException#IO_ERROR IO_ERROR},{@link }
  167. * org.osid.filing.FilingException#ITEM_DOES_NOT_EXIST
  168. * ITEM_DOES_NOT_EXIST}
  169. *
  170. * @access public
  171. */
  172. function getCabinetEntryById ( $id ) {
  173. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  174. }
  175.  
  176. /**
  177. * Get a CabinetEntry by name. Not all CabinetEntrys have names, but if it
  178. * has a name, the name is unique within a Cabinet.
  179. *
  180. * @param string $displayName
  181. *
  182. * @return object CabinetEntry
  183. *
  184. * @throws object FilingException An exception with one of the
  185. * following messages defined in org.osid.filing.FilingException
  186. * may be thrown: {@link }
  187. * org.osid.filing.FilingException#PERMISSION_DENIED
  188. * PERMISSION_DENIED}, {@link }
  189. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  190. * org.osid.filing.FilingException#DELETE_FAILED DELETE_FAILED},
  191. * {@link org.osid.filing.FilingException#ITEM_DOES_NOT_EXIST}
  192. * ITEM_DOES_NOT_EXIST}, {@link }
  193. * org.osid.filing.FilingException#UNIMPLEMENTED UNIMPLEMENTED}
  194. *
  195. * @access public
  196. */
  197. function getCabinetEntryByName ( $displayName ) {
  198. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  199. }
  200.  
  201. /**
  202. * Get an Iterator over all CabinetEntries in this Cabinet.
  203. *
  204. * @return object CabinetEntryIterator
  205. *
  206. * @throws object FilingException
  207. *
  208. * @access public
  209. */
  210. function entries () {
  211. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  212. }
  213.  
  214. /**
  215. * Return the root Cabinet of this Cabinet.
  216. *
  217. * @return object Cabinet
  218. *
  219. * @throws object FilingException An exception with one of the
  220. * following messages defined in org.osid.filing.FilingException
  221. * may be thrown: {@link }
  222. * org.osid.filing.FilingException#PERMISSION_DENIED
  223. * PERMISSION_DENIED}, {@link }
  224. * org.osid.filing.FilingException#IO_ERROR IO_ERROR}, {@link }
  225. * org.osid.filing.FilingException#UNIMPLEMENTED UNIMPLEMENTED}
  226. *
  227. * @access public
  228. */
  229. function getRootCabinet () {
  230. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  231. }
  232.  
  233. /**
  234. * Return true if this Cabinet is the root Cabinet.
  235. *
  236. * @return boolean
  237. *
  238. * @throws object FilingException
  239. *
  240. * @access public
  241. */
  242. function isRootCabinet () {
  243. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  244. }
  245.  
  246. /**
  247. * Return true if this Cabinet allows entries to be added or removed.
  248. *
  249. * @return boolean
  250. *
  251. * @throws object FilingException
  252. *
  253. * @access public
  254. */
  255. function isManageable () {
  256. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  257. }
  258.  
  259. /**
  260. * Get number of bytes available in this Cabinet.
  261. *
  262. * @return int
  263. *
  264. * @throws object FilingException An exception with one of the
  265. * following messages defined in org.osid.filing.FilingException
  266. * may be thrown: {@link org.osid.filing.FilingException#IO_ERROR}
  267. * IO_ERROR}, {@link org.osid.filing.FilingException#UNIMPLEMENTED}
  268. * UNIMPLEMENTED}
  269. *
  270. * @access public
  271. */
  272. function getAvailableBytes () {
  273. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  274. }
  275.  
  276. /**
  277. * Get number of bytes used in this Cabinet.
  278. *
  279. * @return int
  280. *
  281. * @throws object FilingException An exception with one of the
  282. * following messages defined in org.osid.filing.FilingException
  283. * may be thrown: {@link org.osid.filing.FilingException#IO_ERROR}
  284. * IO_ERROR}, {@link org.osid.filing.FilingException#UNIMPLEMENTED}
  285. * UNIMPLEMENTED}
  286. *
  287. * @access public
  288. */
  289. function getUsedBytes () {
  290. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  291. }
  292. }
  293.  
  294. ?>

Documentation generated on Wed, 19 Sep 2007 10:21:57 -0400 by phpDocumentor 1.3.0RC3