This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 257567
Collapse All | Expand All

(-)maven.indexer/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/indexer/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/indexer/Bundle.properties
3
AutoUpdate-Show-In-Client: false
3
AutoUpdate-Show-In-Client: false
4
OpenIDE-Module-Specification-Version: 2.36
4
OpenIDE-Module-Specification-Version: 2.37
5
OpenIDE-Module: org.netbeans.modules.maven.indexer/2
5
OpenIDE-Module: org.netbeans.modules.maven.indexer/2
6
6
(-)maven.indexer/nbproject/project.properties (-1 / +1 lines)
Lines 40-46 Link Here
40
40
41
test.config.stableBTD.includes=**/*Test.class
41
test.config.stableBTD.includes=**/*Test.class
42
is.autoload=true
42
is.autoload=true
43
javac.source=1.6
43
javac.source=1.8
44
javac.compilerargs=-Xlint -Xlint:-serial
44
javac.compilerargs=-Xlint -Xlint:-serial
45
release.external/indexer-core-5.1.1-patched.jar=modules/ext/maven/indexer-core-5.1.1-patched.jar
45
release.external/indexer-core-5.1.1-patched.jar=modules/ext/maven/indexer-core-5.1.1-patched.jar
46
release.external/indexer-artifact-5.1.1.jar=modules/ext/maven/indexer-artifact-5.1.1.jar
46
release.external/indexer-artifact-5.1.1.jar=modules/ext/maven/indexer-artifact-5.1.1.jar
(-)maven.indexer/nbproject/project.xml (+1 lines)
Lines 186-191 Link Here
186
                <package>org.apache.lucene.util.cache</package>
186
                <package>org.apache.lucene.util.cache</package>
187
                <package>org.netbeans.modules.maven.indexer.api</package>
187
                <package>org.netbeans.modules.maven.indexer.api</package>
188
                <package>org.netbeans.modules.maven.indexer.api.ui</package>
188
                <package>org.netbeans.modules.maven.indexer.api.ui</package>
189
                <package>org.netbeans.modules.maven.indexer.spi</package>
189
                <package>org.netbeans.modules.maven.indexer.spi.ui</package>
190
                <package>org.netbeans.modules.maven.indexer.spi.ui</package>
190
                <package>org.netbeans.modules.maven.indexer.spi.impl</package>
191
                <package>org.netbeans.modules.maven.indexer.spi.impl</package>
191
            </friend-packages>
