This project has retired. For details please refer to its Attic page.
ReadMetadataRequest xref
View Javadoc
1   package org.apache.archiva.metadata.repository.storage;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import org.apache.archiva.filter.Filter;
22  
23  /**
24   * @author Olivier Lamy
25   * @since 1.4-M4
26   */
27  public class ReadMetadataRequest
28  {
29      private String repositoryId;
30  
31      private String namespace;
32  
33      private String projectId;
34  
35      private String projectVersion;
36  
37      private Filter<String> filter;
38  
39      /**
40       * define this request as a ui request to remove some constraints added for optimisations
41       * @since 2.0.0
42       */
43      private boolean browsingRequest;
44  
45      public ReadMetadataRequest()
46      {
47          // no op
48      }
49  
50      public ReadMetadataRequest( String repositoryId, String namespace, String projectId, String projectVersion )
51      {
52          this.repositoryId = repositoryId;
53          this.namespace = namespace;
54          this.projectId = projectId;
55          this.projectVersion = projectVersion;
56      }
57  
58      public ReadMetadataRequest( String repositoryId, String namespace, String projectId, String projectVersion,
59                                  Filter<String> filter )
60      {
61          this( repositoryId, namespace, projectId, projectVersion );
62          this.filter = filter;
63      }
64  
65      public String getRepositoryId()
66      {
67          return repositoryId;
68      }
69  
70      public void setRepositoryId( String repositoryId )
71      {
72          this.repositoryId = repositoryId;
73      }
74  
75      public ReadMetadataRequest repositoryId( String repoId )
76      {
77          this.repositoryId = repoId;
78          return this;
79      }
80  
81      public String getNamespace()
82      {
83          return namespace;
84      }
85  
86      public void setNamespace( String namespace )
87      {
88          this.namespace = namespace;
89      }
90  
91      public ReadMetadataRequest namespace( String namespace )
92      {
93          this.namespace = namespace;
94          return this;
95      }
96  
97      public String getProjectId()
98      {
99          return projectId;
100     }
101 
102     public void setProjectId( String projectId )
103     {
104         this.projectId = projectId;
105     }
106 
107     public ReadMetadataRequest projectId( String projectId )
108     {
109         this.projectId = projectId;
110         return this;
111     }
112 
113     public String getProjectVersion()
114     {
115         return projectVersion;
116     }
117 
118     public void setProjectVersion( String projectVersion )
119     {
120         this.projectVersion = projectVersion;
121     }
122 
123     public ReadMetadataRequest projectVersion( String projectVersion )
124     {
125         this.projectVersion = projectVersion;
126         return this;
127     }
128 
129     public Filter<String> getFilter()
130     {
131         return filter;
132     }
133 
134     public void setFilter( Filter<String> filter )
135     {
136         this.filter = filter;
137     }
138 
139     public ReadMetadataRequest filter( Filter<String> filter )
140     {
141         this.filter = filter;
142         return this;
143     }
144 
145     public boolean isBrowsingRequest()
146     {
147         return browsingRequest;
148     }
149 
150     public void setBrowsingRequest( boolean browsingRequest )
151     {
152         this.browsingRequest = browsingRequest;
153     }
154 
155     public ReadMetadataRequest browsingRequest( boolean browsingRequest )
156     {
157         this.browsingRequest = browsingRequest;
158         return this;
159     }
160 
161     @Override
162     public String toString()
163     {
164         final StringBuilder sb = new StringBuilder( "ReadMetadataRequest{" );
165         sb.append( "repositoryId='" ).append( repositoryId ).append( '\'' );
166         sb.append( ", namespace='" ).append( namespace ).append( '\'' );
167         sb.append( ", projectId='" ).append( projectId ).append( '\'' );
168         sb.append( ", projectVersion='" ).append( projectVersion ).append( '\'' );
169         sb.append( ", filter=" ).append( filter );
170         sb.append( ", browsingRequest=" ).append( browsingRequest );
171         sb.append( '}' );
172         return sb.toString();
173     }
174 }