1 7 package com.inversoft.savant; 8 9 10 import java.util.ArrayList ; 11 import java.util.Date ; 12 import java.util.List ; 13 14 15 23 public class ArtifactGroup { 24 25 29 public static final String DEFAULT_FS = "fileset.deps"; 30 31 35 public static final String DEFAULT_PATH = "fileset.path"; 36 37 private List artifacts = new ArrayList (); 38 private List groups = new ArrayList (); 39 private int expireMinutes; 40 private Date expireTime; 41 private String classPathId; 42 private String fileSetId; 43 44 45 48 public ArtifactGroup() { 49 } 50 51 52 55 public List getArtifacts() { 56 return artifacts; 57 } 58 59 64 public void addArtifact(Artifact artifact) { 65 if (artifact.getExpireminutes() == 0) { 66 artifact.setExpireminutes(expireMinutes); 67 } 68 69 if (artifact.getExpiretime() == null) { 70 artifact.setExpiretime(expireTime); 71 } 72 73 artifacts.add(artifact); 74 } 75 76 81 public List getArtifactGroups() { 82 return groups; 83 } 84 85 90 public void addArtifactGroup(ArtifactGroup group) { 91 if (group.getClasspathid() == null) { 92 group.setClasspathid(classPathId); 93 } 94 95 if (group.getFilesetid() == null) { 96 group.setFilesetid(fileSetId); 97 } 98 99 groups.add(group); 100 } 101 102 public String getClasspathid() { 103 return classPathId; 104 } 105 106 public void setClasspathid(String classPathId) { 107 this.classPathId = classPathId; 108 } 109 110 public String getFilesetid() { 111 return fileSetId; 112 } 113 114 public void setFilesetid(String fileSetId) { 115 this.fileSetId = fileSetId; 116 } 117 118 public int getExpireminutes() { 119 return expireMinutes; 120 } 121 122 public void setExpireminutes(int expireMinutes) { 123 this.expireMinutes = expireMinutes; 124 } 125 126 public Date getExpiretime() { 127 return expireTime; 128 } 129 130 public void setExpiretime(Date expireTime) { 131 this.expireTime = expireTime; 132 } 133 134 139 public void validate() throws SavantException { 140 if (artifacts.size() == 0) { 141 throw new SavantException("All artifact groups must have artifacts"); 142 } 143 } 144 } | Popular Tags |