Constructor and Description |
---|
ServiceDesc(String service,
OptString hostport,
OptString protocol,
OptString label,
AuthDesc auth,
OptString failure,
OptInteger providerID)
JSON-driven constructor.
|
ServiceDesc(String service,
String failure)
Error constructor.
|
ServiceDesc(String service,
String hostport,
String protocol,
String label,
AuthDesc auth,
String failure,
int providerID)
Direct constructor.
|
Modifier and Type | Method and Description |
---|---|
HostDesc |
asHostDesc(int retryInterval)
Generate a HostDesc object suitable for establishing a connection
to the service described by this service descriptor.
|
void |
attachLabel(String label)
Set this service's a label string.
|
AuthDesc |
auth()
Get this service's authorization configuration.
|
JSONLiteral |
encode(EncodeControl control)
Encode this object for transmission or persistence.
|
static JSONLiteralArray |
encodeArray(Iterable<ServiceDesc> services)
Generate a JSONLiteralArray of ServiceDesc objects from a sequence of
them.
|
JSONLiteralArray |
encodeAsArray()
Encode this descriptor as a single-element JSONLiteralArray.
|
String |
failure()
Get this descriptor's error message.
|
String |
hostport()
Get this service's host:port string.
|
String |
label()
Get this service's label string.
|
String |
protocol()
Get this service's protocol string.
|
int |
providerID()
Get this service's provider ID.
|
String |
service()
Get this services's service name.
|
void |
setProviderID(int providerID)
Set this service's provider ID.
|
ServiceDesc |
subService(String service)
Generate a service descriptor based on this one.
|
public ServiceDesc(String service, String hostport, String protocol, String label, AuthDesc auth, String failure, int providerID)
service
- The name of the service.hostport
- Where to reach the service.protocol
- Protocol to speak to the sevice with.label
- Printable name for the service.auth
- Authorization configuration for connection to the service.failure
- Optional error message.providerID
- Provider ID, or -1 if not set.public ServiceDesc(String service, String failure)
service
- The name of the service.failure
- Error message.@JSONMethod(value={"service","hostport","protocol","label","?auth","failure","provider"}) public ServiceDesc(String service, OptString hostport, OptString protocol, OptString label, AuthDesc auth, OptString failure, OptInteger providerID)
service
- The name of the service.hostport
- Where to reach the service.protocol
- Protocol to speak to the service with.label
- Optional printable name for the service.auth
- Optional authorization configuration for connection.failure
- Optional error message.providerID
- Optional provider ID.public HostDesc asHostDesc(int retryInterval)
retryInterval
- Connection retry interval for connecting to this
host, or -1 to take the default.public void attachLabel(String label)
label
- The new label string for this service.public AuthDesc auth()
public String failure()
public String hostport()
public String label()
public String protocol()
public int providerID()
public String service()
public void setProviderID(int providerID)
providerID
- Nominal provider ID number for this service.public ServiceDesc subService(String service)
service
- The service name of the sub-service.public JSONLiteral encode(EncodeControl control)
public static JSONLiteralArray encodeArray(Iterable<ServiceDesc> services)
public JSONLiteralArray encodeAsArray()
Copyright © 2017. All rights reserved.