Methods Summary |
---|
protected java.lang.Object | clone()
try {
Registry lhs = (Registry) super.clone();
lhs.roots = (TreeMap) this.roots.clone();
lhs.entries = (HashMap) this.entries.clone();
return lhs;
}
catch (CloneNotSupportedException cne){
return null;
}
|
public boolean | containsDomain(DomainEntry de)
return entries.values().contains(de);
|
private boolean | containsRoot(java.io.File root)
return roots.containsValue(root);
|
private void | delete(java.lang.String name)
roots.remove(name);
entries.remove(name);
|
public DomainEntry | getDomain(java.lang.String name)
return (DomainEntry) entries.get(name);
|
public boolean | isRegistered(java.lang.String name)
return roots.containsKey(name);
|
public java.util.Iterator | iterator()
return new RegistryIterator(this);
|
public void | registerDomain(DomainEntry de)
if (isRegistered(de.getName())) {
throw new AlreadyRegisteredException(de.getName());
}
if (containsRoot(de.getRoot())){
throw new InvalidRootException("The root \""+de.getRoot()+"\" is already registered");
}
roots.put(de.getName(), de.getRoot());
entries.put(de.getName(), de);
|
public void | reregisterDomain(DomainEntry de)
if (isRegistered(de.getName())) {
if (!roots.get(de.getName()).equals(de.getRoot())){
throw new InvalidRootException("The given root ("+de.getRoot()+") of domain "+de.getName()+" doesn't match the already registered root for this domain");
}
} else {
if (containsRoot(de.getRoot())){
throw new InvalidRootException("The given root ("+de.getRoot()+") of domain "+de.getName()+" is already registered with a different domain");
}
};
entries.put(de.getName(), de);
|
public int | size()
return roots.size();
|
public void | unregisterDomain(java.lang.String domain_name)
if (!isRegistered(domain_name)){
throw new UnregisteredDomainException(domain_name);
}
delete(domain_name);
|
public void | unregisterDomain(DomainEntry de)
unregisterDomain(de.getName());
|