code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
String cacheKeyForModificationWithRevision(long materialId, String revision) {
return cacheKeyGenerator.generate("findModificationWithRevision", "ForMaterialId", materialId, "andRevision", revision);
} | Understands how to store and retrieve Materials from the database | cacheKeyForModificationWithRevision | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
String cacheKeyForModificationsForStageLocator(StageIdentifier stageIdentifier) {
return cacheKeyGenerator.generate("modificationsFor", stageIdentifier.getStageLocator());
} | Understands how to store and retrieve Materials from the database | cacheKeyForModificationsForStageLocator | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
public File folderFor(Material material) {
MaterialInstance materialInstance = this.findOrCreateFrom(material);
return new File(new File("pipelines", "flyweight"), materialInstance.getFlyweightName());
} | Understands how to store and retrieve Materials from the database | folderFor | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public List<Modification> getLatestModificationForEachMaterial() {
String queryString = "SELECT mods.* " +
"FROM (" +
" SELECT MAX(id) OVER (PARTITION BY materialid) as max_id, modifications.* " +
" FROM modifications " +
") ... | Understands how to store and retrieve Materials from the database | getLatestModificationForEachMaterial | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public List<Modification> loadHistory(long materialId, FeedModifier modifier, long cursor, Integer pageSize) {
Map<String, Object> params = Map.of(
"materialId", materialId,
"size", pageSize,
"cursor", cursor
);
String query... | Understands how to store and retrieve Materials from the database | loadHistory | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
public PipelineRunIdInfo getOldestAndLatestModificationId(long materialId, String pattern) {
String queryString = "SELECT MAX(modifications.id) as latestRunId, MIN(modifications.id) as oldestRunId " +
"FROM modifications " +
"WHERE modifications.materialid = :materialId ";
Map<St... | Understands how to store and retrieve Materials from the database | getOldestAndLatestModificationId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public List<Modification> findMatchingModifications(long materialId, String pattern, FeedModifier modifier, long cursor, Integer pageSize) {
Map<String, Object> params = Map.of(
"materialId", materialId,
"pattern", "%" + pattern.toLowerCase() + "%",
... | Understands how to store and retrieve Materials from the database | findMatchingModifications | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/MaterialRepository.java | Apache-2.0 |
public static int updateNaturalOrderForPipeline(Session session, Long pipelineId, double naturalOrder) {
String sql = "UPDATE pipelines SET naturalOrder = :naturalOrder WHERE id = :pipelineId";
SQLQuery query = session.createSQLQuery(sql);
query.setLong("pipelineId", pipelineId);
query.s... | Understands how to store and retrieve pipelines from the database | updateNaturalOrderForPipeline | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
public void updatePipelineTimeline(final PipelineTimeline pipelineTimeline, final List<PipelineTimelineEntry> tempEntriesForRollback) {
getHibernateTemplate().execute(new HibernateCallback<>() {
private static final int PIPELINE_NAME = 0;
private static final int ID = 1;
priv... | Understands how to store and retrieve pipelines from the database | updatePipelineTimeline | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
@Override
public Object doInHibernate(Session session) throws HibernateException {
LOGGER.info("Start updating pipeline timeline");
List<Object[]> matches = retrieveTimeline(session, pipelineTimeline);
List<PipelineTimelineEntry> newPipelines = populateFrom(ma... | Understands how to store and retrieve pipelines from the database | doInHibernate | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private void updateNaturalOrdering(Session session, List<PipelineTimelineEntry> pipelines) {
for (PipelineTimelineEntry pipeline : pipelines) {
if (pipeline.hasBeenUpdated()) {
updateNaturalOrderForPipeline(session, pipeline.getId(), pipeline.naturalOrder());
... | Understands how to store and retrieve pipelines from the database | updateNaturalOrdering | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
@SuppressWarnings("unchecked")
private List<Object[]> loadTimeline(SQLQuery query) {
long startedAt = System.currentTimeMillis();
List<Object[]> matches = (List<Object[]>) query.list();
long duration = System.currentTimeMillis() - startedAt;
if... | Understands how to store and retrieve pipelines from the database | loadTimeline | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private List<Object[]> retrieveTimeline(Session session, PipelineTimeline pipelineTimeline) {
SQLQuery query = session.createSQLQuery(queryExtensions.retrievePipelineTimeline());
query.setLong("pipelineId", pipelineTimeline.maximumId());
List<Object[]> matches = loadTime... | Understands how to store and retrieve pipelines from the database | retrieveTimeline | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private void sortTimeLineByPidAndPmrId(List<Object[]> matches) {
matches.sort((m1, m2) -> {
long id1 = id(m1);
long id2 = id(m2);
if (id1 == id2) {
return (int) (pmrId(m1) - pmrId(m2));
}
... | Understands how to store and retrieve pipelines from the database | sortTimeLineByPidAndPmrId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private List<PipelineTimelineEntry> populateFrom(List<Object[]> matches) {
List<PipelineTimelineEntry> newPipelines = new ArrayList<>();
if (matches.isEmpty()) {
return newPipelines;
}
Map<String, List<PipelineTimelineEntry.Revision>> ... | Understands how to store and retrieve pipelines from the database | populateFrom | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private String folder(Object[] row) {
return (String) row[FOLDER];
} | Understands how to store and retrieve pipelines from the database | folder | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private PipelineTimelineEntry.Revision rev(Object[] row) {
return new PipelineTimelineEntry.Revision(modifiedTime(row), stringRevision(row), folder(row), modId(row));
} | Understands how to store and retrieve pipelines from the database | rev | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private long pmrId(Object[] row) {
return ((BigInteger) row[PMR_ID]).longValue();
} | Understands how to store and retrieve pipelines from the database | pmrId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private long modId(Object[] row) {
return ((BigInteger) row[MOD_ID]).longValue();
} | Understands how to store and retrieve pipelines from the database | modId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private double naturalOrder(Object[] row) {
return (Double) row[NATURAL_ORDER];
} | Understands how to store and retrieve pipelines from the database | naturalOrder | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private Date modifiedTime(Object[] row) {
return (Date) row[MODIFIED_TIME];
} | Understands how to store and retrieve pipelines from the database | modifiedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private String stringRevision(Object[] row) {
return (String) row[REVISION];
} | Understands how to store and retrieve pipelines from the database | stringRevision | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private String fingerprint(Object[] row) {
return String.valueOf(row[FINGERPRINT]);
} | Understands how to store and retrieve pipelines from the database | fingerprint | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private String pipelineName(Object[] row) {
return (String) row[PIPELINE_NAME];
} | Understands how to store and retrieve pipelines from the database | pipelineName | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private int counter(Object[] row) {
return row[COUNTER] == null ? -1 : ((BigInteger) row[COUNTER]).intValue();
} | Understands how to store and retrieve pipelines from the database | counter | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private long id(Object[] first) {
return ((BigInteger) first[ID]).longValue();
} | Understands how to store and retrieve pipelines from the database | id | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private void addEntriesToPipelineTimeline(List<PipelineTimelineEntry> newEntries, PipelineTimeline pipelineTimeline, List<PipelineTimelineEntry> tempEntriesForRollback) {
for (PipelineTimelineEntry newEntry : newEntries) {
tempEntriesForRollback.add(newEntry);
pipelineTimeline.add(newEnt... | Understands how to store and retrieve pipelines from the database | addEntriesToPipelineTimeline | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
public long saveSelectedPipelines(PipelineSelections pipelineSelections) {
removePipelineSelectionFromCacheForUserId(pipelineSelections);
removePipelineSelectionFromCacheForCookie(pipelineSelections);
getHibernateTemplate().saveOrUpdate(pipelineSelections);
return pipelineSelections.getI... | Understands how to store and retrieve pipelines from the database | saveSelectedPipelines | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
public PipelineSelections findPipelineSelectionsById(long id) {
PipelineSelections pipelineSelections;
String key = pipelineSelectionForCookieKey(id);
if (goCache.isKeyInCache(key)) {
return goCache.get(key);
}
synchronized (key) {
if (goCache.isKeyInCac... | Understands how to store and retrieve pipelines from the database | findPipelineSelectionsById | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
public PipelineSelections findPipelineSelectionsById(String id) {
if (StringUtils.isEmpty(id)) {
return null;
}
return findPipelineSelectionsById(Long.parseLong(id));
} | Understands how to store and retrieve pipelines from the database | findPipelineSelectionsById | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
public PipelineSelections findPipelineSelectionsByUserId(Long userId) {
if (userId == null) {
return null;
}
PipelineSelections pipelineSelections;
String key = pipelineSelectionForUserIdKey(userId);
if (goCache.isKeyInCache(key)) {
return goCache.get(key)... | Understands how to store and retrieve pipelines from the database | findPipelineSelectionsByUserId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private void removePipelineSelectionFromCacheForCookie(PipelineSelections pipelineSelections) {
String pipelineSelectionCookieKey = pipelineSelectionForCookieKey(pipelineSelections.getId());
synchronized (pipelineSelectionCookieKey) {
goCache.remove(pipelineSelectionCookieKey);
}
... | Understands how to store and retrieve pipelines from the database | removePipelineSelectionFromCacheForCookie | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
private void removePipelineSelectionFromCacheForUserId(PipelineSelections pipelineSelections) {
String pipelineSelectionUserIdKey = pipelineSelectionForUserIdKey(pipelineSelections.userId());
synchronized (pipelineSelectionUserIdKey) {
goCache.remove(pipelineSelectionUserIdKey);
}
... | Understands how to store and retrieve pipelines from the database | removePipelineSelectionFromCacheForUserId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
String pipelineSelectionForUserIdKey(Long userId) {
return (PipelineRepository.class.getName() + "_userIdPipelineSelection_" + userId).intern();
} | Understands how to store and retrieve pipelines from the database | pipelineSelectionForUserIdKey | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
String pipelineSelectionForCookieKey(long id) {
return (PipelineRepository.class.getName() + "_cookiePipelineSelection_" + id).intern();
} | Understands how to store and retrieve pipelines from the database | pipelineSelectionForCookieKey | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/PipelineRepository.java | Apache-2.0 |
public boolean canDelete() {
return canDelete;
} | Understands being a view model of whether a pipeline can be deleted or not | canDelete | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | Apache-2.0 |
public String message() {
return message;
} | Understands being a view model of whether a pipeline can be deleted or not | message | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | Apache-2.0 |
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CanDeleteResult that = (CanDeleteResult) o;
if (canDelete != that.canDelete) {
return false... | Understands being a view model of whether a pipeline can be deleted or not | equals | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | Apache-2.0 |
@Override
public int hashCode() {
int result = (canDelete ? 1 : 0);
result = 31 * result + (message != null ? message.hashCode() : 0);
return result;
} | Understands being a view model of whether a pipeline can be deleted or not | hashCode | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | Apache-2.0 |
@Override public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("CanDeleteResult");
sb.append("{canDelete=").append(canDelete);
sb.append(", message=").append(message);
sb.append('}');
return sb.toString();
} | Understands being a view model of whether a pipeline can be deleted or not | toString | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/CanDeleteResult.java | Apache-2.0 |
public DirectoryEntries listEntries(File rootFolder, String relativePath) {
DirectoryEntries entries = new DirectoryEntries();
if (rootFolder == null) {
return entries;
}
File[] files = rootFolder.listFiles();
if (files == null) {
return entries;
... | Recursively builds a tree of the specified rootFolder
TODO: ChrisS : Note that the URL stuff is completely wrong and should NOT be here - that is view, this is model | listEntries | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | Apache-2.0 |
private String getUrl(String currentPath, String name) {
return urlService.getRestfulArtifactUrl(jobIdentifier, getCurrentPath(currentPath) + name);
} | Recursively builds a tree of the specified rootFolder
TODO: ChrisS : Note that the URL stuff is completely wrong and should NOT be here - that is view, this is model | getUrl | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | Apache-2.0 |
private String getCurrentPath(String currentPath) {
return "".equals(currentPath) ? "" : currentPath + "/";
} | Recursively builds a tree of the specified rootFolder
TODO: ChrisS : Note that the URL stuff is completely wrong and should NOT be here - that is view, this is model | getCurrentPath | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | Apache-2.0 |
@Override
public int compare(File file1, File file2) {
if (file1.isDirectory() && file2.isDirectory() || file1.isFile() && file2.isFile()) {
return file1.getName().compareTo(file2.getName());
} else {
return file1.isDirectory() ? -1 : 1;
}
... | Recursively builds a tree of the specified rootFolder
TODO: ChrisS : Note that the URL stuff is completely wrong and should NOT be here - that is view, this is model | compare | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/DirectoryReader.java | Apache-2.0 |
public ConvertedTime argument(long time) {
String newMessage = StringUtils.replace(message, "$time", String.valueOf(time));
return new ConvertedTime(code, time, newMessage);
} | Create a new ConvertedTime instance based on this with new time value. | argument | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
public String getDefaultMessage() {
return message;
} | Create a new ConvertedTime instance based on this with new time value. | getDefaultMessage | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public int hashCode() {
return super.hashCode();
} | Create a new ConvertedTime instance based on this with new time value. | hashCode | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ConvertedTime other)) {
return false;
}
boolean eq = true;
eq &= Objects.equals(code, other.code);
... | Create a new ConvertedTime instance based on this with new time value. | equals | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public String toString() {
return getDefaultMessage();
} | Create a new ConvertedTime instance based on this with new time value. | toString | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
return LESS_THAN_A_MINUTE_AGO;
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
return ABOUT_1_MINUTE_AGO;
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
long time = (duration + 30) / 60;
return ABOUT_X_MINUTES_AGO.argument(time);
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
return ABOUT_1_HOUR_AGO;
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
long hours = (duration + 30 * 60 + 30) / TimeConverter.HOUR_IN_SECONDS;
long time = hours >= 23 ? 23 : hours;
return ABOUT_X_HOURS_AGO.argument(time);
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
return ABOUT_1_DAY_AGO;
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
long time = (duration + 30) / TimeConverter.DAY_IN_SECONDS;
return ABOUT_X_DAYS_AGO.argument(time);
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
return ABOUT_1_MONTH_AGO;
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
long time = (duration + 30) / TimeConverter.MONTH_IN_SECONDS;
return ABOUT_X_MONTHS_AGO.argument(time);
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
return ABOUT_1_YEAR_AGO;
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
@Override
public ConvertedTime getConvertedTime(long duration) {
long time = (duration + 30)
/ TimeConverter.YEAR_IN_SECONDS;
return OVER_X_YEARS_AGO.argument(time);
} | Create a new ConvertedTime instance based on this with new time value. | getConvertedTime | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/presentation/models/TimeConverter.java | Apache-2.0 |
public Map<String, String> getSpecifiedRevisions() {
return specifiedRevisions;
} | Understands parameter object that contains information like revisions and variables with which the pipeline is triggered | getSpecifiedRevisions | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | Apache-2.0 |
public EnvironmentVariablesConfig getVariables() {
return variables;
} | Understands parameter object that contains information like revisions and variables with which the pipeline is triggered | getVariables | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | Apache-2.0 |
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScheduleOptions that = (ScheduleOptions) o;
if (specifiedRevisions != null ? !specifiedRevisions.equals... | Understands parameter object that contains information like revisions and variables with which the pipeline is triggered | equals | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | Apache-2.0 |
@Override
public int hashCode() {
int result = specifiedRevisions != null ? specifiedRevisions.hashCode() : 0;
result = 31 * result + (variables != null ? variables.hashCode() : 0);
return result;
} | Understands parameter object that contains information like revisions and variables with which the pipeline is triggered | hashCode | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | Apache-2.0 |
public Boolean shouldPerformMDUBeforeScheduling() {
return shouldPerformMDUBeforeScheduling;
} | Understands parameter object that contains information like revisions and variables with which the pipeline is triggered | shouldPerformMDUBeforeScheduling | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | Apache-2.0 |
public void shouldPerformMDUBeforeScheduling(Boolean shouldPerformMDUBeforeScheduling) {
this.shouldPerformMDUBeforeScheduling = shouldPerformMDUBeforeScheduling;
} | Understands parameter object that contains information like revisions and variables with which the pipeline is triggered | shouldPerformMDUBeforeScheduling | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/ScheduleOptions.java | Apache-2.0 |
public boolean isAlreadyTriggered(CaseInsensitiveString pipelineName) {
return triggeredPipelines.contains(pipelineName);
} | Understands what is currently being schedule | isAlreadyTriggered | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/TriggerMonitor.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/TriggerMonitor.java | Apache-2.0 |
public boolean markPipelineAsAlreadyTriggered(PipelineConfig pipelineConfig) {
return markPipelineAsAlreadyTriggered(pipelineConfig.name());
} | Understands what is currently being schedule | markPipelineAsAlreadyTriggered | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/TriggerMonitor.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/TriggerMonitor.java | Apache-2.0 |
public boolean markPipelineAsAlreadyTriggered(CaseInsensitiveString pipelineName) {
return triggeredPipelines.add(pipelineName);
} | Understands what is currently being schedule | markPipelineAsAlreadyTriggered | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/scheduling/TriggerMonitor.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/scheduling/TriggerMonitor.java | Apache-2.0 |
public List<UserSearchModel> search(String searchText, HttpLocalizedOperationResult result) {
List<UserSearchModel> userSearchModels = new ArrayList<>();
if (isInputValid(searchText, result)) {
return userSearchModels;
}
searchUsingPlugins(searchText, userSearchModels);
... | Understands searching for users(from authentication sources) | search | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | Apache-2.0 |
private void searchUsingPlugins(String searchText, List<UserSearchModel> userSearchModels) {
List<User> searchResults = new ArrayList<>();
for (final String pluginId : store.getPluginsThatSupportsUserSearch()) {
try {
List<com.thoughtworks.go.plugin.domain.authorization.User>... | Understands searching for users(from authentication sources) | searchUsingPlugins | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | Apache-2.0 |
private List<com.thoughtworks.go.plugin.domain.authorization.User> getUsersConfiguredViaPlugin(String pluginId, String searchTerm) {
List<com.thoughtworks.go.plugin.domain.authorization.User> users = new ArrayList<>();
if (authorizationExtension.canHandlePlugin(pluginId)) {
List<SecurityAuth... | Understands searching for users(from authentication sources) | getUsersConfiguredViaPlugin | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | Apache-2.0 |
private boolean isInputValid(String searchText, HttpLocalizedOperationResult result) {
if (searchText.trim().length() < MINIMUM_SEARCH_STRING_LENGTH) {
result.badRequest("Please use a search string that has at least two (2) letters.");
return true;
}
return false;
} | Understands searching for users(from authentication sources) | isInputValid | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | Apache-2.0 |
private List<UserSearchModel> convertUsersToUserSearchModel(List<User> users, UserSourceType source) {
List<UserSearchModel> userSearchModels = new ArrayList<>();
for (User user : users) {
userSearchModels.add(new UserSearchModel(user, source));
}
return userSearchModels;
... | Understands searching for users(from authentication sources) | convertUsersToUserSearchModel | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/security/UserSearchService.java | Apache-2.0 |
@Override
public BuildCause onModifications(MaterialRevisions originalMaterialRevisions, boolean materialConfigurationChanged, MaterialRevisions previousMaterialRevisions) {
if (originalMaterialRevisions == null || originalMaterialRevisions.isEmpty()) {
throw new RuntimeException("Cannot find mo... | Understands a build that was triggered by a change in some external materials | onModifications | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
@Override
public BuildCause onEmptyModifications(PipelineConfig pipelineConfig, MaterialRevisions materialRevisions) {
return null;
} | Understands a build that was triggered by a change in some external materials | onEmptyModifications | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
@Override
public void canProduce(PipelineConfig pipelineConfig, SchedulingCheckerService schedulingChecker, ServerHealthService serverHealthService, OperationResult operationResult) {
schedulingChecker.canAutoTriggerProducer(pipelineConfig, operationResult);
} | Understands a build that was triggered by a change in some external materials | canProduce | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
@Override
public boolean isValidBuildCause(PipelineConfig pipelineConfig, BuildCause buildCause) {
for (MaterialRevision materialRevision : buildCause.getMaterialRevisions()) {
if (materialRevision.isChanged() && !materialRevision.shouldIgnoreForScheduling()) {
return true;
... | Understands a build that was triggered by a change in some external materials | isValidBuildCause | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
@Override
public boolean shouldCheckWhetherOlderRunsHaveRunWithLatestMaterials() {
return true;
} | Understands a build that was triggered by a change in some external materials | shouldCheckWhetherOlderRunsHaveRunWithLatestMaterials | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
@Override
public void notifyPipelineNotScheduled(PipelineConfig pipelineConfig) {
} | Understands a build that was triggered by a change in some external materials | notifyPipelineNotScheduled | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
private MaterialRevisions fanInOn(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig, CaseInsensitiveString targetPipelineName) {
LOGGER.debug("[Revision Resolution] Fan-In Resolution is active for pipeline {}", pipelineName);
return pipelineService.getRevisionsBasedOnDependencies(or... | Understands a build that was triggered by a change in some external materials | fanInOn | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
private MaterialRevisions fanInOffTriangleDependency(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig) {
LOGGER.debug("[Revision Resolution] Triangle Resolution is active for pipeline {}", pipelineName);
PipelineConfigDependencyGraph dependencyGraph = goConfigService.upstreamDepend... | Understands a build that was triggered by a change in some external materials | fanInOffTriangleDependency | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
private boolean canRunWithRecomputedRevisions(boolean materialConfigurationChanged, MaterialRevisions previousMaterialRevisions, MaterialRevisions recomputedBasedOnDependencies) {
return materialConfigurationChanged || previousMaterialRevisions == null ||
(recomputedBasedOnDependencies.hasChange... | Understands a build that was triggered by a change in some external materials | canRunWithRecomputedRevisions | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
boolean hasAnyUnsharedMaterialChanged(PipelineConfigDependencyGraph dependencyGraph, MaterialRevisions originalMaterialRevisions) {
for (MaterialConfig materialConfig : dependencyGraph.unsharedMaterialConfigs()) {
MaterialRevision revision = originalMaterialRevisions.findRevisionFor(materialConfig);... | Understands a build that was triggered by a change in some external materials | hasAnyUnsharedMaterialChanged | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/AutoBuild.java | Apache-2.0 |
public ServerBackup scheduleBackup(Username username) {
ServerBackup serverBackup = createServerBackup(username);
backupQueue.post(new StartServerBackupMessage(serverBackup.getId()));
return serverBackup;
} | Understands backing up db and config | scheduleBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
public Optional<ServerBackup> runningBackup() {
return Optional.ofNullable(runningBackup);
} | Understands backing up db and config | runningBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
public Optional<ServerBackup> getServerBackup(long id) {
if (runningBackup != null && runningBackup.getId() == id) {
return Optional.of(runningBackup);
}
return serverBackupRepository.getBackup(id);
} | Understands backing up db and config | getServerBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
public Optional<ServerBackup> startBackupWithId(long id) {
Optional<ServerBackup> backup = serverBackupRepository.getBackup(id);
if (backup.isEmpty()) {
LOGGER.error("Cannot find backup with id: {}. Skipping backup generation", id);
return Optional.empty();
}
Serv... | Understands backing up db and config | startBackupWithId | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
ServerBackup backupViaTimer() {
ServerBackup serverBackup = createServerBackup(Username.CRUISE_TIMER);
return performBackup(serverBackup, List.of(new BackupStatusUpdater(serverBackup, serverBackupRepository)), BackupInitiator.TIMER);
} | Understands backing up db and config | backupViaTimer | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
public ServerBackup startBackup(Username username) {
ServerBackup serverBackup = createServerBackup(username);
return performBackup(serverBackup, List.of(new BackupStatusUpdater(serverBackup, serverBackupRepository)), BackupInitiator.USER);
} | Understands backing up db and config | startBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
ServerBackup startBackup(Username username, BackupUpdateListener backupUpdateListener) {
ServerBackup serverBackup = createServerBackup(username);
return performBackup(serverBackup, List.of(new BackupStatusUpdater(serverBackup, serverBackupRepository), backupUpdateListener), BackupInitiator.USER);
} | Understands backing up db and config | startBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private ServerBackup performBackup(ServerBackup backup, List<BackupUpdateListener> backupUpdateListeners, BackupInitiator initiatedBy) {
GoMailSender mailSender = goConfigService.getMailSender();
File destDir = new File(backup.getPath());
synchronized (BACKUP_MUTEX) {
try {
... | Understands backing up db and config | performBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private ServerBackup createServerBackup(Username username) {
LocalDateTime backupTime = timeProvider.currentLocalDateTime();
ServerBackup serverBackup = new ServerBackup(getBackupDir(backupTime).getAbsolutePath(), Date.from(backupTime.atZone(ZoneOffset.systemDefault()).toInstant()), username.getUsername... | Understands backing up db and config | createServerBackup | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private void backupConfigRepo(List<BackupUpdateListener> backupUpdateListeners, File destDir) throws IOException {
notifyUpdateToListeners(backupUpdateListeners, BackupProgressStatus.BACKUP_CONFIG_REPO);
configRepository.doLocked(new VoidThrowingFn<IOException>() {
@Override
publ... | Understands backing up db and config | backupConfigRepo | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
@Override
public void run() throws IOException {
File configRepoDir = systemEnvironment.getConfigRepoDir();
try (ZipOutputStream configRepoZipStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(new File(destDir, CONFIG_REPOSITORY_BACKUP_ZIP))))) {
... | Understands backing up db and config | run | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private void notifyUpdateToListeners(List<BackupUpdateListener> listeners, BackupProgressStatus status) {
LOGGER.debug(status.getMessage());
listeners.forEach(backupUpdateListener -> backupUpdateListener.updateStep(status));
} | Understands backing up db and config | notifyUpdateToListeners | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private void notifyErrorToListeners(List<BackupUpdateListener> listeners, String message) {
LOGGER.debug(message);
listeners.forEach(backupUpdateListener -> backupUpdateListener.error(message));
} | Understands backing up db and config | notifyErrorToListeners | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private void notifyCompletionToListeners(List<BackupUpdateListener> listeners, boolean backedUpWrapperConfig) {
String message = backedUpWrapperConfig
? "Backup was generated successfully."
: "Backup was generated successfully. Backup of wrapper configuration was skipped as the w... | Understands backing up db and config | notifyCompletionToListeners | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private File getBackupDir(LocalDateTime backupTime) {
return new File(backupLocation(), BACKUP + FILE_NAME_FORMAT.format(backupTime));
} | Understands backing up db and config | getBackupDir | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
private void sendBackupFailedEmail(GoMailSender mailSender, Exception e) {
if (emailOnFailure()) {
LOGGER.debug("Backup failed. Sending email...");
mailSender.send(EmailMessageDrafter.backupFailedMessage(e.getMessage(), goConfigService.adminEmail()));
}
} | Understands backing up db and config | sendBackupFailedEmail | java | gocd/gocd | server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/BackupService.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.