@itwin/core-backend
Version:
iTwin.js backend components
41 lines • 1.91 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module HubAccess
*/
import { IModelHubStatus } from "@itwin/core-bentley";
import { IModelError, } from "@itwin/core-common";
/** Exception thrown if lock cannot be acquired.
* @beta
*/
export class LockConflict extends IModelError {
briefcaseId;
briefcaseAlias;
constructor(
/** Id of Briefcase holding lock */
briefcaseId,
/** Alias of Briefcase holding lock */
briefcaseAlias, msg) {
super(IModelHubStatus.LockOwnedByAnotherBriefcase, msg);
this.briefcaseId = briefcaseId;
this.briefcaseAlias = briefcaseAlias;
}
}
/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).
* @deprecated in 4.7 - will not be removed until after 2026-06-13. Use [LockState]($common)
* @public
*/
export var LockState;
(function (LockState) {
/** The element is not locked */
LockState[LockState["None"] = 0] = "None";
/** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */
LockState[LockState["Shared"] = 1] = "Shared";
/** A Lock that permits modifications to an element and blocks other users from making modifications to it.
* Holding an exclusive lock on an "owner" (a model or a parent element), implicitly exclusively locks all its members.
*/
LockState[LockState["Exclusive"] = 2] = "Exclusive";
})(LockState || (LockState = {}));
//# sourceMappingURL=BackendHubAccess.js.map