/hudson-core/src/main/java/hudson/model/queue/QueueTaskFilter.java

http://github.com/hudson/hudson · Java · 121 lines · 69 code · 23 blank · 29 comment · 0 complexity · e64c57eaef9572d1c9f5949bdd15abab MD5 · raw file

  1. /*
  2. * The MIT License
  3. *
  4. * Copyright (c) 2010, InfraDNA, Inc.
  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.model.queue;
  25. import hudson.model.Label;
  26. import hudson.model.Node;
  27. import hudson.model.Queue;
  28. import hudson.model.Queue.Executable;
  29. import hudson.model.Queue.Task;
  30. import hudson.model.ResourceList;
  31. import java.io.IOException;
  32. import java.util.Collection;
  33. /**
  34. * Base class for defining filter {@link Queue.Task}.
  35. *
  36. * @author Kohsuke Kawaguchi
  37. * @since 1.360
  38. */
  39. public abstract class QueueTaskFilter implements Queue.Task {
  40. private final Queue.Task base;
  41. protected QueueTaskFilter(Task base) {
  42. this.base = base;
  43. }
  44. public Label getAssignedLabel() {
  45. return base.getAssignedLabel();
  46. }
  47. public Node getLastBuiltOn() {
  48. return base.getLastBuiltOn();
  49. }
  50. public boolean isBuildBlocked() {
  51. return base.isBuildBlocked();
  52. }
  53. public String getWhyBlocked() {
  54. return base.getWhyBlocked();
  55. }
  56. public CauseOfBlockage getCauseOfBlockage() {
  57. return base.getCauseOfBlockage();
  58. }
  59. public String getName() {
  60. return base.getName();
  61. }
  62. public String getFullDisplayName() {
  63. return base.getFullDisplayName();
  64. }
  65. public long getEstimatedDuration() {
  66. return base.getEstimatedDuration();
  67. }
  68. public Executable createExecutable() throws IOException {
  69. return base.createExecutable();
  70. }
  71. public void checkAbortPermission() {
  72. base.checkAbortPermission();
  73. }
  74. public boolean hasAbortPermission() {
  75. return base.hasAbortPermission();
  76. }
  77. public String getUrl() {
  78. return base.getUrl();
  79. }
  80. public boolean isConcurrentBuild() {
  81. return base.isConcurrentBuild();
  82. }
  83. public String getDisplayName() {
  84. return base.getDisplayName();
  85. }
  86. public ResourceList getResourceList() {
  87. return base.getResourceList();
  88. }
  89. public Collection<? extends SubTask> getSubTasks() {
  90. return base.getSubTasks();
  91. }
  92. public final Task getOwnerTask() {
  93. return this;
  94. }
  95. public Object getSameNodeConstraint() {
  96. return base.getSameNodeConstraint();
  97. }
  98. }