package org.holer.server.constant;

import org.holer.server.model.HolerStatus;
import org.holer.server.util.ServerUtil;

public  enum HolerCode
{
  OK(1000),
  ERR_INNER(1001),
  EMPTY(1002),
  BAD_DOMAIN(1003),
  BAD_ID(1004),
  BAD_TYPE(1005),
  BAD_USER(1006),
  BAD_TOKEN(1007),
  NOT_FOUND(1008),
  BAD_KEY(1009),
  BAD_PUBLIC_PORT(1010),
  BAD_SERVER(1011),
  BAD_DAY(1012),
  EXIST_KEY(1013),
  EXIST_PORT(1014),
  EXIST_DOMAIN(1015),
  BAD_PRIVATE_PORT(1016),
  NOT_ALLOW(1017),
  BAD_EMAIL(1018),
  ERR_MAX_MAPPING(1019),
  ERR_VERIFY_LICENSE(1020),
  EXIST_LICENSE(1021),
  BAD_LICENSE(1022),
  BAD_LICENSE_PORT(1023),
  BAD_LICENSE_VALIDITY(1024),
  ERR_DEFAULT_MAPPING(1025),
  ERR_EXPIRED_LICENSE(1026);

  private int code;

  HolerCode(int code) { this.code = code; }
  public int value() { return this.code; }
  public String message() {
    HolerStatus status = ServerUtil.status(this.code);
    return status.getMsg();
  }
}
