1 23 package org.apache.slide.store; 24 import java.util.Hashtable ; 25 import org.apache.slide.common.XAServiceBase; 26 import org.apache.slide.common.ServiceAccessException; 27 import org.apache.slide.common.ServiceConnectionFailedException; 28 import org.apache.slide.common.ServiceDisconnectionFailedException; 29 import org.apache.slide.common.ServiceParameterErrorException; 30 import org.apache.slide.common.ServiceParameterMissingException; 31 import org.apache.slide.common.ServiceResetFailedException; 32 import org.apache.slide.common.Uri; 33 import org.apache.slide.content.NodeRevisionContent; 34 import org.apache.slide.content.NodeRevisionDescriptor; 35 import org.apache.slide.content.NodeRevisionNumber; 36 import org.apache.slide.search.IndexException; 37 import org.apache.slide.search.basic.IBasicExpressionFactory; 38 import org.apache.slide.search.basic.IBasicExpressionFactoryProvider; 39 import org.apache.slide.store.IndexStore; 40 41 42 51 public class DefaultIndexer extends XAServiceBase implements IndexStore 52 { 53 private final IBasicExpressionFactoryProvider expressionProvider; 54 55 61 public DefaultIndexer (Object associatedStore) { 62 if (associatedStore instanceof IBasicExpressionFactoryProvider) { 63 expressionProvider = (IBasicExpressionFactoryProvider) associatedStore; 64 } 65 else { 66 expressionProvider = null; 67 } 68 } 69 70 76 public IBasicExpressionFactory getBasicExpressionFactory() 77 { 78 if (expressionProvider != null) { 79 return expressionProvider.getBasicExpressionFactory(); 80 } 81 return null; 82 } 83 84 private boolean started = false; 86 87 88 94 public void createIndex(Uri uri, NodeRevisionDescriptor revisionDescriptor, 95 NodeRevisionContent revisionContent) 96 throws IndexException 97 { 98 } 100 101 111 public void updateIndex(Uri uri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws IndexException 112 { 113 } 115 116 117 123 public void dropIndex(Uri uri, NodeRevisionNumber number) 124 throws IndexException 125 { 126 } 128 129 134 public void connect() throws ServiceConnectionFailedException 135 { 136 started = true; 137 } 138 139 145 public boolean isConnected() throws ServiceAccessException 146 { 147 return started; 148 } 149 150 163 public void setParameters(Hashtable parameters) throws ServiceParameterErrorException, ServiceParameterMissingException 164 { 165 } 167 168 173 public void disconnect() throws ServiceDisconnectionFailedException 174 { 175 started = false; 176 } 177 178 183 public void reset() throws ServiceResetFailedException 184 { 185 } 187 188 } 189 190 | Popular Tags |