public Schema buildSchema(KObject kObject, Set<Message> messages) { return new Schema(kObject.getClusterId(), ORG_KIE, messages); }
public Schema buildSchema(KObject kObject, Set<Message> messages) { return new Schema(kObject.getClusterId(), ORG_KIE, messages); }
private static String generateUniqueIdentifierForKObject(final KObject kObject) { return kObject.getClusterId() + kObject.getKey(); }
private void deleteIfExists(KObject object) { if (this.exists(object.getClusterId(), object.getId())) { this.delete(object.getClusterId(), object.getId()); } }
private void deleteIfExists(KObject object) { if (this.exists(object.getClusterId(), object.getId())) { this.delete(object.getClusterId(), object.getId()); } }
private Schema buildSchema(KObject kObject) { return new Schema(kObject.getClusterId(), ORG_KIE, this.buildMessages(kObject)); }
private Schema buildSchema(KObject kObject) { return new Schema(kObject.getClusterId(), ORG_KIE, this.buildMessages(kObject)); }
@Override public void index(KObject kObject) { KCluster index = new KClusterImpl(kObject.getClusterId()); doOrDeferAction(index, new NewlyIndexedEvent(kObject)); }
@Override public void index(KObject kObject) { KCluster index = new KClusterImpl(kObject.getClusterId()); doOrDeferAction(index, new NewlyIndexedEvent(kObject)); }
@Override public void index(KObject kObject) { this.schemaStore.updateSchema(kObject); this.infinispanContext.getCache(kObject.getClusterId()).put(kObject.getId(), kObject); }
@Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof KObject)) { return false; } final KObject kobj = (KObject) obj; return getClusterId().equals(kobj.getClusterId()) && getId().equals(kobj.getId()) && getKey().equals(kobj.getKey()) && getType().getName().equals(kobj.getType().getName()); }
@Override public void index(KObject kObject) { this.schemaStore.updateSchema(kObject); this.infinispanContext.getCache(kObject.getClusterId()).put(kObject.getId(), kObject); }
public void updateMetaModel(KObject object, MetaObject metaObject) { List<MetaProperty> dirtyProperties = new ArrayList<>(); Optional<MappingMetaData> mappingOptional = this.indexProvider.getMapping(object.getClusterId(), object.getType().getName()); if (!mappingOptional.isPresent()) { this.indexProvider.putMapping(object.getClusterId(), object.getType().getName(), metaObject); } else { Map<String, Object> mapping = mappingOptional.get().getSourceAsMap(); Optional.ofNullable(object.getProperties()) .ifPresent(kProperties -> { for (final KProperty property : object.getProperties()) { Object config = mapping.get(property.getName()); if (config == null) { Optional<MetaProperty> prop = metaObject.getProperty(property.getName()); prop.ifPresent(metaProperty -> dirtyProperties.add(metaProperty)); } } }); this.indexProvider.putMapping(object.getClusterId(), object.getType().getName(), dirtyProperties); } }
@Override public void rename(String index, String id, KObject to) { checkNotEmpty("from", index); checkNotEmpty("id", id); checkNotNull("to", to); checkNotEmpty("clusterId", to.getClusterId()); checkCondition("renames are allowed only from same cluster", to.getClusterId().equals(index)); if (this.exists(index, id)) { this.delete(index, id); this.index(to); } }
@Override public void rename(String index, String id, KObject to) { checkNotEmpty("from", index); checkNotEmpty("id", id); checkNotNull("to", to); checkNotEmpty("clusterId", to.getClusterId()); checkCondition("renames are allowed only from same cluster", to.getClusterId().equals(index)); if (this.exists(index, id)) { this.delete(index, id); this.index(to); } }
@Override public void rename(String index, String id, KObject to) { checkNotEmpty("from", index); checkNotEmpty("id", id); checkNotNull("to", to); checkNotEmpty("clusterId", to.getClusterId()); checkCondition("renames are allowed only from same cluster", to.getClusterId().equals(index)); if (this.exists(index, id)) { this.delete(index, id); this.index(to); } }
@Override public void rename(String index, String id, KObject to) { checkNotEmpty("from", index); checkNotEmpty("id", id); checkNotNull("to", to); checkNotEmpty("clusterId", to.getClusterId()); checkCondition("renames are allowed only from same cluster", to.getClusterId().equals(index)); if (this.exists(index, id)) { this.delete(index, id); this.index(to); } }
@Override public void rename(String index, String id, KObject to) { checkNotNull("from", index); checkNotNull("to", to); checkCondition("renames are allowed only from same cluster", index.equals(to.getClusterId())); LuceneIndex luceneIndex = ((LuceneIndex) indexManager.get(new KClusterImpl(index))); luceneIndex.rename(id, newDocument(to)); }
@Override public void rename(KObjectKey from, KObject to) { checkNotNull("from", from); checkNotNull("to", to); checkCondition("renames are allowed only from same cluster", from.getClusterId().equals(to.getClusterId())); KCluster index = new KClusterImpl(from.getClusterId()); doOrDeferAction(index, new RenamedEvent(from, to)); }
@Override public void rename(KObjectKey from, KObject to) { checkNotNull("from", from); checkNotNull("to", to); checkCondition("renames are allowed only from same cluster", from.getClusterId().equals(to.getClusterId())); KCluster index = new KClusterImpl(from.getClusterId()); doOrDeferAction(index, new RenamedEvent(from, to)); }