com.aerohive.core.security.core.userdetails.HiveEnhancedUserDetails.java Source code

Java tutorial

Introduction

Here is the source code for com.aerohive.core.security.core.userdetails.HiveEnhancedUserDetails.java

Source

package com.aerohive.core.security.core.userdetails;

import java.util.Collection;

import lombok.Getter;
import lombok.Setter;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * The enhanced user details which support hive
 * <p>>I do not like place this class in hive-secuirty because i want hive-security to be a framework without any business code,
 * but till now there no suitable project to have this class, so it have to be placed here</p>
 * @author xczhang
 *
 */
public class HiveEnhancedUserDetails extends User {

    /**
     * 
     */
    private static final long serialVersionUID = 3109010281671742310L;

    @Getter
    @Setter
    private Long userId;

    @Getter
    @Setter
    private Long groupId;

    @Getter
    @Setter
    private String groupName;

    @Getter
    @Setter
    private Long customerId;

    @Getter
    @Setter
    private String externalCustomerId;

    @Getter
    @Setter
    private String customerName;

    @Getter
    @Setter
    private String displayName;

    @Getter
    @Setter
    private Boolean licenseAgreed;

    @Getter
    @Setter
    private Integer status;

    @Getter
    @Setter
    private String indexUrl;

    @Getter
    @Setter
    private Integer dateFormat;

    @Getter
    @Setter
    private Integer timeFormat;

    @Getter
    @Setter
    private String locale;

    public HiveEnhancedUserDetails(String username, String password, boolean enabled, boolean accountNonExpired,
            boolean credentialsNonExpired, boolean accountNonLocked,
            Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }

    @JsonIgnore
    public Collection<GrantedAuthority> getAuthorities() {
        return super.getAuthorities();
    }
}