001package votorola.a.trust; // Copyright 2008, 2010-2011, Michael Allan.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE.
002
003import votorola.a.voter.*;
004import votorola.g.lang.*;
005
006
007/** A node representing a single registrant in a network trace.
008  */
009public interface TraceNode extends java.io.Serializable // serializeable for votorola.a.web.wic.VSession
010{
011
012
013   // - T r a c e - N o d e --------------------------------------------------------------
014
015
016    /** The registrant's local area of residence, or null if unspecified.  This is used
017      * only for multi-area streetwikis.
018      *
019      *     @see <a href='http://reluk.ca/w/Property:Area'
020      *                                     >Property:Area</a>
021      */
022    public String getArea();
023
024
025
026    /** The registrant's country of residence in <a
027      * href='http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2'>ISO_3166-1 alpha-2</a>
028      * form, or null if unspecified.
029      *
030      *     @see <a href='http://reluk.ca/w/Property:Country_code'
031      *                                     >Property:Country_code</a>
032      */
033    public String getCountryCode();
034
035
036
037    /** The normalized, geo-locatable address string for the registrant's primary
038      * residential address.
039      *
040      *     @return geohandle, or null if unknown.
041      *
042      *     @see <a href='http://reluk.ca/w/Property:Geohandle'
043      *                                     >Property:Geohandle</a>
044      */
045    public String getGeohandle();
046
047
048
049    /** Other registration properties. These are formatted as an XML element named
050      * 'other', which may have any content.  The content is set by intermediation of the
051      * local administrator's <code>votrace.js</code> script.
052      *
053      *     @return XML element named 'other'; or null, if there are no other properties
054      *
055      *     @see <a href='http://reluk.ca/project/votorola/s/_/example/full/home/vdev/votorola/trust/votrace.js'
056      *      >Working example of <code>votrace.js</code></a>
057      */
058    public String getOtherProperties(); // untested on the reference server
059
060
061
062    /** The number of primary trust edges extending to this node.
063      */
064    public int primaryTrustEdgeCount();
065
066
067
068    /** The registrant.
069      */
070    public IDPair registrant();
071
072
073
074    /** Calculates the trust level of this node.  The trust level is the highest level (T)
075      * among all immediate trust sources, such that the count of sources at that level or
076      * higher (nT) is at least equal to T (nT >= T).  For example, to have a trust level
077      * of 3, this node must have 3 or more immediate trust sources, each itself at level
078      * 3 or higher.
079      */
080    public int trustLevel();
081
082
083
084}