Coverage Report - org.apache.maven.index.updater.IndexUpdateRequest
 
Classes in this File Line Coverage Branch Coverage Complexity
IndexUpdateRequest
85 %
24/28
50 %
4/8
1
 
 1  
 package org.apache.maven.index.updater;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *   http://www.apache.org/licenses/LICENSE-2.0    
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import java.io.File;
 23  
 
 24  
 import org.apache.maven.index.context.DocumentFilter;
 25  
 import org.apache.maven.index.context.IndexingContext;
 26  
 import org.apache.maven.index.fs.Locker;
 27  
 
 28  
 /**
 29  
  * Request to update indexes.
 30  
  * 
 31  
  * @author Eugene Kuleshov
 32  
  * @author cstamas
 33  
  */
 34  1
 public class IndexUpdateRequest
 35  
 {
 36  
     private final IndexingContext context;
 37  
 
 38  
     private final ResourceFetcher resourceFetcher;
 39  
 
 40  
     private DocumentFilter documentFilter;
 41  
 
 42  
     private boolean forceFullUpdate;
 43  
 
 44  
     private File localIndexCacheDir;
 45  
 
 46  
     private Locker locker;
 47  
 
 48  
     private boolean offline;
 49  
 
 50  
     private boolean cacheOnly;
 51  
 
 52  
     public IndexUpdateRequest( final IndexingContext context, final ResourceFetcher resourceFetcher )
 53  28
     {
 54  28
         assert context != null : "Context to be updated cannot be null!";
 55  28
         assert resourceFetcher != null : "ResourceFetcher has to be provided!";
 56  
 
 57  28
         this.context = context;
 58  28
         this.resourceFetcher = resourceFetcher;
 59  28
         this.forceFullUpdate = false;
 60  28
     }
 61  
 
 62  
     public IndexingContext getIndexingContext()
 63  
     {
 64  125
         return context;
 65  
     }
 66  
 
 67  
     public ResourceFetcher getResourceFetcher()
 68  
     {
 69  25
         return resourceFetcher;
 70  
     }
 71  
 
 72  
     public DocumentFilter getDocumentFilter()
 73  
     {
 74  24
         return documentFilter;
 75  
     }
 76  
 
 77  
     public void setDocumentFilter( DocumentFilter documentFilter )
 78  
     {
 79  1
         this.documentFilter = documentFilter;
 80  1
     }
 81  
 
 82  
     public void setForceFullUpdate( boolean forceFullUpdate )
 83  
     {
 84  8
         this.forceFullUpdate = forceFullUpdate;
 85  8
     }
 86  
 
 87  
     public boolean isForceFullUpdate()
 88  
     {
 89  41
         return forceFullUpdate;
 90  
     }
 91  
 
 92  
     public File getLocalIndexCacheDir()
 93  
     {
 94  27
         return localIndexCacheDir;
 95  
     }
 96  
 
 97  
     public void setLocalIndexCacheDir( File dir )
 98  
     {
 99  17
         this.localIndexCacheDir = dir;
 100  17
     }
 101  
 
 102  
     public Locker getLocker()
 103  
     {
 104  27
         return locker;
 105  
     }
 106  
 
 107  
     public void setLocker( Locker locker )
 108  
     {
 109  0
         this.locker = locker;
 110  0
     }
 111  
 
 112  
     public void setOffline( boolean offline )
 113  
     {
 114  2
         this.offline = offline;
 115  2
     }
 116  
 
 117  
     public boolean isOffline()
 118  
     {
 119  54
         return offline;
 120  
     }
 121  
 
 122  
     public void setCacheOnly( boolean cacheOnly )
 123  
     {
 124  0
         this.cacheOnly = cacheOnly;
 125  0
     }
 126  
 
 127  
     public boolean isCacheOnly()
 128  
     {
 129  26
         return cacheOnly;
 130  
     }
 131  
 }