This project has retired. For details please refer to its Attic page.
Source code
001package org.apache.archiva.metadata.repository.storage;
002/*
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *   http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied.  See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 */
020
021import org.apache.archiva.filter.Filter;
022
023/**
024 * @author Olivier Lamy
025 * @since 1.4-M4
026 */
027public class ReadMetadataRequest
028{
029    private String repositoryId;
030
031    private String namespace;
032
033    private String projectId;
034
035    private String projectVersion;
036
037    private Filter<String> filter;
038
039    /**
040     * define this request as a ui request to remove some constraints added for optimisations
041     * @since 2.0.0
042     */
043    private boolean browsingRequest;
044
045    public ReadMetadataRequest()
046    {
047        // no op
048    }
049
050    public ReadMetadataRequest( String repositoryId, String namespace, String projectId, String projectVersion )
051    {
052        this.repositoryId = repositoryId;
053        this.namespace = namespace;
054        this.projectId = projectId;
055        this.projectVersion = projectVersion;
056    }
057
058    public ReadMetadataRequest( String repositoryId, String namespace, String projectId, String projectVersion,
059                                Filter<String> filter )
060    {
061        this( repositoryId, namespace, projectId, projectVersion );
062        this.filter = filter;
063    }
064
065    public String getRepositoryId()
066    {
067        return repositoryId;
068    }
069
070    public void setRepositoryId( String repositoryId )
071    {
072        this.repositoryId = repositoryId;
073    }
074
075    public ReadMetadataRequest repositoryId( String repoId )
076    {
077        this.repositoryId = repoId;
078        return this;
079    }
080
081    public String getNamespace()
082    {
083        return namespace;
084    }
085
086    public void setNamespace( String namespace )
087    {
088        this.namespace = namespace;
089    }
090
091    public ReadMetadataRequest namespace( String namespace )
092    {
093        this.namespace = namespace;
094        return this;
095    }
096
097    public String getProjectId()
098    {
099        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}