|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.HostUtils
public final class HostUtils
Some simple common host-name utilities.
| Constructor Summary | |
|---|---|
private |
HostUtils()
Prevent construction of an instance. |
| Method Summary | |
|---|---|
static GeoUtils.CCTLD |
getMirrorCC(java.lang.String name)
Extract country code from mirror URL/prefix; null if none. |
static java.lang.String |
getMirrorTag(java.lang.String name)
Extract mirror tag from mirror URL/prefix; null if none. |
static boolean |
isMasterName(java.lang.String name)
Returns true if this looks like a "master" server domain-name. |
static boolean |
isMirrorName(java.lang.String name)
Returns true if this looks like a mirror domain-name. |
static boolean |
isPrimaryMirrorName(java.lang.String name)
Returns true if this appears to be the domain-name of a primary local mirror. |
static boolean |
isPrimaryMirrorTag(java.lang.String tag)
Returns true if this tag (initial domain-name component) appears to for a primary local mirror. |
static boolean |
isSpecialName(java.lang.String name)
Returns true if this looks like a special (mirror or master) domain-name. |
static java.lang.String |
makeMirrorNameGeneric(java.lang.String tag)
Make mirror version of standard "generic" domain-name; never null. |
static java.lang.String |
normaliseVirtualHostName(java.lang.String name)
Normalise host (Web server) name (ours or a third-party one). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private HostUtils()
| Method Detail |
|---|
public static java.lang.String normaliseVirtualHostName(java.lang.String name)
If the name is already normalised, it is returned unchanged.
java.lang.IllegalArgumentException - if arguments are malformedpublic static boolean isMirrorName(java.lang.String name)
name - host name, must be lower-case and non-nullpublic static boolean isPrimaryMirrorName(java.lang.String name)
(Thus 'mirror-uk-ww11.something' would also be primary, but we don't care yet.)
This returns true for the full domain name iff isPrimaryMirrorTag() would return true for the embedded mirror tag.
name - host name, must be lower-case and non-nullpublic static boolean isPrimaryMirrorTag(java.lang.String tag)
(Thus 'mirror-uk-ww11' would also be primary, but we don't care yet.)
This returns true for the tag iff isPrimaryMirrorName() would return true for the whole name, though a null tag will cause this routine to return false for simplicity.
mirror - tag, must be lower-casepublic static java.lang.String getMirrorTag(java.lang.String name)
public static GeoUtils.CCTLD getMirrorCC(java.lang.String name)
public static boolean isMasterName(java.lang.String name)
name - host name, must be lower-case and non-nullpublic static boolean isSpecialName(java.lang.String name)
name - host name, must be lower-case and non-nullpublic static java.lang.String makeMirrorNameGeneric(java.lang.String tag)
tag - valid non-null mirror tag
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||