-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from KPMP/develop
Release v2.1
- Loading branch information
Showing
18 changed files
with
368 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.kpmp.cache; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.cache.CacheManager; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
import java.util.Collection; | ||
|
||
@Controller | ||
public class CacheController { | ||
|
||
@Autowired | ||
private CacheManager cacheManager; | ||
|
||
@RequestMapping(value = "/v1/clearCache", method = RequestMethod.GET) | ||
public @ResponseBody CacheResponse clearCache(){ | ||
Collection<String> cacheNames = cacheManager.getCacheNames(); | ||
CacheResponse clearCacheResponse = new CacheResponse(); | ||
clearCacheResponse.setMessage("Caches successfully cleared!"); | ||
for(String name:cacheNames){ | ||
if (cacheManager.getCache(name) != null) { | ||
cacheManager.getCache(name).clear(); | ||
} else { | ||
clearCacheResponse.setMessage("There was a problem getting the " + name + " cache."); | ||
break; | ||
} | ||
} | ||
clearCacheResponse.setCacheNames(cacheNames); | ||
return clearCacheResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.kpmp.cache; | ||
|
||
import java.util.Collection; | ||
|
||
public class CacheResponse { | ||
|
||
private String message; | ||
private Collection<String> cacheNames; | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
public Collection<String> getCacheNames() { | ||
return cacheNames; | ||
} | ||
|
||
public void setCacheNames(Collection<String> cacheNames) { | ||
this.cacheNames = cacheNames; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/org/kpmp/participant/ParticipantRepoDataTypeInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.kpmp.participant; | ||
|
||
import org.kpmp.dataSummary.AtlasRepoSummaryLinkInformation; | ||
|
||
public class ParticipantRepoDataTypeInformation { | ||
|
||
private String dataType; | ||
private Integer count; | ||
private AtlasRepoSummaryLinkInformation linkInformation; | ||
|
||
public ParticipantRepoDataTypeInformation(String dataType, Integer count, AtlasRepoSummaryLinkInformation linkInformation) { | ||
this.dataType = dataType; | ||
this.count = count; | ||
this.linkInformation = linkInformation; | ||
} | ||
|
||
public String getDataType() { | ||
return dataType; | ||
} | ||
|
||
public void setDataType(String dataType) { | ||
this.dataType = dataType; | ||
} | ||
|
||
public Integer getCount() { | ||
return count; | ||
} | ||
|
||
public void setCount(Integer count) { | ||
this.count = count; | ||
} | ||
|
||
public AtlasRepoSummaryLinkInformation getLinkInformation() { | ||
return linkInformation; | ||
} | ||
|
||
public void setLinkInformation(AtlasRepoSummaryLinkInformation linkInformation) { | ||
this.linkInformation = linkInformation; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/kpmp/participant/ParticipantRepoDataTypeSummary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.kpmp.participant; | ||
|
||
import java.util.List; | ||
|
||
public class ParticipantRepoDataTypeSummary { | ||
private List<ParticipantRepoDataTypeInformation> repositoryDataTypes; | ||
|
||
public List<ParticipantRepoDataTypeInformation> getRepositoryDataTypes() { | ||
return repositoryDataTypes; | ||
} | ||
|
||
public void setRepositoryDataTypes(List<ParticipantRepoDataTypeInformation> repositoryDataTypes) { | ||
this.repositoryDataTypes = repositoryDataTypes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.