Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Commit

Permalink
feat(healthcheck): Add a state to the endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
brasseld committed Jun 22, 2016
1 parent 2f961b3 commit c3d16c3
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions model/src/main/java/io/gravitee/definition/model/Endpoint.java
Expand Up @@ -82,10 +82,36 @@ public void setStatus(Status status) {
this.status = status;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Endpoint endpoint = (Endpoint) o;

return target != null ? target.equals(endpoint.target) : endpoint.target == null;

}

@Override
public int hashCode() {
return target != null ? target.hashCode() : 0;
}

public enum Status {
UP,
DOWN,
TRANSITIONALLY_DOWN,
TRANSITIONALLY_UP
UP(3),
DOWN(0),
TRANSITIONALLY_DOWN(1),
TRANSITIONALLY_UP(2);

private final int code;

Status(int code) {
this.code = code;
}

public int code() {
return this.code;
}
}
}

0 comments on commit c3d16c3

Please sign in to comment.