private IndexingPolicy getIndexingPolicy(Class<?> domainClass) { final IndexingPolicy policy = new IndexingPolicy(); policy.setAutomatic(this.getIndexingPolicyAutomatic(domainClass)); policy.setIndexingMode(this.getIndexingPolicyMode(domainClass)); policy.setIncludedPaths(this.getIndexingPolicyIncludePaths(domainClass)); policy.setExcludedPaths(this.getIndexingPolicyExcludePaths(domainClass)); return policy; }
/** * Constructor. */ public IndexingPolicy() { this.setAutomatic(true); this.setIndexingMode(IndexingMode.Consistent); }
@Override void populatePropertyBag() { // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.None && this.getIncludedPaths().size() == 0 && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(); includedPath.setPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } if (this.includedPaths != null) { for (IncludedPath includedPath : this.includedPaths) { includedPath.populatePropertyBag(); } super.set(Constants.Properties.INCLUDED_PATHS, this.includedPaths); } if (this.excludedPaths != null) { for (ExcludedPath excludedPath : this.excludedPaths) { excludedPath.populatePropertyBag(); } super.set(Constants.Properties.EXCLUDED_PATHS, this.excludedPaths); } } }
/** * Gets the indexing policy. * * @return the indexing policy. */ public IndexingPolicy getIndexingPolicy() { if (this.indexingPolicy == null) { if (super.has(Constants.Properties.INDEXING_POLICY)) { this.indexingPolicy = super.getObject(Constants.Properties.INDEXING_POLICY, IndexingPolicy.class); } else { this.indexingPolicy = new IndexingPolicy(); } } return this.indexingPolicy; }
includedPath.setPath(IndexingPolicy.DEFAULT_PATH); includedPath.setIndexes(new ArrayList<Index>(Arrays.asList(defaultIndexOverrides))); this.getIncludedPaths().add(includedPath);
collection.setIndexingPolicy(policy); if (information.getIndexingPolicy().getAutomatic()) {
private IndexingPolicy getIndexingPolicy(Class<?> domainClass) { final IndexingPolicy policy = new IndexingPolicy(); policy.setAutomatic(this.getIndexingPolicyAutomatic(domainClass)); policy.setIndexingMode(this.getIndexingPolicyMode(domainClass)); policy.setIncludedPaths(this.getIndexingPolicyIncludePaths(domainClass)); policy.setExcludedPaths(this.getIndexingPolicyExcludePaths(domainClass)); return policy; }