Package io.lumify.reindex

Source Code of io.lumify.reindex.ReIndexGraphPropertyWorker

package io.lumify.reindex;

import io.lumify.core.ingest.graphProperty.GraphPropertyWorkData;
import io.lumify.core.ingest.graphProperty.GraphPropertyWorker;
import org.securegraph.Element;
import org.securegraph.GraphBase;
import org.securegraph.GraphBaseWithSearchIndex;
import org.securegraph.Property;
import org.securegraph.search.SearchIndex;

import java.io.InputStream;

public class ReIndexGraphPropertyWorker extends GraphPropertyWorker {
    @Override
    public void execute(InputStream in, GraphPropertyWorkData data) throws Exception {
        if (getGraph() instanceof GraphBase) {
            SearchIndex searchIndex = ((GraphBaseWithSearchIndex) getGraph()).getSearchIndex();
            searchIndex.addElement(getGraph(), data.getElement(), data.getElement().getAuthorizations());
        }
    }

    @Override
    public boolean isHandled(Element element, Property property) {
        if (property == null) {
            return true;
        }

        return false;
    }
}
TOP

Related Classes of io.lumify.reindex.ReIndexGraphPropertyWorker

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.