Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
07f8d2fe
Commit
07f8d2fe
authored
4 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-5302: cache and share resource root across WebDAV user's sessions
parent
1088af99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/core/commons/services/webdav/manager/WebDAVManagerImpl.java
+19
-12
19 additions, 12 deletions
...re/commons/services/webdav/manager/WebDAVManagerImpl.java
src/main/resources/infinispan-config.xml
+8
-0
8 additions, 0 deletions
src/main/resources/infinispan-config.xml
with
27 additions
and
12 deletions
src/main/java/org/olat/core/commons/services/webdav/manager/WebDAVManagerImpl.java
+
19
−
12
View file @
07f8d2fe
...
@@ -77,8 +77,10 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean {
...
@@ -77,8 +77,10 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean {
private
static
boolean
enabled
=
true
;
private
static
boolean
enabled
=
true
;
public
static
final
String
BASIC_AUTH_REALM
=
"OLAT WebDAV Access"
;
public
static
final
String
BASIC_AUTH_REALM
=
"OLAT WebDAV Access"
;
private
static
final
String
DIR_CONTEXT
=
"_DIRCTX"
;
private
CoordinatorManager
coordinatorManager
;
private
CoordinatorManager
coordinatorManager
;
private
CacheWrapper
<
Long
,
VFSResourceRoot
>
resourceCache
;
private
CacheWrapper
<
CacheKey
,
UserSession
>
timedSessionCache
;
private
CacheWrapper
<
CacheKey
,
UserSession
>
timedSessionCache
;
@Autowired
@Autowired
...
@@ -97,7 +99,10 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean {
...
@@ -97,7 +99,10 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean {
@Override
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
public
void
afterPropertiesSet
()
throws
Exception
{
timedSessionCache
=
coordinatorManager
.
getCoordinator
().
getCacher
().
getCache
(
WebDAVManager
.
class
.
getSimpleName
(),
"webdav"
);
resourceCache
=
coordinatorManager
.
getCoordinator
().
getCacher
()
.
getCache
(
WebDAVManager
.
class
.
getSimpleName
(),
"resources"
);
timedSessionCache
=
coordinatorManager
.
getCoordinator
().
getCacher
()
.
getCache
(
WebDAVManager
.
class
.
getSimpleName
(),
"webdav"
);
}
}
@Override
@Override
...
@@ -108,21 +113,23 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean {
...
@@ -108,21 +113,23 @@ public class WebDAVManagerImpl implements WebDAVManager, InitializingBean {
}
}
usess
.
getSessionInfo
().
setLastClickTime
();
usess
.
getSessionInfo
().
setLastClickTime
();
VFSResourceRoot
fdc
=
(
VFSResourceRoot
)
usess
.
getEntry
(
"_
DIR
CTX"
);
VFSResourceRoot
fdc
=
(
VFSResourceRoot
)
usess
.
getEntry
(
DIR
_CONTEXT
);
if
(
fdc
!=
null
)
{
if
(
fdc
!=
null
)
{
return
fdc
;
return
fdc
;
}
}
IdentityEnvironment
identityEnv
=
usess
.
getIdentityEnvironment
();
VFSContainer
webdavContainer
=
getMountableRoot
(
identityEnv
);
//create the / folder
VirtualContainer
rootContainer
=
new
VirtualContainer
(
""
);
rootContainer
.
addItem
(
webdavContainer
);
rootContainer
.
setLocalSecurityCallback
(
new
ReadOnlyCallback
());
fdc
=
new
VFSResourceRoot
(
identityEnv
.
getIdentity
(),
rootContainer
);
final
IdentityEnvironment
identityEnv
=
usess
.
getIdentityEnvironment
();
usess
.
putEntry
(
"_DIRCTX"
,
fdc
);
final
Identity
identity
=
identityEnv
.
getIdentity
();
fdc
=
resourceCache
.
computeIfAbsent
(
identity
.
getKey
(),
key
->
{
VFSContainer
webdavContainer
=
getMountableRoot
(
identityEnv
);
//create the / folder
VirtualContainer
rootContainer
=
new
VirtualContainer
(
""
);
rootContainer
.
addItem
(
webdavContainer
);
rootContainer
.
setLocalSecurityCallback
(
new
ReadOnlyCallback
());
return
new
VFSResourceRoot
(
identity
,
rootContainer
);
});
usess
.
putEntry
(
DIR_CONTEXT
,
fdc
);
return
fdc
;
return
fdc
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/infinispan-config.xml
+
8
−
0
View file @
07f8d2fe
...
@@ -92,6 +92,14 @@
...
@@ -92,6 +92,14 @@
<!-- max-idle same as session time out for WebDAV session in UserSessionManager -->
<!-- max-idle same as session time out for WebDAV session in UserSessionManager -->
</local-cache>
</local-cache>
<local-cache
name=
"WebDAVManager@resources"
simple-cache=
"true"
statistics=
"true"
statistics-available=
"true"
>
<locking
isolation=
"READ_COMMITTED"
concurrency-level=
"1000"
acquire-timeout=
"15000"
striping=
"false"
/>
<transaction
mode=
"NONE"
auto-commit=
"true"
/>
<memory
max-count=
"10000"
when-full=
"REMOVE"
/>
<expiration
max-idle=
"900000"
interval=
"5000"
/>
<!-- max-idle same as session time out for WebDAV session in UserSessionManager -->
</local-cache>
<local-cache
name=
"UserManager@username"
simple-cache=
"true"
statistics=
"true"
statistics-available=
"true"
>
<local-cache
name=
"UserManager@username"
simple-cache=
"true"
statistics=
"true"
statistics-available=
"true"
>
<locking
isolation=
"READ_COMMITTED"
concurrency-level=
"1000"
acquire-timeout=
"15000"
striping=
"false"
/>
<locking
isolation=
"READ_COMMITTED"
concurrency-level=
"1000"
acquire-timeout=
"15000"
striping=
"false"
/>
<transaction
mode=
"NONE"
auto-commit=
"true"
/>
<transaction
mode=
"NONE"
auto-commit=
"true"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment