All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.geotab.model.entity.user.SystemUser Maven / Gradle / Ivy

/*
 *
 * 2020 Copyright (C) Geotab Inc. All rights reserved.
 */

package com.geotab.model.entity.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.geotab.model.entity.group.CompanyGroup;
import com.geotab.model.entity.group.EverythingSecurityGroup;
import com.geotab.model.enumeration.UserAuthenticationType;
import com.geotab.model.serialization.SystemEntitySerializationAware;
import com.google.common.collect.Lists;
import java.time.LocalDateTime;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * The internal user that has access to everything and is used internally by MyGeotab processes.
 */
@Getter
@Setter
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public final class SystemUser extends User implements SystemEntitySerializationAware {

  private static class InstanceHolder {

    private static final SystemUser INSTANCE = new SystemUser();
  }

  public static final String SYSTEM_USER_ID = "SystemUserId";

  private SystemUser() {
    super(SYSTEM_USER_ID, "System", 0L, 0, 0, 0,
        null,
        LocalDateTime.of(1986, 1, 1, 0, 0, 0, 0),
        LocalDateTime.of(2050, 1, 1, 0, 0, 0, 0),
        null, null, false,
        "", Lists.newArrayList(new CompanyGroup()), null, null, null,
        null, null, null, null,
        null, null, null, null, "System", null,
        null, null, false, false,
        false, null, null, null, false,
        true, false, false, true, null, null,
        "", null, "", Lists.newArrayList(), Lists.newArrayList(),
        Lists.newArrayList(new EverythingSecurityGroup()), false,
        null, UserAuthenticationType.BASIC_AUTHENTICATION, null, null,
        null, null, null, null, false, true);
  }

  public static SystemUser getInstance() {
    return InstanceHolder.INSTANCE;
  }

  @JsonIgnore
  @Override
  public boolean isSystemEntity() {
    return true;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy