package org.xbib.net;

import java.util.Collection;
import java.util.Map;

public interface UserProfile {

    String USER_ID = "user_id";

    String EFFECTIVE_USER_ID = "e_user_id";

    String NAME = "name";

    String ROLES = "roles";

    String EFFECTIVE_ROLES = "e_roles";

    String PERMISSIONS = "perms";

    String EFFECTIVE_PERMISSIONS = "e_perms";

    String ATTRIBUTES = "attrs";

    String REFRESH = "refresh";

    void setUserId(String uid);

    String getUserId();

    void setEffectiveUserId(String eid);

    String getEffectiveUserId();

    void setName(String name);

    String getName();

    void addRole(String role);

    void setRoles(Collection<String> roles);

    Collection<String> getRoles();

    void addEffectiveRole(String role);

    void setEffectiveRoles(Collection<String> effectiveRoles);

    Collection<String> getEffectiveRoles();

    void addPermission(String permission);

    void setPermissions(Collection<String> permissions);

    Collection<String> getPermissions();

    void addEffectivePermission(String permission);

    void setEffectivePermissions(Collection<String> effectivePermissions);

    Collection<String> getEffectivePermissions();

    void setAttributes(Attributes attributes);

    void updateAttribute(String key, Object value);

    Attributes getAttributes();

    Map<String, Object> asMap();

    void triggerRefresh(boolean refresh);

    boolean isRefreshTriggered();
}
