Added Query classes for index searching git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@365802 13f79535-47bb-0310-9956-ffa450edef68tags/archiva-0.9-alpha-1
@@ -0,0 +1,45 @@ | |||
package org.apache.maven.repository.indexing.query; | |||
/* | |||
* Copyright 2001-2005 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
* | |||
* @author Edwin Punzalan | |||
*/ | |||
public abstract class AbstractCompoundQuery | |||
{ | |||
protected List queries; | |||
public AbstractCompoundQuery() | |||
{ | |||
queries = new ArrayList(); | |||
} | |||
public void add( Query query ) | |||
{ | |||
queries.add( query ); | |||
} | |||
public List getQueryList() | |||
{ | |||
return queries; | |||
} | |||
} |
@@ -0,0 +1,30 @@ | |||
package org.apache.maven.repository.indexing.query; | |||
/* | |||
* Copyright 2001-2005 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
* | |||
* @author Edwin Punzalan | |||
*/ | |||
public class OptionalQuery | |||
extends AbstractCompoundQuery | |||
{ | |||
} |
@@ -0,0 +1,26 @@ | |||
package org.apache.maven.repository.indexing.query; | |||
/* | |||
* Copyright 2001-2005 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/** | |||
* | |||
* @author Edwin Punzalan | |||
*/ | |||
public interface Query | |||
{ | |||
} |
@@ -0,0 +1,27 @@ | |||
package org.apache.maven.repository.indexing.query; | |||
/* | |||
* Copyright 2001-2005 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/** | |||
* | |||
* @author Edwin Punzalan | |||
*/ | |||
public class RequiredQuery | |||
extends AbstractCompoundQuery | |||
{ | |||
} |
@@ -0,0 +1,45 @@ | |||
package org.apache.maven.repository.indexing.query; | |||
/* | |||
* Copyright 2001-2005 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/** | |||
* | |||
* @author Edwin Punzalan | |||
*/ | |||
public class SinglePhraseQuery | |||
implements Query | |||
{ | |||
private String field; | |||
private String value; | |||
public SinglePhraseQuery( String field, String value ) | |||
{ | |||
this.field = field; | |||
this.value = value; | |||
} | |||
public String getField() | |||
{ | |||
return field; | |||
} | |||
public String getValue() | |||
{ | |||
return value; | |||
} | |||
} |