java.lang.Object
i2p.susi.dns.AddressBean
Bean representing an I2P address entry with hostname and destination. Provides methods for handling I2P addresses and their properties.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]The destination bytes, if the name has one.private static final charASCII dot separating name labels.private static final charIdeographic dot treated as a label separator too.private static final charFullwidth dot treated as a label separator too.private static final charHalfwidth ideographic dot treated as a label separator too.(package private) static final booleanAvailable as of Java 6.private final StringThe name being resolved.private PropertiesProperties stored with the destination, if any.Constructor Summary
ConstructorsConstructorDescriptionAddressBean(String name, byte[] destination) Constructs an AddressBean with hostname and destination as byte array.AddressBean(String name, String destination) Constructs an AddressBean with hostname and base64 encoded destination.AddressBean(String name, Destination destination) Constructs an AddressBean with hostname and destination object.Method Summary
Modifier and TypeMethodDescriptionprivate static StringTranslate a string.private static StringTranslate a string with one parameter.private static StringTranslate a string with two parameters.getAdded()Gets the date when this address was added.getB32()Gets the base32 hash address for this destination.getB64()Gets the base64 hash of the destination.getCert()Do this the easy way.private StringParse a date property from the bean map.Gets the destination as base64 encoded string.The Unicode name, translated from Punycode.Do this the easy way.Gets the date when this address was last modified.getName()The ASCII (Punycode) name.getNotes()Gets the notes for this address entry, HTML escaped.(package private) StringGets a property value for this address entry.Do this the easy way.Gets the source URL or name for this address entry.Gets the source URL with hostname as display text for this address entry.booleanisIDN()Is the ASCII name Punycode-encoded?booleanChecks if this address has been validated.voidSets the properties for this address entry.(package private) static StringRef: java.net.IDN and RFC 3490.static StringThe Unicode name, translated from Punycode.
Field Details
name
The name being resolved.dest
private final byte[] destThe destination bytes, if the name has one.props
Properties stored with the destination, if any.haveIDN
static final boolean haveIDNAvailable as of Java 6.DOT
DOT2
private static final char DOT2Ideographic dot treated as a label separator too.- See Also:
DOT3
private static final char DOT3Fullwidth dot treated as a label separator too.- See Also:
DOT4
private static final char DOT4Halfwidth ideographic dot treated as a label separator too.- See Also:
Constructor Details
AddressBean
AddressBean
Constructs an AddressBean with hostname and destination object.- Parameters:
name- the ASCII (Punycode) hostnamedestination- theDestinationbeing published
AddressBean
Constructs an AddressBean with hostname and destination as byte array.- Parameters:
name- the ASCII (Punycode) hostnamedestination- the 387-byte destination being published
Method Details
getDestination
Gets the destination as base64 encoded string.- Returns:
- the base64 encoded destination
getName
The ASCII (Punycode) name.- Returns:
- the name exactly as supplied, not Punycode-decoded
getDisplayName
The Unicode name, translated from Punycode.- Returns:
- the original string on error
toUnicode
isIDN
public boolean isIDN()Is the ASCII name Punycode-encoded?- Returns:
- true if the name is Punycode-encoded
toASCII
Ref: java.net.IDN and RFC 3490.- Parameters:
host- will be converted to lower case- Returns:
- name converted to lower case and punycoded if necessary
- Throws:
IllegalArgumentException- on various errors or if IDN is needed but not available
getB32
Gets the base32 hash address for this destination.- Returns:
- the base32 hash address
getB64
setProperties
Sets the properties for this address entry.- Parameters:
p- the properties to set
getSource
Gets the source URL or name for this address entry.- Returns:
- the source URL or name
getSourceHostname
Gets the source URL with hostname as display text for this address entry.- Returns:
- the source URL with hostname as display text
getAdded
getModded
Gets the date when this address was last modified.- Returns:
- the date when modified
isValidated
public boolean isValidated()Checks if this address has been validated.- Returns:
- true if validated
getNotes
Gets the notes for this address entry, HTML escaped.- Returns:
- the notes, HTML escaped
getCert
getSigType
getEncType
getProp
getDate
_t
_t
_t