@Override public final void convertResourceAttribute(PathAddress address, String name, ModelNode value, TransformationContext context) { this.converter.convert(address, name, value, context.readResource(PathAddress.EMPTY_ADDRESS).getModel(), context); } }
@Override public boolean rejectResourceAttribute(PathAddress address, String name, ModelNode value, TransformationContext context) { return this.rejecter.reject(address, name, value, context.readResource(PathAddress.EMPTY_ADDRESS).getModel(), context); }
/** * @return contextual discard policy if any resource attributes are undefined and has no children; {@link DiscardPolicy#SILENT} otherwise. */ @Override public DiscardPolicy checkResource(TransformationContext context, PathAddress address) { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); ImmutableManagementResourceRegistration registration = context.getResourceRegistration(PathAddress.EMPTY_ADDRESS); ModelNode model = resource.getModel(); if (model.isDefined()) { for (String attribute : registration.getAttributeNames(PathAddress.EMPTY_ADDRESS)) { if (model.hasDefined(attribute)) { return this.policy; } } } for (PathElement path : registration.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { if (path.isWildcard() ? resource.hasChildren(path.getKey()) : resource.hasChild(path)) { return this.policy; } } return DiscardPolicy.SILENT; } }
@Override public Resource readResource(PathAddress address) { Resource resource = delegate.readResource(address); if (resource != null) { return immutable ? new ProtectedModelResource(resource) : resource; } return null; }
@Override public Resource readResource(PathAddress address) { Resource resource = delegate.readResource(address); if (resource != null) { return immutable ? new ProtectedModelResource<Resource>(resource) : resource; } return null; }
@Override public Resource readResource(PathAddress address) { Resource resource = delegate.readResource(address); if (resource != null) { return immutable ? new ProtectedModelResource<Resource>(resource) : resource; } return null; }
@Override public Resource readResource(PathAddress address) { Resource resource = delegate.readResource(address); if (resource != null) { return immutable ? new ProtectedModelResource<Resource>(resource) : resource; } return null; }
@Override public boolean rejectResourceAttribute(PathAddress address, String name, ModelNode value, TransformationContext context) { return this.rejecter.reject(address, name, value, context.readResource(PathAddress.EMPTY_ADDRESS).getModel(), context); }
@Override public final void convertResourceAttribute(PathAddress address, String name, ModelNode value, TransformationContext context) { this.converter.convert(address, name, value, context.readResource(PathAddress.EMPTY_ADDRESS).getModel(), context); } }
@Override public boolean isResourceAttributeDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return discard(attributeValue, context.readResource(PathAddress.EMPTY_ADDRESS).getModel()); }
@Override public boolean isResourceAttributeDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return discard(attributeValue, context.readResource(PathAddress.EMPTY_ADDRESS).getModel()); }
return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel()); return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel());
return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel()); return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel());
return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel()); return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel());
return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel()); return isDiscardAllowed(context.readResource(PathAddress.EMPTY_ADDRESS).getModel());
/** * @return contextual discard policy if any resource attributes are undefined and has no children; {@link DiscardPolicy#SILENT} otherwise. */ @Override public DiscardPolicy checkResource(TransformationContext context, PathAddress address) { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); ImmutableManagementResourceRegistration registration = context.getResourceRegistration(PathAddress.EMPTY_ADDRESS); ModelNode model = resource.getModel(); if (model.isDefined()) { for (String attribute : registration.getAttributeNames(PathAddress.EMPTY_ADDRESS)) { if (model.hasDefined(attribute)) { return this.policy; } } } for (PathElement path : registration.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { if (path.isWildcard() ? resource.hasChildren(path.getKey()) : resource.hasChild(path)) { return this.policy; } } return DiscardPolicy.SILENT; } }