@Override public IgnoredDomainResourceRoot clone() { IgnoredDomainResourceRoot clone = new IgnoredDomainResourceRoot(ignoredRegistry); synchronized (children) { for (IgnoreDomainResourceTypeResource child : children.values()) { IgnoreDomainResourceTypeResource childClone = child.clone(); clone.registerChildInternal(childClone); } } return clone; }
@Override public boolean hasChildren(String childType) { boolean result = !isMaster() && IGNORED_RESOURCE_TYPE.equals(childType); if (result) { synchronized (children) { result = children.size() > 0; } } return result; }
void publish() { parent.publish(); }
@Override public Resource getChild(PathElement element) { Resource result = null; if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(element.getKey())) { result = getChildInternal(element.getValue()); } return result; }
@Override public void registerChild(PathElement address, Resource resource) { if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(address.getKey())) { synchronized (children) { if (children.containsKey(address.getValue())) { throw ControllerLogger.ROOT_LOGGER.duplicateResource(address.getValue()); } registerChildInternal(IgnoreDomainResourceTypeResource.class.cast(resource)); } } else { throw new IllegalArgumentException(); } }
@Override public Resource requireChild(PathElement address) { final Resource resource = getChild(address); if(resource == null) { throw new NoSuchResourceException(address); } return resource; }
public Resource.ResourceEntry getRootResource() { IgnoredDomainResourceRoot root = new IgnoredDomainResourceRoot(this); this.rootResource = root; return root; }
/** * Returns whether this host should ignore operations from the master domain controller that target * the given address. * * @param address the resource address. Cannot be {@code null} * * @return {@code true} if the operation should be ignored; {@code false} otherwise */ public boolean isResourceExcluded(final PathAddress address) { boolean result = false; if (!localHostControllerInfo.isMasterDomainController() && address.size() > 0) { IgnoredDomainResourceRoot root = this.rootResource; PathElement firstElement = address.getElement(0); IgnoreDomainResourceTypeResource typeResource = root == null ? null : root.getChildInternal(firstElement.getKey()); if (typeResource != null) { result = typeResource.hasName(firstElement.getValue()); } } return result; }
@Override public Resource getChild(PathElement element) { Resource result = null; if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(element.getKey())) { result = getChildInternal(element.getValue()); } return result; }
@Override public void registerChild(PathElement address, Resource resource) { if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(address.getKey())) { synchronized (children) { if (children.containsKey(address.getValue())) { throw MESSAGES.duplicateResource(address.getValue()); } registerChildInternal(IgnoreDomainResourceTypeResource.class.cast(resource)); } } else { throw new IllegalArgumentException(); } }
@Override public Resource requireChild(PathElement address) { final Resource resource = getChild(address); if(resource == null) { throw new NoSuchResourceException(address); } return resource; }
public Resource.ResourceEntry getRootResource() { IgnoredDomainResourceRoot root = new IgnoredDomainResourceRoot(this); this.rootResource = root; return root; }
/** * Returns whether this host should ignore operations from the master domain controller that target * the given address. * * @param address the resource address. Cannot be {@code null} * * @return {@code true} if the operation should be ignored; {@code false} otherwise */ public boolean isResourceExcluded(final PathAddress address) { if (!localHostControllerInfo.isMasterDomainController() && address.size() > 0) { IgnoredDomainResourceRoot root = this.rootResource; PathElement firstElement = address.getElement(0); IgnoreDomainResourceTypeResource typeResource = root == null ? null : root.getChildInternal(firstElement.getKey()); if (typeResource != null) { if (typeResource.hasName(firstElement.getValue())) { return true; } } } return false; }
@Override public Resource getChild(PathElement element) { Resource result = null; if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(element.getKey())) { result = getChildInternal(element.getValue()); } return result; }
@Override public boolean hasChildren(String childType) { boolean result = !isMaster() && IGNORED_RESOURCE_TYPE.equals(childType); if (result) { synchronized (children) { result = children.size() > 0; } } return result; }
@Override public IgnoredDomainResourceRoot clone() { IgnoredDomainResourceRoot clone = new IgnoredDomainResourceRoot(ignoredRegistry); synchronized (children) { for (IgnoreDomainResourceTypeResource child : children.values()) { IgnoreDomainResourceTypeResource childClone = child.clone(); clone.registerChildInternal(childClone); } } return clone; }
@Override public void registerChild(PathElement address, Resource resource) { if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(address.getKey())) { synchronized (children) { if (children.containsKey(address.getValue())) { throw ControllerLogger.ROOT_LOGGER.duplicateResource(address.getValue()); } registerChildInternal(IgnoreDomainResourceTypeResource.class.cast(resource)); } } else { throw new IllegalArgumentException(); } }
@Override public Resource requireChild(PathElement address) { final Resource resource = getChild(address); if(resource == null) { throw new NoSuchResourceException(address); } return resource; }
public Resource.ResourceEntry getRootResource() { IgnoredDomainResourceRoot root = new IgnoredDomainResourceRoot(this); this.rootResource = root; return root; }
void publish() { parent.publish(); }