192
            </friend-packages>
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java (-2 / +2 lines)
Lines 119-126 Link Here
119
import org.netbeans.modules.maven.indexer.spi.ContextLoadedQuery;
119
import org.netbeans.modules.maven.indexer.spi.ContextLoadedQuery;
120
import org.netbeans.modules.maven.indexer.spi.DependencyInfoQueries;
120
import org.netbeans.modules.maven.indexer.spi.DependencyInfoQueries;
121
import org.netbeans.modules.maven.indexer.spi.GenericFindQuery;
121
import org.netbeans.modules.maven.indexer.spi.GenericFindQuery;
122
import org.netbeans.modules.maven.indexer.spi.Redo;
122
import org.netbeans.modules.maven.indexer.spi.impl.Redo;
123
import org.netbeans.modules.maven.indexer.spi.RepositoryIndexerImplementation;
123
import org.netbeans.modules.maven.indexer.spi.impl.RepositoryIndexerImplementation;
124
import org.netbeans.modules.maven.indexer.spi.impl.IndexingNotificationProvider;
124
import org.netbeans.modules.maven.indexer.spi.impl.IndexingNotificationProvider;
125
import org.openide.modules.Places;
125
import org.openide.modules.Places;
126
import org.openide.util.BaseUtilities;
126
import org.openide.util.BaseUtilities;
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/OnStop.java (-1 / +1 lines)
Lines 44-50 Link Here
44
44
45
import java.util.logging.Level;
45
import java.util.logging.Level;
46
import java.util.logging.Logger;
46
import java.util.logging.Logger;
47
import org.netbeans.modules.maven.indexer.spi.RepositoryIndexerImplementation;
47
import org.netbeans.modules.maven.indexer.spi.impl.RepositoryIndexerImplementation;
48
import org.openide.util.Lookup;
48
import org.openide.util.Lookup;
49
49
50
@org.openide.modules.OnStop
50
@org.openide.modules.OnStop
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/api/RepositoryIndexer.java (-1 / +1 lines)
Lines 44-50 Link Here
44
import java.util.Collection;
44
import java.util.Collection;
45
import org.apache.maven.artifact.Artifact;
45
import org.apache.maven.artifact.Artifact;
46
import org.netbeans.api.annotations.common.NonNull;
46
import org.netbeans.api.annotations.common.NonNull;
47
import org.netbeans.modules.maven.indexer.spi.RepositoryIndexerImplementation;
47
import org.netbeans.modules.maven.indexer.spi.impl.RepositoryIndexerImplementation;
48
import org.openide.util.Lookup;
48
import org.openide.util.Lookup;
49
49
50
/**
50
/**
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/api/RepositoryQueries.java (-28 / +88 lines)
Lines 42-47 Link Here
42
42
43
package org.netbeans.modules.maven.indexer.api;
43
package org.netbeans.modules.maven.indexer.api;
44
44
45
import org.netbeans.modules.maven.indexer.spi.impl.Redo;
45
import java.io.File;
46
import java.io.File;
46
import java.io.IOException;
47
import java.io.IOException;
47
import java.util.ArrayList;
48
import java.util.ArrayList;
Lines 71-93 Link Here
71
72
72
    /**
73
    /**
73
     * query result set
74
     * query result set
75
     * @param <T>
74
     * @since 2.9
76
     * @since 2.9
75
     */
77
     */
76
    public final static class Result<T> {
78
    public final static class Result<T> {
77
        private final List<RepositoryInfo> skipped = new ArrayList<RepositoryInfo>();
79
        private final QueryResultImplementation<T> impl;
78
        private List<T> results = new ArrayList<T>();
79
        private final Redo<T> redoAction;
80
        int totalResults = 0;
81
        int returnedResults = 0;
82
        
80
        
83
        /**
81
        /**
84
         * used internally by the repository indexing/searching engine(s)
82
         * Creates a Result instance.
83
         * @param impl 
85
         */
84
         */
86
        Result(Redo<T> redo) {
85
        public Result(QueryResultImplementation<T> impl) {
87
            redoAction = redo;
86
            this.impl = impl;
88
        }
87
        }
89
        
88
        
90
        /**
89
        /**
90
         * Returns true is one or more indexes were skipped, e.g. because the indexing was taking place.
91
         * @return 
92
         */
93
        public synchronized boolean isPartial() {
94
            return impl.isPartial();
95
        }
96
               
97
        /**
98
         * Waits for currently unaccessible indexes to finish, not to be called in AWT thread.
99
         */
100
        public void waitForSkipped() {
101
            assert !ProjectIDEServices.isEventDispatchThread();
102
            impl.waitForSkipped();
103
        }
104
        
105
        /**
106
         * Returns a list of results
107
         * @return 
108
         */
109
        public synchronized List<T> getResults() {
110
            return impl.getResults();
111
        }
112
                
113
        /**
114
         * Total number of hits
115
         * @return
116
         * @since 2.20
117
         */
118
        public int getTotalResultCount() {
119
            return impl.getTotalResultCount();
120
        }
121
        
122
        /**
123
         * in some cases not entirely accurate number of processed and returned hits, typically should be less or equals to totalResultCount
124
         * @return 
125
         * @since 2.20
126
         */
127
        public int getReturnedResultCount() {
128
            return impl.getReturnedResultCount();
129
        }
130
        
131
        ResultInternal getImpl() {
132
            return (ResultInternal) impl;
133
        }
134
    } 
135
        
136
    private final static class ResultInternal<T> implements QueryResultImplementation {
137
        private final List<RepositoryInfo> skipped = new ArrayList<RepositoryInfo>();
138
        private List<T> results = new ArrayList<T>();
139
        private Runnable redoAction;
140
        
141
        int totalResults = 0;
142
        int returnedResults = 0;
143
144
        /**
91
         * returns true is one or more indexes were skipped, eg because the indexing was taking place.
145
         * returns true is one or more indexes were skipped, eg because the indexing was taking place.
92
         * @return 
146
         * @return 
93
         */
147
         */
Lines 106-113 Link Here
106
         * waits for currently unaccessible indexes to finish, not to be called in AWT thread.
160
         * waits for currently unaccessible indexes to finish, not to be called in AWT thread.
107
         */
161
         */
108
        public void waitForSkipped() {
162
        public void waitForSkipped() {
109
            assert !ProjectIDEServices.isEventDispatchThread();
163
            if(redoAction != null) {
110
            redoAction.run(this);
164
                redoAction.run();
165
            }
111
            synchronized (this) {
166
            synchronized (this) {
112
                skipped.clear();
167
                skipped.clear();
113
            }
168
            }
Lines 161-242 Link Here
161
            returnedResults = returnedResults + moreReturnedResults;
216
            returnedResults = returnedResults + moreReturnedResults;
162
        }
217
        }
163
        
218
        
164
        
219
        void setRedoAction(Runnable redoAction) {
165
        
220
            this.redoAction = redoAction;
166
    } 
221
    } 
222
    } 
