@Override public Value[] getDescriptorValues(String key) { return delegate.getDescriptorValues(key); }
public Value[] getDescriptorValues(String key) { return wrapped.getDescriptorValues(key); }
@Override public Value[] getDescriptorValues( String key ) { return repository.getDescriptorValues(key); }
public Value[] getDescriptorValues(String key) { return delegatee.getDescriptorValues(key); }
@Override public Value[] getDescriptorValues(final String key) { return this.delegate.getDescriptorValues(key); }
public Value[] getDescriptorValues(String key) { return repository.getDescriptorValues(key); }
public Value[] getDescriptorValues(String key) { return repository.getDescriptorValues(key); }
@Override public Value[] getDescriptorValues(String key) { Repository repo = getRepository(); if (repo != null) { return repo.getDescriptorValues(key); } logger.error("getDescriptorValues: Repository not available"); return null; }
public Value[] getDescriptorValues(String key) { Repository curRepository = getCurrentThreadRepository(); if (curRepository != null) { return curRepository.getDescriptorValues(key); } return null; }
public Value[] getDescriptorValues(String key) { try { return getRepository().getDescriptorValues(key); } catch (RepositoryException e) { log.error("RepositoryException: ",e); } return null; }
/** * Returns the values of the descriptor with the given key from the proxied * repository. Returns <code>null</code> if the descriptor does not exist * or if the proxied repository can not be accessed. * * @param key descriptor key * @return descriptor values, or <code>null</code> */ public Value[] getDescriptorValues(String key) { try { return getRepository().getDescriptorValues(key); } catch (RepositoryException e) { return null; } }
/** * Returns the values of the descriptor with the given key from the proxied * repository. Returns <code>null</code> if the descriptor does not exist * or if the proxied repository can not be accessed. * * @param key descriptor key * @return descriptor values, or <code>null</code> */ public Value[] getDescriptorValues(String key) { try { return getRepository().getDescriptorValues(key); } catch (RepositoryException e) { return null; } }
/** * Returns the values of the descriptor with the given key from the proxied * repository. Returns <code>null</code> if the descriptor does not exist * or if the proxied repository can not be accessed. * * @param key descriptor key * @return descriptor values, or <code>null</code> */ public Value[] getDescriptorValues(String key) { try { return getRepository().getDescriptorValues(key); } catch (RepositoryException e) { return null; } }
/** * Returns the values of the descriptor with the given key from the proxied * repository. Returns <code>null</code> if the descriptor does not exist * or if the proxied repository can not be accessed. * * @param key descriptor key * @return descriptor values, or <code>null</code> */ public Value[] getDescriptorValues(String key) { try { return factory.getRepository().getDescriptorValues(key); } catch (RepositoryException e) { return null; } }
public Value[] getDescriptorValues(String key) { if (jcrDelegateeRepository != null) { return jcrDelegateeRepository.getDescriptorValues(key); } if (hippoRepository != null) { ClassLoader currentClassloader = switchToRepositoryClassloader(); try { return hippoRepository.getRepository().getDescriptorValues(key); } finally { if (currentClassloader != null) { Thread.currentThread().setContextClassLoader(currentClassloader); } } } return null; }
/** {@inheritDoc} */ public Value[] getDescriptorValues(String key) throws RemoteException { try { return SerialValueFactory.makeSerialValueArray(repository.getDescriptorValues(key)); } catch (RepositoryException ex) { throw new RemoteException(ex.getMessage(), ex); } }
/** * {@inheritDoc} */ public Map<String, QValue[]> getRepositoryDescriptors() throws RepositoryException { Map<String, QValue[]> descriptors = new HashMap<String, QValue[]>(); for (String key : repository.getDescriptorKeys()) { if (key.equals(Repository.OPTION_TRANSACTIONS_SUPPORTED)) { descriptors.put(key, new QValue[] {qValueFactory.create(false)}); } else { Value[] vs = repository.getDescriptorValues(key); QValue[] qvs = new QValue[vs.length]; for (int i = 0; i < vs.length; i++) { // Name and path resolver that uses a dummy namespace resolver // as Name/Path values are not expected to occur in the // descriptors. TODO: check again. NamePathResolver resolver = new DefaultNamePathResolver(new NamespaceResolver() { public String getURI(String prefix) { return prefix; } public String getPrefix(String uri) { return uri; } }); qvs[i] = ValueFormat.getQValue(vs[i], resolver, qValueFactory); } descriptors.put(key, qvs); } } return descriptors; }
private void addRepository( HttpServletRequest request, RestRepositories repositories, String repositoryName ) { RestRepositories.Repository repository = repositories.addRepository(repositoryName, request); try { Repository jcrRepository = RepositoryManager.getRepository(repositoryName); repository.setActiveSessionsCount(((org.modeshape.jcr.api.Repository)jcrRepository).getActiveSessionsCount()); for (String metadataKey : jcrRepository.getDescriptorKeys()) { Value[] descriptorValues = jcrRepository.getDescriptorValues(metadataKey); if (descriptorValues != null) { List<String> values = new ArrayList<String>(descriptorValues.length); for (Value descriptorValue : descriptorValues) { values.add(descriptorValue.getString()); } repository.addMetadata(metadataKey, values); } } } catch (Exception e) { logger.error(e, e.getMessage()); } }
/** * Tests that the required repository descriptors are available. */ public void testRequiredDescriptors() { Repository rep = session.getRepository(); for (Iterator<String> it = requiredDescriptorKeys.iterator(); it.hasNext();) { String descName = it.next(); assertTrue(descName + " is a standard descriptor", rep.isStandardDescriptor(descName)); if (rep.isSingleValueDescriptor(descName)) { Value val = rep.getDescriptorValue(descName); assertNotNull("Required descriptor is missing: " + descName, val); } else { Value[] vals = rep.getDescriptorValues(descName); assertNotNull("Required descriptor is missing: " + descName, vals); } } }
/** * Tests whether {@link Repository#getDescriptorValues(String)} returns an * Value[] of size 1 for single valued descriptors. */ public void testGetDescriptorValues() { Repository rep = session.getRepository(); // "option.node.type.management.supported" denotes a single-valued BOOLEAN descriptor String descName = Repository.OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED; assertTrue(rep.isSingleValueDescriptor(descName)); Value[] vals = rep.getDescriptorValues(descName); assertNotNull("Required descriptor is missing: " + descName, vals); assertEquals(1, vals.length); assertEquals(PropertyType.BOOLEAN, vals[0].getType()); try { // getDescriptorValue(key).getString() is equivalent to getDescriptor(key) assertEquals(vals[0].getString(), rep.getDescriptor(descName)); } catch (RepositoryException e) { fail(e.getMessage()); } // "option.node.type.management.supported" denotes a single-valued BOOLEAN descriptor descName = Repository.QUERY_LANGUAGES; assertFalse(rep.isSingleValueDescriptor(descName)); Value val = rep.getDescriptorValue(descName); assertNull(descName + " is a multi-value descriptor, getDescriptorValue() should return null", val); } }