public Collection exportSpecifications()

in src/main/java/com/amazonaws/services/neptune/propertygraph/Scope.java [29:83]


        public Collection<ExportSpecification> exportSpecifications(GraphSchema graphSchema,
                                                                    Collection<Label> nodeLabels,
                                                                    Collection<Label> edgeLabels,
                                                                    GremlinFilters gremlinFilters,
                                                                    TokensOnly tokensOnly,
                                                                    EdgeLabelStrategy edgeLabelStrategy,
                                                                    ExportStats stats,
                                                                    FeatureToggles featureToggles) {

            Collection<ExportSpecification> results = new ArrayList<>();

            if (graphSchema.isEmpty()) {
                results.add(new ExportSpecification(
                        GraphElementType.nodes,
                        Scope.labelsFilter(nodeLabels, NodeLabelStrategy.nodeLabelsOnly),
                        gremlinFilters,
                        stats,
                        tokensOnly.nodeTokensOnly(),
                        featureToggles));
                results.add(new ExportSpecification(
                        GraphElementType.edges,
                        Scope.labelsFilter(edgeLabels, edgeLabelStrategy),
                        gremlinFilters,
                        stats,
                        tokensOnly.edgeTokensOnly(),
                        featureToggles));
            } else {
                if (graphSchema.hasNodeSchemas()) {
                    LabelsFilter labelsFilter = Scope.labelsFilter(nodeLabels, NodeLabelStrategy.nodeLabelsOnly)
                            .intersection(graphSchema.graphElementSchemasFor(GraphElementType.nodes).labels());
                    if (!labelsFilter.isEmpty()) {
                        results.add(new ExportSpecification(
                                GraphElementType.nodes,
                                labelsFilter,
                                gremlinFilters, stats,
                                tokensOnly.nodeTokensOnly(),
                                featureToggles));
                    }
                }
                if (graphSchema.hasEdgeSchemas()) {
                    LabelsFilter labelsFilter = Scope.labelsFilter(edgeLabels, edgeLabelStrategy)
                            .intersection(graphSchema.graphElementSchemasFor(GraphElementType.edges).labels());
                    if (!labelsFilter.isEmpty()) {
                        results.add(new ExportSpecification(
                                GraphElementType.edges,
                                labelsFilter,
                                gremlinFilters, stats,
                                tokensOnly.edgeTokensOnly(),
                                featureToggles));
                    }
                }
            }

            return results;
        }