svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / feature / spi / AbstractFeatureStoreProvider.java @ 47198
History | View | Annotate | Download (18.7 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
|
25 |
package org.gvsig.fmap.dal.feature.spi; |
26 |
|
27 |
import java.io.BufferedOutputStream; |
28 |
import java.io.File; |
29 |
import java.io.FileOutputStream; |
30 |
import java.io.OutputStream; |
31 |
import java.nio.charset.StandardCharsets; |
32 |
import java.util.Collection; |
33 |
import java.util.Iterator; |
34 |
import org.apache.commons.io.FileUtils; |
35 |
import org.apache.commons.io.FilenameUtils; |
36 |
import org.apache.commons.io.IOUtils; |
37 |
import org.apache.commons.lang3.builder.ToStringBuilder; |
38 |
import org.cresques.cts.ICRSFactory; |
39 |
import org.cresques.cts.IProjection; |
40 |
import org.gvsig.expressionevaluator.Expression; |
41 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
42 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
43 |
import org.gvsig.fmap.dal.DALLocator; |
44 |
import org.gvsig.fmap.dal.DataServerExplorer; |
45 |
import org.gvsig.fmap.dal.DataStore; |
46 |
import org.gvsig.fmap.dal.DataStoreParameters; |
47 |
import org.gvsig.fmap.dal.StoresRepository; |
48 |
import org.gvsig.fmap.dal.exception.CloseException; |
49 |
import org.gvsig.fmap.dal.exception.DataException; |
50 |
import org.gvsig.fmap.dal.exception.InitializeException; |
51 |
import org.gvsig.fmap.dal.exception.OpenException; |
52 |
import org.gvsig.fmap.dal.exception.ReadException; |
53 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
54 |
import org.gvsig.fmap.dal.feature.FeatureLocks; |
55 |
import org.gvsig.fmap.dal.feature.FeatureReference; |
56 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
57 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
58 |
import org.gvsig.fmap.dal.feature.FeatureType; |
59 |
import org.gvsig.fmap.dal.resource.ResourceAction; |
60 |
import org.gvsig.fmap.dal.resource.ResourceManager; |
61 |
import org.gvsig.fmap.dal.resource.spi.ResourceManagerProviderServices; |
62 |
import org.gvsig.fmap.dal.resource.spi.ResourceProvider; |
63 |
import org.gvsig.fmap.dal.spi.AbstractDataStoreProvider; |
64 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
65 |
import org.gvsig.fmap.dal.spi.DataTransactionServices; |
66 |
import org.gvsig.fmap.geom.primitive.Envelope; |
67 |
import org.gvsig.timesupport.Interval; |
68 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
69 |
import org.gvsig.tools.dynobject.DynClass; |
70 |
import org.gvsig.tools.dynobject.DynObject; |
71 |
import org.gvsig.tools.dynobject.DynObject_v2; |
72 |
import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException; |
73 |
import org.gvsig.tools.dynobject.exception.DynMethodException; |
74 |
import org.gvsig.tools.exception.BaseException; |
75 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
76 |
import org.gvsig.tools.util.UnmodifiableBasicMap; |
77 |
import org.slf4j.Logger; |
78 |
import org.slf4j.LoggerFactory; |
79 |
|
80 |
/**
|
81 |
* Abstract implementation of {@link FeatureStoreProvider}
|
82 |
*
|
83 |
*/
|
84 |
public abstract class AbstractFeatureStoreProvider extends AbstractDataStoreProvider |
85 |
implements FeatureStoreProvider_v2 {
|
86 |
|
87 |
protected FeatureStoreProviderServices store;
|
88 |
private DelegatedDynObject metadata;
|
89 |
private DataStoreParameters parameters;
|
90 |
|
91 |
private static final Logger logger = LoggerFactory.getLogger(AbstractFeatureStoreProvider.class); |
92 |
|
93 |
|
94 |
/**
|
95 |
* Default Constructor.
|
96 |
*
|
97 |
* @param params
|
98 |
* @param storeServices
|
99 |
* @param metadata
|
100 |
*/
|
101 |
protected AbstractFeatureStoreProvider(DataStoreParameters params,
|
102 |
DataStoreProviderServices storeServices, DynObject metadata) { |
103 |
this.store = (FeatureStoreProviderServices) storeServices;
|
104 |
this.metadata = (DelegatedDynObject) metadata;
|
105 |
this.parameters = params;
|
106 |
} |
107 |
|
108 |
/**
|
109 |
* Constructor when cannot create metada in constrution time. <br>
|
110 |
* <br>
|
111 |
* <strong>Note: </strong> Don't use it if not is necesary. Set metada
|
112 |
* <strong>as soon as posible</strong> by
|
113 |
* {@link AbstractFeatureStoreProvider#setMetadata(DynObject)}
|
114 |
*
|
115 |
* @param params
|
116 |
* @param storeServices
|
117 |
*/
|
118 |
protected AbstractFeatureStoreProvider(DataStoreParameters params,
|
119 |
DataStoreProviderServices storeServices) { |
120 |
this.store = (FeatureStoreProviderServices) storeServices;
|
121 |
this.metadata = null; |
122 |
this.parameters = params;
|
123 |
} |
124 |
|
125 |
public final FeatureProvider getFeatureProviderByReference( |
126 |
final FeatureReferenceProviderServices reference)
|
127 |
throws DataException {
|
128 |
this.open();
|
129 |
FeatureProvider featureProvider = (FeatureProvider) getResource() |
130 |
.execute(new ResourceAction() {
|
131 |
public Object run() throws Exception { |
132 |
return internalGetFeatureProviderByReference(reference);
|
133 |
} |
134 |
public String toString() { |
135 |
return "getFeatureByReference"; |
136 |
} |
137 |
|
138 |
}); |
139 |
|
140 |
if (featureProvider == null) { |
141 |
throw new FeatureProviderNotFoundException(reference); |
142 |
} |
143 |
|
144 |
return featureProvider;
|
145 |
} |
146 |
|
147 |
public final FeatureProvider getFeatureProviderByReference( |
148 |
final FeatureReferenceProviderServices reference,
|
149 |
final FeatureType featureType) throws DataException { |
150 |
this.open();
|
151 |
FeatureProvider featureProvider = (FeatureProvider) getResource() |
152 |
.execute(new ResourceAction() {
|
153 |
public Object run() throws Exception { |
154 |
return internalGetFeatureProviderByReference(reference,
|
155 |
featureType); |
156 |
} |
157 |
}); |
158 |
|
159 |
if (featureProvider == null) { |
160 |
throw new FeatureProviderNotFoundException(reference); |
161 |
} |
162 |
|
163 |
return featureProvider;
|
164 |
} |
165 |
|
166 |
/**
|
167 |
* Returns a {@link FeatureProvider} by reference, using the default
|
168 |
* {@link FeatureType}. This method may be rewritten by the child classes as
|
169 |
* an implementation of the
|
170 |
* {@link #getFeatureProviderByReference(FeatureReferenceProviderServices)}
|
171 |
* method.
|
172 |
*
|
173 |
* @param reference
|
174 |
* the reference to the {@link FeatureProvider}
|
175 |
* @return the {@link FeatureProvider} being referenced
|
176 |
* @throws DataException
|
177 |
* if there is an error loading the {@link FeatureProvider}
|
178 |
*/
|
179 |
protected FeatureProvider internalGetFeatureProviderByReference(
|
180 |
FeatureReferenceProviderServices reference) throws DataException {
|
181 |
return internalGetFeatureProviderByReference(reference,
|
182 |
getStoreServices().getDefaultFeatureType()); |
183 |
} |
184 |
|
185 |
/**
|
186 |
* Set metada container if this not set at construction time and only in one
|
187 |
* time. In other case an Exception will be throw
|
188 |
*
|
189 |
* @param metadata
|
190 |
*/
|
191 |
protected void setMetadata(DynObject metadata) { |
192 |
if (this.metadata != null) { |
193 |
// FIXME Exception
|
194 |
throw new IllegalStateException(); |
195 |
} |
196 |
this.metadata = (DelegatedDynObject) metadata;
|
197 |
} |
198 |
|
199 |
/**
|
200 |
* @return the parameters
|
201 |
*/
|
202 |
public DataStoreParameters getParameters() {
|
203 |
return parameters;
|
204 |
} |
205 |
|
206 |
/**
|
207 |
* Create or get a resource of <code>type</code> for <code>params</code> in
|
208 |
* {@link ResourceManager}
|
209 |
*
|
210 |
* @param type
|
211 |
* @param params
|
212 |
* @return
|
213 |
* @throws InitializeException
|
214 |
*/
|
215 |
protected ResourceProvider createResource(String type, Object[] params) |
216 |
throws InitializeException {
|
217 |
ResourceManagerProviderServices manager = (ResourceManagerProviderServices) DALLocator |
218 |
.getResourceManager(); |
219 |
ResourceProvider resource = manager.createAddResource(type, params); |
220 |
return resource;
|
221 |
} |
222 |
|
223 |
@Override
|
224 |
public FeatureStoreProviderServices getStoreServices() {
|
225 |
return this.store; |
226 |
} |
227 |
|
228 |
@Override
|
229 |
public FeatureStore getFeatureStore() {
|
230 |
FeatureStoreProviderServices services = this.getStoreServices();
|
231 |
if(services == null){ |
232 |
return null; |
233 |
} |
234 |
return services.getFeatureStore();
|
235 |
} |
236 |
|
237 |
@Override
|
238 |
public boolean allowWrite() { |
239 |
return false; |
240 |
} |
241 |
|
242 |
/**
|
243 |
* unsupported by default, override this otherwise
|
244 |
*
|
245 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#performChanges(Iterator,
|
246 |
* Iterator, Iterator, Iterator)
|
247 |
*/
|
248 |
|
249 |
public void performChanges(Iterator deleteds, Iterator inserteds, |
250 |
Iterator updateds, Iterator featureTypesChanged) |
251 |
throws DataException {
|
252 |
// FIXME exception
|
253 |
throw new UnsupportedOperationException(); |
254 |
|
255 |
} |
256 |
|
257 |
/**
|
258 |
* unsupported by default, override this otherwise
|
259 |
*
|
260 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#isLocksSupported()
|
261 |
*/
|
262 |
public boolean isLocksSupported() { |
263 |
return false; |
264 |
} |
265 |
|
266 |
/**
|
267 |
* Default Factory of {@link FeatureProvider}. Create a new default
|
268 |
* {@link FeatureProvider} instance.<br>
|
269 |
*
|
270 |
* Override this if you need an special implemtation of
|
271 |
* {@link FeatureProvider}.
|
272 |
*
|
273 |
* @return
|
274 |
* @throws DataException
|
275 |
*
|
276 |
* @see {@link org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createFeatureProvider(FeatureType)}
|
277 |
*/
|
278 |
|
279 |
public FeatureProvider createFeatureProvider(FeatureType type)
|
280 |
throws DataException {
|
281 |
FeatureStoreProviderServices services = this.getStoreServices();
|
282 |
return services.createDefaultFeatureProvider(type);
|
283 |
} |
284 |
|
285 |
/**
|
286 |
* unsupported by default (return <code>null</code>), override this
|
287 |
* otherwise
|
288 |
*
|
289 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createFeatureLocks()
|
290 |
*/
|
291 |
public FeatureLocks createFeatureLocks() throws DataException { |
292 |
return null; |
293 |
} |
294 |
|
295 |
/**
|
296 |
* Default Factory of {@link FeatureSelection}. Create a new default
|
297 |
* {@link FeatureSelection} instance.<br>
|
298 |
*
|
299 |
* Override this if you need an special implemtation of
|
300 |
* {@link FeatureSelection}.
|
301 |
*
|
302 |
* @return
|
303 |
* @throws DataException
|
304 |
*
|
305 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#createFeatureSelection()
|
306 |
*/
|
307 |
@Override
|
308 |
public FeatureSelection createFeatureSelection() throws DataException { |
309 |
FeatureStoreProviderServices services = this.getStoreServices();
|
310 |
return services.createDefaultFeatureSelection();
|
311 |
} |
312 |
|
313 |
/**
|
314 |
* do nothing by default, override this otherwise
|
315 |
*
|
316 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#refresh()
|
317 |
*/
|
318 |
public void refresh() throws OpenException { |
319 |
// Do nothing by default
|
320 |
} |
321 |
|
322 |
/**
|
323 |
* do nothing by default, override this otherwise
|
324 |
*
|
325 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#close()
|
326 |
*/
|
327 |
@Override
|
328 |
public void close() throws CloseException { |
329 |
// Do nothing by default
|
330 |
} |
331 |
|
332 |
@Override
|
333 |
protected void doDispose() throws BaseException { |
334 |
this.metadata = null; |
335 |
this.store = null; |
336 |
} |
337 |
|
338 |
/**
|
339 |
* unsupported geometry by default (return <code>null</code>), override this
|
340 |
* otherwise
|
341 |
*
|
342 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#getEnvelope()
|
343 |
*/
|
344 |
public Envelope getEnvelope() throws DataException { |
345 |
return null; |
346 |
} |
347 |
|
348 |
/**
|
349 |
* unsupported geometry write by default (return <code>false</code>),
|
350 |
* override this otherwise
|
351 |
*
|
352 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#canWriteGeometry(int,
|
353 |
* int)
|
354 |
*/
|
355 |
public boolean canWriteGeometry(int geometryType, int geometrySubType) |
356 |
throws DataException {
|
357 |
return false; |
358 |
} |
359 |
|
360 |
// --- Metadata methods ---
|
361 |
|
362 |
public void delegate(DynObject dynObject) { |
363 |
if (this.metadata == null) { |
364 |
return;
|
365 |
} |
366 |
this.metadata.delegate(dynObject);
|
367 |
} |
368 |
|
369 |
public DynClass getDynClass() {
|
370 |
if (this.metadata == null) { |
371 |
return null; |
372 |
} |
373 |
return this.metadata.getDynClass(); |
374 |
} |
375 |
|
376 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
377 |
if (this.metadata == null) { |
378 |
return null; |
379 |
} |
380 |
// TODO this.open??
|
381 |
return this.metadata.getDynValue(name); |
382 |
} |
383 |
|
384 |
public boolean hasDynValue(String name) { |
385 |
if (this.metadata == null) { |
386 |
return false; |
387 |
} |
388 |
// TODO this.open??
|
389 |
return this.metadata.hasDynValue(name); |
390 |
} |
391 |
|
392 |
@Override
|
393 |
public boolean hasDynMethod(String name) { |
394 |
if( metadata instanceof DynObject_v2 ) { |
395 |
return ((DynObject_v2)this.metadata).hasDynMethod(name); |
396 |
} |
397 |
return false; |
398 |
} |
399 |
|
400 |
public void implement(DynClass dynClass) { |
401 |
if (this.metadata == null) { |
402 |
return;
|
403 |
} |
404 |
this.metadata.implement(dynClass);
|
405 |
|
406 |
} |
407 |
|
408 |
public Object invokeDynMethod(int code, Object[] args) |
409 |
throws DynMethodException {
|
410 |
if (this.metadata == null) { |
411 |
return null; |
412 |
} |
413 |
// TODO this.open??
|
414 |
return this.metadata.invokeDynMethod(this, code, args); |
415 |
} |
416 |
|
417 |
public Object invokeDynMethod(String name, Object[] args) |
418 |
throws DynMethodException {
|
419 |
if (this.metadata == null) { |
420 |
return null; |
421 |
} |
422 |
// TODO this.open??
|
423 |
return this.metadata.invokeDynMethod(this, name, args); |
424 |
} |
425 |
|
426 |
public void setDynValue(String name, Object value) |
427 |
throws DynFieldNotFoundException {
|
428 |
if (this.metadata == null) { |
429 |
return;
|
430 |
} |
431 |
// TODO this.open??
|
432 |
this.metadata.setDynValue(name, value);
|
433 |
} |
434 |
|
435 |
// --- end Metadata methods ---
|
436 |
|
437 |
/**
|
438 |
* unsupported by default, override this otherwise
|
439 |
*
|
440 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#allowAutomaticValues()
|
441 |
*/
|
442 |
public boolean allowAutomaticValues() { |
443 |
return false; |
444 |
|
445 |
} |
446 |
|
447 |
/**
|
448 |
* unsupported by default, override this otherwise
|
449 |
*
|
450 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#append(org.gvsig.
|
451 |
* fmap.dal.feature.spi.FeatureProvider)
|
452 |
*/
|
453 |
public void append(FeatureProvider featureProvider) throws DataException { |
454 |
// FIXME exception
|
455 |
throw new UnsupportedOperationException(); |
456 |
} |
457 |
|
458 |
/**
|
459 |
* unsupported by default, override this otherwise
|
460 |
*
|
461 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#beginAppend()
|
462 |
*/
|
463 |
public void beginAppend() throws DataException { |
464 |
// FIXME exception
|
465 |
throw new UnsupportedOperationException(); |
466 |
} |
467 |
|
468 |
/**
|
469 |
* unsupported by default, override this otherwise
|
470 |
*
|
471 |
* @see org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider#endAppend()
|
472 |
*/
|
473 |
public void endAppend() throws DataException { |
474 |
// FIXME exception
|
475 |
throw new UnsupportedOperationException(); |
476 |
} |
477 |
|
478 |
public void abortAppend() throws DataException { |
479 |
// FIXME exception
|
480 |
throw new UnsupportedOperationException(); |
481 |
} |
482 |
|
483 |
@Override
|
484 |
public boolean supportsAppendMode() { |
485 |
return false; |
486 |
} |
487 |
|
488 |
@Override
|
489 |
public UnmodifiableBasicMap<String,DataStore> getChildren() { |
490 |
return UnmodifiableBasicMap.EMPTY_UNMODIFIABLEBASICMAP;
|
491 |
} |
492 |
|
493 |
@Override
|
494 |
public StoresRepository getStoresRepository() {
|
495 |
return null; |
496 |
} |
497 |
|
498 |
@Override
|
499 |
public ResourcesStorage getResourcesStorage() {
|
500 |
return null; |
501 |
} |
502 |
|
503 |
/**
|
504 |
* unsupported by default (return null), override this otherwise
|
505 |
*
|
506 |
* @throws org.gvsig.fmap.dal.exception.ReadException
|
507 |
* @throws org.gvsig.fmap.dal.exception.ValidateDataParametersException
|
508 |
* @see org.gvsig.fmap.dal.spi.DataStoreProvider#getExplorer()
|
509 |
*/
|
510 |
@Override
|
511 |
public DataServerExplorer getExplorer() throws ReadException, |
512 |
ValidateDataParametersException { |
513 |
return null; |
514 |
} |
515 |
|
516 |
public void clear() { |
517 |
if (metadata != null) { |
518 |
metadata.clear(); |
519 |
} |
520 |
} |
521 |
|
522 |
/**
|
523 |
* Returns a {@link FeatureProvider} by reference, using the provided
|
524 |
* {@link FeatureType}. This is the child classes implementation of the
|
525 |
* {@link #getFeatureProviderByReference(FeatureReferenceProviderServices)}
|
526 |
* method.
|
527 |
*
|
528 |
* @param reference
|
529 |
* the reference to the {@link FeatureProvider}
|
530 |
* @param featureType
|
531 |
* the type of feature to load
|
532 |
* @return the {@link FeatureProvider} being referenced
|
533 |
* @throws DataException
|
534 |
* if there is an error loading the {@link FeatureProvider}
|
535 |
*/
|
536 |
protected abstract FeatureProvider internalGetFeatureProviderByReference( |
537 |
FeatureReferenceProviderServices reference, FeatureType featureType) |
538 |
throws DataException;
|
539 |
|
540 |
public static class FeatureProviderNotFoundException extends DataException { |
541 |
|
542 |
private static final long serialVersionUID = 5161749797695723151L; |
543 |
|
544 |
public FeatureProviderNotFoundException(FeatureReference reference) {
|
545 |
super("Cannot retreive FeatureProvider for reference %(reference)", |
546 |
"_FeatureProviderNotFoundException", serialVersionUID);
|
547 |
setValue("reference", reference.toString());
|
548 |
} |
549 |
} |
550 |
|
551 |
public boolean isKnownEnvelope(){ |
552 |
return true; |
553 |
} |
554 |
|
555 |
public boolean hasRetrievedFeaturesLimit(){ |
556 |
return false; |
557 |
} |
558 |
|
559 |
public int getRetrievedFeaturesLimit(){ |
560 |
return -1; |
561 |
} |
562 |
|
563 |
public Interval getInterval() {
|
564 |
return null; |
565 |
} |
566 |
|
567 |
public Collection getTimes() { |
568 |
// TODO Auto-generated method stub
|
569 |
return null; |
570 |
} |
571 |
|
572 |
public Collection getTimes(Interval interval) { |
573 |
// TODO Auto-generated method stub
|
574 |
return null; |
575 |
} |
576 |
|
577 |
@Override
|
578 |
public ExpressionBuilder createExpression() {
|
579 |
ExpressionBuilder builder = ExpressionEvaluatorLocator.getManager().createExpressionBuilder(); |
580 |
return builder;
|
581 |
} |
582 |
|
583 |
protected void savePrjFile(File dataFile, IProjection proj){ |
584 |
File file = new File(FilenameUtils.removeExtension(dataFile.getAbsolutePath())+".prj"); |
585 |
try {
|
586 |
String export = proj.export(ICRSFactory.FORMAT_WKT_ESRI); |
587 |
if(export!=null){ |
588 |
OutputStream os = null; |
589 |
try {
|
590 |
os = new BufferedOutputStream(FileUtils.openOutputStream(file)); |
591 |
IOUtils.write(export, os, StandardCharsets.UTF_8);
|
592 |
} finally {
|
593 |
IOUtils.closeQuietly(os); |
594 |
} |
595 |
} |
596 |
} catch (Exception e) { |
597 |
logger.info("Can't write prj file '" + file.getAbsolutePath() + "'."); |
598 |
} |
599 |
} |
600 |
|
601 |
@Override
|
602 |
public boolean isTemporary() { |
603 |
return false; |
604 |
} |
605 |
|
606 |
@Override
|
607 |
public void fixFeatureTypeFromParameters() { |
608 |
|
609 |
} |
610 |
|
611 |
@Override
|
612 |
public boolean supportsPassThroughMode() { |
613 |
return false; |
614 |
} |
615 |
|
616 |
@Override
|
617 |
public void passThroughInsert(FeatureProvider featureProvider) throws DataException { |
618 |
throw new UnsupportedOperationException(); |
619 |
} |
620 |
|
621 |
@Override
|
622 |
public void passThroughUpdate(FeatureProvider featureProvider) throws DataException { |
623 |
throw new UnsupportedOperationException(); |
624 |
} |
625 |
|
626 |
@Override
|
627 |
public void passThroughDelete(FeatureReferenceProviderServices featureReference) throws DataException { |
628 |
throw new UnsupportedOperationException(); |
629 |
} |
630 |
|
631 |
@Override
|
632 |
public void passThroughDelete(Expression filter) throws DataException { |
633 |
throw new UnsupportedOperationException(); |
634 |
} |
635 |
|
636 |
@Override
|
637 |
public void passThroughUpdate(Object[] parameters, Expression filter){ |
638 |
throw new UnsupportedOperationException(); |
639 |
} |
640 |
|
641 |
@Override
|
642 |
public String toString() { |
643 |
try {
|
644 |
ToStringBuilder builder = new ToStringBuilder(this); |
645 |
builder.append("parameters", this.parameters, true); |
646 |
return builder.toString();
|
647 |
} catch (Exception e) { |
648 |
return super.toString(); |
649 |
} |
650 |
} |
651 |
} |