public final class ServiceInfo extends Object
This info requires a name and a group of locatable services. A locatable service is a named
group of ServiceAcl
s.
PSequence<ServiceAcl> helloAcls = TreePVector.from(Arrays.asList(
ServiceAcl.methodAndPath(Method.GET, "?/hello/.*"),
ServiceAcl.methodAndPath(Method.POST, "/login"))
);
PSequence<ServiceAcl> goodbyeAcls = TreePVector.singleton(
ServiceAcl.methodAndPath(Method.POST, "/logout/.*")
);
PMap<String, PSequence<ServiceAcl>> locatableServices =
HashTreePMap.<String, PSequence<ServiceAcl>>empty()
.plus("hello-service", helloAcls)
.plus("goodbye-service", goodbyeAcls);
new ServiceInfo("GreetingService", locatableServices);
Constructor and Description |
---|
ServiceInfo(String serviceName)
Deprecated.
use
ServiceInfo(String, PMap) instead. |
ServiceInfo(String serviceName,
org.pcollections.PMap<String,org.pcollections.PSequence<ServiceAcl>> locatableServices)
Deprecated.
use
of(String, ServiceAcl...) instead. |
Modifier and Type | Method and Description |
---|---|
org.pcollections.PSequence<ServiceAcl> |
getAcls() |
org.pcollections.PMap<String,org.pcollections.PSequence<ServiceAcl>> |
getLocatableServices()
Deprecated.
this method will be removed when dropping support for multiple locatable service
descriptors per service.
|
static ServiceInfo |
of(String serviceName,
ServiceAcl... acls)
Factory method to create ServiceInfo instances that contain a single locatable service.
|
String |
serviceName() |
@Deprecated public ServiceInfo(String serviceName)
ServiceInfo(String, PMap)
instead.@Deprecated public ServiceInfo(String serviceName, org.pcollections.PMap<String,org.pcollections.PSequence<ServiceAcl>> locatableServices)
of(String, ServiceAcl...)
instead.serviceName
- identifies this service. This is the default id when this service acts as a
client.locatableServices
- a group of locatable services. This information should be publicized
on a Service Registry for either client-side or server-side service discovery.public static ServiceInfo of(String serviceName, ServiceAcl... acls)
serviceName
- acls
- for the single locatableService of this Service.public String serviceName()
@Deprecated public org.pcollections.PMap<String,org.pcollections.PSequence<ServiceAcl>> getLocatableServices()
public org.pcollections.PSequence<ServiceAcl> getAcls()