@Override public String getName() { return parent.getName(); }
@Override public String getName() { return parent.getName(); }
@Override public String getObject() { return _associatedObject.getName(); }
public String getName() { return _existing.getName(); }
protected DuplicateNameException(final ConfiguredObject<?> existing) { this("Child of type " + existing.getClass().getSimpleName() + " already exists with name of " + existing.getName(), existing); }
@Override public Thread newThread(final Runnable r) { final Thread thread = Executors.defaultThreadFactory().newThread(r); thread.setName(parent.getName() + "-store-"+_count.incrementAndGet()); return thread; } });
/** * Get the name of the virtual host against which the report is being run. * * @return the name of the virtual host */ public final String getVirtualHostName() { return _queue.getParent().getName(); }
private Object extractConfiguredObjectValue(final ConfiguredObject<?> object, final Object attrVal) { final Object value; if(!(attrVal instanceof String) || object.getId().toString().equals(attrVal)) { value = object.getName(); } else { value = attrVal; } return value; }
private <C extends ConfiguredObject> void unregisterChild(final C child) { Class categoryClass = child.getCategoryClass(); synchronized(_children) { _children.get(categoryClass).remove(child); _childrenById.get(categoryClass).remove(child.getId(), child); _childrenByName.get(categoryClass).remove(child.getName(), child); } }
public List<String> getPathAsList(final ConfiguredObject<?> object) { final List<Class<? extends ConfiguredObject>> hierarchy = _hierarchies.get(object.getCategoryClass()); List<String> pathElements = new ArrayList<>(); for (Class<? extends ConfiguredObject> ancestorClass : hierarchy) { pathElements.add(_model.getAncestor(ancestorClass, object).getName()); } return pathElements; }
public OperationLogMessage(ConfiguredObject<?> object, String operation) { _hierarchy = AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX + "." + object.getCategoryClass().getSimpleName().toLowerCase() + ".operation"; _logMessage = object.getCategoryClass().getSimpleName() + "("+object.getName()+") : Operation " + operation; }
@Override public <Y extends ConfiguredObject<Y>> Y findConfiguredObject(Class<Y> clazz, String name) { Collection<Y> reachable = getModel().getReachableObjects(this, clazz); for(Y candidate : reachable) { if(candidate.getName().equals(name)) { return candidate; } } return null; }
private <C extends ConfiguredObject> void registerChild(final C child) { synchronized(_children) { Class categoryClass = child.getCategoryClass(); UUID childId = child.getId(); String name = child.getName(); ConfiguredObject<?> existingWithSameId = _childrenById.get(categoryClass).get(childId); if(existingWithSameId != null) { throw new DuplicateIdException(existingWithSameId); } ConfiguredObject<?> existingWithSameName = _childrenByName.get(categoryClass).putIfAbsent(name, child); if (existingWithSameName != null) { throw new DuplicateNameException(existingWithSameName); } _childrenByName.get(categoryClass).put(name, child); _children.get(categoryClass).add(child); _childrenById.get(categoryClass).put(childId,child); } }
@Override protected void doOpen(final ConfiguredObject<?> parent) { _parent = parent; _connectionURL = DerbyUtils.createConnectionUrl(parent.getName(), ((FileBasedSettings)_parent).getStorePath()); }
@Override protected void validateChange(final ConfiguredObject<?> proxyForValidation, final Set<String> changedAttributes) { super.validateChange(proxyForValidation, changedAttributes); if(changedAttributes.contains(NAME)) { String newName = proxyForValidation.getName(); if(!getName().equals(newName)) { throw new IllegalConfigurationException("Changing the name of jmx management plugin is not allowed"); } } }
@Override protected void validateChildDelete(final ConfiguredObject<?> child) { super.validateChildDelete(child); if(child instanceof AccessControlProvider && getChildren(AccessControlProvider.class).size() == 1) { String categoryName = child.getCategoryClass().getSimpleName(); throw new IllegalConfigurationException("The " + categoryName + " named '" + child.getName() + "' cannot be deleted as at least one " + categoryName + " must be present"); } }
public GenericPrincipal(final QpidPrincipal principal) { _name = principal.getName(); ConfiguredObject<?> origin = principal.getOrigin(); if (origin != null) { _originType = origin.getType(); _originName = origin.getName(); } else { _originType = "UNKNOWN"; _originName = ""; } }
@Override public void init(ConfiguredObject<?> parent) throws StoreException { changeState(CLOSED, CONFIGURED); { _parent = parent; DerbyUtils.loadDerbyDriver(); _connectionURL = DerbyUtils.createConnectionUrl(parent.getName(), ((FileBasedSettings)_parent).getStorePath()); createOrOpenConfigurationStoreDatabase(); } }
@Override public void init(ConfiguredObject<?> parent) { assertState(State.CLOSED); _parent = parent; _classNameMapping = generateClassNameMap(_parent.getModel(), _rootClass); FileBasedSettings fileBasedSettings = (FileBasedSettings) _parent; setup(parent.getName(), fileBasedSettings.getStorePath(), parent.getContextValue(String.class, SystemConfig.POSIX_FILE_PERMISSIONS), Collections.emptyMap()); changeState(State.CLOSED, State.CONFIGURED); }