|
| 1 | +package com.faforever.api.data.domain; |
| 2 | + |
| 3 | +import com.faforever.api.data.checks.Prefab; |
| 4 | +import com.faforever.api.security.elide.permission.LobbyCheck; |
| 5 | +import com.yahoo.elide.annotation.Include; |
| 6 | +import com.yahoo.elide.annotation.ReadPermission; |
| 7 | +import com.yahoo.elide.annotation.UpdatePermission; |
| 8 | +import lombok.Setter; |
| 9 | + |
| 10 | +import javax.persistence.Column; |
| 11 | +import javax.persistence.Entity; |
| 12 | +import javax.persistence.GeneratedValue; |
| 13 | +import javax.persistence.GenerationType; |
| 14 | +import javax.persistence.Id; |
| 15 | +import javax.persistence.Table; |
| 16 | + |
| 17 | +@Entity |
| 18 | +@Table(name = "coturn_servers") |
| 19 | +@Include(name = CoturnServer.TYPE_NAME) |
| 20 | +@ReadPermission(expression = LobbyCheck.EXPRESSION) |
| 21 | +@UpdatePermission(expression = Prefab.NONE) |
| 22 | +@Setter |
| 23 | +public class CoturnServer { |
| 24 | + public static final String TYPE_NAME = "coturnServer"; |
| 25 | + |
| 26 | + private Integer id; |
| 27 | + private String region; |
| 28 | + private String host; |
| 29 | + private Integer port; |
| 30 | + private String key; |
| 31 | + private boolean active; |
| 32 | + |
| 33 | + @Id |
| 34 | + @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 35 | + @Column(name = "id") |
| 36 | + public Integer getId() { |
| 37 | + return id; |
| 38 | + } |
| 39 | + |
| 40 | + @Column(name = "region") |
| 41 | + public String getRegion() { |
| 42 | + return region; |
| 43 | + } |
| 44 | + |
| 45 | + @Column(name = "host") |
| 46 | + public String getHost() { |
| 47 | + return host; |
| 48 | + } |
| 49 | + |
| 50 | + @Column(name = "port") |
| 51 | + public Integer getPort() { |
| 52 | + return port; |
| 53 | + } |
| 54 | + |
| 55 | + @Column(name = "preshared_key") |
| 56 | + public String getKey() { |
| 57 | + return key; |
| 58 | + } |
| 59 | + |
| 60 | + @Column(name = "active") |
| 61 | + public boolean isActive() { |
| 62 | + return active; |
| 63 | + } |
| 64 | +} |
0 commit comments