270 |
270 |
|
271 |
271 |
@Override
|
272 |
272 |
public DataStoreParameters createStoreParameters(String providerName) throws InitializeException, ProviderNotRegisteredException {
|
|
273 |
if( providerName == null ) {
|
|
274 |
String msg = "Provider name can't be null.";
|
|
275 |
logger.warn(msg);
|
|
276 |
throw new IllegalArgumentException(msg);
|
|
277 |
}
|
273 |
278 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName);
|
|
279 |
if( providerFactory == null ) {
|
|
280 |
String msg = "Can't locate provider factory for '"+providerName+"'.";
|
|
281 |
logger.warn(msg);
|
|
282 |
throw new IllegalArgumentException(msg);
|
|
283 |
}
|
274 |
284 |
return (DataStoreParameters) providerFactory.createParameters();
|
275 |
285 |
}
|
276 |
286 |
|
... | ... | |
286 |
296 |
|
287 |
297 |
@Override
|
288 |
298 |
public DataServerExplorerParameters createServerExplorerParameters(String explorerName) throws InitializeException, ProviderNotRegisteredException {
|
|
299 |
if( explorerName == null ) {
|
|
300 |
String msg = "Explorer name can't be null.";
|
|
301 |
logger.warn(msg);
|
|
302 |
throw new IllegalArgumentException(msg);
|
|
303 |
}
|
289 |
304 |
DataFactory explorerFactory = this.getServerExplorerRegister().getFactory(explorerName);
|
290 |
305 |
if( explorerFactory == null ) {
|
291 |
306 |
String msg = "Can't locate server explorer factory for '"+explorerName+"'.";
|
... | ... | |
313 |
328 |
|
314 |
329 |
@Override
|
315 |
330 |
public DataServerExplorer openServerExplorer(String explorerName, DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException {
|
|
331 |
if( explorerName == null ) {
|
|
332 |
String msg = "Explorer name can't be null.";
|
|
333 |
logger.warn(msg);
|
|
334 |
throw new IllegalArgumentException(msg);
|
|
335 |
}
|
316 |
336 |
DataFactory explorerFactory = this.getServerExplorerRegister().getFactory(explorerName);
|
317 |
337 |
if( explorerFactory == null ) {
|
318 |
338 |
String msg = "Can't locate server explorer factory for '"+explorerName+"'.";
|
... | ... | |
337 |
357 |
// llamar al que toca.
|
338 |
358 |
return openServerExplorer(explorerName, (DataServerExplorerParameters)(arguments[0]));
|
339 |
359 |
}
|
|
360 |
if( explorerName == null ) {
|
|
361 |
String msg = "Explorer name can't be null.";
|
|
362 |
logger.warn(msg);
|
|
363 |
throw new IllegalArgumentException(msg);
|
|
364 |
}
|
340 |
365 |
if( (arguments.length % 2)!= 0 ) {
|
341 |
366 |
throw new ValidateDataParametersException();
|
342 |
367 |
}
|
... | ... | |
383 |
408 |
|
384 |
409 |
@Override
|
385 |
410 |
public DataStore openStore(String providerName, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException {
|
386 |
|
|
|
411 |
if( providerName == null ) {
|
|
412 |
String msg = "Provider name can't be null.";
|
|
413 |
logger.warn(msg);
|
|
414 |
throw new IllegalArgumentException(msg);
|
|
415 |
}
|
387 |
416 |
SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager();
|
388 |
417 |
if (!identityManager.getCurrentIdentity().isAuthorized(READ_STORE_AUTHORIZATION, parameters, providerName)) {
|
389 |
418 |
throw new UnauthorizedException(READ_STORE_AUTHORIZATION, parameters, providerName);
|
... | ... | |
439 |
468 |
if( (arguments.length % 2)!= 0 ) {
|
440 |
469 |
throw new ValidateDataParametersException();
|
441 |
470 |
}
|
|
471 |
if( providerName == null ) {
|
|
472 |
String msg = "Provider name can't be null.";
|
|
473 |
logger.warn(msg);
|
|
474 |
throw new IllegalArgumentException(msg);
|
|
475 |
}
|
442 |
476 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName);
|
443 |
477 |
DataStoreParameters parameters = (DataStoreParameters) providerFactory.createParameters();
|
444 |
478 |
for( int i=0; i<arguments.length; i+=2 ) {
|
... | ... | |
462 |
496 |
|
463 |
497 |
@Override
|
464 |
498 |
public DataStoreProviderFactory getStoreProviderFactory(String providerName) {
|
|
499 |
if( providerName == null ) {
|
|
500 |
String msg = "Provider name can't be null.";
|
|
501 |
logger.warn(msg);
|
|
502 |
throw new IllegalArgumentException(msg);
|
|
503 |
}
|
465 |
504 |
DataFactory providerFactory = this.getStoreProviderRegister().getFactory(providerName);
|
466 |
505 |
return (DataStoreProviderFactory) providerFactory;
|
467 |
506 |
}
|
... | ... | |
473 |
512 |
|
474 |
513 |
@Override
|
475 |
514 |
public List<String> getStoreProviders(String explorerName) {
|
|
515 |
if( explorerName == null ) {
|
|
516 |
String msg = "Explorer name can't be null.";
|
|
517 |
logger.warn(msg);
|
|
518 |
throw new IllegalArgumentException(msg);
|
|
519 |
}
|
476 |
520 |
try {
|
477 |
521 |
DataServerExplorer explorer = openServerExplorer(explorerName, (DataServerExplorerParameters)null);
|
478 |
522 |
List names = explorer.getDataStoreProviderNames();
|
... | ... | |
608 |
652 |
|
609 |
653 |
@Override
|
610 |
654 |
public void newStore(String explorerName, String providerName, NewDataStoreParameters parameters, boolean overwrite) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException {
|
|
655 |
if( explorerName == null ) {
|
|
656 |
String msg = "Explorer name can't be null.";
|
|
657 |
logger.warn(msg);
|
|
658 |
throw new IllegalArgumentException(msg);
|
|
659 |
}
|
|
660 |
if( providerName == null ) {
|
|
661 |
String msg = "Provider name can't be null.";
|
|
662 |
logger.warn(msg);
|
|
663 |
throw new IllegalArgumentException(msg);
|
|
664 |
}
|
611 |
665 |
|
612 |
666 |
SimpleIdentityManager identityManager = ToolsLocator.getIdentityManager();
|
613 |
667 |
if (!identityManager.getCurrentIdentity().isAuthorized(CREATE_STORE_AUTHORIZATION, parameters, providerName)) {
|