Source for file UsermessagingManager.php

Documentation is available at UsermessagingManager.php

  1. <?php
  2. include_once(dirname(__FILE__)."/../OsidManager.php");
  3. /**
  4. * <p>
  5. * The Manager sends and receives messages and returns the Types of messages
  6. * and delivery supported by the implementation. A message is not created
  7. * explicitly; it is created when it is sent.
  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.usermessaging
  39. */
  40. class UsermessagingManager
  41. extends OsidManager
  42. {
  43. /**
  44. * Get all the Types of Messages supported by this implementation.
  45. * Examples of these Types are instant, store and forward, and attempt to
  46. * deliver once.
  47. *
  48. * @return object TypeIterator
  49. *
  50. * @throws object UsermessagingException An exception with
  51. * one of the following messages defined in
  52. * org.osid.usermessaging.UsermessagingException may be thrown:
  53. * {@link }
  54. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  55. * OPERATION_FAILED}, {@link }
  56. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  57. * PERMISSION_DENIED}, {@link }
  58. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  59. * CONFIGURATION_ERROR}, {@link }
  60. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  61. * UNIMPLEMENTED}
  62. *
  63. * @access public
  64. */
  65. function getDeliveryTypes () {
  66. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  67. }
  68.  
  69. /**
  70. * Get all the Types of Messages supported by this implementation.
  71. * Examples of these are rich-text and MIME.
  72. *
  73. * @return object TypeIterator
  74. *
  75. * @throws object UsermessagingException An exception with
  76. * one of the following messages defined in
  77. * org.osid.usermessaging.UsermessagingException may be thrown:
  78. * {@link }
  79. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  80. * OPERATION_FAILED}, {@link }
  81. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  82. * PERMISSION_DENIED}, {@link }
  83. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  84. * CONFIGURATION_ERROR}, {@link }
  85. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  86. * UNIMPLEMENTED}
  87. *
  88. * @access public
  89. */
  90. function getMessageTypes () {
  91. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  92. }
  93.  
  94. /**
  95. * Get all the Topics supported by this implementation. This might also be
  96. * all the currently available Topics in the case of an implementation
  97. * that allows applications to add Topics by sending a Message with a new
  98. * Topic.
  99. *
  100. * @return object StringIterator
  101. *
  102. * @throws object UsermessagingException An exception with
  103. * one of the following messages defined in
  104. * org.osid.usermessaging.UsermessagingException may be thrown:
  105. * {@link }
  106. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  107. * OPERATION_FAILED}, {@link }
  108. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  109. * PERMISSION_DENIED}, {@link }
  110. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  111. * CONFIGURATION_ERROR}, {@link }
  112. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  113. * UNIMPLEMENTED}
  114. *
  115. * @access public
  116. */
  117. function getTopics () {
  118. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  119. }
  120.  
  121. /**
  122. * Get all the current subscribers to this Service.
  123. *
  124. * @return object IdIterator
  125. *
  126. * @throws object UsermessagingException An exception with
  127. * one of the following messages defined in
  128. * org.osid.usermessaging.UsermessagingException may be thrown:
  129. * {@link }
  130. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  131. * OPERATION_FAILED}, {@link }
  132. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  133. * PERMISSION_DENIED}, {@link }
  134. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  135. * CONFIGURATION_ERROR}, {@link }
  136. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  137. * UNIMPLEMENTED}
  138. *
  139. * @access public
  140. */
  141. function getSubscribers () {
  142. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  143. }
  144.  
  145. /**
  146. * Get all the current subscribers to this Service for a specific Topic.
  147. *
  148. * @param string $topic
  149. *
  150. * @return object IdIterator
  151. *
  152. * @throws object UsermessagingException An exception with
  153. * one of the following messages defined in
  154. * org.osid.usermessaging.UsermessagingException may be thrown:
  155. * {@link }
  156. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  157. * OPERATION_FAILED}, {@link }
  158. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  159. * PERMISSION_DENIED}, {@link }
  160. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  161. * CONFIGURATION_ERROR}, {@link }
  162. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  163. * UNIMPLEMENTED}
  164. *
  165. * @access public
  166. */
  167. function getSubscribersByTopic ( $topic ) {
  168. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  169. }
  170.  
  171. /**
  172. * Subscribe an agentId for a particular topic.
  173. *
  174. * @param object Id $agentId
  175. * @param string $topic
  176. *
  177. * @throws object UsermessagingException An exception with
  178. * one of the following messages defined in
  179. * org.osid.usermessaging.UsermessagingException may be thrown:
  180. * {@link }
  181. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  182. * OPERATION_FAILED}, {@link }
  183. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  184. * PERMISSION_DENIED}, {@link }
  185. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  186. * CONFIGURATION_ERROR}, {@link }
  187. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  188. * UNIMPLEMENTED}, {@link }
  189. * org.osid.usermessaging.UsermessagingException#UNKNOWN_TOPIC
  190. * UNKNOWN_TOPIC}
  191. *
  192. * @access public
  193. */
  194. function subscribe ( $agentId, $topic ) {
  195. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  196. }
  197.  
  198. /**
  199. * Unsubscribe an agentId for a particular topic.
  200. *
  201. * @param object Id $agentId
  202. * @param string $topic
  203. *
  204. * @throws object UsermessagingException An exception with
  205. * one of the following messages defined in
  206. * org.osid.usermessaging.UsermessagingException may be thrown:
  207. * {@link }
  208. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  209. * OPERATION_FAILED}, {@link }
  210. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  211. * PERMISSION_DENIED}, {@link }
  212. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  213. * CONFIGURATION_ERROR}, {@link }
  214. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  215. * UNIMPLEMENTED}, {@link }
  216. * org.osid.usermessaging.UsermessagingException#UNKNOWN_TOPIC
  217. * UNKNOWN_TOPIC}
  218. *
  219. * @access public
  220. */
  221. function unsubscribe ( $agentId, $topic ) {
  222. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  223. }
  224.  
  225. /**
  226. * Unsubscribe an agentId for all topics.
  227. *
  228. * @param object Id $agentId
  229. *
  230. * @throws object UsermessagingException An exception with
  231. * one of the following messages defined in
  232. * org.osid.usermessaging.UsermessagingException may be thrown:
  233. * {@link }
  234. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  235. * OPERATION_FAILED}, {@link }
  236. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  237. * PERMISSION_DENIED}, {@link }
  238. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  239. * CONFIGURATION_ERROR}, {@link }
  240. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  241. * UNIMPLEMENTED}, {@link }
  242. * org.osid.usermessaging.UsermessagingException#NOT_SUBSCRIBED
  243. * NOT_SUBSCRIBED}
  244. *
  245. * @access public
  246. */
  247. function unsubscribeAll ( $agentId ) {
  248. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  249. }
  250.  
  251. /**
  252. * Send a Message to a recipient. The Topic is optional and should be
  253. * ignored if null.
  254. *
  255. * @param object Id[] $agents
  256. * @param object mixed $content (original type: java.io.Serializable)
  257. * @param object Type $messageType
  258. * @param object Type $deliveryType
  259. * @param string $topic
  260. *
  261. * @throws object UsermessagingException An exception with
  262. * one of the following messages defined in
  263. * org.osid.usermessaging.UsermessagingException may be thrown:
  264. * {@link }
  265. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  266. * OPERATION_FAILED}, {@link }
  267. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  268. * PERMISSION_DENIED}, {@link }
  269. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  270. * CONFIGURATION_ERROR}, {@link }
  271. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  272. * UNIMPLEMENTED}, {@link }
  273. * org.osid.usermessaging.UsermessagingException#NULL_ARGUMENT
  274. * NULL_ARGUMENT}, {@link }
  275. * org.osid.usermessaging.UsermessagingException#UNKNOWN_TYPE
  276. * UNKNOWN_TYPE}, {@link }
  277. * org.osid.usermessaging.UsermessagingException#UNKNOWN_TOPIC
  278. * UNKNOWN_TOPIC}, {@link }
  279. * org.osid.usermessaging.UsermessagingException#UNKNOWN_ID
  280. * UNKNOWN_ID}
  281. *
  282. * @access public
  283. */
  284. function send ( $agents, $content, $messageType, $deliveryType, $topic ) {
  285. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  286. }
  287.  
  288. /**
  289. * Send a Message to all subscribers. The Topic is optional and should be
  290. * ignored if null.
  291. *
  292. * @param object mixed $content (original type: java.io.Serializable)
  293. * @param object Type $messageType
  294. * @param object Type $deliveryType
  295. * @param string $topic
  296. *
  297. * @throws object UsermessagingException An exception with
  298. * one of the following messages defined in
  299. * org.osid.usermessaging.UsermessagingException may be thrown:
  300. * {@link }
  301. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  302. * OPERATION_FAILED}, {@link }
  303. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  304. * PERMISSION_DENIED}, {@link }
  305. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  306. * CONFIGURATION_ERROR}, {@link }
  307. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  308. * UNIMPLEMENTED}, {@link }
  309. * org.osid.usermessaging.UsermessagingException#NULL_ARGUMENT
  310. * NULL_ARGUMENT}, {@link }
  311. * org.osid.usermessaging.UsermessagingException#UNKNOWN_TYPE
  312. * UNKNOWN_TYPE}, {@link }
  313. * org.osid.usermessaging.UsermessagingException#UNKNOWN_TOPIC
  314. * UNKNOWN_TOPIC}, {@link }
  315. * org.osid.usermessaging.UsermessagingException#UNKNOWN_ID
  316. * UNKNOWN_ID}
  317. *
  318. * @access public
  319. */
  320. function sendToAll ( $content, $messageType, $deliveryType, $topic ) {
  321. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  322. }
  323.  
  324. /**
  325. * Get all Messages for a specific Topic.
  326. *
  327. * @param string $topic
  328. *
  329. * @return object MessageIterator
  330. *
  331. * @throws object UsermessagingException An exception with
  332. * one of the following messages defined in
  333. * org.osid.usermessaging.UsermessagingException may be thrown:
  334. * {@link }
  335. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  336. * OPERATION_FAILED}, {@link }
  337. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  338. * PERMISSION_DENIED}, {@link }
  339. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  340. * CONFIGURATION_ERROR}, {@link }
  341. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  342. * UNIMPLEMENTED}
  343. *
  344. * @access public
  345. */
  346. function receiveForTopic ( $topic ) {
  347. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  348. }
  349.  
  350. /**
  351. * Get all Messages of a specific Message Type.
  352. *
  353. * @param object Type $messageType
  354. *
  355. * @return object MessageIterator
  356. *
  357. * @throws object UsermessagingException An exception with
  358. * one of the following messages defined in
  359. * org.osid.usermessaging.UsermessagingException may be thrown:
  360. * {@link }
  361. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  362. * OPERATION_FAILED}, {@link }
  363. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  364. * PERMISSION_DENIED}, {@link }
  365. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  366. * CONFIGURATION_ERROR}, {@link }
  367. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  368. * UNIMPLEMENTED}
  369. *
  370. * @access public
  371. */
  372. function receiveForMessageType ( $messageType ) {
  373. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  374. }
  375.  
  376. /**
  377. * Get all Messages.
  378. *
  379. * @return object MessageIterator
  380. *
  381. * @throws object UsermessagingException An exception with
  382. * one of the following messages defined in
  383. * org.osid.usermessaging.UsermessagingException may be thrown:
  384. * {@link }
  385. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  386. * OPERATION_FAILED}, {@link }
  387. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  388. * PERMISSION_DENIED}, {@link }
  389. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  390. * CONFIGURATION_ERROR}, {@link }
  391. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  392. * UNIMPLEMENTED}
  393. *
  394. * @access public
  395. */
  396. function receive () {
  397. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  398. }
  399.  
  400. /**
  401. * Delete a Message for the user.
  402. *
  403. * @param object Message $message
  404. *
  405. * @throws object UsermessagingException An exception with
  406. * one of the following messages defined in
  407. * org.osid.usermessaging.UsermessagingException may be thrown:
  408. * {@link }
  409. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  410. * OPERATION_FAILED}, {@link }
  411. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  412. * PERMISSION_DENIED}, {@link }
  413. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  414. * CONFIGURATION_ERROR}, {@link }
  415. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  416. * UNIMPLEMENTED}, {@link }
  417. * org.osid.usermessaging.UsermessagingException#NULL_ARGUMENT
  418. * NULL_ARGUMENT}
  419. *
  420. * @access public
  421. */
  422. function deleteMessage ( $message ) {
  423. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  424. }
  425.  
  426. /**
  427. * Delete a Message for all subscribers.
  428. *
  429. * @param object Message $message
  430. *
  431. * @throws object UsermessagingException An exception with
  432. * one of the following messages defined in
  433. * org.osid.usermessaging.UsermessagingException may be thrown:
  434. * {@link }
  435. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  436. * OPERATION_FAILED}, {@link }
  437. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  438. * PERMISSION_DENIED}, {@link }
  439. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  440. * CONFIGURATION_ERROR}, {@link }
  441. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  442. * UNIMPLEMENTED}, {@link }
  443. * org.osid.usermessaging.UsermessagingException#NULL_ARGUMENT
  444. * NULL_ARGUMENT}
  445. *
  446. * @access public
  447. */
  448. function purgeMessage ( $message ) {
  449. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  450. }
  451.  
  452. /**
  453. * Delete all Messages for the user. Include only Messages before a date,
  454. * on a Topic, and of a specific MessageType if those values are supplied.
  455. *
  456. * @param int $before
  457. * @param object Type $messageType
  458. * @param string $topic
  459. *
  460. * @throws object UsermessagingException An exception with
  461. * one of the following messages defined in
  462. * org.osid.usermessaging.UsermessagingException may be thrown:
  463. * {@link }
  464. * org.osid.usermessaging.UsermessagingException#OPERATION_FAILED
  465. * OPERATION_FAILED}, {@link }
  466. * org.osid.usermessaging.UsermessagingException#PERMISSION_DENIED
  467. * PERMISSION_DENIED}, {@link }
  468. * org.osid.usermessaging.UsermessagingException#CONFIGURATION_ERROR
  469. * CONFIGURATION_ERROR}, {@link }
  470. * org.osid.usermessaging.UsermessagingException#UNIMPLEMENTED
  471. * UNIMPLEMENTED}, {@link }
  472. * org.osid.usermessaging.UsermessagingException#NULL_ARGUMENT
  473. * NULL_ARGUMENT}
  474. *
  475. * @access public
  476. */
  477. function deleteMessages ( $before, $messageType, $topic ) {
  478. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  479. }
  480. }
  481.  
  482. ?>

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