/** * Provides descriptors for current repository implementations. Can be overridden * by the subclasses to add more values to the descriptor * @return repository descriptor */ protected GenericDescriptors determineDescriptors() { return new JcrDescriptorsImpl(contentRepository.getDescriptors(), new SimpleValueFactory()); }
@Override public Value getValue(String key) { if (!OAK_DISCOVERYLITE_CLUSTERVIEW.equals(key)) { return null; } return factory.createValue(getClusterViewAsDescriptorValue()); }
new SimpleValueFactory().createValue( ClusterRepositoryInfo.getOrCreateId(nodeStore)), true, false); whiteboard.register(Descriptors.class, clusterIdDesc, Collections.emptyMap());
new SimpleValueFactory().createValue( ClusterRepositoryInfo.getOrCreateId(nodeStore)), true, false); whiteboard.register(Descriptors.class, clusterIdDesc, Collections.emptyMap());
/** * Provides descriptors for current repository implementations. Can be overridden * by the subclasses to add more values to the descriptor * @return repository descriptor */ protected GenericDescriptors determineDescriptors() { return new JcrDescriptorsImpl(contentRepository.getDescriptors(), new SimpleValueFactory()); }
clusterIdDesc.put( ClusterRepositoryInfo.OAK_CLUSTERID_REPOSITORY_DESCRIPTOR_KEY, new SimpleValueFactory().createValue(getOrCreateId(segmentNodeStore)), true, false
@Override public Value getValue(String key) { if (!OAK_DISCOVERYLITE_CLUSTERVIEW.equals(key)) { return null; } return factory.createValue(getClusterViewAsDescriptorValue()); }
/** * Provides descriptors for current repository implementations. Can be overridden * by the subclasses to add more values to the descriptor * @return repository descriptor */ protected GenericDescriptors determineDescriptors() { return new JcrDescriptorsImpl(contentRepository.getDescriptors(), new SimpleValueFactory()); }
@Override public Value getValue(@NotNull String key) { if (!OAK_DISCOVERYLITE_CLUSTERVIEW.equals(key)) { return null; } return factory.createValue(getClusterViewAsDescriptorValue()); }
@Test public void testInitialDescriptors() throws Exception { final ValueFactory valueFactory = new SimpleValueFactory(); final MyTracker<Descriptors> tracker = createTracker(); final GenericDescriptors input = new GenericDescriptors(); input.put("a", valueFactory.createValue("b"), true, false); input.put("b", valueFactory.createValue("c"), true, true); tracker.addService(input); AggregatingDescriptors aggregator = new AggregatingDescriptors(tracker); assertMatches(aggregator, 2, input); }
@Test public void testLaterAddedDescriptors() throws Exception { final ValueFactory valueFactory = new SimpleValueFactory(); final MyTracker<Descriptors> tracker = createTracker(); AggregatingDescriptors aggregator = new AggregatingDescriptors(tracker); assertMatches(aggregator, 0); final GenericDescriptors input1 = new GenericDescriptors(); input1.put("a", valueFactory.createValue("b"), true, false); input1.put("b", valueFactory.createValue("c"), true, true); tracker.addService(input1); assertMatches(aggregator, 2, input1); final GenericDescriptors input2 = new GenericDescriptors(); input2.put("b", valueFactory.createValue("c2"), true, true); input2.put("c", valueFactory.createValue("d"), true, true); tracker.addService(input2); assertMatches(aggregator, 3, input2, input1); }
@SuppressWarnings("deprecation") @Nonnull protected GenericDescriptors createDescriptors() { final ValueFactory valueFactory = new SimpleValueFactory(); final Value trueValue = valueFactory.createValue(true); final Value falseValue = valueFactory.createValue(false);
@SuppressWarnings("deprecation") @NotNull protected GenericDescriptors createDescriptors() { final ValueFactory valueFactory = new SimpleValueFactory(); final Value trueValue = valueFactory.createValue(true); final Value falseValue = valueFactory.createValue(false);
@SuppressWarnings("deprecation") @NotNull protected GenericDescriptors createDescriptors() { final ValueFactory valueFactory = new SimpleValueFactory(); final Value trueValue = valueFactory.createValue(true); final Value falseValue = valueFactory.createValue(false);