Package org.apache.axis.types

Examples of org.apache.axis.types.Duration


    durationStrings[ 10 ] = "-P2Y3M8DT8H1M3.3S";

    for( int i = 0; i < durationStrings.length; i++ )
      {
      String durationString = durationStrings[ i ];
      Duration duration =
              new Duration( durationString );

      assertTrue( "Duration string \"" + durationString +
                  "\" not equal to returned: " + duration.toString(),
                  durationString.equals( duration.toString() ) );
      }
    }
View Full Code Here


    private static Duration toDuration(Object value) throws PageException, IllegalArgumentException {
        if(value instanceof Duration) return (Duration) value;
        try {
            TimeSpan ts = Caster.toTimespan(value);
            return new Duration(true, 0, 0, ts.getDay(), ts.getHour(), ts.getMinute(), ts.getSecond());
        } catch (PageException e) {
            return new Duration(Caster.toString(value));
        }
    }
View Full Code Here

        * 0 days
        * 0 hours
        * # minutes
        * 0 seconds
        */
        return new Duration(false, 0, 0, 0, 0, minutes, 0);
    }
View Full Code Here

        * 0 days
        * 0 hours
        * 0 minutes
        * # seconds
        */
        return new Duration(false, 0, 0, 0, 0, 0, seconds);
    }
View Full Code Here

                            statusPort.queryUsedAndReservedTime(new VoidType());
                } catch (RemoteException e) {
                    die(e, "Problem with query", client.isDebugMode());
                }

                Duration used = usedReserved.getUsedTime();
                Duration reserved = usedReserved.getReservedTime();

                if (used == null) {
                    System.err.println("No used minutes " +
                            "information returned");
                } else {
View Full Code Here

            throw new IllegalArgumentException("rpSet may not be null");
        }

        final FactoryRPs rps = new FactoryRPs();

        final Duration defaultRunningTime = rpSet.getDefaultRunningTime();
        if (defaultRunningTime != null) {
            rps.setDefaultRunningSeconds(
                    CommonUtil.durationToSeconds(defaultRunningTime));
        }

        final Duration maxRunningTime = rpSet.getMaximumRunningTime();
        if (maxRunningTime != null) {
            rps.setMaximumRunningSeconds(
                    CommonUtil.durationToSeconds(maxRunningTime));
        }
View Full Code Here

        final DeploymentTime_Type time = this.req.getDeploymentTime();
        if (time == null) {
            throw new ParameterProblem("no DeploymentTime_Type in request?");
        }

        final Duration minDuration = time.getMinDuration();
        if (minDuration == null) {
            throw new ParameterProblem("no minDuration in request?");
        }

        try {
View Full Code Here

            throw new IllegalArgumentException("xmlSched may not be " +
                    "null, use null " + this.getClass().getName() +
                    " reference instead");
        }

        final Duration duration = xmlSched.getDuration();
        this.durationSeconds = CommonUtil.durationToSeconds(duration);

        final Calendar instantiationTime =
                            xmlSched.getActualInstantiationTime();
View Full Code Here

        /* DefaultRunningTime: */
       
        final Integer ttl =
                new Integer(advert.getDefaultRunningTimeSeconds());
        final Duration ttlDur =
                CommonUtil.minutesToDuration(ttl.intValue());
               
        ResourceProperty prop =
                new SimpleResourceProperty(
                        Constants_GT4_0.RP_FACTORY_DefTTL);
        prop.add(ttlDur);
        this.propSet.add(prop);

        /* MaximumRunningTime: */

        final Integer maxttl =
                        new Integer(advert.getMaximumRunningTimeSeconds());
        final Duration maxTtlDur =
                        CommonUtil.minutesToDuration(maxttl.intValue());

        prop = new SimpleResourceProperty(
                        Constants_GT4_0.RP_FACTORY_MaxTTL);
        prop.add(maxTtlDur);
View Full Code Here

        return dep;
    }

    public static DeploymentTime_Type constructDeploymentTime_Type(int durationMinutes) {

        final Duration dur = new Duration();
        dur.setMinutes(durationMinutes);
        return new DeploymentTime_Type(dur);
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.types.Duration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.