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

de.zib.gndms.model.common.PersistentContract Class Reference

A PersistenContract can be transformed to an Quote. More...

Inherits java::io::Serializable.

List of all members.

Public Member Functions

void mold (final @NotNull PersistentContract instance)

Static Public Member Functions

static PersistentContract acceptQuoteAt (DateTime dt, Quote quote)
static PersistentContract acceptQuoteNow (Quote quote)

Static Protected Member Functions

static PersistentContract acceptQuoteAsIs (Quote quote)
 Creates a persistent-contract form this contract by fixing future time using the accepted time stamp.

Private Attributes

DateTime accepted
DateTime deadline
DateTime resultValidity
Long expectedSize

Static Private Attributes

static final long serialVersionUID = -7695057432890400329L

Detailed Description

A PersistenContract can be transformed to an Quote.

See also:
de.zib.gndms.common.model.gorfx.types.Quote
Author:
try ste fan pla nti kow zib
Version:
$Id$

User: stepn Date: 24.11.2008 Time: 15:22:43


Member Function Documentation

static PersistentContract de.zib.gndms.model.common.PersistentContract.acceptQuoteAsIs ( Quote  quote) [static, protected]

Creates a persistent-contract form this contract by fixing future time using the accepted time stamp.

Returns:
A persistent-contract representing this contract.

todo maybe set fixed values here

Note:
The created contract may be invalid wrt its jpa constraints.
Parameters:
quote
                                                                       {

        PersistentContract pc = new PersistentContract();
        pc.setAccepted( quote.getAccepted() );

        DateTime fixedDeadline = null;
        if ( quote.hasDeadline() ) {
            fixedDeadline = quote.getDeadline().fixedWith( quote.getAccepted() ).getFixedTime();
            pc.setDeadline( fixedDeadline );
        }

        if ( quote.hasResultValidity() ) {
            DateTime fixedResultValidity;
            if ( fixedDeadline != null )
                fixedResultValidity = quote.getResultValidity().fixedWith( fixedDeadline ).getFixedTime();
            else {
                fixedResultValidity = quote.getResultValidity().fixedWith( quote.getAccepted() ).getFixedTime();
            }
            pc.setResultValidity( fixedResultValidity );
        }

        if ( quote.hasExpectedSize() )
            pc.setExpectedSize( quote.getExpectedSize() );
        return pc;
    }
void de.zib.gndms.model.common.PersistentContract.mold ( final @NotNull PersistentContract  instance)
See also:
de.zib.gndms.stuff.mold.Molder
                                                                 {
        instance.accepted = Copier.copy(true, accepted);
        instance.deadline = Copier.copy(true, deadline);
        instance.resultValidity = Copier.copy(true, resultValidity);
        setExpectedSize(Copier.copy(true, getExpectedSize()));
    }

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