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.Contextcontextprotected Set<String>declaredMemberOfprotected Stringidprotected Set<String>memberOfprotected Stringpathprotected StringprincipalNameprotected Stringtypestatic StringTYPE_GROUPstatic StringTYPE_SERVICEstatic Map<String,String>TYPE_TO_ICONstatic StringTYPE_USER
-
Constructor Summary
Constructors Modifier Constructor Description protectedAuthorizableModel(Authorizables.Context context, @NotNull AuthorizableWrapper authorizable)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(AuthorizableModel other)booleanequals(Object other)@NotNull Set<String>getDeclaredMemberOf()@NotNull Collection<GroupModel>getDeclaredModelOf()static @NotNull Collection<GroupModel>getGroups(Authorizables.Context context, @NotNull Set<String> idSet)@NotNull StringgetId()protected StringgetKey()@NotNull Set<String>getMemberOf()@NotNull Collection<GroupModel>getModelOf()static @NotNull Collection<AuthorizableModel>getModels(Authorizables.Context context, @NotNull Set<String> idSet)@NotNull StringgetPath()@NotNull StringgetPrincipalName()protected abstract intgetRank()@NotNull StringgetType()protected static StringgetType(@NotNull AuthorizableWrapper authorizable)@NotNull StringgetTypeIcon()static @NotNull Collection<UserModel>getUsers(Authorizables.Context context, @NotNull Set<String> idSet)inthashCode()abstract booleanisGroup()protected static @NotNull Set<String>stripIDs(@NotNull Iterator<? extends AuthorizableWrapper> authorizableIterator)voidtoJson(com.google.gson.stream.JsonWriter writer)protected voidtoJsonData(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:
compareToin 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)
-
-