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

org.ligoj.app.plugin.prov.model.ProvLocation Maven / Gradle / Ivy

The newest version!
/*
 * Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
 */
package org.ligoj.app.plugin.prov.model;

import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import jakarta.validation.constraints.NotNull;

import org.ligoj.app.model.Node;
import org.ligoj.bootstrap.core.model.AbstractDescribedEntity;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Getter;
import lombok.Setter;

/**
 * Location for a VM provider. The name attribute is a unique location API name within the VM provider.
 *
 * @see unstats.un.org
 * @see UN_M.49
 */
@Getter
@Setter
@Entity
@Table(name = "LIGOJ_PROV_LOCATION", uniqueConstraints = @UniqueConstraint(columnNames = { "name", "node" }))
public class ProvLocation extends AbstractDescribedEntity {

	/**
	 * SID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The related node (VM provider) of this location.
	 */
	@NotNull
	@ManyToOne(fetch = FetchType.LAZY)
	@JsonIgnore
	private Node node;

	/**
	 * Longitude of the data center.
	 */
	private Double longitude;

	/**
	 * Latitude of the data center
	 */
	private Double latitude;

	/**
	 * Region or city name inside the country. Values: Florida, Sydney, Beijing, Paris, ...
	 */
	private String subRegion;

	/**
	 * Placement inside the country, not at region or continent level. Values : north, west, east, south, central,
	 * northwest,...
	 */
	private String placement;

	/**
	 * M49 country code: 840 (USA), 250 (France), ...
	 */
	private Integer countryM49;

	/**
	 * ISO 3166-1-alpha-2 country code: US (USA), FR (France), ...
	 */
	private String countryA2;

	/**
	 * M49 region code: 154 (Northern Europe), 021 (Northern America), 155 (Western Europe)...
	 */
	private Integer regionM49;

	/**
	 * M49 continent code: 142 (Asia), 150 (Europe), 019 (Americas),...
	 */
	private Integer continentM49;
	
	/**
	 * When true, this location is the default one for new quotes
	 */
	private  boolean preferred;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy