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
public String stageDetailsPageLink(String stageLocator) { return relative(format("/pipelines/%s", stageLocator)); }
Understands objects required by domain entities to render xml representation
stageDetailsPageLink
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String stageXmlLink(StageIdentifier stageIdentifier) { return stageXmlByLocator(stageIdentifier.getStageLocator()); }
Understands objects required by domain entities to render xml representation
stageXmlLink
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String stageXmlLink(Modification modification) { return stageXmlByLocator(modification.getRevision()); }
Understands objects required by domain entities to render xml representation
stageXmlLink
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String stageXmlByLocator(String stageLocator) { return relative(format("/api/feed/pipelines/%s.xml", stageLocator)); }
Understands objects required by domain entities to render xml representation
stageXmlByLocator
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String pipelineXmlLink(String pipelineName, long pipelineCounter) { return relative(format("/api/feed/pipelines/%s/%s.xml", pipelineName, pipelineCounter)); }
Understands objects required by domain entities to render xml representation
pipelineXmlLink
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String materialUri(String pipelineName, Integer pipelineCounter, String revision) { return relative(format("/api/feed/materials/%s/%s/%s.xml", pipelineName, pipelineCounter, revision)); }
Understands objects required by domain entities to render xml representation
materialUri
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String jobXmlLink(JobIdentifier identifier) { return relative(format("/api/feed/pipelines/%s.xml", identifier.buildLocator())); }
Understands objects required by domain entities to render xml representation
jobXmlLink
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
public String jobDetailsLink(JobIdentifier identifier) { return relative(identifier.webUrl()); }
Understands objects required by domain entities to render xml representation
jobDetailsLink
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/domain/xml/XmlWriterContext.java
Apache-2.0
@Override public void initialize() { this.dependencyMaterials = dependencyMaterials(); goConfigService.register(this); goConfigService.register(pipelineConfigChangedListener()); materialUpdateService.registerMaterialUpdateCompleteListener(this); updateMaterialsOnInitializat...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
initialize
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@Override public void startDaemon() { }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
startDaemon
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@Override public void onMaterialUpdate(Material material) { if (material instanceof DependencyMaterial) { if (retryQueue.remove(material)) { LOGGER.debug("[Material Update] Retrying update of dependency material {} ", material); updateMaterial(material); ...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
onMaterialUpdate
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@Override public void stageStatusChanged(Stage stage) { if (StageResult.Passed == stage.getResult()) { Material material = dependencyMaterials.get(stageIdentifier(stage.getIdentifier().getPipelineName(), stage.getName())); if (material != null) { updateMaterial(mater...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
stageStatusChanged
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@Override public void onConfigChange(CruiseConfig newCruiseConfig) { scheduleRecentlyAddedMaterialsForUpdate(); }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
onConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
protected EntityConfigChangedListener<PipelineConfig> pipelineConfigChangedListener() { final DependencyMaterialUpdateNotifier self = this; return new EntityConfigChangedListener<>() { @Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { se...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
pipelineConfigChangedListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { self.scheduleRecentlyAddedMaterialsForUpdate(); }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@TestOnly public void disableUpdates() { this.skipUpdate = true; }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
disableUpdates
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@TestOnly public void enableUpdates() { this.skipUpdate = false; }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
enableUpdates
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
private void updateMaterial(Material material) { if (skipUpdate) return; try { if (!materialUpdateService.updateMaterial(material)) { retryQueue.add(material); } } catch (Exception e) { HealthStateScope scope = HealthStateScope.forMaterialUpda...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
updateMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
private void updateMaterialsOnInitialization() { for (Material material : this.dependencyMaterials.values()) { updateMaterial(material); } }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
updateMaterialsOnInitialization
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
private void scheduleRecentlyAddedMaterialsForUpdate() { Collection<Material> materialsBeforeConfigChange = dependencyMaterials.values(); this.dependencyMaterials = dependencyMaterials(); Collection<Material> materialsAfterConfigChange = dependencyMaterials.values(); Collection<Materi...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
scheduleRecentlyAddedMaterialsForUpdate
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
private Map<String, Material> dependencyMaterials() { Map<String, Material> map = new HashMap<>(); for (DependencyMaterialConfig materialConfig : goConfigService.getSchedulableDependencyMaterials()) { String stageIdentifier = stageIdentifier(materialConfig.getPipelineName().toString(), mater...
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
dependencyMaterials
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
private String stageIdentifier(String pipelineName, String stageName) { return String.format("%s[%s]", pipelineName.toLowerCase(), stageName.toLowerCase()); }
Listens to Stage/Config changes and notifies MaterialUpdateService to update DependencyMaterial
stageIdentifier
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/DependencyMaterialUpdateNotifier.java
Apache-2.0
@Override public List<Modification> findModificationsSince(File workingFolder, Material material, MaterialRevision revision) { return materialService.modificationsSince(material, workingFolder, revision.getRevision(), execCtx); }
Understands how to find modifications for materials using the SCM directly
findModificationsSince
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/LegacyMaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/LegacyMaterialChecker.java
Apache-2.0
@Override public List<Modification> findLatestModification(File workingFolder, Material material, final SubprocessExecutionContext execCtx) { List<Modification> modifications = materialService.latestModification(material, workingFolder, execCtx); if (modifications.isEmpty()) { throw new ...
Understands how to find modifications for materials using the SCM directly
findLatestModification
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/LegacyMaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/LegacyMaterialChecker.java
Apache-2.0
public MaterialRevision findSpecificRevision(Material material, String revision) { if (StringUtils.isEmpty(revision)) { throw new RuntimeException(format("Revision was not specified for material [%s]", material)); } Modification modification = materialRepository.findModificationWithRevision(material, re...
Understands how to retrieve changes on SCMs given a material
findSpecificRevision
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
Apache-2.0
public MaterialRevisions findRevisionsSince(MaterialRevisions peggedRevisions, Materials newMaterials, MaterialRevisions previous, MaterialRevisions latestRevisions) { MaterialRevisions materialRevisions = new MaterialRevisions(); for (Material material : newMaterials) { MaterialRevision pre...
Understands how to retrieve changes on SCMs given a material
findRevisionsSince
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
Apache-2.0
public MaterialRevisions findLatestRevisions(MaterialRevisions peggedRevisions, Materials materials) { MaterialRevisions revisions = new MaterialRevisions(); for (Material material : materials) { if (ensureHasRevisionForMaterial(peggedRevisions, revisions, material)) { continue; } ...
Understands how to retrieve changes on SCMs given a material
findLatestRevisions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
Apache-2.0
private boolean ensureHasRevisionForMaterial(MaterialRevisions alreadyFoundRevisions, MaterialRevisions revisions, Material material) { for (MaterialRevision alreadyFoundRevision : alreadyFoundRevisions) { if (material.equals(alreadyFoundRevision.getMaterial())) { revisions.addRevisi...
Understands how to retrieve changes on SCMs given a material
ensureHasRevisionForMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
Apache-2.0
public boolean hasPipelineEverRunWith(String pipelineName, MaterialRevisions materialRevisions) { return materialRepository.hasPipelineEverRunWith(pipelineName, materialRevisions); }
Understands how to retrieve changes on SCMs given a material
hasPipelineEverRunWith
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
Apache-2.0
public void updateChangedRevisions(CaseInsensitiveString pipelineName, BuildCause buildCause) { for (MaterialRevision materialRevision : buildCause.getMaterialRevisions()) { Long latestModificationRunByPipeline = materialRepository.latestModificationRunByPipeline(pipelineName, materialRevision.getMa...
Understands how to retrieve changes on SCMs given a material
updateChangedRevisions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialChecker.java
Apache-2.0
public void updateMaterial(final Material material) throws Exception { String materialMutex = mutexForMaterial(material); HealthStateScope scope = HealthStateScope.forMaterial(material); try { MaterialInstance materialInstance = materialRepository.findMaterialInstance(material); ...
Understands how to update materials on the database from the real SCMs
updateMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
@Override public Object doInTransaction(TransactionStatus status) { initializeMaterialWithLatestRevision(material); return null; }
Understands how to update materials on the database from the real SCMs
doInTransaction
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
@Override public Object doInTransaction(TransactionStatus status) { updateMaterialWithNewRevisions(material); return null; }
Understands how to update materials on the database from the real SCMs
doInTransaction
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
private String affectedPipelinesMessageFor(Material material) { List<CaseInsensitiveString> pipelineNames = goConfigService.pipelinesWithMaterial(material.config().getFingerprint()); return pipelineNames.isEmpty() ? "\nNo pipelines affected, may only affect configuration repositories." ...
Understands how to update materials on the database from the real SCMs
affectedPipelinesMessageFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
private void initializeMaterialWithLatestRevision(Material material) { Materials materials = new Materials(); materialExpansionService.expandForHistory(material, materials); for (Material expanded : materials) { addNewMaterialWithModifications(folderFor(expanded), expanded, updater(e...
Understands how to update materials on the database from the real SCMs
initializeMaterialWithLatestRevision
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
void updateMaterialWithNewRevisions(Material material) { Materials materials = new Materials(); materialExpansionService.expandForHistory(material, materials); for (Material expanded : materials) { MaterialInstance expandedInstance = materialRepository.findMaterialInstance(expanded);...
Understands how to update materials on the database from the real SCMs
updateMaterialWithNewRevisions
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
private void insertLatestOrNewModifications(Material material, MaterialInstance materialInstance, File folder, MaterialUpdater updater) { MaterialRevisions materialRevisions = materialRepository.findLatestModification(material); Modifications list = materialRevisions.getModifications(material); ...
Understands how to update materials on the database from the real SCMs
insertLatestOrNewModifications
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
MaterialUpdater updater(Material material) { if (material instanceof DependencyMaterial) { return dependencyMaterialUpdater; } if (material instanceof PackageMaterial) { return packageMaterialUpdater; } if (material instanceof PluggableSCMMaterial) { ...
Understands how to update materials on the database from the real SCMs
updater
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
private File folderFor(Material material) { return this.materialRepository.folderFor(material); }
Understands how to update materials on the database from the real SCMs
folderFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
private void addNewMaterialWithModifications(File folder, Material expanded, MaterialUpdater updater) { updater.addNewMaterialWithModifications(expanded, folder); }
Understands how to update materials on the database from the real SCMs
addNewMaterialWithModifications
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
private String mutexForMaterial(Material material) { if (material instanceof DependencyMaterial dep) { return String.format(MATERIALS_MUTEX_FORMAT, dep.getPipelineName().toLower(), dep.getStageName().toLower()).intern(); } else { return String.format(MATERIALS_MUTEX_FORMAT, mater...
Understands how to update materials on the database from the real SCMs
mutexForMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialDatabaseUpdater.java
Apache-2.0
public Material getMaterial() { return material; }
Understands when a material update has completed
getMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
Apache-2.0
public long trackingId() { return trackingId; }
Understands when a material update has completed
trackingId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MaterialUpdateCompletedMessage that = (MaterialUpdateCompletedMessage) o; if (material != null ? !mater...
Understands when a material update has completed
equals
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
Apache-2.0
@Override public int hashCode() { return material != null ? material.hashCode() : 0; }
Understands when a material update has completed
hashCode
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateCompletedMessage.java
Apache-2.0
@Override public void onMessage(MaterialUpdateMessage message) { final Material material = message.getMaterial(); if (maintenanceModeService.isMaintenanceMode()) { LOGGER.debug("[Maintenance Mode] GoCD server is in 'maintenance' mode, skip performing MDU for material {}.", material); ...
Understands when to trigger updates for materials
onMessage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateListener.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateListener.java
Apache-2.0
public Material getMaterial() { return material; }
Understands what material needs to be updated
getMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
Apache-2.0
@Override public boolean equals(Object o) { return reflectionEquals(this, o, "trackingId"); }
Understands what material needs to be updated
equals
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
Apache-2.0
public long trackingId() { return trackingId; }
Understands what material needs to be updated
trackingId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
Apache-2.0
@Override public int hashCode() { return reflectionHashCode(this); }
Understands what material needs to be updated
hashCode
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
Apache-2.0
@Override public String toString() { return "MaterialUpdateMessage{" + "material=" + material + '}'; }
Understands what material needs to be updated
toString
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateMessage.java
Apache-2.0
public void initialize() { goConfigService.register(this); goConfigService.register(pipelineConfigChangedListener()); }
Understands when to send requests to update a material on the database
initialize
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public void onTimer() { if (maintenanceModeService.isMaintenanceMode()) { LOGGER.debug("[Maintenance Mode] GoCD server is in 'maintenance' mode, skip checking for MDU."); return; } for (MaterialSource materialSource : materialSources) { Set<Material> material...
Understands when to send requests to update a material on the database
onTimer
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public void notifyMaterialsForUpdate(Username username, Map<String, String> attributes, HttpLocalizedOperationResult result) { if (!goConfigService.isUserAdmin(username)) { result.forbidden("Unauthorized to access this API.", HealthStateType.forbidden()); return; } if (at...
Understands when to send requests to update a material on the database
notifyMaterialsForUpdate
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public boolean updateGitMaterial(String branchName, Collection<String> possibleUrls, List<String> scmNames) { final CruiseConfig cruiseConfig = goConfigService.currentCruiseConfig(); Set<Material> allUniquePostCommitSchedulableMaterials = materialConfigConverter.toMaterials(cruiseConfig.getAllUniquePost...
Understands when to send requests to update a material on the database
updateGitMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public boolean updateMaterial(MaterialConfig config) { return updateMaterial(materialConfigConverter.toMaterial(config)); }
Understands when to send requests to update a material on the database
updateMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public boolean updateMaterial(Material material) { Date inProgressSince = inProgress.putIfAbsent(material, new Date()); if (inProgressSince == null || !material.isAutoUpdate()) { LOGGER.debug("[Material Update] Starting update of material {}", material); try { lon...
Understands when to send requests to update a material on the database
updateMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
private void resolveSecretForSvnMaterials(Set<Material> allUniquePostCommitSchedulableMaterials) { // Secrets are resolved only for SvnMaterials, since only SvnMaterial prune requires resolved password. allUniquePostCommitSchedulableMaterials.stream() .filter(material -> material instanceo...
Understands when to send requests to update a material on the database
resolveSecretForSvnMaterials
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
@Override public void onMessage(MaterialUpdateCompletedMessage message) { if (message instanceof MaterialUpdateSkippedMessage) { inProgress.remove(message.getMaterial()); return; } try { LOGGER.debug("[Material Update] Material update completed for materi...
Understands when to send requests to update a material on the database
onMessage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
@Override public void onConfigChange(CruiseConfig newCruiseConfig) { Set<HealthStateScope> materialScopes = toHealthStateScopes(newCruiseConfig.getAllUniqueMaterials()); serverHealthService.removeByScopeMatcher(scope -> scope.isForMaterial() && !materialScopes.contains(scope)); }
Understands when to send requests to update a material on the database
onConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
protected EntityConfigChangedListener<PipelineConfig> pipelineConfigChangedListener() { final MaterialUpdateService self = this; return new EntityConfigChangedListener<>() { @Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { self.onConfigC...
Understands when to send requests to update a material on the database
pipelineConfigChangedListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
@Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { self.onConfigChange(goConfigService.getCurrentConfig()); }
Understands when to send requests to update a material on the database
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
private Set<HealthStateScope> toHealthStateScopes(Set<MaterialConfig> materialConfigs) { Set<HealthStateScope> scopes = new HashSet<>(); for (MaterialConfig materialConfig : materialConfigs) { scopes.add(HealthStateScope.forMaterialConfig(materialConfig)); } return scopes; ...
Understands when to send requests to update a material on the database
toHealthStateScopes
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
private boolean isConfigMaterial(Material material) { return watchList.hasConfigRepoWithFingerprint(material.getFingerprint()); }
Understands when to send requests to update a material on the database
isConfigMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
private long getMaterialUpdateInActiveTimeoutInMillis() { return TimeUnit.MINUTES.toMillis(systemEnvironment.get(SystemEnvironment.MATERIAL_UPDATE_INACTIVE_TIMEOUT_IN_MINUTES)); }
Understands when to send requests to update a material on the database
getMaterialUpdateInActiveTimeoutInMillis
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
private GoMessageQueue<MaterialUpdateMessage> queueFor(Material material) { if (isConfigMaterial(material)) { return configUpdateQueue; } return (material instanceof DependencyMaterial) ? dependencyMaterialUpdateQueue : updateQueue; }
Understands when to send requests to update a material on the database
queueFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
ProcessManager getProcessManager() { return ProcessManager.getInstance(); }
Understands when to send requests to update a material on the database
getProcessManager
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public boolean isInProgress(Material material) { for (Material m : this.inProgress.keySet()) { if (m.isSameFlyweight(material)) return true; } return false; }
Understands when to send requests to update a material on the database
isInProgress
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
@Override public boolean test(Material material) { return material instanceof GitMaterial && ((GitMaterial) material).getBranch().equals(branchName) && possibleUrls.contains(((GitMaterial) material).getUrlArgument().withoutCredentials()); }
Understands when to send requests to update a material on the database
test
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
@Override public boolean test(Material material) { return material instanceof PluggableSCMMaterial && scmNames.contains(((PluggableSCMMaterial) material).getScmConfig().getName()); }
Understands when to send requests to update a material on the database
test
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/MaterialUpdateService.java
Apache-2.0
public void initialize() { goConfigService.register(this); goConfigService.register(new InternalConfigChangeListener() { @Override public void onEntityConfigChange(Object entity) { updateSchedulableMaterials(true); } }); materialUpdateS...
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
initialize
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public void onEntityConfigChange(Object entity) { updateSchedulableMaterials(true); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public Set<Material> materialsForUpdate() { updateSchedulableMaterials(false); return materialsWithUpdateIntervalElapsed(); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
materialsForUpdate
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public void onMaterialUpdate(Material material) { if (!(material instanceof DependencyMaterial)) { updateLastUpdateTimeForScmMaterial(material); } }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
onMaterialUpdate
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public void onConfigChange(CruiseConfig newCruiseConfig) { updateSchedulableMaterials(true); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
onConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public void onEntityConfigChange(ConfigRepoConfig entity) { updateSchedulableMaterials(true); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
protected EntityConfigChangedListener<PipelineConfig> pipelineConfigChangedListener() { final SCMMaterialSource self = this; return new EntityConfigChangedListener<>() { @Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { self.onConfigChang...
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
pipelineConfigChangedListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public void onEntityConfigChange(PipelineConfig pipelineConfig) { self.onConfigChange(null); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
onEntityConfigChange
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
private Set<Material> materialsWithUpdateIntervalElapsed() { Set<Material> materialsForUpdate = new HashSet<>(); for (Material material : schedulableMaterials) { if (hasUpdateIntervalElapsedForScmMaterial(material)) { materialsForUpdate.add(material); } } ...
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
materialsWithUpdateIntervalElapsed
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
boolean hasUpdateIntervalElapsedForScmMaterial(Material material) { Long lastMaterialUpdateTime = materialLastUpdateTimeMap.get(material); if (lastMaterialUpdateTime != null) { boolean shouldUpdateMaterial = (timeProvider.currentTimeMillis() - lastMaterialUpdateTime) >= materialUpdateInterva...
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
hasUpdateIntervalElapsedForScmMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
private void updateLastUpdateTimeForScmMaterial(Material material) { materialLastUpdateTimeMap.put(material, timeProvider.currentTimeMillis()); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
updateLastUpdateTimeForScmMaterial
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
private void updateSchedulableMaterials(boolean forceLoad) { if (forceLoad || schedulableMaterials == null) { schedulableMaterials = materialConfigConverter.toMaterials(goConfigService.getSchedulableSCMMaterials()); } }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
updateSchedulableMaterials
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
@Override public boolean shouldCareAbout(Object entity) { return securityConfigClasses.stream().anyMatch(aClass -> aClass.isAssignableFrom(entity.getClass())); }
Provides a list of unique SCMMaterials to be updated which will be consumed by MaterialUpdateService
shouldCareAbout
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SCMMaterialSource.java
Apache-2.0
public MaterialRevisions create(String pipelineName, Map<String, String> revisionInfo) { MaterialRevisions materialRevisions = new MaterialRevisions(); for (String materialFingerprint : revisionInfo.keySet()) { MaterialConfig materialConfig = goConfigService.findMaterial(new CaseInsensitiveS...
Understands how to create material revisions from an already known revision
create
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/materials/SpecificMaterialRevisionFactory.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/materials/SpecificMaterialRevisionFactory.java
Apache-2.0
@Override public void init(FilterConfig filterConfig) { }
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
init
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (blockBecauseMaintenanceMode((HttpServletRequest) servletRequest)) { LOGGER.info("G...
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
doFilter
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
String generateHTMLResponse() throws IOException { String path = "server_in_maintenance_mode.html"; try (InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(path)) { return new String(resourceAsStream.readAllBytes(), UTF_8) .replaceAll("%updated...
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
generateHTMLResponse
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
private boolean blockBecauseMaintenanceMode(HttpServletRequest servletRequest) { if (isWhitelistedRequest(servletRequest) || isAllowedRequest(servletRequest)) { return false; } return maintenanceModeService.isMaintenanceMode(); }
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
blockBecauseMaintenanceMode
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
private boolean isWhitelistedRequest(HttpServletRequest servletRequest) { return ALLOWED_MAINTENANCE_MODE_REQUEST_MATCHER.matches(servletRequest); }
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
isWhitelistedRequest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
private boolean isAllowedRequest(HttpServletRequest servletRequest) { if ((systemEnvironment.getWebappContextPath() + "/auth/security_check").equals(servletRequest.getRequestURI())) return true; return isReadOnlyRequest(servletRequest); }
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
isAllowedRequest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
private boolean isReadOnlyRequest(HttpServletRequest servletRequest) { return RequestMethod.GET.name().equalsIgnoreCase(servletRequest.getMethod()) || RequestMethod.HEAD.name().equalsIgnoreCase(servletRequest.getMethod()); }
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
isReadOnlyRequest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
@Override public void destroy() { }
"), new AntPathRequestMatcher("/api/backups", "POST", true), new AntPathRequestMatcher("/admin/backup", "POST", true), new RegexRequestMatcher("/api/stages/[0-9]
destroy
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/newsecurity/filters/ModeAwareFilter.java
Apache-2.0
public String cookieFor(final AgentIdentifier agentIdentifier) { Agent agent = getAgentByUUIDFromCacheOrDB(agentIdentifier.getUuid()); return null == agent ? null : agent.getCookie(); }
Understands persisting and retrieving agent uuid-cookie mapping
cookieFor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
public Agent getAgentByUUIDFromCacheOrDB(String uuid) { String key = agentCacheKey(uuid); Agent agent = (Agent) cache.get(key); if (agent == null) { List<String> uuids = List.of(uuid); AgentMutex mutex = agentMutexes.acquire(uuids); synchronized (mutex) { ...
Understands persisting and retrieving agent uuid-cookie mapping
getAgentByUUIDFromCacheOrDB
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
public void associateCookie(final AgentIdentifier agentIdentifier, final String cookie) { final String uuid = agentIdentifier.getUuid(); final String key = agentCacheKey(uuid); List<String> uuids = List.of(agentIdentifier.getUuid()); AgentMutex mutex = agentMutexes.acquire(uuids); ...
Understands persisting and retrieving agent uuid-cookie mapping
associateCookie
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
@Override protected void doInTransactionWithoutResult(TransactionStatus status) { Agent agent = fetchAgentFromDBByUUID(uuid); if (agent == null) { throw new UnregisteredAgentException(format("Agent [%s] is not registered.", uuid), uuid); ...
Understands persisting and retrieving agent uuid-cookie mapping
doInTransactionWithoutResult
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
String agentCacheKey(String uuid) { return (AgentDao.class.getName() + "_agent_" + uuid).intern(); }
Understands persisting and retrieving agent uuid-cookie mapping
agentCacheKey
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
@SuppressWarnings("unchecked") public List<Agent> getAllAgents() { return ((List<Agent>) transactionTemplate.execute(transactionStatus -> { try { Query query = sessionFactory.getCurrentSession().createQuery("FROM Agent where deleted = false"); query.setCacheable(t...
Understands persisting and retrieving agent uuid-cookie mapping
getAllAgents
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
@SuppressWarnings("unchecked") public List<Agent> getAgentsByUUIDs(List<String> uuids) { AgentMutex mutex = agentMutexes.acquire(uuids); synchronized (mutex) { List<Agent> agents = (List<Agent>) transactionTemplate.execute(transactionStatus -> { Query query = sessionFacto...
Understands persisting and retrieving agent uuid-cookie mapping
getAgentsByUUIDs
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0
public Agent fetchAgentFromDBByUUID(final String uuid) { List<String> uuids = List.of(uuid); AgentMutex mutex = agentMutexes.acquire(uuids); synchronized (mutex) { Agent agent = (Agent) transactionTemplate.execute(transactionStatus -> { Query query = sessionFactory.ge...
Understands persisting and retrieving agent uuid-cookie mapping
fetchAgentFromDBByUUID
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/persistence/AgentDao.java
Apache-2.0