@Override public LifecycleComponentType getComponentType() { return delegate.getComponentType(); }
@Override public LifecycleComponentType getComponentType() { return getDelegate().getComponentType(); }
/** * Recursive matching of nested components to find those of the given type. * * @param current * @param matches * @param type * @throws SiteWhereException */ public void findComponentsOfType(ILifecycleComponent current, List<ILifecycleComponent> matches, LifecycleComponentType type) throws SiteWhereException { if (current.getComponentType() == type) { matches.add(current); } for (ILifecycleComponent child : current.getLifecycleComponents().values()) { findComponentsOfType(child, matches, type); } }
/** * Recursive matching of nested components to find those of the given type. * * @param current * @param matches * @param type * @throws SiteWhereException */ public void findComponentsOfType(ILifecycleComponent current, List<ILifecycleComponent> matches, LifecycleComponentType type) throws SiteWhereException { if (current.getComponentType() == type) { matches.add(current); } for (ILifecycleComponent child : current.getLifecycleComponents().values()) { findComponentsOfType(child, matches, type); } }
/** * Recursive call to capture hierarchy of components. * * @param parent * @param results */ protected void getComponentHierarchyState(ILifecycleComponent parent, List<ITenantEngineComponent> results) { Map<String, ILifecycleComponent> children = parent.getLifecycleComponents(); for (ILifecycleComponent child : children.values()) { TenantEngineComponent component = new TenantEngineComponent(); component.setId(child.getComponentId()); component.setName(child.getComponentName()); component.setStatus(child.getLifecycleStatus()); component.setType(child.getComponentType()); component.setParentId(parent.getComponentId()); results.add(component); getComponentHierarchyState(child, results); } }