-
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.
Create Archival Group, introduce transactions
- Loading branch information
Showing
11 changed files
with
203 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Fedora.ApiModel | ||
{ | ||
public class Transaction | ||
{ | ||
public Uri Location { get; set; } | ||
public DateTime Expires { get; set; } | ||
public bool Expired { get; set; } | ||
public bool Committed { get; set; } | ||
|
||
public const string HeaderName = "Atomic-ID"; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Fedora.ApiModel; | ||
|
||
namespace Fedora | ||
{ | ||
public interface IFedora | ||
{ | ||
Task<string> Proxy(string contentType, string path, string? jsonLdMode = null, bool preferContained = false); | ||
Task<ArchivalGroup?> CreateArchivalGroup(string parentPath, string slug, string name); | ||
Task<ArchivalGroup?> CreateArchivalGroup(string parentPath, string slug, string name, Transaction? transaction = null); | ||
|
||
|
||
// Transactions | ||
Task<Transaction> BeginTransaction(); | ||
Task CheckTransaction(Transaction tx); | ||
Task KeepTransactionAlive(Transaction tx); | ||
Task CommitTransaction(Transaction tx); | ||
Task RollbackTransaction(Transaction tx); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,18 +1,34 @@ | ||
using System; | ||
using Fedora.ApiModel; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Threading.Tasks; | ||
|
||
namespace Fedora | ||
{ | ||
public abstract class Resource | ||
{ | ||
public Resource(FedoraJsonLdResponse jsonLdResponse) | ||
{ | ||
Name = jsonLdResponse.Title; | ||
Created = jsonLdResponse.Created; | ||
CreatedBy = jsonLdResponse.CreatedBy; | ||
LastModified = jsonLdResponse.LastModified; | ||
LastModifiedBy = jsonLdResponse.LastModifiedBy; | ||
} | ||
|
||
// The original name of the resource (possibly non-filesystem-safe) | ||
// Use dc:title on the fedora resource | ||
public string? Name { get; set; } | ||
|
||
// The Fedora identifier | ||
public required string Identifier { get; set; } | ||
|
||
public DateTime? Created { get; set; } | ||
public string? CreatedBy { get; set; } | ||
public DateTime? LastModified { get; set; } | ||
public string? LastModifiedBy { get; set; } | ||
} | ||
} |
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