Skip to content

Commit

Permalink
Tidy up interface files
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcrane committed Feb 18, 2024
1 parent cb1f9b3 commit 7ea79e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
21 changes: 6 additions & 15 deletions LeedsExperiment/Fedora/IFedora.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ public interface IFedora
{
Uri GetUri(string path);

Task<Resource?> GetRepositoryRoot(Transaction? transaction = null);

Task<string> Proxy(string contentType, string path, string? jsonLdMode = null, bool preferContained = false, string? acceptDate = null, bool head = false);

Task<ResourceInfo> GetResourceInfo(Uri uri, Transaction? transaction = null);
Task<Resource?> GetObject(Uri uri, Transaction? transaction = null);

Task<Resource?> GetObject(Uri uri, Transaction? transaction = null);
Task<Resource?> GetObject(string path, Transaction? transaction = null);

Task<T?> GetObject<T>(Uri uri, Transaction? transaction = null) where T: Resource;
Expand All @@ -23,19 +27,7 @@ public interface IFedora
Task<ArchivalGroup?> CreateArchivalGroup(string parentPath, string slug, string name, Transaction? transaction = null);

Task<Container?> CreateContainer(ContainerDirectory containerDirectory, Transaction? transaction = null);

/// <summary>
/// DISALLOW a POST for binaries, for now
/// Always require a PUT, so we can detect tombstone issues and not allow Fedora to give alternative slugs
/// </summary>
/// <param name="location">Uri of parent container resource</param>
/// <param name="localFileInfo">(for now) a FileInfo - will we have an S3 impl, a filesystem impl, etc? We'll take the slug from this file (?)</param>
/// <param name="originalName">The original name of the file, provided from external metadata, stored as dc:title</param>
/// <param name="transaction">A transaction if running</param>
/// <param name="checksum">An initial checksum, e.g., calculated in browser on upload. This method will still calculate a checksum and compare with what it gets back from Fedora.</param>
/// <returns></returns>
// Task<Binary> AddBinary(Uri parent, FileInfo localFileInfo, string originalName, string contentType, Transaction? transaction = null, string? checksum = null);
// Task<Binary> PutBinary(Uri location, FileInfo localFileInfo, string originalName, string contentType, Transaction? transaction = null, string? checksum = null);

Task<Binary> PutBinary(BinaryFile binaryFile, Transaction? transaction = null);

// Transactions
Expand All @@ -46,6 +38,5 @@ public interface IFedora
Task RollbackTransaction(Transaction tx);

Task Delete(Uri uri, Transaction? transaction = null);
Task<Resource?> GetRepositoryRoot(Transaction? transaction = null);
}
}
11 changes: 9 additions & 2 deletions LeedsExperiment/Preservation/IPreservation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace Preservation;
public interface IPreservation
{
// Getting things from Fedora

// ==========================

Task<Resource?> GetResource(string? path);
string GetInternalPath(Uri preservationApiUri);
Task<ArchivalGroup?> GetArchivalGroup(string path, string? version);

Task<ResourceInfo> GetResourceInfo(string path);


Expand Down Expand Up @@ -39,6 +39,10 @@ public interface IPreservation
/// <returns>A partially populated ImportJob</returns>
Task<ImportJob> GetUpdateJob(string archivalGroupPath, string source);


// Making changes to Fedora/OCFL objects (all CRUD)
// ================================================

/// <summary>
/// "Execute" the update job obtrained above.
/// There is an `isUpdate` flag on ImportJob that must be explicitly set to true if a new version is intended.
Expand All @@ -51,6 +55,9 @@ public interface IPreservation
/// <returns>A fully populated Job including the results</returns> //
Task<ImportJob> Import(ImportJob importJob);

// Organising the repository above the Archival Group level
// ========================================================

/// <summary>
/// For creating containers outside of an archival group - or maybe even within one, later
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Fedora.Abstractions;
using Fedora.Abstractions.Transfer;
using Preservation;
using System.Net.Http.Json;
using System.Text.Json;
Expand Down

0 comments on commit 7ea79e8

Please sign in to comment.