summaryrefslogtreecommitdiffstats
path: root/application-model
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2016-11-16 13:49:33 +0100
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2016-11-16 14:24:11 +0100
commitcb16a7066964618d30159b42bbfb5d49c4f6d294 (patch)
tree11568634a463b49a4fbc4009487f29476aba3c0d /application-model
parentb8944897b97c4b46302cd97e61355e53059e91ef (diff)
Replace Scala case classes with Java POJOs
Diffstat (limited to 'application-model')
-rw-r--r--application-model/OWNERS1
-rw-r--r--application-model/pom.xml42
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstance.java65
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java43
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.java52
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java43
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ConfigId.java42
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/DummyJavadocTrigger.java13
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/HostName.java43
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java62
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceClusterKey.java52
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceInstance.java59
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java43
-rw-r--r--application-model/src/main/java/com/yahoo/vespa/applicationmodel/TenantId.java43
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstance.scala17
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.scala15
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.scala15
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ClusterId.scala14
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ConfigId.scala14
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/HostName.scala14
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceCluster.scala12
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceClusterKey.scala15
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceInstance.scala7
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceType.scala14
-rw-r--r--application-model/src/main/scala/com/yahoo/vespa/applicationmodel/TenantId.scala15
25 files changed, 548 insertions, 207 deletions
diff --git a/application-model/OWNERS b/application-model/OWNERS
index e131dacde49..27e1155db8b 100644
--- a/application-model/OWNERS
+++ b/application-model/OWNERS
@@ -1 +1,2 @@
hakonhall
+bjorncs
diff --git a/application-model/pom.xml b/application-model/pom.xml
index f68deb83993..69b7101029d 100644
--- a/application-model/pom.xml
+++ b/application-model/pom.xml
@@ -15,21 +15,6 @@
<description>Model classes for Vespa application entities such as host name, application id etc.</description>
<dependencies>
<dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- </dependency>
- <dependency>
- <groupId>org.json4s</groupId>
- <artifactId>json4s-native_${scala.major-version}</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.scala-lang</groupId>
- <artifactId>scalap</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson2.version}</version>
@@ -44,33 +29,6 @@
<build>
<plugins>
<plugin>
- <groupId>org.scala-tools</groupId>
- <artifactId>maven-scala-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>add-source</goal>
- <goal>compile</goal>
- <goal>testCompile</goal>
- </goals>
- </execution>
- <execution>
- <id>compile-scala-classes-for-use-in-java-classes</id>
- <phase>process-resources</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <args>
- <arg>-unchecked</arg>
- <arg>-deprecation</arg>
- <arg>-feature</arg>
- </args>
- </configuration>
- </plugin>
- <plugin>
<groupId>com.yahoo.vespa</groupId>
<artifactId>bundle-plugin</artifactId>
<extensions>true</extensions>
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstance.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstance.java
new file mode 100644
index 00000000000..31c6861b706
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstance.java
@@ -0,0 +1,65 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * @author bjorncs
+ */
+public class ApplicationInstance<STATUS> {
+ private final TenantId tenantId;
+ private final ApplicationInstanceId applicationInstanceId;
+ private final Set<ServiceCluster<STATUS>> serviceClusters;
+
+ public ApplicationInstance(TenantId tenantId, ApplicationInstanceId applicationInstanceId, Set<ServiceCluster<STATUS>> serviceClusters) {
+ this.tenantId = tenantId;
+ this.applicationInstanceId = applicationInstanceId;
+ this.serviceClusters = serviceClusters;
+ }
+
+ @JsonProperty("tenantId")
+ public TenantId tenantId() {
+ return tenantId;
+ }
+
+ @JsonProperty("applicationInstanceId")
+ public ApplicationInstanceId applicationInstanceId() {
+ return applicationInstanceId;
+ }
+
+ @JsonProperty("serviceClusters")
+ public Set<ServiceCluster<STATUS>> serviceClusters() {
+ return serviceClusters;
+ }
+
+ @JsonProperty("reference")
+ public ApplicationInstanceReference reference() {
+ return new ApplicationInstanceReference(tenantId, applicationInstanceId);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ApplicationInstance<?> that = (ApplicationInstance<?>) o;
+ return Objects.equals(tenantId, that.tenantId) &&
+ Objects.equals(applicationInstanceId, that.applicationInstanceId) &&
+ Objects.equals(serviceClusters, that.serviceClusters);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(tenantId, applicationInstanceId, serviceClusters);
+ }
+
+ @Override
+ public String toString() {
+ return "ApplicationInstance{" +
+ "tenantId=" + tenantId +
+ ", applicationInstanceId=" + applicationInstanceId +
+ ", serviceClusters=" + serviceClusters +
+ '}';
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java
new file mode 100644
index 00000000000..93b16b98d47
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.java
@@ -0,0 +1,43 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+// TODO: Remove this and use ApplicationName/InstanceName instead (if you need it for the JSON stuff move it to that layer and don't let it leak)
+public class ApplicationInstanceId {
+ public final String id;
+
+ public ApplicationInstanceId(String id) {
+ this.id = id;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @Override
+ @JsonValue
+ public String toString() {
+ return id;
+ }
+
+ // For compatibility with original Scala case class
+ public String s() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ApplicationInstanceId that = (ApplicationInstanceId) o;
+ return Objects.equals(id, that.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.java
new file mode 100644
index 00000000000..bb458ea7999
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.java
@@ -0,0 +1,52 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+// TODO: Remove this and use ApplicationId instead (if you need it for the JSON stuff move it to that layer and don't let it leak)
+public class ApplicationInstanceReference {
+ private final TenantId tenantId;
+ private final ApplicationInstanceId applicationInstanceId;
+
+ public ApplicationInstanceReference(TenantId tenantId, ApplicationInstanceId applicationInstanceId) {
+ this.tenantId = tenantId;
+ this.applicationInstanceId = applicationInstanceId;
+ }
+
+ @JsonProperty("tenantId")
+ public TenantId tenantId() {
+ return tenantId;
+ }
+
+ @JsonProperty("applicationInstanceId")
+ public ApplicationInstanceId applicationInstanceId() {
+ return applicationInstanceId;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @JsonValue
+ @Override
+ public String toString() {
+ return tenantId.id + ":" + applicationInstanceId.id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ApplicationInstanceReference that = (ApplicationInstanceReference) o;
+ return Objects.equals(tenantId, that.tenantId) &&
+ Objects.equals(applicationInstanceId, that.applicationInstanceId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(tenantId, applicationInstanceId);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
new file mode 100644
index 00000000000..a2c3a4c21cb
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ClusterId.java
@@ -0,0 +1,43 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+public class ClusterId {
+
+ public final String id;
+
+ public ClusterId(String id) {
+ this.id = id;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @JsonValue
+ @Override
+ public String toString() {
+ return id;
+ }
+
+ // For compatibility with original Scala case class
+ public String s() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ClusterId clusterId = (ClusterId) o;
+ return Objects.equals(id, clusterId.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ConfigId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ConfigId.java
new file mode 100644
index 00000000000..7a292edd00b
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ConfigId.java
@@ -0,0 +1,42 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+public class ConfigId {
+
+ public final String id;
+
+ public ConfigId(String id) {
+ this.id = id;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @JsonValue
+ @Override
+ public String toString() {
+ return super.toString();
+ }
+
+ public String s() { // For compatibility with original Scala case class
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ConfigId configId = (ConfigId) o;
+ return Objects.equals(id, configId.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/DummyJavadocTrigger.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/DummyJavadocTrigger.java
deleted file mode 100644
index 79406276885..00000000000
--- a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/DummyJavadocTrigger.java
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel;
-
-/**
- * Dummy class present only to satisfy javadoc plugin.
- *
- * See http://stackoverflow.com/questions/1138390/javadoc-for-package-info-java-only
- *
- * @author bakksjo
- */
-final class DummyJavadocTrigger {
- private DummyJavadocTrigger() {} // Prevents instantiation.
-}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/HostName.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/HostName.java
new file mode 100644
index 00000000000..dc334085a4c
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/HostName.java
@@ -0,0 +1,43 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+public class HostName {
+
+ public final String id;
+
+ public HostName(String id) {
+ this.id = id;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @JsonValue
+ @Override
+ public String toString() {
+ return super.toString();
+ }
+
+ // For compatibility with original Scala case class
+ public String s() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ HostName hostName = (HostName) o;
+ return Objects.equals(id, hostName.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java
new file mode 100644
index 00000000000..205dbf5a2e6
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceCluster.java
@@ -0,0 +1,62 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * Represents a collection of service instances that together make up a service with a single cluster id.
+ *
+ * @author bjorncs
+ */
+public class ServiceCluster<STATUS> {
+ private final ClusterId clusterId;
+ private final ServiceType serviceType;
+ private final Set<ServiceInstance<STATUS>> serviceInstances;
+
+ public ServiceCluster(ClusterId clusterId, ServiceType serviceType, Set<ServiceInstance<STATUS>> serviceInstances) {
+ this.clusterId = clusterId;
+ this.serviceType = serviceType;
+ this.serviceInstances = serviceInstances;
+ }
+
+ @JsonProperty("clusterId")
+ public ClusterId clusterId() {
+ return clusterId;
+ }
+
+ @JsonProperty("serviceType")
+ public ServiceType serviceType() {
+ return serviceType;
+ }
+
+ @JsonProperty("serviceInstances")
+ public Set<ServiceInstance<STATUS>> serviceInstances() {
+ return serviceInstances;
+ }
+
+ @Override
+ public String toString() {
+ return "ServiceCluster{" +
+ "clusterId=" + clusterId +
+ ", serviceType=" + serviceType +
+ ", serviceInstances=" + serviceInstances +
+ '}';
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ServiceCluster<?> that = (ServiceCluster<?>) o;
+ return Objects.equals(clusterId, that.clusterId) &&
+ Objects.equals(serviceType, that.serviceType) &&
+ Objects.equals(serviceInstances, that.serviceInstances);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(clusterId, serviceType, serviceInstances);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceClusterKey.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceClusterKey.java
new file mode 100644
index 00000000000..baa443f0612
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceClusterKey.java
@@ -0,0 +1,52 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+public class ServiceClusterKey {
+
+ private final ClusterId clusterId;
+ private final ServiceType serviceType;
+
+ public ServiceClusterKey(ClusterId clusterId, ServiceType serviceType) {
+ this.clusterId = clusterId;
+ this.serviceType = serviceType;
+ }
+
+ @JsonProperty("clusterId")
+ public ClusterId clusterId() {
+ return clusterId;
+ }
+
+ @JsonProperty("serviceType")
+ public ServiceType serviceType() {
+ return serviceType;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @JsonValue
+ @Override
+ public String toString() {
+ return clusterId.id + ":" + serviceType.id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ServiceClusterKey that = (ServiceClusterKey) o;
+ return Objects.equals(clusterId, that.clusterId) &&
+ Objects.equals(serviceType, that.serviceType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(clusterId, serviceType);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceInstance.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceInstance.java
new file mode 100644
index 00000000000..160e0a39d5b
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceInstance.java
@@ -0,0 +1,59 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+public class ServiceInstance<STATUS> {
+ private final ConfigId configId;
+ private final HostName hostName;
+ private final STATUS serviceStatus;
+
+ public ServiceInstance(ConfigId configId, HostName hostName, STATUS serviceStatus) {
+ this.configId = configId;
+ this.hostName = hostName;
+ this.serviceStatus = serviceStatus;
+ }
+
+ @JsonProperty("configId")
+ public ConfigId configId() {
+ return configId;
+ }
+
+ @JsonProperty("hostName")
+ public HostName hostName() {
+ return hostName;
+ }
+
+ @JsonProperty("serviceStatus")
+ public STATUS serviceStatus() {
+ return serviceStatus;
+ }
+
+ @Override
+ public String toString() {
+ return "ServiceInstance{" +
+ "configId=" + configId +
+ ", hostName=" + hostName +
+ ", serviceStatus=" + serviceStatus +
+ '}';
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ServiceInstance<?> that = (ServiceInstance<?>) o;
+ return Objects.equals(configId, that.configId) &&
+ Objects.equals(hostName, that.hostName) &&
+ Objects.equals(serviceStatus, that.serviceStatus);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(configId, hostName, serviceStatus);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java
new file mode 100644
index 00000000000..ed274782046
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java
@@ -0,0 +1,43 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+public class ServiceType {
+
+ public final String id;
+
+ public ServiceType(String id) {
+ this.id = id;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @JsonValue
+ @Override
+ public String toString() {
+ return id;
+ }
+
+ // For compatibility with original Scala case class
+ public String s() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ServiceType that = (ServiceType) o;
+ return Objects.equals(id, that.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/TenantId.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/TenantId.java
new file mode 100644
index 00000000000..a051ee069e5
--- /dev/null
+++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/TenantId.java
@@ -0,0 +1,43 @@
+package com.yahoo.vespa.applicationmodel;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Objects;
+
+/**
+ * @author bjorncs
+ */
+// TODO: Remove this and use TenantName instead (if you need it for the JSON stuff move it to that layer and don't let it leak)
+public class TenantId {
+ public final String id;
+
+ public TenantId(String id) {
+ this.id = id;
+ }
+
+ // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
+ // Therefore, we use toString() as the JSON-producing method, which is really sad.
+ @Override
+ @JsonValue
+ public String toString() {
+ return id;
+ }
+
+ // For compatibility with original Scala case class
+ public String s() {
+ return id;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ TenantId tenantId = (TenantId) o;
+ return Objects.equals(id, tenantId.id);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id);
+ }
+}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstance.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstance.scala
deleted file mode 100644
index 68f32db22dd..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstance.scala
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-/**
- * TODO: What is this
- *
- * @author bakksjo
- */
-case class ApplicationInstance[S](
- tenantId: TenantId,
- applicationInstanceId: ApplicationInstanceId,
-
- // TODO: What is this for?
- serviceClusters: java.util.Set[ServiceCluster[S]]) {
-
- def reference = ApplicationInstanceReference(tenantId, applicationInstanceId)
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.scala
deleted file mode 100644
index 8c1bfe284fa..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceId.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
- // TODO: Remove this and use ApplicationName/InstanceName instead (if you need it for the JSON stuff move it to that layer and don't let it leak)
-case class ApplicationInstanceId(s: String) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.scala
deleted file mode 100644
index 35e00d31ba2..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ApplicationInstanceReference.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
- // TODO: Remove this and use ApplicationId instead (if you need it for the JSON stuff move it to that layer and don't let it leak)
-case class ApplicationInstanceReference(tenantId: TenantId, applicationInstanceId: ApplicationInstanceId) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s"${tenantId.s}:${applicationInstanceId.s}"
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ClusterId.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ClusterId.scala
deleted file mode 100644
index 929d79c2f8e..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ClusterId.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
-case class ClusterId(s: String) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ConfigId.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ConfigId.scala
deleted file mode 100644
index 013f2cd976b..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ConfigId.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
-case class ConfigId(s: String) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/HostName.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/HostName.scala
deleted file mode 100644
index 1715ed9fa80..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/HostName.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
-case class HostName(s: String) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceCluster.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceCluster.scala
deleted file mode 100644
index 6e5bb0d35b3..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceCluster.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-/**
- * Represents a collection of service instances that together make up a service with a single cluster id.
- *
- * @author bakksjo
- */
-case class ServiceCluster[S](
- clusterId: ClusterId,
- serviceType: ServiceType,
- serviceInstances: java.util.Set[ServiceInstance[S]])
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceClusterKey.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceClusterKey.scala
deleted file mode 100644
index 48a19311ffe..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceClusterKey.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
-case class ServiceClusterKey(clusterId: ClusterId, serviceType: ServiceType) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s"${clusterId}:${serviceType}"
-}
-
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceInstance.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceInstance.scala
deleted file mode 100644
index 473e47f9d33..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceInstance.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-/**
- * @author bakksjo
- */
-case class ServiceInstance[S](configId: ConfigId, hostName: HostName, serviceStatus: S)
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceType.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceType.scala
deleted file mode 100644
index c1a91039ae5..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/ServiceType.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author tonytv
- */
-case class ServiceType(s: String) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s
-}
diff --git a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/TenantId.scala b/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/TenantId.scala
deleted file mode 100644
index 17e9d1f1c7a..00000000000
--- a/application-model/src/main/scala/com/yahoo/vespa/applicationmodel/TenantId.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.applicationmodel
-
-import com.fasterxml.jackson.annotation.JsonValue
-
-/**
- * @author bakksjo
- */
- // TODO: Remove this and use TenantName instead (if you need it for the JSON stuff move it to that layer and don't let it leak)
-case class TenantId(s: String) {
- // Jackson's StdKeySerializer uses toString() (and ignores annotations) for objects used as Map keys.
- // Therefore, we use toString() as the JSON-producing method, which is really sad.
- @JsonValue
- override def toString(): String = s
-}