/** * Resolve a resource transformer for a given address. * * @param address the address * @param placeholderResolver a placeholder resolver used to resolve children of a placeholder registration * @return the resource transformer */ public ResourceTransformerEntry resolveResourceTransformer(final PathAddress address, final PlaceholderResolver placeholderResolver) { return resolveResourceTransformer(address.iterator(), null, placeholderResolver); }
/** * Discard an operation. * * @param address the operation handler address * @param version the model version * @param operationName the operation name */ public void discardOperation(final PathAddress address, ModelVersion version, final String operationName) { registerTransformer(address.iterator(), version, operationName, OperationTransformerRegistry.DISCARD); }
/** * Discard an operation. * * @param address the operation handler address * @param version the model version * @param operationName the operation name */ public void discardOperation(final PathAddress address, ModelVersion version, final String operationName) { registerTransformer(address.iterator(), version, operationName, OperationTransformerRegistry.DISCARD); }
@Override public void registerNotificationHandler(PathAddress source, NotificationHandler handler, NotificationFilter filter) { NotificationHandlerEntry entry = new NotificationHandlerEntry(handler, filter); if (source == ANY_ADDRESS) { anyAddressEntries.add(entry); return; } ListIterator<PathElement> iterator = source.iterator(); rootRegistry.registerEntry(iterator, entry); }
protected void mergeSubtree(final OperationTransformerRegistry targetRegistry, final PathAddress address, final ModelVersion version) { final GlobalTransformerRegistry child = navigate(address.iterator()); if(child != null) { child.process(targetRegistry, address, version, Collections.<PathAddress, ModelVersion>emptyMap()); } }
@Override public void unregisterNotificationHandler(PathAddress source, NotificationHandler handler, NotificationFilter filter) { NotificationHandlerEntry entry = new NotificationHandlerEntry(handler, filter); if (source == ANY_ADDRESS) { anyAddressEntries.remove(entry); return; } ListIterator<PathElement> iterator = source.iterator(); rootRegistry.unregisterEntry(iterator, entry); }
@Override public void unregisterNotificationHandler(PathAddress source, NotificationHandler handler, NotificationFilter filter) { NotificationHandlerEntry entry = new NotificationHandlerEntry(handler, filter); if (source == ANY_ADDRESS) { anyAddressEntries.remove(entry); return; } ListIterator<PathElement> iterator = source.iterator(); rootRegistry.unregisterEntry(iterator, entry); }
protected void mergeSubtree(final OperationTransformerRegistry targetRegistry, final PathAddress address, final ModelVersion version) { final GlobalTransformerRegistry child = navigate(address.iterator()); if(child != null) { child.process(targetRegistry, address, version, Collections.<PathAddress, ModelVersion>emptyMap()); } }
public OperationTransformerRegistry mergeSubtree(final OperationTransformerRegistry parent, final PathAddress address, final Map<PathAddress, ModelVersion> subTree) { final OperationTransformerRegistry target = parent.createChildRegistry(address.iterator(), PathAddressTransformer.DEFAULT, RESOURCE_TRANSFORMER, OperationTransformerRegistry.FORWARD, false); mergeSubtree(target, subTree); return target; }
/** * Register an operation transformer. * * @param address the operation handler address * @param version the model version * @param operationName the operation name * @param transformer the operation transformer */ public void registerTransformer(final PathAddress address, final ModelVersion version, String operationName, OperationTransformer transformer) { registerTransformer(address.iterator(), version, operationName, new OperationTransformerRegistry.OperationTransformerEntry(transformer, false)); }
/** * Discard an operation. * * @param address the operation handler address * @param major the major version * @param minor the minor version * @param operationName the operation name */ public void discardOperation(final PathAddress address, int major, int minor, final String operationName) { registerTransformer(address.iterator(), ModelVersion.create(major, minor), operationName, OperationTransformerRegistry.DISCARD); }
/** * Discard an operation. * * @param address the operation handler address * @param major the major version * @param minor the minor version * @param operationName the operation name */ public void discardOperation(final PathAddress address, int major, int minor, final String operationName) { registerTransformer(address.iterator(), ModelVersion.create(major, minor), operationName, OperationTransformerRegistry.DISCARD); }
@Override public final Set<ProxyController> getProxyControllers(PathAddress address){ if (parent != null) { RootInvocation ri = getRootInvocation(); return ri.root.getProxyControllers(ri.pathAddress.append(address)); } // else we are the root Set<ProxyController> controllers = new HashSet<ProxyController>(); getProxyControllers(address.iterator(), controllers); return controllers; }
/** * Register an operation transformer. * * @param address the operation handler address * @param major the major version * @param minor the minor version * @param operationName the operation name * @param transformer the operation transformer */ public void registerTransformer(final PathAddress address, int major, int minor, String operationName, OperationTransformer transformer) { registerTransformer(address.iterator(), ModelVersion.create(major, minor), operationName, new OperationTransformerRegistry.OperationTransformerEntry(transformer, false)); }
/** * Register an operation transformer. * * @param address the operation handler address * @param major the major version * @param minor the minor version * @param operationName the operation name * @param transformer the operation transformer */ public void registerTransformer(final PathAddress address, int major, int minor, String operationName, OperationTransformer transformer) { registerTransformer(address.iterator(), ModelVersion.create(major, minor), operationName, new OperationTransformerRegistry.OperationTransformerEntry(transformer, false)); }
private void registerTransformer(final Iterator<PathElement> iterator, ModelVersion version, String operationName, OperationTransformerRegistry.OperationTransformerEntry entry) { if(! iterator.hasNext()) { // by default skip the default transformer getOrCreate(version, PathAddressTransformer.DEFAULT, null, null, false).registerTransformer(PathAddress.EMPTY_ADDRESS.iterator(), operationName, entry); } else { final PathElement element = iterator.next(); final SubRegistry subRegistry = getOrCreate(element.getKey()); subRegistry.registerTransformer(iterator, element.getValue(), version, operationName, entry); } }
protected void registerTransformer(final Iterator<PathElement> iterator, ModelVersion version, String operationName, OperationTransformerRegistry.OperationTransformerEntry entry) { if(! iterator.hasNext()) { // by default skip the default transformer getOrCreate(version, PathAddressTransformer.DEFAULT, null, null).registerTransformer(PathAddress.EMPTY_ADDRESS.iterator(), operationName, entry); } else { final PathElement element = iterator.next(); final SubRegistry subRegistry = getOrCreate(element.getKey()); subRegistry.registerTransformer(iterator, element.getValue(), version, operationName, entry); } }
final ManagementResourceRegistration getSubRegistration(PathAddress address) { if (parent != null) { RootInvocation ri = getRootInvocation(); return ri.root.getSubRegistration(ri.pathAddress.append(address)); } // else we are the root return getResourceRegistration(address.iterator()); }
final AbstractResourceRegistration getSubRegistration(PathAddress address) { if (parent != null) { RootInvocation ri = getRootInvocation(); return ri.root.getSubRegistration(ri.pathAddress.append(address)); } // else we are the root return getResourceRegistration(address.iterator()); }
/** {@inheritDoc} */ @Override public final OperationEntry getOperationEntry(final PathAddress pathAddress, final String operationName) { if (parent != null) { RootInvocation ri = getRootInvocation(); return ri.root.getOperationEntry(ri.pathAddress.append(pathAddress), operationName); } // else we are the root OperationEntry inheritable = getInheritableOperationEntry(operationName); return getOperationEntry(pathAddress.iterator(), operationName, inheritable); }