Commit c3be495a by Thomas Bosch

boot admin

parent 05ef6ab9
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<properties>
<spring-boot.version>1.0.2.RELEASE</spring-boot.version>
<spring.version>4.0.3.RELEASE</spring.version>
......
package de.codecentric;
package de.codecentric.boot.admin;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
......
package de.codecentric.config;
package de.codecentric.boot.admin.config;
import java.util.List;
......
package de.codecentric.controller;
package de.codecentric.boot.admin.controller;
import java.util.List;
......@@ -9,8 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import de.codecentric.model.Application;
import de.codecentric.service.ApplicationRegistry;
import de.codecentric.boot.admin.model.Application;
import de.codecentric.boot.admin.service.ApplicationRegistry;
@Controller
public class RegistryController {
......
package de.codecentric.model;
package de.codecentric.boot.admin.model;
import java.io.Serializable;
......@@ -34,4 +34,35 @@ public class Application implements Serializable {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Application other = (Application) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (url == null) {
if (other.url != null)
return false;
} else if (!url.equals(other.url))
return false;
return true;
}
}
package de.codecentric.service;
package de.codecentric.boot.admin.service;
import java.util.ArrayList;
import java.util.Collections;
......@@ -7,7 +7,7 @@ import java.util.List;
import org.apache.commons.lang3.Validate;
import org.springframework.stereotype.Service;
import de.codecentric.model.Application;
import de.codecentric.boot.admin.model.Application;
@Service
public class ApplicationRegistry {
......@@ -21,6 +21,10 @@ public class ApplicationRegistry {
registry.add(app);
}
public boolean isRegistered(Application app) {
return registry.contains(app);
}
public List<Application> getApplications() {
return Collections.unmodifiableList(registry);
}
......
package de.codecentric;
package de.codecentric.boot.admin;
import org.springframework.web.client.RestTemplate;
import de.codecentric.model.Application;
import de.codecentric.boot.admin.model.Application;
public class RegisterExampleApp {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment