mdk_discovery.Node Maven / Gradle / Ivy
/* Quark 1.0.452 run at 2016-11-10 18:39:58.222591 */
package mdk_discovery;
/**
* The Node class captures address and metadata information about a
* server functioning as a service instance.
*/
public class Node implements io.datawire.quark.runtime.QObject {
public static quark.reflect.Class mdk_discovery_Node_ref = datawire_mdk_md.Root.mdk_discovery_Node_md;
/**
* The service name.
*/
public String service;
/**
* The service version (e.g. '1.2.3')
*/
public String version;
/**
* The address at which clients can reach the server.
*/
public String address;
/**
* Additional metadata associated with this service instance.
*/
public java.util.HashMap properties = io.datawire.quark.runtime.Builtins.map(new Object[]{});
/**
* The Environment the Node is in.
*/
public mdk_protocol.OperationalEnvironment environment = new mdk_protocol.OperationalEnvironment();
public FailurePolicy _policy = null;
public Node() {}
public void success() {
(this._policy).success();
}
public void failure() {
(this._policy).failure();
}
public Boolean available() {
return (this._policy).available();
}
/**
* Return a string representation of the Node.
*/
public String toString() {
String result = "Node(";
if ((this.service)==(null) || ((Object)(this.service) != null && ((Object) (this.service)).equals(null))) {
result = (result) + ("");
} else {
result = (result) + (this.service);
}
result = (result) + (": ");
if ((this.address)==(null) || ((Object)(this.address) != null && ((Object) (this.address)).equals(null))) {
result = (result) + ("");
} else {
result = (result) + (this.address);
}
if (!((this.version)==(null) || ((Object)(this.version) != null && ((Object) (this.version)).equals(null)))) {
result = ((result) + (", ")) + (this.version);
}
result = (result) + (")");
if (!((this.properties)==(null) || ((Object)(this.properties) != null && ((Object) (this.properties)).equals(null)))) {
result = ((result) + (" ")) + (("" + (this.properties)));
}
return result;
}
public String _getClass() {
return "mdk_discovery.Node";
}
public Object _getField(String name) {
if ((name)==("service") || ((Object)(name) != null && ((Object) (name)).equals("service"))) {
return (this).service;
}
if ((name)==("version") || ((Object)(name) != null && ((Object) (name)).equals("version"))) {
return (this).version;
}
if ((name)==("address") || ((Object)(name) != null && ((Object) (name)).equals("address"))) {
return (this).address;
}
if ((name)==("properties") || ((Object)(name) != null && ((Object) (name)).equals("properties"))) {
return (this).properties;
}
if ((name)==("environment") || ((Object)(name) != null && ((Object) (name)).equals("environment"))) {
return (this).environment;
}
if ((name)==("_policy") || ((Object)(name) != null && ((Object) (name)).equals("_policy"))) {
return (this)._policy;
}
return null;
}
public void _setField(String name, Object value) {
if ((name)==("service") || ((Object)(name) != null && ((Object) (name)).equals("service"))) {
(this).service = (String) (value);
}
if ((name)==("version") || ((Object)(name) != null && ((Object) (name)).equals("version"))) {
(this).version = (String) (value);
}
if ((name)==("address") || ((Object)(name) != null && ((Object) (name)).equals("address"))) {
(this).address = (String) (value);
}
if ((name)==("properties") || ((Object)(name) != null && ((Object) (name)).equals("properties"))) {
(this).properties = (java.util.HashMap) (value);
}
if ((name)==("environment") || ((Object)(name) != null && ((Object) (name)).equals("environment"))) {
(this).environment = (mdk_protocol.OperationalEnvironment) (value);
}
if ((name)==("_policy") || ((Object)(name) != null && ((Object) (name)).equals("_policy"))) {
(this)._policy = (FailurePolicy) (value);
}
}
}