git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/data-transfer-library@131283 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d46e112929
commit
7198dfa329
|
@ -13,6 +13,7 @@ import org.gcube.data.transfer.library.faults.InvalidDestinationException;
|
||||||
import org.gcube.data.transfer.library.faults.InvalidSourceException;
|
import org.gcube.data.transfer.library.faults.InvalidSourceException;
|
||||||
import org.gcube.data.transfer.library.faults.RemoteServiceException;
|
import org.gcube.data.transfer.library.faults.RemoteServiceException;
|
||||||
import org.gcube.data.transfer.library.faults.SourceNotSetException;
|
import org.gcube.data.transfer.library.faults.SourceNotSetException;
|
||||||
|
import org.gcube.data.transfer.library.faults.UnreachableNodeException;
|
||||||
import org.gcube.data.transfer.library.model.LocalSource;
|
import org.gcube.data.transfer.library.model.LocalSource;
|
||||||
import org.gcube.data.transfer.library.model.Source;
|
import org.gcube.data.transfer.library.model.Source;
|
||||||
import org.gcube.data.transfer.library.model.StorageSource;
|
import org.gcube.data.transfer.library.model.StorageSource;
|
||||||
|
@ -121,9 +122,13 @@ public abstract class Transferer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkDestination() throws InvalidDestinationException,DestinationNotSetException{
|
protected void checkDestination() throws InvalidDestinationException,DestinationNotSetException, UnreachableNodeException{
|
||||||
if(destination==null) throw new DestinationNotSetException();
|
if(destination==null) throw new DestinationNotSetException();
|
||||||
// perform checks
|
if(!destination.getPersistenceId().equals(Destination.DEFAULT_PERSISTENCE_ID)){
|
||||||
|
Set<String> availablePersistenceIds=getDestinationCapabilities().getAvailablePersistenceIds();
|
||||||
|
if(!availablePersistenceIds.contains(destination.getPersistenceId()))
|
||||||
|
throw new InvalidDestinationException("Declared persistence id "+destination.getPersistenceId()+" not found. Available are "+availablePersistenceIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkSource() throws SourceNotSetException, InvalidSourceException{
|
protected void checkSource() throws SourceNotSetException, InvalidSourceException{
|
||||||
|
@ -145,11 +150,11 @@ public abstract class Transferer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransferCapabilities getDestinationCapabilities() throws InitializationException {
|
public TransferCapabilities getDestinationCapabilities() throws UnreachableNodeException {
|
||||||
try{
|
try{
|
||||||
return client.getCapabilties();
|
return client.getCapabilties();
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
throw new InitializationException(e);
|
throw new UnreachableNodeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue