refactor: Rename associated resource to subject resource

This commit is contained in:
Joachim Van Herwegen
2021-10-07 16:38:25 +02:00
parent 13c49045d4
commit 7c7fee5f5c
20 changed files with 93 additions and 93 deletions

View File

@@ -244,8 +244,8 @@ export class DataAccessorBasedStore implements ResourceStore {
}
if (this.auxiliaryStrategy.isAuxiliaryIdentifier(identifier) &&
this.auxiliaryStrategy.isRequiredInRoot(identifier)) {
const associatedIdentifier = this.auxiliaryStrategy.getAssociatedIdentifier(identifier);
const parentMetadata = await this.accessor.getMetadata(associatedIdentifier);
const subjectIdentifier = this.auxiliaryStrategy.getSubjectIdentifier(identifier);
const parentMetadata = await this.accessor.getMetadata(subjectIdentifier);
if (this.isRootStorage(parentMetadata)) {
throw new MethodNotAllowedHttpError(`Cannot delete ${identifier.path} from a root storage container.`);
}

View File

@@ -17,7 +17,7 @@ import type { ResourceStore } from './ResourceStore';
* and releases it afterwards.
* In case the request returns a Representation the lock will only be released when the data stream is finished.
*
* For auxiliary resources the lock will be applied to the associated resource.
* For auxiliary resources the lock will be applied to the subject resource.
* The actual operation is still executed on the auxiliary resource.
*/
export class LockingResourceStore implements AtomicResourceStore {
@@ -71,11 +71,11 @@ export class LockingResourceStore implements AtomicResourceStore {
/**
* Acquires the correct identifier to lock this resource.
* For auxiliary resources this means the associated identifier.
* For auxiliary resources this means the subject identifier.
*/
protected getLockIdentifier(identifier: ResourceIdentifier): ResourceIdentifier {
return this.auxiliaryStrategy.isAuxiliaryIdentifier(identifier) ?
this.auxiliaryStrategy.getAssociatedIdentifier(identifier) :
this.auxiliaryStrategy.getSubjectIdentifier(identifier) :
identifier;
}