/hudson-core/src/main/java/hudson/scm/ChangeLogEntry.java

http://github.com/hudson/hudson · Java · 104 lines · 13 code · 9 blank · 82 comment · 0 complexity · a33d562df77d8adbafd101c13de53e59 MD5 · raw file

  1. /*
  2. * The MIT License
  3. *
  4. * Copyright (c) 2011, Oracle Corporation, Nikita Levyankov
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. */
  24. package hudson.scm;
  25. import hudson.model.User;
  26. import java.util.Collection;
  27. /**
  28. * Interface that represents entry from change log.
  29. * Note: this interface is gonna be used in email-ext plugin and some other plugins.
  30. * So, changing methods signatures could broke existing logic.
  31. * <p/>
  32. * <p/>
  33. * Date: 5/23/11
  34. *
  35. * @author Nikita Levyankov
  36. */
  37. interface ChangeLogEntry {
  38. ChangeLogSet getParent();
  39. /**
  40. * Gets the text fully marked up by {@link ChangeLogAnnotator}.
  41. *
  42. * @return annotated message.
  43. */
  44. String getMsgAnnotated();
  45. /**
  46. * Gets the "commit message".
  47. * <p/>
  48. * The exact definition depends on the individual SCM implementation.
  49. *
  50. * @return Can be empty but never null.
  51. */
  52. String getMsg();
  53. /**
  54. * Returns a set of paths in the workspace that was
  55. * affected by this change.
  56. * <p/>
  57. * Contains string like 'foo/bar/zot'. No leading/trailing '/',
  58. * and separator must be normalized to '/'.
  59. *
  60. * @return never null.
  61. */
  62. Collection<String> getAffectedPaths();
  63. /**
  64. * The user who made this change.
  65. *
  66. * @return never null.
  67. */
  68. User getAuthor();
  69. /**
  70. * Return string representation of user.
  71. *
  72. * @return name or id.
  73. */
  74. String getUser();
  75. /**
  76. * Returns revision version.
  77. * Some VCS's use string representation of revision number, for ex. git or cvs;
  78. * perforce, svn - use numeric values for revisions
  79. *
  80. * @return revision version.
  81. */
  82. String getCurrentRevision();
  83. /**
  84. * Returns a set of paths in the workspace that was
  85. * affected by this change.
  86. * <p/>
  87. * Noted: since this is a new interface, some of the SCMs may not have
  88. * implemented this interface. The default implementation for this
  89. * interface is throw UnsupportedOperationException
  90. *
  91. * @return AffectedFile never null.
  92. * @since 2.0.1
  93. */
  94. Collection<? extends ChangeLogSet.AffectedFile> getAffectedFiles();
  95. }