// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ActuatorEndpointsUpdated.java
// public class ActuatorEndpointsUpdated extends ApplicationEvent {
// 
// 	public ActuatorEndpointsUpdated(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// 	public ApplicationInstance getApplicationInstance() {
// 		return (ApplicationInstance) this.source;
// 	}
// 
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ApplicationInstanceCreated.java
// public class ApplicationInstanceCreated extends ApplicationEvent {
// 
// 	public ApplicationInstanceCreated(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// 	public ApplicationInstance getApplicationInstance() {
// 		return (ApplicationInstance) this.source;
// 	}
// 
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ApplicationInstanceDeleted.java
// public class ApplicationInstanceDeleted extends ApplicationEvent {
// 
// 	public ApplicationInstanceDeleted(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// 	public ApplicationInstance getApplicationInstance() {
// 		return (ApplicationInstance) this.source;
// 	}
// 
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ApplicationInstanceHealthUpdated.java
// public class ApplicationInstanceHealthUpdated extends ApplicationEvent {
// 
// 	public ApplicationInstanceHealthUpdated(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// }


import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import be.ordina.msdashboard.applicationinstance.events.ActuatorEndpointsUpdated;
import be.ordina.msdashboard.applicationinstance.events.ApplicationInstanceCreated;
import be.ordina.msdashboard.applicationinstance.events.ApplicationInstanceDeleted;
import be.ordina.msdashboard.applicationinstance.events.ApplicationInstanceHealthUpdated;
import org.springframework.boot.actuate.health.Status;
import org.springframework.context.ApplicationEvent;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.Links;
	private Status healthStatus = Status.UNKNOWN;
	private Links actuatorEndpoints = new Links();

	private ApplicationInstance(Builder builder) {
		this.id = builder.id;
		this.application = builder.application;
		this.baseUri = builder.baseUri;
		this.state = State.CREATED;
		this.changes.add(new ApplicationInstanceCreated(this));
	}

	public String getId() {
		return this.id;
	}

	public String getApplication() {
		return this.application;
	}

	public URI getBaseUri() {
		return this.baseUri;
	}

	public Status getHealthStatus() {
		return this.healthStatus;
	}

	void updateHealthStatus(Status healthStatus) {
		if (!this.healthStatus.equals(healthStatus)) {
			this.healthStatus = healthStatus;
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ActuatorEndpointsUpdated.java
// public class ActuatorEndpointsUpdated extends ApplicationEvent {
// 
// 	public ActuatorEndpointsUpdated(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// 	public ApplicationInstance getApplicationInstance() {
// 		return (ApplicationInstance) this.source;
// 	}
// 
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ApplicationInstanceCreated.java
// public class ApplicationInstanceCreated extends ApplicationEvent {
// 
// 	public ApplicationInstanceCreated(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// 	public ApplicationInstance getApplicationInstance() {
// 		return (ApplicationInstance) this.source;
// 	}
// 
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ApplicationInstanceDeleted.java
// public class ApplicationInstanceDeleted extends ApplicationEvent {
// 
// 	public ApplicationInstanceDeleted(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// 	public ApplicationInstance getApplicationInstance() {
// 		return (ApplicationInstance) this.source;
// 	}
// 
// }
// 
// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/events/ApplicationInstanceHealthUpdated.java
// public class ApplicationInstanceHealthUpdated extends ApplicationEvent {
// 
// 	public ApplicationInstanceHealthUpdated(ApplicationInstance instance) {
// 		super(instance);
// 	}
// 
// }


// Path: microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/applicationinstance/ApplicationInstance.java
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import be.ordina.msdashboard.applicationinstance.events.ActuatorEndpointsUpdated;
import be.ordina.msdashboard.applicationinstance.events.ApplicationInstanceCreated;
import be.ordina.msdashboard.applicationinstance.events.ApplicationInstanceDeleted;
import be.ordina.msdashboard.applicationinstance.events.ApplicationInstanceHealthUpdated;
import org.springframework.boot.actuate.health.Status;
import org.springframework.context.ApplicationEvent;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.Links;

	private Status healthStatus = Status.UNKNOWN;
	private Links actuatorEndpoints = new Links();

	private ApplicationInstance(Builder builder) {
		this.id = builder.id;
		this.application = builder.application;
		this.baseUri = builder.baseUri;
		this.state = State.CREATED;
		this.changes.add(new ApplicationInstanceCreated(this));
	}

	public String getId() {
		return this.id;
	}

	public String getApplication() {
		return this.application;
	}

	public URI getBaseUri() {
		return this.baseUri;
	}

	public Status getHealthStatus() {
		return this.healthStatus;
	}

	void updateHealthStatus(Status healthStatus) {
		if (!this.healthStatus.equals(healthStatus)) {
			this.healthStatus = healthStatus;
			this.changes.add(new ApplicationInstanceHealthUpdated(this));