Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Change / Migrate harvester Jeeves services to Spring MVC #7668

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

josegar74
Copy link
Member

@josegar74 josegar74 commented Jan 28, 2024

Migrate the following harvester Jeeves API services to Spring MVC:

  • Clear
  • Create clone
  • Get
  • Invoke
  • Remove
  • Run
  • Start
  • Stop
  • Harvester log file
  • History delete: the original service contains code to delete the harvester history by harvester uuid, which is used by the UI and it has been migrated. But also has some code that accepts a list of harvester ids and a list of files (I guess log files?), that seem not used anywhere in the UI. This code hasn't been migrated.

Collection<Integer> ids = Collections2.transform(params.getChildren("id"), new Function<Object, Integer>() {
@Nullable
@Override
public Integer apply(@Nonnull Object input) {
return Integer.valueOf(((Element) input).getText());
}
});
List<Element> files = params.getChildren("file");
for (Element file : files) {
try {
File f = new File(file.getTextTrim());
if (f.exists() && f.canWrite()) {
if (!f.delete()) {
org.fao.geonet.utils.Log.warning(Geonet.HARVESTER,
"Removing history. Failed to delete file: " + f.getCanonicalPath());
}
}
} catch (Exception e) {
org.fao.geonet.utils.Log.error(Geonet.HARVESTER, e.getMessage(), e);
}
}
if (!ids.isEmpty()) {
nrRecs = historyRepository.deleteAllById(ids);
}

Also the service deletes the entries in the database, but doesn't seem to delete the log files associated with the harvester. I'm not really sure if should be deleted also.

Jeeves services are mark as deprecated.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@josegar74 josegar74 added the api change Indicate a change in the API label Jan 28, 2024
@josegar74 josegar74 added this to the 4.4.3 milestone Jan 28, 2024
@josegar74 josegar74 requested a review from fxprunayre January 28, 2024 18:18
@josegar74 josegar74 force-pushed the harvester-api branch 2 times, most recently from 0698b0c to 8490224 Compare January 28, 2024 19:20
…deQL issue - retrieve log files using the history identifier not directly using the log file name as a request parameter
@josegar74 josegar74 modified the milestones: 4.4.3, 4.4.4 Mar 4, 2024
@fxprunayre fxprunayre modified the milestones: 4.4.4, 4.4.5 Apr 16, 2024
@fxprunayre fxprunayre modified the milestones: 4.4.5, 4.4.6 Jun 4, 2024
@fxprunayre fxprunayre modified the milestones: 4.4.6, 4.4.7 Oct 15, 2024
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Indicate a change in the API changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants