-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbb35a6
commit fe952b4
Showing
15 changed files
with
347 additions
and
150 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/nl/knaw/dans/dvingest/DansDepositSupportDisabledFactory.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,27 @@ | ||
/* | ||
* Copyright (C) 2024 DANS - Data Archiving and Networked Services ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package nl.knaw.dans.dvingest; | ||
|
||
import nl.knaw.dans.dvingest.core.DataverseIngestDeposit; | ||
import nl.knaw.dans.dvingest.core.Deposit; | ||
import nl.knaw.dans.dvingest.core.dansbag.DansDepositSupportFactory; | ||
|
||
public class DansDepositSupportDisabledFactory implements DansDepositSupportFactory { | ||
@Override | ||
public Deposit addDansDepositSupportIfEnabled(DataverseIngestDeposit deposit) { | ||
return deposit; | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/nl/knaw/dans/dvingest/DataverseIngestDepositFactoryImpl.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,33 @@ | ||
/* | ||
* Copyright (C) 2024 DANS - Data Archiving and Networked Services ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package nl.knaw.dans.dvingest; | ||
|
||
import lombok.AllArgsConstructor; | ||
import nl.knaw.dans.dvingest.core.DataverseIngestDeposit; | ||
import nl.knaw.dans.dvingest.core.DataverseIngestDepositFactory; | ||
import nl.knaw.dans.dvingest.core.service.YamlService; | ||
|
||
import java.nio.file.Path; | ||
|
||
@AllArgsConstructor | ||
public class DataverseIngestDepositFactoryImpl implements DataverseIngestDepositFactory { | ||
private final YamlService yamlService; | ||
|
||
@Override | ||
public DataverseIngestDeposit createDataverseIngestDeposit(Path location) { | ||
return new DataverseIngestDeposit(location, yamlService); | ||
} | ||
} |
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/nl/knaw/dans/dvingest/DepositTaskFactoryImpl.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 @@ | ||
/* | ||
* Copyright (C) 2024 DANS - Data Archiving and Networked Services ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package nl.knaw.dans.dvingest; | ||
|
||
import lombok.AllArgsConstructor; | ||
import nl.knaw.dans.dvingest.core.DataverseIngestDeposit; | ||
import nl.knaw.dans.dvingest.core.DepositTask; | ||
import nl.knaw.dans.dvingest.core.DepositTaskFactory; | ||
import nl.knaw.dans.dvingest.core.dansbag.DansDepositSupportFactory; | ||
import nl.knaw.dans.dvingest.core.service.DataverseService; | ||
import nl.knaw.dans.dvingest.core.service.UtilityServices; | ||
import nl.knaw.dans.dvingest.core.service.YamlService; | ||
|
||
import java.nio.file.Path; | ||
|
||
@AllArgsConstructor | ||
public class DepositTaskFactoryImpl implements DepositTaskFactory { | ||
private final DataverseService dataverseService; | ||
private final UtilityServices utilityServices; | ||
private final DansDepositSupportFactory dansDepositSupportFactory; | ||
private final YamlService yamlService; | ||
|
||
@Override | ||
public Runnable createDepositTask(DataverseIngestDeposit deposit, Path outputDir, boolean onlyConvertDansDeposit) { | ||
return new DepositTask(deposit, outputDir, onlyConvertDansDeposit, dansDepositSupportFactory, dataverseService, utilityServices, yamlService); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/nl/knaw/dans/dvingest/ImportJobFactoryImpl.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,39 @@ | ||
/* | ||
* Copyright (C) 2024 DANS - Data Archiving and Networked Services ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package nl.knaw.dans.dvingest; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.NonNull; | ||
import nl.knaw.dans.dvingest.api.ImportCommandDto; | ||
import nl.knaw.dans.dvingest.core.DataverseIngestDepositFactory; | ||
import nl.knaw.dans.dvingest.core.DepositTaskFactory; | ||
import nl.knaw.dans.dvingest.core.ImportJob; | ||
import nl.knaw.dans.dvingest.core.ImportJobFactory; | ||
|
||
import java.nio.file.Path; | ||
|
||
@AllArgsConstructor | ||
public class ImportJobFactoryImpl implements ImportJobFactory { | ||
@NonNull | ||
private final DataverseIngestDepositFactory dataverseIngestDepositFactory; | ||
@NonNull | ||
private final DepositTaskFactory depositTaskFactory; | ||
|
||
@Override | ||
public ImportJob createImportJob(ImportCommandDto importCommand, Path outputDir, boolean onlyConvertDansDeposit) { | ||
return new ImportJob(importCommand, outputDir, onlyConvertDansDeposit, dataverseIngestDepositFactory, depositTaskFactory); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/nl/knaw/dans/dvingest/InboxTaskFactoryImpl.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,35 @@ | ||
/* | ||
* Copyright (C) 2024 DANS - Data Archiving and Networked Services ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package nl.knaw.dans.dvingest; | ||
|
||
import lombok.AllArgsConstructor; | ||
import nl.knaw.dans.dvingest.core.DataverseIngestDepositFactory; | ||
import nl.knaw.dans.dvingest.core.DepositTaskFactory; | ||
import nl.knaw.dans.lib.util.inbox.InboxTaskFactory; | ||
|
||
import java.nio.file.Path; | ||
|
||
@AllArgsConstructor | ||
public class InboxTaskFactoryImpl implements InboxTaskFactory { | ||
private final DataverseIngestDepositFactory dataverseIngestDepositFactory; | ||
private final DepositTaskFactory depositTaskFactory; | ||
|
||
@Override | ||
public Runnable createInboxTask(Path path) { | ||
var dataVerseIngestDeposit = dataverseIngestDepositFactory.createDataverseIngestDeposit(path); | ||
return depositTaskFactory.createDepositTask(dataVerseIngestDeposit, path, false); | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/nl/knaw/dans/dvingest/core/DataverseIngestDepositFactory.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,23 @@ | ||
/* | ||
* Copyright (C) 2024 DANS - Data Archiving and Networked Services ([email protected]) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package nl.knaw.dans.dvingest.core; | ||
|
||
import java.nio.file.Path; | ||
|
||
public interface DataverseIngestDepositFactory { | ||
|
||
DataverseIngestDeposit createDataverseIngestDeposit(Path location); | ||
} |
Oops, something went wrong.