diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-07-01 09:19:49 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-07-01 09:19:49 (GMT) |
commit | 2da71a8a85486a494343f1662d64fb5ae5a2a44e (patch) | |
tree | 23992f9f2a00bac23b345e5c2cc9c1194efc25be /src/com/isode/stroke/network/DomainNameServiceQuery.java | |
download | stroke-2da71a8a85486a494343f1662d64fb5ae5a2a44e.zip stroke-2da71a8a85486a494343f1662d64fb5ae5a2a44e.tar.bz2 |
Initial import
Diffstat (limited to 'src/com/isode/stroke/network/DomainNameServiceQuery.java')
-rw-r--r-- | src/com/isode/stroke/network/DomainNameServiceQuery.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/com/isode/stroke/network/DomainNameServiceQuery.java b/src/com/isode/stroke/network/DomainNameServiceQuery.java new file mode 100644 index 0000000..ddb94a8 --- /dev/null +++ b/src/com/isode/stroke/network/DomainNameServiceQuery.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010, Isode Limited, London, England. + * All rights reserved. + */ +/* + * Copyright (c) 2010, Remko Tron¨on. + * All rights reserved. + */ +package com.isode.stroke.network; + +import com.isode.stroke.signals.Signal1; +import java.util.Collection; + +public abstract class DomainNameServiceQuery { + + public class Result { + + public Result() { + hostname = ""; + port = -1; + priority = -1; + weight = -1; + } + + public Result(String hostname, int port, int priority, int weight) { + this.hostname = hostname; + this.port = port; + this.priority = priority; + this.weight = weight; + } + public final String hostname; + public final int port; + public final int priority; + public final int weight; + }; + + public class ResultPriorityComparator { + + public boolean compare(DomainNameServiceQuery.Result a, DomainNameServiceQuery.Result b) { + return a.priority < b.priority; + } + }; + + public abstract void run(); + public final Signal1<Collection<Result>> onResult = new Signal1<Collection<Result>>(); +} |