Source for file AgentManager.php

Documentation is available at AgentManager.php

  1. <?php
  2. include_once(dirname(__FILE__)."/../OsidManager.php");
  3. /**
  4. * <p>
  5. * AgentManager handles creating, deleting, and getting Agents and Groups.
  6. * Group is a subclass of Agent. Groups contain members. Group members are
  7. * Agents or other Groups.
  8. * </p>
  9. *
  10. * <p>
  11. * All implementations of OsidManager (manager) provide methods for accessing
  12. * and manipulating the various objects defined in the OSID package. A manager
  13. * defines an implementation of an OSID. All other OSID objects come either
  14. * directly or indirectly from the manager. New instances of the OSID objects
  15. * are created either directly or indirectly by the manager. Because the OSID
  16. * objects are defined using interfaces, create methods must be used instead
  17. * of the new operator to create instances of the OSID objects. Create methods
  18. * are used both to instantiate and persist OSID objects. Using the
  19. * OsidManager class to define an OSID's implementation allows the application
  20. * to change OSID implementations by changing the OsidManager package name
  21. * used to load an implementation. Applications developed using managers
  22. * permit OSID implementation substitution without changing the application
  23. * source code. As with all managers, use the OsidLoader to load an
  24. * implementation of this interface.
  25. * </p>
  26. *
  27. * <p></p>
  28. *
  29. * <p>
  30. * OSID Version: 2.0
  31. * </p>
  32. *
  33. * <p>
  34. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  35. * O.K.I&#46; OSID Definition License}.
  36. * </p>
  37. *
  38. * @package org.osid.agent
  39. */
  40. class AgentManager
  41. extends OsidManager
  42. {
  43. /**
  44. * Create an Agent with the display name, Type, and Properties specified.
  45. * All are immutable.
  46. *
  47. * @param string $displayName
  48. * @param object Type $agentType
  49. * @param object Properties $properties
  50. *
  51. * @return object Agent
  52. *
  53. * @throws object AgentException An exception with one of the
  54. * following messages defined in org.osid.agent.AgentException may
  55. * be thrown: {@link }
  56. * org.osid.agent.AgentException#OPERATION_FAILED
  57. * OPERATION_FAILED}, {@link }
  58. * org.osid.agent.AgentException#PERMISSION_DENIED
  59. * PERMISSION_DENIED}, {@link }
  60. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  61. * CONFIGURATION_ERROR}, {@link }
  62. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  63. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  64. * NULL_ARGUMENT}, {@link }
  65. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  66. *
  67. * @access public
  68. */
  69. function createAgent ( $displayName, $agentType, $properties ) {
  70. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  71. }
  72.  
  73. /**
  74. * Delete the Agent with the specified unique Id.
  75. *
  76. * @param object Id $id
  77. *
  78. * @throws object AgentException An exception with one of the
  79. * following messages defined in org.osid.agent.AgentException may
  80. * be thrown: {@link }
  81. * org.osid.agent.AgentException#OPERATION_FAILED
  82. * OPERATION_FAILED}, {@link }
  83. * org.osid.agent.AgentException#PERMISSION_DENIED
  84. * PERMISSION_DENIED}, {@link }
  85. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  86. * CONFIGURATION_ERROR}, {@link }
  87. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  88. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  89. * NULL_ARGUMENT}, {@link org.osid.agent.AgentException#UNKNOWN_ID}
  90. * UNKNOWN_ID}
  91. *
  92. * @access public
  93. */
  94. function deleteAgent ( $id ) {
  95. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  96. }
  97.  
  98. /**
  99. * Get the Agent with the specified unique Id. Getting an Agent by name is
  100. * not supported since names are not guaranteed to be unique.
  101. *
  102. * @param object Id $id
  103. *
  104. * @return object Agent
  105. *
  106. * @throws object AgentException An exception with one of the
  107. * following messages defined in org.osid.agent.AgentException may
  108. * be thrown: {@link }
  109. * org.osid.agent.AgentException#OPERATION_FAILED
  110. * OPERATION_FAILED}, {@link }
  111. * org.osid.agent.AgentException#PERMISSION_DENIED
  112. * PERMISSION_DENIED}, {@link }
  113. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  114. * CONFIGURATION_ERROR}, {@link }
  115. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  116. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  117. * NULL_ARGUMENT}, {@link org.osid.agent.AgentException#UNKNOWN_ID}
  118. * UNKNOWN_ID}
  119. *
  120. * @access public
  121. */
  122. function getAgent ( $id ) {
  123. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  124. }
  125.  
  126. /**
  127. * Get all the Agents. The returned iterator provides access to the Agents
  128. * one at a time. Iterators have a method hasNextAgent() which returns
  129. * <code>true</code> if there is an Agent available and a method
  130. * nextAgent() which returns the next Agent.
  131. *
  132. * @return object AgentIterator
  133. *
  134. * @throws object AgentException An exception with one of the
  135. * following messages defined in org.osid.agent.AgentException may
  136. * be thrown: {@link }
  137. * org.osid.agent.AgentException#OPERATION_FAILED
  138. * OPERATION_FAILED}, {@link }
  139. * org.osid.agent.AgentException#PERMISSION_DENIED
  140. * PERMISSION_DENIED}, {@link }
  141. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  142. * CONFIGURATION_ERROR}, {@link }
  143. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}
  144. *
  145. * @access public
  146. */
  147. function getAgents () {
  148. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  149. }
  150.  
  151. /**
  152. * Get all the agent Types. The returned iterator provides access to the
  153. * agent Types from this implementation one at a time. Iterators have a
  154. * method hasNext() which returns true if there is an agent Type
  155. * available and a method next() which returns the next agent Type.
  156. *
  157. * @return object TypeIterator
  158. *
  159. * @throws object AgentException An exception with one of the
  160. * following messages defined in org.osid.agent.AgentException may
  161. * be thrown: {@link }
  162. * org.osid.agent.AgentException#OPERATION_FAILED
  163. * OPERATION_FAILED}, {@link }
  164. * org.osid.agent.AgentException#PERMISSION_DENIED
  165. * PERMISSION_DENIED}, {@link }
  166. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  167. * CONFIGURATION_ERROR}, {@link }
  168. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}
  169. *
  170. * @access public
  171. */
  172. function getAgentTypes () {
  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 all the property Types. The returned iterator provides access to
  178. * the property Types from this implementation one at a time. Iterators
  179. * have a method hasNext() which returns true if there is another
  180. * property Type available and a method next() which returns the next
  181. * property Type.
  182. *
  183. * @return object TypeIterator
  184. *
  185. * @throws object AgentException An exception with one of the
  186. * following messages defined in org.osid.agent.AgentException may
  187. * be thrown: {@link }
  188. * org.osid.agent.AgentException#OPERATION_FAILED
  189. * OPERATION_FAILED}, {@link }
  190. * org.osid.agent.AgentException#PERMISSION_DENIED
  191. * PERMISSION_DENIED}, {@link }
  192. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  193. * CONFIGURATION_ERROR}, {@link }
  194. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}
  195. *
  196. * @access public
  197. */
  198. function getPropertyTypes () {
  199. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  200. }
  201.  
  202. /**
  203. * Create a Group with the display name, Type, description, and Properties
  204. * specified. All but description are immutable.
  205. *
  206. * @param string $displayName
  207. * @param object Type $groupType
  208. * @param string $description
  209. * @param object Properties $properties
  210. *
  211. * @return object Group
  212. *
  213. * @throws object AgentException An exception with one of the
  214. * following messages defined in org.osid.agent.AgentException may
  215. * be thrown: {@link }
  216. * org.osid.agent.AgentException#OPERATION_FAILED
  217. * OPERATION_FAILED}, {@link }
  218. * org.osid.agent.AgentException#PERMISSION_DENIED
  219. * PERMISSION_DENIED}, {@link }
  220. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  221. * CONFIGURATION_ERROR}, {@link }
  222. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  223. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  224. * NULL_ARGUMENT}, {@link }
  225. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  226. *
  227. * @access public
  228. */
  229. function createGroup ( $displayName, $groupType, $description, $properties ) {
  230. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  231. }
  232.  
  233. /**
  234. * Delete the Group with the specified unique Id.
  235. *
  236. * @param object Id $id
  237. *
  238. * @throws object AgentException An exception with one of the
  239. * following messages defined in org.osid.agent.AgentException may
  240. * be thrown: {@link }
  241. * org.osid.agent.AgentException#OPERATION_FAILED
  242. * OPERATION_FAILED}, {@link }
  243. * org.osid.agent.AgentException#PERMISSION_DENIED
  244. * PERMISSION_DENIED}, {@link }
  245. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  246. * CONFIGURATION_ERROR}, {@link }
  247. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  248. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  249. * NULL_ARGUMENT}, {@link org.osid.agent.AgentException#UNKNOWN_ID}
  250. * UNKNOWN_ID}
  251. *
  252. * @access public
  253. */
  254. function deleteGroup ( $id ) {
  255. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  256. }
  257.  
  258. /**
  259. * Gets the Group with the specified unique Id. Getting a Group by name is
  260. * not supported since names are not guaranteed to be unique.
  261. *
  262. * @param object Id $id
  263. *
  264. * @return object Group
  265. *
  266. * @throws object AgentException An exception with one of the
  267. * following messages defined in org.osid.agent.AgentException may
  268. * be thrown: {@link }
  269. * org.osid.agent.AgentException#OPERATION_FAILED
  270. * OPERATION_FAILED}, {@link }
  271. * org.osid.agent.AgentException#PERMISSION_DENIED
  272. * PERMISSION_DENIED}, {@link }
  273. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  274. * CONFIGURATION_ERROR}, {@link }
  275. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  276. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  277. * NULL_ARGUMENT}, {@link org.osid.agent.AgentException#UNKNOWN_ID}
  278. * UNKNOWN_ID}
  279. *
  280. * @access public
  281. */
  282. function getGroup ( $id ) {
  283. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  284. }
  285.  
  286. /**
  287. * Get all the Groups. Note since Groups subclass Agents, we are returning
  288. * an AgentIterator and there is no GroupIterator. the returned iterator
  289. * provides access to the Groups one at a time. Iterators have a method
  290. * hasNextAgent() which returns true if there is a Group available and a
  291. * method nextAgent() which returns the next Group.
  292. *
  293. * @return object AgentIterator
  294. *
  295. * @throws object AgentException An exception with one of the
  296. * following messages defined in org.osid.agent.AgentException may
  297. * be thrown: {@link }
  298. * org.osid.agent.AgentException#OPERATION_FAILED
  299. * OPERATION_FAILED}, {@link }
  300. * org.osid.agent.AgentException#PERMISSION_DENIED
  301. * PERMISSION_DENIED}, {@link }
  302. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  303. * CONFIGURATION_ERROR}, {@link }
  304. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}
  305. *
  306. * @access public
  307. */
  308. function getGroups () {
  309. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  310. }
  311.  
  312. /**
  313. * Get all the group Types. The returned iterator provides access to the
  314. * group Types from this implementation one at a time. Iterators have a
  315. * method hasNext() which returns true if there is a group Type
  316. * available and a method next() which returns the next group Type.
  317. *
  318. * @return object TypeIterator
  319. *
  320. * @throws object AgentException An exception with one of the
  321. * following messages defined in org.osid.agent.AgentException may
  322. * be thrown: {@link }
  323. * org.osid.agent.AgentException#OPERATION_FAILED
  324. * OPERATION_FAILED}, {@link }
  325. * org.osid.agent.AgentException#PERMISSION_DENIED
  326. * PERMISSION_DENIED}, {@link }
  327. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  328. * CONFIGURATION_ERROR}, {@link }
  329. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED}
  330. *
  331. * @access public
  332. */
  333. function getGroupTypes () {
  334. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  335. }
  336.  
  337. /**
  338. * Get all the Agents of the specified Type.
  339. *
  340. * @param object Type $agentType
  341. *
  342. * @return object AgentIterator
  343. *
  344. * @throws object AgentException An exception with one of the
  345. * following messages defined in org.osid.agent.AgentException may
  346. * be thrown: {@link }
  347. * org.osid.agent.AgentException#OPERATION_FAILED
  348. * OPERATION_FAILED}, {@link }
  349. * org.osid.agent.AgentException#PERMISSION_DENIED
  350. * PERMISSION_DENIED}, {@link }
  351. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  352. * CONFIGURATION_ERROR}, {@link }
  353. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  354. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  355. * NULL_ARGUMENT}, {@link }
  356. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  357. *
  358. * @access public
  359. */
  360. function getAgentsByType ( $agentType ) {
  361. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  362. }
  363.  
  364. /**
  365. * Get all the Groups of the specified Type.
  366. *
  367. * @param object Type $groupType
  368. *
  369. * @return object AgentIterator
  370. *
  371. * @throws object AgentException An exception with one of the
  372. * following messages defined in org.osid.agent.AgentException may
  373. * be thrown: {@link }
  374. * org.osid.agent.AgentException#OPERATION_FAILED
  375. * OPERATION_FAILED}, {@link }
  376. * org.osid.agent.AgentException#PERMISSION_DENIED
  377. * PERMISSION_DENIED}, {@link }
  378. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  379. * CONFIGURATION_ERROR}, {@link }
  380. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  381. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  382. * NULL_ARGUMENT}, {@link }
  383. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  384. *
  385. * @access public
  386. */
  387. function getGroupsByType ( $groupType ) {
  388. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  389. }
  390.  
  391. /**
  392. * Get all the agent search Types supported by this implementation.
  393. *
  394. * @return object TypeIterator
  395. *
  396. * @throws object AgentException An exception with one of the
  397. * following messages defined in org.osid.agent.AgentException may
  398. * be thrown: {@link }
  399. * org.osid.agent.AgentException#OPERATION_FAILED
  400. * OPERATION_FAILED}, {@link }
  401. * org.osid.agent.AgentException#PERMISSION_DENIED
  402. * PERMISSION_DENIED}, {@link }
  403. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  404. * CONFIGURATION_ERROR}, {@link }
  405. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  406. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  407. * NULL_ARGUMENT}, {@link }
  408. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  409. *
  410. * @access public
  411. */
  412. function getAgentSearchTypes () {
  413. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  414. }
  415.  
  416. /**
  417. * Get all the Agents with the specified search criteria and search Type.
  418. *
  419. * @param object mixed $searchCriteria (original type: java.io.Serializable)
  420. * @param object Type $agentSearchType
  421. *
  422. * @return object AgentIterator
  423. *
  424. * @throws object AgentException An exception with one of the
  425. * following messages defined in org.osid.agent.AgentException may
  426. * be thrown: {@link }
  427. * org.osid.agent.AgentException#OPERATION_FAILED
  428. * OPERATION_FAILED}, {@link }
  429. * org.osid.agent.AgentException#PERMISSION_DENIED
  430. * PERMISSION_DENIED}, {@link }
  431. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  432. * CONFIGURATION_ERROR}, {@link }
  433. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  434. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  435. * NULL_ARGUMENT}, {@link }
  436. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  437. *
  438. * @access public
  439. */
  440. function getAgentsBySearch ( $searchCriteria, $agentSearchType ) {
  441. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  442. }
  443.  
  444. /**
  445. * Get all the group search types supported by this implementation.
  446. *
  447. * @return object TypeIterator
  448. *
  449. * @throws object AgentException An exception with one of the
  450. * following messages defined in org.osid.agent.AgentException may
  451. * be thrown: {@link }
  452. * org.osid.agent.AgentException#OPERATION_FAILED
  453. * OPERATION_FAILED}, {@link }
  454. * org.osid.agent.AgentException#PERMISSION_DENIED
  455. * PERMISSION_DENIED}, {@link }
  456. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  457. * CONFIGURATION_ERROR}, {@link }
  458. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  459. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  460. * NULL_ARGUMENT}, {@link }
  461. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  462. *
  463. * @access public
  464. */
  465. function getGroupSearchTypes () {
  466. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  467. }
  468.  
  469. /**
  470. * Get all the groups with the specified search criteria and search Type.
  471. *
  472. * @param object mixed $searchCriteria (original type: java.io.Serializable)
  473. * @param object Type $groupSearchType
  474. *
  475. * @return object AgentIterator
  476. *
  477. * @throws object AgentException An exception with one of the
  478. * following messages defined in org.osid.agent.AgentException may
  479. * be thrown: {@link }
  480. * org.osid.agent.AgentException#OPERATION_FAILED
  481. * OPERATION_FAILED}, {@link }
  482. * org.osid.agent.AgentException#PERMISSION_DENIED
  483. * PERMISSION_DENIED}, {@link }
  484. * org.osid.agent.AgentException#CONFIGURATION_ERROR
  485. * CONFIGURATION_ERROR}, {@link }
  486. * org.osid.agent.AgentException#UNIMPLEMENTED UNIMPLEMENTED},
  487. * {@link org.osid.agent.AgentException#NULL_ARGUMENT}
  488. * NULL_ARGUMENT}, {@link }
  489. * org.osid.agent.AgentException#UNKNOWN_TYPE UNKNOWN_TYPE}
  490. *
  491. * @access public
  492. */
  493. function getGroupsBySearch ( $searchCriteria, $groupSearchType ) {
  494. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  495. }
  496. }
  497.  
  498. ?>

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