123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package com.yihu.hos.models;
- import org.springframework.data.annotation.Id;
- import org.springframework.data.mongodb.core.index.Indexed;
- import org.springframework.data.mongodb.core.mapping.Document;
- import java.util.Date;
- /**
- * @created Airhead 2016/7/27.
- */
- @Document
- public class BrokerServer {
- @Id
- private String id;
- private String hostName;
- private String hostAddress;
- private int port;
- @Indexed(name = "updateTime_1", expireAfterSeconds = 30)
- private Date updateTime;
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public int getPort() {
- return port;
- }
- public void setPort(int port) {
- this.port = port;
- }
- public Date getUpdateTime() {
- return updateTime;
- }
- public void setUpdateTime(Date updateTime) {
- this.updateTime = updateTime;
- }
- public String getHostName() {
- return hostName;
- }
- public void setHostName(String hostName) {
- this.hostName = hostName;
- }
- public String getHostAddress() {
- return hostAddress;
- }
- public void setHostAddress(String hostAddress) {
- this.hostAddress = hostAddress;
- }
- public String getURL() {
- return "http://" + hostAddress + ":" + port;
- }
- }
|