-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathRepositoryManagerInterface.php
More file actions
69 lines (66 loc) · 2.92 KB
/
RepositoryManagerInterface.php
File metadata and controls
69 lines (66 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace PHPCR;
/**
* A RepositoryManager represents a management view of the Session's Repository
* instance.
*
* This is useful for applications that embed a JCR repository and need a way
* to manage the lifecycle of that Repository instance. Each RepositoryManager
* object is associated one-to-one with a Session object and is defined by the
* authorization settings of that session object.
*
* The RepositoryManager object can be acquired using a {@link Session} by
* calling $session->getWorkspace()->getRepositoryManager()< on a session
* object. Likewise, the repository being managed can be found for a given
* RepositoryManager object by calling
* $mgr->getWorkspace()->getSession()->getRepository().
*
* @license http://www.apache.org/licenses Apache License Version 2.0, January 2004
* @license http://opensource.org/licenses/MIT MIT License
*
* @api
*
* @since JCR 2.1
*/
interface RepositoryManagerInterface
{
/**
* Return the Workspace object through which this repository manager was
* created.
*
* @return WorkspaceInterface
*/
public function getWorkspace();
/**
* Closes the repository by preventing the creation of new sessions and
* freeing all resources. The $closeSessionsImmediately parameter dictates
* whether existing sessions should be closed immediately or allowed to
* close naturally.
*
* Either way, this method always blocks until all sessions are closed and
* the repository has completely terminated.
*
* Some repository implementations may not allow repositories to be closed,
* while other implementations might allow closing only for certain
* configurations (e.g., repositories embedded within an application). An
* implementation will throw an UnsupportedRepositoryOperationException if
* the particular repository cannot be closed, or an AccessDeniedException
* when the repository can be closed but the session does not have the
* authority to do so.
*
* @param bool $closeSessionsImmediately true if all existing sessions
* should be closed immediately, or false if they are to be allowed to
* close naturally
*
* @return void
*
* @throws AccessDeniedException if the caller does not have authorization
* to close the repository
* @throws UnsupportedRepositoryOperationException if the repository
* implementation does not support or allow the repository to be
* closed
* @throws RepositoryException if an error occurred while shutting down the
* repository
*/
public function closeRepository($closeSessionsImmediately);
}