167
    
223
    
168
    
169
    static {
224
    static {
170
        new AccessorImpl();       
225
        new AccessorImpl();       
171
    }
226
    }
172
    
227
    
173
    
174
    
175
    static class AccessorImpl extends NexusRepositoryIndexerImpl.Accessor {
228
    static class AccessorImpl extends NexusRepositoryIndexerImpl.Accessor {
176
229
177
        @Override
230
        @Override
178
        public void addSkipped(Result<?> result, Collection<RepositoryInfo> infos) {
231
        public void addSkipped(Result<?> result, Collection<RepositoryInfo> infos) {
179
            result.addSkipped(infos);
232
            result.getImpl().addSkipped(infos);
180
        }
233
        }
181
234
182
        @Override
235
        @Override
183
        public List<RepositoryInfo> getSkipped(Result<?> result) {
236
        public List<RepositoryInfo> getSkipped(Result<?> result) {
184
            return result.getSkipped();
237
            return result.getImpl().getSkipped();
185
        }
238
        }
186
239
187
        @Override
240
        @Override
188
        public void addSkipped(Result<?> result, RepositoryInfo info) {
241
        public void addSkipped(Result<?> result, RepositoryInfo info) {
189
            result.addSkipped(info);
242
            result.getImpl().addSkipped(info);
190
        }
243
        }
191
244
192
        @Override
245
        @Override
193
        public Result<String> createStringResult(Redo<String> redo) {
246
        public Result<String> createStringResult(Redo<String> redo) {
194
            return new Result<String>(redo);
247
            return createResult(redo);
195
        }
248
        }
196
249
250
        protected static <T> Result<T> createResult(final Redo<T> redo) {
251
            ResultInternal<Object> resultInternal = new ResultInternal<>();
252
            final Result result = new Result<>(resultInternal);
253
            resultInternal.setRedoAction(() -> { redo.run(result); });
254
            return result;
255
        }
256
197
        @Override
257
        @Override
198
        public Result<NBVersionInfo> createVersionResult(Redo<NBVersionInfo> redo) {
258
        public Result<NBVersionInfo> createVersionResult(Redo<NBVersionInfo> redo) {
199
            return new Result<NBVersionInfo>(redo);
259
            return createResult(redo);
200
        }
260
        }
201
261
202
        @Override
262
        @Override
203
        public void setStringResults(Result<String> result, Collection<String> newResults) {
263
        public void setStringResults(Result<String> result, Collection<String> newResults) {
204
            result.setResults(newResults);
264
            result.getImpl().setResults(newResults);
205
        }
265
        }
206
266
207
        @Override
267
        @Override
208
        public void setVersionResults(Result<NBVersionInfo> result, Collection<NBVersionInfo> newResults) {
268
        public void setVersionResults(Result<NBVersionInfo> result, Collection<NBVersionInfo> newResults) {
209
            result.setResults(newResults);
269
            result.getImpl().setResults(newResults);
210
        }
270
        }
211
271
212
        @Override
272
        @Override
213
        public Result<NBGroupInfo> createGroupResult(Redo<NBGroupInfo> redo) {
273
        public Result<NBGroupInfo> createGroupResult(Redo<NBGroupInfo> redo) {
214
            return new Result<NBGroupInfo>(redo);
274
            return createResult(redo);
215
        }
275
        }
216
276
217
        @Override
277
        @Override
218
        public void setGroupResults(Result<NBGroupInfo> result, Collection<NBGroupInfo> newResults) {
278
        public void setGroupResults(Result<NBGroupInfo> result, Collection<NBGroupInfo> newResults) {
219
            result.setResults(newResults);
279
            result.getImpl().setResults(newResults);
220
        }
280
        }
221
281
222
        @Override
282
        @Override
223
        public Result<ClassUsage> createClassResult(Redo<ClassUsage> redo) {
283
        public Result<ClassUsage> createClassResult(Redo<ClassUsage> redo) {
224
            return new Result<ClassUsage>(redo);
284
            return createResult(redo);
225
        }
285
        }
226
286
227
        @Override
287
        @Override
228
        public void setClassResults(Result<ClassUsage> result, Collection<ClassUsage> newResults) {
288
        public void setClassResults(Result<ClassUsage> result, Collection<ClassUsage> newResults) {
229
            result.setResults(newResults);
289
            result.getImpl().setResults(newResults);
230
        }
290
        }
231
291
232
        @Override
292
        @Override
233
        public void addTotalResults(Result<?> result, int moreResults) {
293
        public void addTotalResults(Result<?> result, int moreResults) {
234
            result.addTotalResultCount(moreResults);
294
            result.getImpl().addTotalResultCount(moreResults);
235
        }
295
        }
236
296
237
        @Override
297
        @Override
238
        public void addReturnedResults(Result<?> result, int moreResults) {
298
        public void addReturnedResults(Result<?> result, int moreResults) {
239
            result.addReturnedResultCount(moreResults);
299
            result.getImpl().addReturnedResultCount(moreResults);
240
        }
300
        }
241
    }
301
    }
