Package de.nava.informa.core

Examples of de.nava.informa.core.ChannelUpdatePeriod


    // 0..1 update period element
    Element updatePeriod = channel.getChild("updatePeriod", syNS);
    if (updatePeriod != null) {
      try {
        ChannelUpdatePeriod channelUpdatePeriod = ChannelUpdatePeriod
            .valueFromText(updatePeriod.getTextTrim());
        chnl.setUpdatePeriod(channelUpdatePeriod);
      } catch (IllegalArgumentException ex) {
        logger.warn(updatePeriod.getTextTrim(), ex);
      }
View Full Code Here


  /**
   * Returns the ttl (in order of preference) feed producer ttl (if exists)
   * wantedTtl (if exists) defaultTtl (if exists).
   */
  public long getTtl(ChannelIF channel, long ttlInMs) {
    ChannelUpdatePeriod updatePeriod = channel.getUpdatePeriod();
    int updateFrequency = channel.getUpdateFrequency();

    if (updatePeriod == null) {
      if (ttlInMs > MINIMAL_TTL)
        return ttlInMs;
      return this.defaultTtl;
    }

    if (updateFrequency < 0) {
      updateFrequency = 1;
    }

    long timeToExpire = updatePeriod.getMsInPeriod() / updateFrequency;

    if (ttlInMs > timeToExpire) {
      return ttlInMs;
    }
    return timeToExpire;
View Full Code Here

   * @see org.hibernate.usertype.UserType#nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object)
   */
  public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
      throws HibernateException, SQLException {
    String name = resultSet.getString(names[0]);
    ChannelUpdatePeriod result = null;
    if (!resultSet.wasNull()) {
      result = ChannelUpdatePeriod.valueFromText(name);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of de.nava.informa.core.ChannelUpdatePeriod

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.