private static boolean equalNodes(Object a, Object b) { if (a instanceof Node && b instanceof Node) { Node l = (Node) a; Node r = (Node) b; return l.componentId.equals(r.componentId); } else { return a.equals(b); } }
/** Initializes this. Always called from a constructor or the framework. Do not call. */ public final void initId(ComponentId id) { if (this.id != null && !this.id.equals(id)) throw new RuntimeException("Can't change component id: " + this.id + " -> " + id); if (id==null) throw new NullPointerException("A component cannot be created with a null id"); this.id=id; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Chain<?> chain = (Chain<?>) o; if (!componentList.equals(chain.componentList)) return false; if (!id.equals(chain.id)) return false; return true; }
private boolean validMember(Source leader) { return leader.getComponentId().equals(id); }
/** * Returns the next call to this processor id, or null if no such calls are * left */ public Call findCall(final ComponentId processorId) { for (final Iterator<Call> i = iterator(); i.hasNext();) { final Call call = i.next(); if (call.getDocumentProcessorId().equals(processorId)) { return call; } } return null; }
/** Two types are equal if they have the same id */ @Override public boolean equals(Object o) { if (o == this) return true; if ( ! (o instanceof QueryProfileType)) return false; QueryProfileType other = (QueryProfileType)o; return other.getId().equals(this.getId()); }
@Override public boolean equals(Object other) { if (other instanceof Node) { Node that = (Node) other; return getClass().equals(that.getClass()) && this.componentId.equals(that.componentId) && this.instanceType().equals(that.instanceType()) && equalEdges(this.usedComponents(), that.usedComponents()); } else { return false; } }
private boolean namespaceMatch(ComponentId otherNamespace) { if (getNamespace() == otherNamespace) { return true; } else if (getNamespace() == null || otherNamespace == null){ return false; } else { return getNamespace().equals(otherNamespace); } }
public boolean hasChain(ComponentId filterChain) { for (Chain<Filter> chain : allChains().allComponents()) { if (chain.getId().equals(filterChain)) return true; } return false; }
public boolean hasChainThatInherits(ComponentId filterChain) { for (Chain<Filter> chain : allChains().allComponents()) { for (ComponentSpecification spec : chain.getChainSpecification().inheritance.chainSpecifications) { if(spec.toId().equals(filterChain)) return true; } } return false; }
private void configureLegacyFilters(ComponentId id, ComponentRegistry<SecurityRequestFilter> legacyRequestFilters) { ComponentId serverName = id.getNamespace(); if (SEARCH_SERVER_COMPONENT_ID.equals(serverName) && !legacyRequestFilters.allComponents().isEmpty()) { requestFilters.bind("http://*/*", SecurityRequestFilterChain.newInstance(legacyRequestFilters.allComponents())); } }
public void register(ComponentId globalComponentId, ChainedComponentModel componentModel) { assert (componentModel.getComponentId().withoutNamespace().equals( globalComponentId.withoutNamespace())); componentModels.register(globalComponentId, ComponentAdaptor.create(globalComponentId, componentModel)); }
private Object initId(Object component) { if (component instanceof AbstractComponent) { AbstractComponent abstractComponent = (AbstractComponent) component; if (abstractComponent.hasInitializedId() && !abstractComponent.getId().equals(componentId())) { throw new IllegalStateException( "Component with id '" + componentId() + "' is trying to set its component id explicitly: '" + abstractComponent.getId() + "'. " + "This is not allowed, so please remove any call to super() in your component's constructor."); } abstractComponent.initId(componentId()); } return component; }
@Override public boolean equals(Object other) { if (other instanceof ComponentRegistryNode) { ComponentRegistryNode that = (ComponentRegistryNode) other; return this.componentId().equals(that.componentId()) && this.instanceType().equals(that.instanceType()) && equalNodeEdges(this.usedComponents(), that.usedComponents()); } else { return false; } }
public void add(Source source) { assert source.getComponentId().equals(getComponentId()): "Ids differ: " + source.getComponentId() + " -- " + getComponentId(); if (Source.GroupOption.leader == source.groupOption) { setLeader(source); } else { addParticipant(source); } }