242
    
302
    
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/spi/QueryResultImplementation.java (+85 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2016 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2016 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.maven.indexer.spi;
43
44
import java.util.List;
45
import org.netbeans.modules.maven.indexer.api.RepositoryQueries;
46
47
/**
48
 * Implement to provide a maven index query result.
49
 * 
50
 * @author Tomas Stupka
51
 * @param <T>
52
 * @since 2.37
53
 * @see org.netbeans.modules.maven.indexer.api.RepositoryQueries.Result
54
 */
55
public interface QueryResultImplementation<T> {
56
    /**
57
     * Returns true is one or more indexes were skipped, e.g. because the indexing was taking place.
58
     * @return 
59
     */
60
    public boolean isPartial();
61
    
62
    /**
63
     * Waits for currently unaccessible indexes to finish, not to be called in AWT thread.
64
     */
65
    public void waitForSkipped();
66
    
67
    /**
68
     * Returns the results.
69
     * @return 
70
     */
71
    public List<T> getResults();
72
    
73
    /**
74
     * Total number of hits.
75
     * @return     
76
     */
77
    public int getTotalResultCount();
78
    
79
    /**
80
     * In some cases not entirely accurate number of processed and returned hits, 
81
     * typically should be less or equal to {@link #getReturnedResultCount()}
82
     * @return 
83
     */
84
    public int getReturnedResultCount();
85
}
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/spi/Redo.java (-53 lines)
Lines 1-53 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.maven.indexer.spi;
43
44
import org.netbeans.modules.maven.indexer.api.RepositoryQueries;
45
46
/**
47
 * used internally by the repository indexing/searching engine(s)
48
 * @author mkleint
49
 */
50
public interface Redo<T> {
51
    void run(RepositoryQueries.Result<T> result);
52
}    
53
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/spi/RepositoryIndexerImplementation.java (-67 lines)
Lines 1-67 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.maven.indexer.spi;
43
44
import java.util.Collection;
45
import org.apache.maven.artifact.Artifact;
46
import org.netbeans.modules.maven.indexer.api.RepositoryInfo;
47
48
/**
49
 * Implementation of repository indexer (repository manager). Apart from basic
50
 * indexing features also serves as provider of various index queries.
51
 * There is one implementation based on apache indexer
52
 * 
53
 * @author Milos Kleint
54
 */
55
public interface RepositoryIndexerImplementation {
56
    
57
    /**
58
     * Index local repository or retrieve remote prepopulated index for local use.
59
     * @param repo
60
     */
61
    void indexRepo(RepositoryInfo repo);
62
    
63
    void updateIndexWithArtifacts(RepositoryInfo repo, Collection<Artifact> artifacts);
64
65
    void deleteArtifactFromIndex(RepositoryInfo repo, Artifact artifact);
66
67
}
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/spi/impl/Redo.java (+53 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.maven.indexer.spi.impl;
43
44
import org.netbeans.modules.maven.indexer.api.RepositoryQueries;
45
46
/**
47
 * used internally by the repository indexing/searching engine(s)
48
 * @author mkleint
49
 */
50
public interface Redo<T> {
51
    void run(RepositoryQueries.Result<T> result);
52
}    
53
(-)maven.indexer/src/org/netbeans/modules/maven/indexer/spi/impl/RepositoryIndexerImplementation.java (+67 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.modules.maven.indexer.spi.impl;
43
44
import java.util.Collection;
45
import org.apache.maven.artifact.Artifact;
46
import org.netbeans.modules.maven.indexer.api.RepositoryInfo;
47
48
/**
49
 * Implementation of repository indexer (repository manager). Apart from basic
50
 * indexing features also serves as provider of various index queries.
51
 * There is one implementation based on apache indexer
52
 * 
53
 * @author Milos Kleint
54
 */
55
public interface RepositoryIndexerImplementation {
56
    
57
    /**
58
     * Index local repository or retrieve remote prepopulated index for local use.
59
     * @param repo
60
     */
61
    void indexRepo(RepositoryInfo repo);
62
    
63
    void updateIndexWithArtifacts(RepositoryInfo repo, Collection<Artifact> artifacts);
64
65
    void deleteArtifactFromIndex(RepositoryInfo repo, Artifact artifact);
66
67
}
(-)maven/test/unit/src/org/netbeans/modules/maven/classpath/ClassPathProviderImplTest.java (-1 / +1 lines)
Lines 64-70 Link Here
64
import org.netbeans.modules.maven.indexer.api.RepositoryQueries.Result;
64
import org.netbeans.modules.maven.indexer.api.RepositoryQueries.Result;
65
import org.netbeans.modules.maven.indexer.api.RepositoryUtil;
65
import org.netbeans.modules.maven.indexer.api.RepositoryUtil;
66
import org.netbeans.modules.maven.indexer.spi.ChecksumQueries;
66
import org.netbeans.modules.maven.indexer.spi.ChecksumQueries;
67
import org.netbeans.modules.maven.indexer.spi.Redo;
67
import org.netbeans.modules.maven.indexer.spi.impl.Redo;
68
import org.openide.filesystems.FileObject;
68
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileUtil;
69
import org.openide.filesystems.FileUtil;
70
import org.openide.filesystems.test.TestFileUtils;
70
import org.openide.filesystems.test.TestFileUtils;

Return to bug 257567