GNDMS 0.6.0
RESTful verison of GNDMS
Public Member Functions | Protected Member Functions | Private Attributes

de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder > Class Reference

Inherits de::zib::gndms::logic::model::gorfx::AbstractQuoteCalculator< M >.

List of all members.

Public Member Functions

List< Quote > createQuotes () throws ServerException, IOException, ClientException, URISyntaxException
boolean validate ()
 Weak order validation.
Long getEstimatedTransferSize () throws ServerException, IOException, ClientException
 PRECONDITION estimateTransferSize must have been called before.
Float getEstimatedBandWidth ()
 PRECONDITION estimateBandWidth must have been called before.
boolean uriCheck (String address)
CredentialProvider getCredentialProvider ()
void setScheme (String scheme)
String getScheme ()
MyProxyFactoryProvider getMyProxyFactoryProvider ()
void setMyProxyFactoryProvider (final MyProxyFactoryProvider myProxyFactoryProvider)

Protected Member Functions

Long estimateTransferSize () throws ServerException, IOException, ClientException, URISyntaxException
Float estimateBandWidth () throws IOException
 Estimates the bandwidth.
Quote calculateOffer ()
 PRECONDITION estimateTransferSize and estimateBandWidth or their associated setters must have been called before.
void setEstimatedTransferSize (long estimatedTransferSize)
 Use this method to set the download size manually.
void setEstimatedBandWidth (float estimatedBandWidth)
 Use this method to set the available band-width manually.

Private Attributes

Long estimatedTransferSize
Float estimatedBandWidth
String scheme
MyProxyFactoryProvider myProxyFactoryProvider

Detailed Description

Author:
try ma ik jo rr a zib
Version:
$Id$

User: mjorra, Date: 30.09.2008, Time: 10:51:38


Member Function Documentation

Quote de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder >.calculateOffer ( ) [protected]

PRECONDITION estimateTransferSize and estimateBandWidth or their associated setters must have been called before.

Returns:
The band width NULL if it wasn't estimated yet.
                                      {

        // may at least take 10 s to cover communication overhead.
        long ms = NetworkAuxiliariesProvider.calculateTransferTime( estimatedTransferSize, estimatedBandWidth, 10000 );

        Quote quote = new Quote( );
        quote.setDeadline( FutureTime.atOffset( new Duration( ms ) ) );
        quote.setExpectedSize( estimatedTransferSize );

        return quote;
    }
Float de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder >.getEstimatedBandWidth ( )

PRECONDITION estimateBandWidth must have been called before.

Returns:
The band width NULL if it wasn't estimated yet.
                                          {
        return estimatedBandWidth;
    }
Long de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder >.getEstimatedTransferSize ( ) throws ServerException, IOException, ClientException

PRECONDITION estimateTransferSize must have been called before.

Returns:
The estimated transfer size or NULL if it wasn't estimated yet.
                                                                                                 {
        return estimatedTransferSize;
    }
void de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder >.setEstimatedBandWidth ( float  estimatedBandWidth) [protected]

Use this method to set the available band-width manually.

This is the alternative to calling estimateBandWidth.

Parameters:
estimatedBandWidth-- Guess what.
                                                                     {
        this.estimatedBandWidth = estimatedBandWidth;
    }
void de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder >.setEstimatedTransferSize ( long  estimatedTransferSize) [protected]

Use this method to set the download size manually.

This is the alternativ to calling estimateTransferSize.

Parameters:
estimatedTransferSize-- what the name implies.
                                                                          {
        this.estimatedTransferSize = estimatedTransferSize;
    }
boolean de.zib.gndms.taskflows.filetransfer.server.logic.AbstractTransferQuoteCalculator< M extends FileTransferOrder >.validate ( )

Weak order validation.

Just checks if source and destination URI are provided and are valid URI's. but NOT if the resources exist.

Returns:
true if the parameters are set.
                              {
        FileTransferOrder order = getOrderBean();
        if( order == null )
            throw new IllegalStateException( "No order provided" );

        return uriCheck( order.getSourceURI() ) && uriCheck( order.getDestinationURI() );
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables