Class AuthorizableModel
- java.lang.Object
-
- com.composum.sling.core.usermanagement.model.AuthorizableModel
-
- All Implemented Interfaces:
Serializable
,Comparable<AuthorizableModel>
- Direct Known Subclasses:
GroupModel
,UserModel
public abstract class AuthorizableModel extends Object implements Serializable, Comparable<AuthorizableModel>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Authorizables.Context
context
protected Set<String>
declaredMemberOf
protected String
id
protected Set<String>
memberOf
protected String
path
protected String
principalName
protected String
type
static String
TYPE_GROUP
static String
TYPE_SERVICE
static Map<String,String>
TYPE_TO_ICON
static String
TYPE_USER
-
Constructor Summary
Constructors Modifier Constructor Description protected
AuthorizableModel(Authorizables.Context context, @NotNull AuthorizableWrapper authorizable)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(AuthorizableModel other)
boolean
equals(Object other)
@NotNull Set<String>
getDeclaredMemberOf()
@NotNull Collection<GroupModel>
getDeclaredModelOf()
static @NotNull Collection<GroupModel>
getGroups(Authorizables.Context context, @NotNull Set<String> idSet)
@NotNull String
getId()
protected String
getKey()
@NotNull Set<String>
getMemberOf()
@NotNull Collection<GroupModel>
getModelOf()
static @NotNull Collection<AuthorizableModel>
getModels(Authorizables.Context context, @NotNull Set<String> idSet)
@NotNull String
getPath()
@NotNull String
getPrincipalName()
protected abstract int
getRank()
@NotNull String
getType()
protected static String
getType(@NotNull AuthorizableWrapper authorizable)
@NotNull String
getTypeIcon()
static @NotNull Collection<UserModel>
getUsers(Authorizables.Context context, @NotNull Set<String> idSet)
int
hashCode()
abstract boolean
isGroup()
protected static @NotNull Set<String>
stripIDs(@NotNull Iterator<? extends AuthorizableWrapper> authorizableIterator)
void
toJson(com.google.gson.stream.JsonWriter writer)
protected void
toJsonData(com.google.gson.stream.JsonWriter writer)
-
-
-
Field Detail
-
TYPE_GROUP
public static final String TYPE_GROUP
- See Also:
- Constant Field Values
-
TYPE_USER
public static final String TYPE_USER
- See Also:
- Constant Field Values
-
TYPE_SERVICE
public static final String TYPE_SERVICE
- See Also:
- Constant Field Values
-
type
protected final String type
-
id
protected final String id
-
path
protected final String path
-
principalName
protected final String principalName
-
context
protected final Authorizables.Context context
-
-
Constructor Detail
-
AuthorizableModel
protected AuthorizableModel(@NotNull Authorizables.Context context, @NotNull @NotNull AuthorizableWrapper authorizable) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
-
Method Detail
-
isGroup
public abstract boolean isGroup()
-
toJson
public void toJson(com.google.gson.stream.JsonWriter writer) throws IOException
- Throws:
IOException
-
toJsonData
protected void toJsonData(com.google.gson.stream.JsonWriter writer) throws IOException
- Throws:
IOException
-
getType
@NotNull public @NotNull String getType()
-
getTypeIcon
@NotNull public @NotNull String getTypeIcon()
-
getId
@NotNull public @NotNull String getId()
-
getPath
@NotNull public @NotNull String getPath()
-
getPrincipalName
@NotNull public @NotNull String getPrincipalName()
-
getModelOf
@NotNull public @NotNull Collection<GroupModel> getModelOf() throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
getDeclaredModelOf
@NotNull public @NotNull Collection<GroupModel> getDeclaredModelOf() throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
compareTo
public int compareTo(AuthorizableModel other)
- Specified by:
compareTo
in interfaceComparable<AuthorizableModel>
-
getKey
protected String getKey()
-
getRank
protected abstract int getRank()
-
getUsers
@NotNull public static @NotNull Collection<UserModel> getUsers(@NotNull Authorizables.Context context, @NotNull @NotNull Set<String> idSet) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
getGroups
@NotNull public static @NotNull Collection<GroupModel> getGroups(@NotNull Authorizables.Context context, @NotNull @NotNull Set<String> idSet) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
getModels
@NotNull public static @NotNull Collection<AuthorizableModel> getModels(@NotNull Authorizables.Context context, @NotNull @NotNull Set<String> idSet) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
stripIDs
@NotNull protected static @NotNull Set<String> stripIDs(@NotNull @NotNull Iterator<? extends AuthorizableWrapper> authorizableIterator) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
getType
protected static String getType(@NotNull @NotNull AuthorizableWrapper authorizable)
-
-