Package railo.runtime.type.dt

Examples of railo.runtime.type.dt.TimeSpan


    boolean _isInit=isinit;
    super.touchAfterRequest(pc);
    if(!_isInit) return;
   
    ApplicationContext ac=pc.getApplicationContext();
    TimeSpan timespan=(getType()==SCOPE_CLIENT)?ac.getClientTimeout():ac.getSessionTimeout();
    Cookie cookie = pc.cookieScope();
   
   
    Date exp = new DateTimeImpl(pc,System.currentTimeMillis()+timespan.getMillis(),true);
    try {
      String ser=serializer.serializeStruct(sct, ignoreSet);
      if(hasChanges()){
        cookie.setCookie(KeyImpl.init(cookieName), ser,exp, false, "/", null);
      }
View Full Code Here


        sct.set("clientCookies",Caster.toBoolean(config.isClientCookies()));
        sct.set("clientStorage",config.getClientStorage());
        sct.set("sessionStorage",config.getSessionStorage());

       
        TimeSpan ts=config.getSessionTimeout();
        sct.set("sessionTimeout",ts);
        sct.set("sessionTimeout_day",Caster.toInteger(ts.getDay()));
        sct.set("sessionTimeout_hour",Caster.toInteger(ts.getHour()));
        sct.set("sessionTimeout_minute",Caster.toInteger(ts.getMinute()));
        sct.set("sessionTimeout_second",Caster.toInteger(ts.getSecond()));

        ts=config.getApplicationTimeout();
        sct.set("applicationTimeout",ts);
        sct.set("applicationTimeout_day",Caster.toInteger(ts.getDay()));
        sct.set("applicationTimeout_hour",Caster.toInteger(ts.getHour()));
        sct.set("applicationTimeout_minute",Caster.toInteger(ts.getMinute()));
        sct.set("applicationTimeout_second",Caster.toInteger(ts.getSecond()));

        ts=config.getClientTimeout();
        sct.set("clientTimeout",ts);
        sct.set("clientTimeout_day",Caster.toInteger(ts.getDay()));
        sct.set("clientTimeout_hour",Caster.toInteger(ts.getHour()));
        sct.set("clientTimeout_minute",Caster.toInteger(ts.getMinute()));
        sct.set("clientTimeout_second",Caster.toInteger(ts.getSecond()));
       
       
        // scope cascading type
        if(config.getScopeCascadingType()==Config.SCOPE_STRICT) sct.set("scopeCascadingType","strict");
        else if(config.getScopeCascadingType()==Config.SCOPE_SMALL) sct.set("scopeCascadingType","small");
View Full Code Here

   
  }
  private void doPut() throws PageException {
    required("cache", "id", id);
    required("cache", "value", value);
    TimeSpan ts = timespan;
    TimeSpan it = idletime;
    if(ts==TIMESPAN_FAR_AWAY)ts=TIMESPAN_0;
    if(it==TIMESPAN_FAR_AWAY)it=TIMESPAN_0;
    CachePut.call(pageContext, Caster.toString(id),value,ts,it,cachename);
  }
View Full Code Here

      values=list.toArray(new DateTime[list.size()]);
    }
    // Timespan
    else if(type==CFTypes.TYPE_TIMESPAN) {
      List<TimeSpan> list=new ArrayList<TimeSpan>();
      TimeSpan ts;
      for(int i=0;i<res.length;i++){
        ts=Caster.toTimespan(res[i],null);
        if(ts!=null)list.add(ts);
      }
      values=list.toArray(new TimeSpan[list.size()]);
View Full Code Here

 
  public static Object toTimespan(long timespan) {
    if(timespan==0)return "";
   
    TimeSpan ts = TimeSpanImpl.fromMillis(timespan);
    if(ts==null)return "";
    return ts;
  }
View Full Code Here

      else if (hasCS)
        config.setAllowURLRequestTimeout(configServer.isAllowURLRequestTimeout());
    }

    // Req Timeout
    TimeSpan ts=null;
    if(hasAccess) {
      String reqTimeoutApplication = application.getAttribute("requesttimeout");
      String reqTimeoutScope = scope.getAttribute("requesttimeout"); // deprecated
     
      if (!StringUtil.isEmpty(reqTimeoutApplication)) ts=Caster.toTimespan(reqTimeoutApplication);
      if (ts==null && !StringUtil.isEmpty(reqTimeoutScope))  ts=Caster.toTimespan(reqTimeoutScope);
    }
   
    if (ts!=null && ts.getMillis()>0) config.setRequestTimeout(ts);
    else if (hasCS) config.setRequestTimeout(configServer.getRequestTimeout());

    // Req Timeout Log
    String strReqTimeLog = application.getAttribute("requesttimeout-log");
    if (StringUtil.isEmpty(strReqTimeLog))
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

TOP

Related Classes of railo.runtime.type.dt.TimeSpan

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.