Skip to content

Commit dbac9c5

Browse files
authored
Merge pull request #696 from scalecube/remove-groups-support
Remove groups support
2 parents 15f1d8c + 6d269a9 commit dbac9c5

File tree

12 files changed

+47
-879
lines changed

12 files changed

+47
-879
lines changed

services-api/src/main/java/io/scalecube/services/ServiceEndpoint.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class ServiceEndpoint {
1818
private Set<String> contentTypes;
1919
private Map<String, String> tags;
2020
private Collection<ServiceRegistration> serviceRegistrations;
21-
private ServiceGroup serviceGroup;
2221

2322
/**
2423
* Constructor for SerDe.
@@ -34,7 +33,6 @@ private ServiceEndpoint(Builder builder) {
3433
this.tags = new HashMap<>(builder.tags);
3534
this.serviceRegistrations =
3635
Collections.unmodifiableCollection(new ArrayList<>(builder.serviceRegistrations));
37-
this.serviceGroup = builder.serviceGroup;
3836
}
3937

4038
public static Builder builder() {
@@ -57,10 +55,6 @@ public Map<String, String> tags() {
5755
return tags;
5856
}
5957

60-
public ServiceGroup serviceGroup() {
61-
return serviceGroup;
62-
}
63-
6458
/**
6559
* Return collection of service registratrions.
6660
*
@@ -84,12 +78,11 @@ public Collection<ServiceReference> serviceReferences() {
8478
@Override
8579
public String toString() {
8680
return new StringJoiner(", ", ServiceEndpoint.class.getSimpleName() + "[", "]")
87-
.add("id='" + id + "'")
81+
.add("id=" + id)
8882
.add("address=" + address)
8983
.add("contentTypes=" + contentTypes)
90-
.add("tags(" + tags.size() + ")")
84+
.add("tags=" + tags)
9185
.add("serviceRegistrations(" + serviceRegistrations.size() + ")")
92-
.add("serviceGroup=" + serviceGroup)
9386
.toString();
9487
}
9588

@@ -100,7 +93,6 @@ public static class Builder {
10093
private Set<String> contentTypes = Collections.emptySet();
10194
private Map<String, String> tags = Collections.emptyMap();
10295
private Collection<ServiceRegistration> serviceRegistrations = new ArrayList<>();
103-
private ServiceGroup serviceGroup;
10496

10597
private Builder() {}
10698

@@ -135,11 +127,6 @@ public Builder serviceRegistrations(Collection<ServiceRegistration> serviceRegis
135127
return this;
136128
}
137129

138-
public Builder serviceGroup(String groupId, int groupSize) {
139-
this.serviceGroup = new ServiceGroup(groupId, groupSize);
140-
return this;
141-
}
142-
143130
public ServiceEndpoint build() {
144131
return new ServiceEndpoint(this);
145132
}

services-api/src/main/java/io/scalecube/services/ServiceGroup.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

services-api/src/main/java/io/scalecube/services/ServiceMethodDefinition.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.Collections;
44
import java.util.Map;
5+
import java.util.StringJoiner;
56

67
/**
78
* A Service Method Definition is a single method definition of a service inside service
@@ -76,14 +77,10 @@ public ServiceMethodDefinition setAuth(boolean auth) {
7677

7778
@Override
7879
public String toString() {
79-
return "ServiceMethodDefinition{"
80-
+ "action='"
81-
+ action
82-
+ '\''
83-
+ ", tags="
84-
+ tags
85-
+ ", auth="
86-
+ auth
87-
+ '}';
80+
return new StringJoiner(", ", ServiceMethodDefinition.class.getSimpleName() + "[", "]")
81+
.add("action=" + action)
82+
.add("tags=" + tags)
83+
.add("auth=" + auth)
84+
.toString();
8885
}
8986
}

services-api/src/main/java/io/scalecube/services/ServiceReference.java

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.HashMap;
77
import java.util.Map;
88
import java.util.Set;
9+
import java.util.StringJoiner;
910

1011
/**
1112
* Service reference. This is merge of service method information together with service registration
@@ -88,30 +89,13 @@ private Map<String, String> mergeTags(
8889

8990
@Override
9091
public String toString() {
91-
return "ServiceReference{"
92-
+ "qualifier='"
93-
+ qualifier
94-
+ '\''
95-
+ ", endpointId='"
96-
+ endpointId
97-
+ '\''
98-
+ ", address='"
99-
+ address
100-
+ '\''
101-
+ ", namespace='"
102-
+ namespace
103-
+ '\''
104-
+ ", contentTypes='"
105-
+ contentTypes
106-
+ '\''
107-
+ ", tags="
108-
+ tags
109-
+ ", action='"
110-
+ action
111-
+ '\''
112-
+ ", auth='"
113-
+ auth
114-
+ '\''
115-
+ '}';
92+
return new StringJoiner(", ", ServiceReference.class.getSimpleName() + "[", "]")
93+
.add("endpointId=" + endpointId)
94+
.add("address=" + address)
95+
.add("qualifier=" + qualifier)
96+
.add("contentTypes=" + contentTypes)
97+
.add("tags=" + tags)
98+
.add("auth=" + auth)
99+
.toString();
116100
}
117101
}

services-api/src/main/java/io/scalecube/services/ServiceRegistration.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.Collection;
44
import java.util.Map;
5+
import java.util.StringJoiner;
56

67
public class ServiceRegistration {
78

@@ -49,14 +50,10 @@ public ServiceRegistration setTags(Map<String, String> tags) {
4950

5051
@Override
5152
public String toString() {
52-
return "ServiceRegistration{"
53-
+ "namespace='"
54-
+ namespace
55-
+ '\''
56-
+ ", tags="
57-
+ tags
58-
+ ", methods="
59-
+ methods
60-
+ '}';
53+
return new StringJoiner(", ", ServiceRegistration.class.getSimpleName() + "[", "]")
54+
.add("namespace=" + namespace)
55+
.add("tags=" + tags)
56+
.add("methods(" + methods.size() + ")")
57+
.toString();
6158
}
6259
}

services-api/src/main/java/io/scalecube/services/api/ErrorData.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.scalecube.services.api;
22

3+
import java.util.StringJoiner;
4+
35
public final class ErrorData {
46

57
private int errorCode;
@@ -33,6 +35,9 @@ public String getErrorMessage() {
3335

3436
@Override
3537
public String toString() {
36-
return "ErrorData{" + "errorCode=" + errorCode + ", errorMessage='" + errorMessage + '\'' + '}';
38+
return new StringJoiner(", ", ErrorData.class.getSimpleName() + "[", "]")
39+
.add("errorCode=" + errorCode)
40+
.add("errorMessage=" + errorMessage)
41+
.toString();
3742
}
3843
}

services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Map;
66
import java.util.Objects;
77
import java.util.Optional;
8+
import java.util.StringJoiner;
89

910
public final class ServiceMessage {
1011

@@ -184,7 +185,10 @@ public int errorType() {
184185

185186
@Override
186187
public String toString() {
187-
return "ServiceMessage {headers: " + headers + ", data: " + data + '}';
188+
return new StringJoiner(", ", ServiceMessage.class.getSimpleName() + "[", "]")
189+
.add("headers(" + headers.size() + ")")
190+
.add("data=" + (data != null ? data.getClass().getName() : null))
191+
.toString();
188192
}
189193

190194
public static class Builder {

0 commit comments

Comments
 (0)