Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
nfs4j
Commits
c9aedca6
Commit
c9aedca6
authored
Oct 16, 2020
by
Tigran Mkrtchyan
☕
Browse files
nfs4: use java8 stream to filter first Principal on exchange_id
modernize Acked-by: Paul Millar Target: master
parent
89b09abb
Pipeline
#465
passed with stage
in 1 minute and 8 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
core/src/main/java/org/dcache/nfs/v4/CompoundContext.java
View file @
c9aedca6
/*
/*
* Copyright (c) 2009 - 20
19
Deutsches Elektronen-Synchroton,
* Copyright (c) 2009 - 20
20
Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
*
*
* This library is free software; you can redistribute it and/or modify
* This library is free software; you can redistribute it and/or modify
...
@@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory;
...
@@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.Set
;
import
javax.security.auth.Subject
;
import
javax.security.auth.Subject
;
import
javax.security.auth.kerberos.KerberosPrincipal
;
import
javax.security.auth.kerberos.KerberosPrincipal
;
import
org.dcache.auth.UidPrincipal
;
import
org.dcache.auth.UidPrincipal
;
...
@@ -324,9 +323,10 @@ public class CompoundContext {
...
@@ -324,9 +323,10 @@ public class CompoundContext {
type
=
UidPrincipal
.
class
;
type
=
UidPrincipal
.
class
;
}
}
Set
<?
extends
Principal
>
principals
=
return
call
.
getCredential
().
getSubject
().
getPrincipals
().
stream
()
call
.
getCredential
().
getSubject
().
getPrincipals
(
type
);
.
filter
(
type:
:
isInstance
)
return
principals
.
isEmpty
()
?
NO_PRINCIPAL
:
principals
.
iterator
().
next
();
.
findFirst
()
.
orElse
(
NO_PRINCIPAL
);
}
}
/**
/**
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment