UserPropertiesManager.java
3.4 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* aQute.bnd.annotation.ProviderType
* javax.annotation.Nonnull
* javax.annotation.Nullable
* javax.jcr.Node
* javax.jcr.Property
* javax.jcr.RepositoryException
* org.apache.jackrabbit.api.security.user.Authorizable
* org.apache.jackrabbit.api.security.user.Group
* org.apache.sling.commons.osgi.PropertiesUtil
*/
package com.adobe.granite.security.user;
import aQute.bnd.annotation.ProviderType;
import com.adobe.granite.security.user.UserProperties;
import com.adobe.granite.security.user.UserPropertiesComposite;
import com.adobe.granite.security.user.UserPropertiesFilter;
import java.security.Principal;
import java.util.Comparator;
import java.util.Iterator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.Group;
import org.apache.sling.commons.osgi.PropertiesUtil;
@ProviderType
public interface UserPropertiesManager {
public static final String JCR_TITLE = "{http://www.jcp.org/jcr/1.0}title";
public static final String GRANITE_RANKING = "granite:ranking";
public static final int DEFAULT_RANKING = 1000;
public static final Comparator<Node> DESCENDING_RANKING_COMPARATOR = new Comparator<Node>(){
@Override
public int compare(Node p1, Node p2) {
try {
return this.ranking(p1) - this.ranking(p2);
}
catch (RepositoryException e) {
return 0;
}
}
private int ranking(Node p) throws RepositoryException {
if (p.hasProperty("granite:ranking")) {
return PropertiesUtil.toInteger((Object)p.getProperty("granite:ranking").getLong(), (int)1000);
}
return 1000;
}
};
public UserProperties createUserProperties(String var1, String var2) throws RepositoryException;
public UserProperties getUserProperties(String var1, String var2) throws RepositoryException;
public UserProperties getUserProperties(Authorizable var1, String var2) throws RepositoryException;
public UserProperties getUserProperties(Node var1) throws RepositoryException;
public UserPropertiesComposite getUserPropertiesComposite(String var1, String[] var2) throws RepositoryException;
public UserPropertiesComposite getUserPropertiesComposite(String var1, UserPropertiesFilter var2) throws RepositoryException;
@Nonnull
public UserPropertiesComposite getUserPropertiesComposite(@Nonnull String var1, @Nullable String var2) throws RepositoryException;
@Nonnull
public UserPropertiesComposite getUserPropertiesComposite(@Nonnull String var1, @Nullable String var2, @Nonnull Comparator<Node> var3) throws RepositoryException;
public Iterator<UserProperties> getMemberOfUserProperties(String var1, String var2, boolean var3) throws RepositoryException;
public Iterator<UserProperties> getMemberUserProperties(Group var1, String var2, boolean var3) throws RepositoryException;
public /* varargs */ boolean addReaders(@Nonnull UserProperties var1, @Nonnull Principal ... var2) throws RepositoryException;
public /* varargs */ boolean removeReaders(@Nonnull UserProperties var1, @Nonnull Principal ... var2) throws RepositoryException;
}