Revision 43450
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/jdbc/DefaultJDBCConnectionPanel.java | ||
---|---|---|
371 | 371 |
this.cboConnectors.addItem(new ServerExplorerParametersComboItem("",null)); |
372 | 372 |
|
373 | 373 |
for (DataFactory factory : dataManager.getServerExplorerRegister() ) { |
374 |
if( factory.isHidden() ) { |
|
375 |
continue; |
|
376 |
} |
|
374 | 377 |
DataServerExplorerParameters params = (DataServerExplorerParameters) factory.createParameters(); |
375 | 378 |
if ( params instanceof JDBCServerExplorerParameters ) { |
376 | 379 |
if( this.connectorFilter==null || this.connectorFilter.accept((JDBCServerExplorerParameters) params) ) { |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/DataFactory.java | ||
---|---|---|
10 | 10 |
public String getName(); |
11 | 11 |
|
12 | 12 |
public String getDescription(); |
13 |
|
|
14 |
public boolean isHidden(); |
|
13 | 15 |
|
14 | 16 |
public DynObject createParameters(); |
15 | 17 |
|
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/AbstractFeatureStoreProviderFactory.java | ||
---|---|---|
41 | 41 |
super(name, description); |
42 | 42 |
} |
43 | 43 |
|
44 |
public AbstractFeatureStoreProviderFactory(String name, String description, boolean hidden) { |
|
45 |
super(name, description, hidden); |
|
46 |
} |
|
47 |
|
|
44 | 48 |
public int allowMultipleGeometryTypes() { |
45 | 49 |
return UNKNOWN; |
46 | 50 |
} |
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/spi/AbstractDataServerExplorerFactory.java | ||
---|---|---|
1 |
|
|
2 | 1 |
package org.gvsig.fmap.dal.spi; |
3 | 2 |
|
4 |
import org.apache.commons.lang3.StringUtils; |
|
5 | 3 |
import org.gvsig.fmap.dal.DataFactoryUnit; |
6 | 4 |
import org.gvsig.fmap.dal.DataServerExplorerFactory; |
7 | 5 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
... | ... | |
10 | 8 |
import org.gvsig.tools.dynobject.DynObject; |
11 | 9 |
import org.gvsig.tools.service.spi.Services; |
12 | 10 |
|
13 |
public abstract class AbstractDataServerExplorerFactory |
|
11 |
public abstract class AbstractDataServerExplorerFactory |
|
12 |
extends AbstractDataFactory |
|
14 | 13 |
implements DataServerExplorerFactory { |
15 |
private String name = null; |
|
16 |
private String description = ""; |
|
17 | 14 |
|
15 |
protected AbstractDataServerExplorerFactory(String name, String description) { |
|
16 |
super(name, description); |
|
17 |
} |
|
18 | 18 |
|
19 |
protected AbstractDataServerExplorerFactory(String name, String description) { |
|
20 |
this.name = name; |
|
21 |
this.description = description; |
|
22 |
} |
|
19 |
protected AbstractDataServerExplorerFactory(String name, String description, boolean hidden) { |
|
20 |
super(name, description,hidden); |
|
21 |
} |
|
23 | 22 |
|
24 |
@Override |
|
25 |
public DataFactoryUnit create(DynObject parameters, Services services) { |
|
26 |
try { |
|
27 |
return this.create( |
|
28 |
(DataServerExplorerParameters)parameters, |
|
29 |
(DataServerExplorerProviderServices)services |
|
30 |
); |
|
31 |
} catch (InitializeException ex) { |
|
32 |
throw new RuntimeException(ex); |
|
33 |
} |
|
23 |
@Override |
|
24 |
public DataFactoryUnit create(DynObject parameters, Services services) { |
|
25 |
try { |
|
26 |
return this.create( |
|
27 |
(DataServerExplorerParameters) parameters, |
|
28 |
(DataServerExplorerProviderServices) services |
|
29 |
); |
|
30 |
} catch (InitializeException ex) { |
|
31 |
throw new RuntimeException(ex); |
|
34 | 32 |
} |
35 |
|
|
36 |
@Override |
|
37 |
public final String getName() { |
|
38 |
return this.name; |
|
39 |
} |
|
33 |
} |
|
40 | 34 |
|
41 |
@Override |
|
42 |
public final String getDescription() { |
|
43 |
if( StringUtils.isEmpty(this.description) ) { |
|
44 |
return this.name; |
|
45 |
} |
|
46 |
return this.description; |
|
47 |
} |
|
35 |
@Override |
|
36 |
public int allowCreate() { |
|
37 |
return UNKNOWN; |
|
38 |
} |
|
48 | 39 |
|
49 |
@Override
|
|
50 |
public int allowCreate() {
|
|
51 |
return UNKNOWN;
|
|
52 |
}
|
|
40 |
@Override |
|
41 |
public int hasTabularSupport() {
|
|
42 |
return UNKNOWN;
|
|
43 |
}
|
|
53 | 44 |
|
54 |
@Override
|
|
55 |
public int hasTabularSupport() {
|
|
56 |
return UNKNOWN;
|
|
57 |
}
|
|
45 |
@Override |
|
46 |
public int hasVectorialSupport() {
|
|
47 |
return UNKNOWN;
|
|
48 |
}
|
|
58 | 49 |
|
59 |
@Override |
|
60 |
public int hasVectorialSupport() { |
|
61 |
return UNKNOWN; |
|
62 |
} |
|
63 |
|
|
64 |
@Override |
|
65 |
public int hasRasterSupport() { |
|
66 |
return UNKNOWN; |
|
67 |
} |
|
50 |
@Override |
|
51 |
public int hasRasterSupport() { |
|
52 |
return UNKNOWN; |
|
53 |
} |
|
68 | 54 |
} |
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/spi/AbstractDataStoreProviderFactory.java | ||
---|---|---|
30 | 30 |
import org.gvsig.tools.dynobject.DynObject; |
31 | 31 |
import org.gvsig.tools.service.spi.Services; |
32 | 32 |
|
33 |
public abstract class AbstractDataStoreProviderFactory implements |
|
34 |
DataStoreProviderFactory { |
|
33 |
public abstract class AbstractDataStoreProviderFactory |
|
34 |
extends AbstractDataFactory |
|
35 |
implements DataStoreProviderFactory { |
|
35 | 36 |
|
36 |
private String name = null; |
|
37 |
private String description = ""; |
|
37 |
protected AbstractDataStoreProviderFactory(String name, String description) { |
|
38 |
super(name, description); |
|
39 |
} |
|
38 | 40 |
|
41 |
protected AbstractDataStoreProviderFactory(String name, String description, boolean hidden) { |
|
42 |
super(name, description,hidden); |
|
43 |
} |
|
39 | 44 |
|
40 |
protected AbstractDataStoreProviderFactory(String name, String description) { |
|
41 |
this.name = name; |
|
42 |
this.description = description; |
|
43 |
} |
|
44 |
|
|
45 |
@Override |
|
46 |
public DataFactoryUnit create(DynObject parameters, Services providerServices) { |
|
47 |
try { |
|
48 |
return this.createProvider( |
|
49 |
(DataParameters)parameters, |
|
50 |
(DataStoreProviderServices)providerServices |
|
51 |
); |
|
52 |
} catch (InitializeException ex) { |
|
53 |
throw new RuntimeException(ex); |
|
54 |
} |
|
45 |
@Override |
|
46 |
public DataFactoryUnit create(DynObject parameters, Services providerServices) { |
|
47 |
try { |
|
48 |
return this.createProvider( |
|
49 |
(DataParameters) parameters, |
|
50 |
(DataStoreProviderServices) providerServices |
|
51 |
); |
|
52 |
} catch (InitializeException ex) { |
|
53 |
throw new RuntimeException(ex); |
|
55 | 54 |
} |
55 |
} |
|
56 | 56 |
|
57 |
@Override
|
|
58 |
public final String getName() {
|
|
59 |
return this.name;
|
|
60 |
}
|
|
57 |
@Override |
|
58 |
public int allowRead() {
|
|
59 |
return UNKNOWN;
|
|
60 |
}
|
|
61 | 61 |
|
62 |
@Override
|
|
63 |
public final String getDescription() {
|
|
64 |
return this.description;
|
|
65 |
}
|
|
62 |
@Override |
|
63 |
public int allowWrite() {
|
|
64 |
return UNKNOWN;
|
|
65 |
}
|
|
66 | 66 |
|
67 |
@Override
|
|
68 |
public int allowRead() {
|
|
69 |
return UNKNOWN;
|
|
70 |
}
|
|
67 |
@Override |
|
68 |
public int allowCreate() {
|
|
69 |
return UNKNOWN;
|
|
70 |
}
|
|
71 | 71 |
|
72 |
@Override
|
|
73 |
public int allowWrite() {
|
|
74 |
return UNKNOWN;
|
|
75 |
}
|
|
72 |
@Override |
|
73 |
public int hasTabularSupport() {
|
|
74 |
return UNKNOWN;
|
|
75 |
}
|
|
76 | 76 |
|
77 |
@Override
|
|
78 |
public int allowCreate() {
|
|
79 |
return UNKNOWN;
|
|
80 |
}
|
|
77 |
@Override |
|
78 |
public int hasVectorialSupport() {
|
|
79 |
return UNKNOWN;
|
|
80 |
}
|
|
81 | 81 |
|
82 |
@Override
|
|
83 |
public int hasTabularSupport() {
|
|
84 |
return UNKNOWN;
|
|
85 |
}
|
|
82 |
@Override |
|
83 |
public int hasRasterSupport() {
|
|
84 |
return UNKNOWN;
|
|
85 |
}
|
|
86 | 86 |
|
87 |
@Override |
|
88 |
public int hasVectorialSupport() { |
|
89 |
return UNKNOWN; |
|
90 |
} |
|
91 |
|
|
92 |
@Override |
|
93 |
public int hasRasterSupport() { |
|
94 |
return UNKNOWN; |
|
95 |
} |
|
96 |
|
|
97 | 87 |
@Override |
98 | 88 |
public int worksBestTiled() { |
99 | 89 |
return UNKNOWN; |
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/spi/AbstractDataFactory.java | ||
---|---|---|
1 |
package org.gvsig.fmap.dal.spi; |
|
2 |
|
|
3 |
import org.apache.commons.lang3.StringUtils; |
|
4 |
import org.gvsig.fmap.dal.DataFactory; |
|
5 |
|
|
6 |
public abstract class AbstractDataFactory implements DataFactory { |
|
7 |
|
|
8 |
private String name = null; |
|
9 |
private String description = ""; |
|
10 |
private boolean hidden = false; |
|
11 |
|
|
12 |
protected AbstractDataFactory(String name, String description, boolean hidden) { |
|
13 |
this.name = name; |
|
14 |
this.description = description; |
|
15 |
this.hidden = hidden; |
|
16 |
} |
|
17 |
|
|
18 |
protected AbstractDataFactory(String name, String description) { |
|
19 |
this(name, description, false); |
|
20 |
} |
|
21 |
|
|
22 |
@Override |
|
23 |
public final String getName() { |
|
24 |
return this.name; |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
28 |
public final String getDescription() { |
|
29 |
if( StringUtils.isEmpty(this.description) ) { |
|
30 |
return this.name; |
|
31 |
} |
|
32 |
return this.description; |
|
33 |
} |
|
34 |
|
|
35 |
@Override |
|
36 |
public boolean isHidden() { |
|
37 |
return this.hidden; |
|
38 |
} |
|
39 |
|
|
40 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/JSIRSpatialIndexProviderFactory.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import org.gvsig.fmap.dal.DataFactory; |
4 | 4 |
import org.gvsig.fmap.dal.DataFactoryUnit; |
5 |
import org.gvsig.fmap.dal.spi.AbstractDataFactory; |
|
5 | 6 |
import org.gvsig.tools.dynobject.DynObject; |
6 | 7 |
import org.gvsig.tools.service.spi.Services; |
7 | 8 |
|
8 |
public class JSIRSpatialIndexProviderFactory implements DataFactory { |
|
9 |
public class JSIRSpatialIndexProviderFactory |
|
10 |
extends AbstractDataFactory |
|
11 |
implements DataFactory |
|
12 |
{ |
|
9 | 13 |
|
10 |
@Override |
|
11 |
public String getName() { |
|
12 |
return JSIRSpatialIndexProvider.NAME; |
|
14 |
public JSIRSpatialIndexProviderFactory() { |
|
15 |
super(JSIRSpatialIndexProvider.NAME, ""); |
|
13 | 16 |
} |
14 | 17 |
|
15 | 18 |
@Override |
16 |
public String getDescription() { |
|
17 |
return ""; |
|
18 |
} |
|
19 |
|
|
20 |
@Override |
|
21 | 19 |
public DataFactoryUnit create(DynObject parameters, Services services) { |
22 | 20 |
return new JSIRSpatialIndexProvider(); |
23 | 21 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/MemorySpatialIndexProviderFactory.java | ||
---|---|---|
3 | 3 |
|
4 | 4 |
import org.gvsig.fmap.dal.DataFactory; |
5 | 5 |
import org.gvsig.fmap.dal.DataFactoryUnit; |
6 |
import org.gvsig.fmap.dal.spi.AbstractDataFactory; |
|
6 | 7 |
import org.gvsig.tools.dynobject.DynObject; |
7 | 8 |
import org.gvsig.tools.service.spi.Services; |
8 | 9 |
|
9 | 10 |
|
10 |
public class MemorySpatialIndexProviderFactory implements DataFactory { |
|
11 |
public class MemorySpatialIndexProviderFactory |
|
12 |
extends AbstractDataFactory |
|
13 |
implements DataFactory |
|
14 |
{ |
|
11 | 15 |
|
12 |
@Override |
|
13 |
public String getName() { |
|
14 |
return MemorySpatialIndexProvider.NAME; |
|
16 |
public MemorySpatialIndexProviderFactory() { |
|
17 |
super(MemorySpatialIndexProvider.NAME, ""); |
|
15 | 18 |
} |
16 |
|
|
17 |
@Override |
|
18 |
public String getDescription() { |
|
19 |
return ""; |
|
20 |
} |
|
21 | 19 |
|
22 | 20 |
@Override |
23 | 21 |
public DataFactoryUnit create(DynObject parameters, Services services) { |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/DefaultDataManager.java | ||
---|---|---|
8 | 8 |
import java.util.HashMap; |
9 | 9 |
import java.util.List; |
10 | 10 |
import java.util.Map; |
11 |
import org.apache.commons.lang3.StringUtils; |
|
11 | 12 |
|
12 | 13 |
import org.gvsig.fmap.dal.DataFactory; |
13 | 14 |
import org.gvsig.fmap.dal.DataManager; |
... | ... | |
73 | 74 |
import org.gvsig.tools.identitymanagement.SimpleIdentityManager; |
74 | 75 |
import org.gvsig.tools.identitymanagement.UnauthorizedException; |
75 | 76 |
import org.gvsig.tools.service.spi.Services; |
77 |
import org.slf4j.Logger; |
|
78 |
import org.slf4j.LoggerFactory; |
|
76 | 79 |
|
77 | 80 |
public class DefaultDataManager |
78 | 81 |
implements DataManager, DataManagerProviderServices, Services { |
79 | 82 |
|
83 |
private static final Logger logger = LoggerFactory.getLogger(DefaultDataManager.class); |
|
84 |
|
|
80 | 85 |
final static private String DATA_MANAGER_CACHE = "Data.manager.caches"; |
81 | 86 |
final static private String DATA_MANAGER_CACHE_DESCRIPTION = |
82 | 87 |
"DAL cache providers"; |
... | ... | |
304 | 309 |
@Override |
305 | 310 |
public DataServerExplorer openServerExplorer(String explorerName, DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException { |
306 | 311 |
DataFactory explorerFactory = this.getServerExplorerRegister().getFactory(explorerName); |
312 |
if( explorerFactory == null ) { |
|
313 |
String msg = "Can't locate server explorer factory for '"+explorerName+"'."; |
|
314 |
logger.warn(msg); |
|
315 |
throw new IllegalArgumentException(msg); |
|
316 |
} |
|
307 | 317 |
if (parameters == null) { |
308 | 318 |
parameters = (DataServerExplorerParameters) explorerFactory.createParameters(); |
309 | 319 |
} |
... | ... | |
377 | 387 |
parameters.validate(); |
378 | 388 |
|
379 | 389 |
String storeName = this.getStoreName(parameters); |
390 |
if( StringUtils.isEmpty(storeName) ) { |
|
391 |
String msg = "Can't locate the store name from the parameters. parameters=" + parameters.toString(); |
|
392 |
logger.warn(msg); |
|
393 |
throw new IllegalArgumentException(msg); |
|
394 |
} |
|
380 | 395 |
|
381 | 396 |
DataStoreFactory_v2_4 storeFactory = (DataStoreFactory_v2_4) this.getStoreRegister().getFactory(storeName); |
397 |
if( storeFactory == null ) { |
|
398 |
String msg = "Can't locate store factory for '"+storeName+"'."; |
|
399 |
logger.warn(msg); |
|
400 |
throw new IllegalArgumentException(msg); |
|
401 |
} |
|
382 | 402 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName); |
403 |
if( providerFactory == null ) { |
|
404 |
String msg = "Can't locate provider factory for '"+providerName+"'."; |
|
405 |
logger.warn(msg); |
|
406 |
throw new IllegalArgumentException(msg); |
|
407 |
} |
|
383 | 408 |
|
384 | 409 |
DataStore store = (DataStore) storeFactory.create(parameters, this); |
385 | 410 |
DataStoreProvider provider = (DataStoreProvider) providerFactory.create(parameters, store); |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/AbstractDataStoreFactory.java | ||
---|---|---|
2 | 2 |
package org.gvsig.fmap.dal.impl; |
3 | 3 |
|
4 | 4 |
import org.gvsig.fmap.dal.DataStoreFactory_v2_4; |
5 |
import org.gvsig.fmap.dal.spi.AbstractDataFactory; |
|
5 | 6 |
|
6 | 7 |
|
7 | 8 |
public abstract class AbstractDataStoreFactory |
9 |
extends AbstractDataFactory |
|
8 | 10 |
implements DataStoreFactory_v2_4 |
9 | 11 |
{ |
10 |
|
|
11 |
private final String name; |
|
12 |
private final String description; |
|
13 | 12 |
|
14 | 13 |
protected AbstractDataStoreFactory( |
15 | 14 |
String name, |
16 | 15 |
String description |
17 | 16 |
) { |
18 |
this.name = name; |
|
19 |
this.description = description; |
|
17 |
super(name, description); |
|
20 | 18 |
} |
21 |
@Override |
|
22 |
public String getName() { |
|
23 |
return this.name; |
|
19 |
|
|
20 |
protected AbstractDataStoreFactory( |
|
21 |
String name, |
|
22 |
String description, |
|
23 |
boolean hidden |
|
24 |
) { |
|
25 |
super(name, description, hidden); |
|
24 | 26 |
} |
25 |
|
|
26 |
@Override |
|
27 |
public String getDescription() { |
|
28 |
return this.description; |
|
29 |
} |
|
30 | 27 |
|
31 | 28 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/impl/JDBCServerExplorerFactory.java | ||
---|---|---|
28 | 28 |
super(name,description); |
29 | 29 |
} |
30 | 30 |
|
31 |
protected JDBCServerExplorerFactory(String name, String description, boolean hidden) { |
|
32 |
super(name,description, hidden); |
|
33 |
} |
|
34 |
|
|
31 | 35 |
@Override |
32 | 36 |
public JDBCServerExplorer create( |
33 | 37 |
DataServerExplorerParameters parameters, |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/impl/JDBCStoreProviderFactory.java | ||
---|---|---|
50 | 50 |
protected JDBCStoreProviderFactory(String name, String description) { |
51 | 51 |
super(name, description); |
52 | 52 |
} |
53 |
|
|
54 |
protected JDBCStoreProviderFactory(String name, String description, boolean hidden) { |
|
55 |
super(name, description, hidden); |
|
56 |
} |
|
53 | 57 |
|
54 | 58 |
@Override |
55 | 59 |
public JDBCStoreProvider createProvider( |
Also available in: Unified diff