Source for file HarmoniReadableLog.class.php

Documentation is available at HarmoniReadableLog.class.php

  1. <?php
  2. /**
  3. * @since 3/1/06
  4. * @package harmoni.osid_v2.logging
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: HarmoniReadableLog.class.php,v 1.3 2007/09/04 20:25:43 adamfranco Exp $
  10. */
  11. require_once(OKI2."/osid/logging/ReadableLog.php");
  12. require_once(dirname(__FILE__)."/HarmoniEntryIterator.class.php");
  13. require_once(dirname(__FILE__)."/SearchEntryIterator.class.php");
  14. /**
  15. * ReadableLog allows reading of its entries.
  16. *
  17. * <p>
  18. * OSID Version: 2.0
  19. * </p>
  20. *
  21. * <p>
  22. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  23. * O.K.I&#46; OSID Definition License}.
  24. * </p>
  25. *
  26. * @package harmoni.osid_v2.logging
  27. */
  28. class HarmoniReadableLog
  29. extends ReadableLog
  30. {
  31. /**
  32. * Constructor
  33. *
  34. * @param string $name
  35. * @return object
  36. * @access public
  37. * @since 3/1/06
  38. */
  39. function HarmoniReadableLog ($name, $dbIndex) {
  40. ArgumentValidator::validate($name, StringValidatorRule::getRule());
  41. ArgumentValidator::validate($dbIndex, IntegerValidatorRule::getRule());
  42. $this->_name = $name;
  43. $this->_dbIndex = $dbIndex;
  44. }
  45. /**
  46. * Get the display name for this ReadableLog.
  47. *
  48. * @return string
  49. *
  50. * @throws object LoggingException An exception with one of the
  51. * following messages defined in org.osid.logging.LoggingException
  52. * may be thrown: {@link }
  53. * org.osid.logging.LoggingException#UNIMPLEMENTED UNIMPLEMENTED},
  54. * {@link org.osid.logging.LoggingException#OPERATION_FAILED}
  55. * OPERATION_FAILED}, {@link }
  56. * org.osid.logging.LoggingException#CONFIGURATION_ERROR
  57. * CONFIGURATION_ERROR}, {@link }
  58. * org.osid.logging.LoggingException#PERMISSION_DENIED
  59. * PERMISSION_DENIED}
  60. *
  61. * @access public
  62. */
  63. function getDisplayName () {
  64. return $this->_name;
  65. }
  66.  
  67. /**
  68. * Return the ReadableLog Entries in a last-in, first-out (LIFO) order.
  69. *
  70. * @param object Type $formatType
  71. * @param object Type $priorityType
  72. *
  73. * @return object EntryIterator
  74. *
  75. * @throws object LoggingException An exception with one of the
  76. * following messages defined in org.osid.logging.LoggingException
  77. * may be thrown: {@link }
  78. * org.osid.logging.LoggingException#UNIMPLEMENTED UNIMPLEMENTED},
  79. * {@link org.osid.logging.LoggingException#OPERATION_FAILED}
  80. * OPERATION_FAILED}, {@link }
  81. * org.osid.logging.LoggingException#CONFIGURATION_ERROR
  82. * CONFIGURATION_ERROR}, {@link }
  83. * org.osid.logging.LoggingException#PERMISSION_DENIED
  84. * PERMISSION_DENIED}, {@link }
  85. * org.osid.logging.LoggingException#NULL_ARGUMENT NULL_ARGUMENT},
  86. * {@link org.osid.logging.LoggingException#UNKNOWN_TYPE}
  87. * UNKNOWN_TYPE}
  88. *
  89. * @access public
  90. */
  91. function getEntries ( $formatType, $priorityType ) {
  92. $iterator = new HarmoniEntryIterator($this->_name, $formatType, $priorityType, $this->_dbIndex);
  93. return $iterator;
  94. }
  95. /**
  96. * Return the ReadableLog Entries in a last-in, first-out (LIFO) order.
  97. * Limit by the search criteria.
  98. *
  99. * Warning: NOT IN OSID
  100. *
  101. * @param mixed $searchCriteria
  102. * @param object Type $searchType
  103. * @param object Type $formatType
  104. * @param object Type $priorityType
  105. *
  106. * @return object EntryIterator
  107. *
  108. * @throws object LoggingException An exception with one of the
  109. * following messages defined in org.osid.logging.LoggingException
  110. * may be thrown: {@link }
  111. * org.osid.logging.LoggingException#UNIMPLEMENTED UNIMPLEMENTED},
  112. * {@link org.osid.logging.LoggingException#OPERATION_FAILED}
  113. * OPERATION_FAILED}, {@link }
  114. * org.osid.logging.LoggingException#CONFIGURATION_ERROR
  115. * CONFIGURATION_ERROR}, {@link }
  116. * org.osid.logging.LoggingException#PERMISSION_DENIED
  117. * PERMISSION_DENIED}, {@link }
  118. * org.osid.logging.LoggingException#NULL_ARGUMENT NULL_ARGUMENT},
  119. * {@link org.osid.logging.LoggingException#UNKNOWN_TYPE}
  120. * UNKNOWN_TYPE}
  121. *
  122. * @access public
  123. */
  124. function getEntriesBySearch ( $searchCriteria, $searchType, $formatType, $priorityType ) {
  125. $validType = new Type("logging_search", "edu.middlebury", "Date-Range/Agent/Node");
  126. if (!$validType->isEqual($searchType)) {
  127. throwError(new Error("Invalid search type, ".Type::typeToString($searchType).".", "Logging"));
  128. }
  129. $iterator = new SearchEntryIterator($this->_name, $searchCriteria, $formatType, $priorityType, $this->_dbIndex);
  130. return $iterator;
  131. }
  132. }
  133.  
  134. ?>

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