1 /*
2 * Copyright 2013 smartics, Kronseder & Reiner GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package de.smartics.maven.plugin.jboss.modules.aether;
17
18 import org.sonatype.aether.RepositorySystemSession;
19 import org.sonatype.aether.collection.DependencyTraverser;
20 import org.sonatype.aether.util.FilterRepositorySystemSession;
21
22 import de.smartics.util.lang.Arg;
23
24 /**
25 * Used for pruning the dependency tree.
26 */
27 public class FilterSession extends FilterRepositorySystemSession
28 {
29 // ********************************* Fields *********************************
30
31 // --- constants ------------------------------------------------------------
32
33 // --- members --------------------------------------------------------------
34
35 /**
36 * The traverser to prune.
37 */
38 private final DependencyTraverser traverser;
39
40 // ****************************** Initializer *******************************
41
42 // ****************************** Constructors ******************************
43
44 // ****************************** Inner Classes *****************************
45
46 // ********************************* Methods ********************************
47
48 // --- init -----------------------------------------------------------------
49
50 // --- get&set --------------------------------------------------------------
51
52 /**
53 * Creates a new repository system session that wraps the specified session.
54 *
55 * @param session the repository system session to wrap.
56 * @param traverser the traverser to prune.
57 * @throws NullPointerException if {@code session} or {@code traverser} is
58 * <code>null</code>.
59 */
60 public FilterSession(final RepositorySystemSession session,
61 final DependencyTraverser traverser) throws NullPointerException
62 {
63 super(session);
64 this.traverser = Arg.checkNotNull("traverser", traverser);
65 }
66
67 // --- business -------------------------------------------------------------
68
69 @Override
70 public DependencyTraverser getDependencyTraverser()
71 {
72 return traverser;
73 }
74
75 // --- object basics --------------------------------------------------------
76
77 }