Announcement

Collapse
No announcement yet.

Servlet code for internal RateInquiry

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Servlet code for internal RateInquiry

    Code:
    import glog.business.rate.rateinquiry.RateInquiryInput;
    ...
        public RateInquiryResult[] getRates(RateInquiryInput input)
        throws GLException
        {
            RateInquiryResult results[] = null;
            try
            {
                NamingDirectory nd = null;
                RateActionSession session = null;
                try
                {
                    nd = NamingDirectory.get(AppFunction.RIQ);
                    RateActionSessionHome home = (RateActionSessionHome)nd.lookup("RateActionSessionHome");
                    session = home.create();
                    results = session.getRates(input, new UserPreference());
                }
                finally
                {
                    if(session != null)
                        session.remove();
                    if(nd != null)
                        nd.release();
                }
            }
            catch(Throwable t)
            {
                throw FrontEndException.factory(new glog.util.exception.GLException.CausedBy("cause.RiqResult.0001", null, new Object[][] {
                    new Object[] {
                        "destAddress", input.getDestAddress().toString()
                    }, new Object[] {
                        "sourceAddress", input.getSourceAddress().toString()
                    }
                }), t);
            }
            return results;
        }
    Vincent Van
    OTM Customization Service
    [email protected]

  • #2
    Re: Servlet code for internal RateInquiry

    Vincent,
    This looks very interesting, and perhaps something I will never be able to create myself, but could you explain to us what this code can be used for, in lament terms so even I can understand it?
    Thanks,
    Lourens

    Comment


    • #3
      Re: Servlet code for internal RateInquiry

      Lourens,
      This is a customized servlet which used in our project to calculate the KPI date base on the Location,AvailableTime,RateServiceGid,Perspective, TransportMode, etc... The code use internal glog function and object to simulate the RIQ process.
      Basically, we can pass all variables (all items on RIQ query form) to the object "RateInquiryInput" to query the "RateInquiryResult" (the result might be an array), similarly, all items on RIQ result form will return in "RateInquiryResult". We can use it to update earlydeliverdate, etc..
      Any question please let me know, thanks.
      Vincent
      Vincent Van
      OTM Customization Service
      [email protected]

      Comment

      Working...
      X