Petals CDK

Add a method to get timeout value if set or its default value

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 5.6.1
  • Fix Version/s: 5.6.2
  • Component/s: configuration
  • Security Level: Public
  • Description:
    Hide

    At an external listener implementation level, to get the consumer timeout value set, it is needed to get it from the class Consumes, and NPE can occurs when converting from Long to long.
    The method getDefaultTimeoutFrom of AbstractListener contains a private method to get the timeout value set on a consumer or a provider, and if not set, a default timeout value is used.
    So, it should be interesting to change the visibility of AbstractListener.getDefaultTimeoutFrom(...) to public, so instead of:

    long timeout = this.restExternalListener.getConsumes().getTimeout(); --> NPE if no timeout set

    we can use something as:

    long timeout = this.restExternalListener.getTimeout(this.restExternalListener.getConsumes());  --> No NPE if no timeout set, a default value is returned
    Show
    At an external listener implementation level, to get the consumer timeout value set, it is needed to get it from the class Consumes, and NPE can occurs when converting from Long to long. The method getDefaultTimeoutFrom of AbstractListener contains a private method to get the timeout value set on a consumer or a provider, and if not set, a default timeout value is used. So, it should be interesting to change the visibility of AbstractListener.getDefaultTimeoutFrom(...) to public, so instead of:
    long timeout = this.restExternalListener.getConsumes().getTimeout(); --> NPE if no timeout set
    we can use something as:
    long timeout = this.restExternalListener.getTimeout(this.restExternalListener.getConsumes());  --> No NPE if no timeout set, a default value is returned
  • Environment:
    -

Issue Links

Activity

Christophe DENEUX made changes - Fri, 24 Feb 2017 - 12:29:33 +0100
Field Original Value New Value
Project Petals BC REST [ 10240 ] Petals CDK [ 10032 ]
Key PETALSBCREST-39 PETALSCDK-181
Affects Version/s 5.6.1 [ 10641 ]
Affects Version/s 1.0.1-BC [ 10648 ]
Component/s configuration [ 10060 ]
Component/s Consumer mode [ 10403 ]
Component/s Provider mode [ 10404 ]
Christophe DENEUX made changes - Fri, 24 Feb 2017 - 12:29:42 +0100
Status New [ 10000 ] Open [ 10002 ]
Priority Major [ 3 ]
Christophe DENEUX made changes - Fri, 24 Feb 2017 - 12:29:45 +0100
Status Open [ 10002 ] In Progress [ 10003 ]
Hide
Christophe DENEUX added a comment - Fri, 24 Feb 2017 - 12:30:59 +0100

Visibility of method changed, and method renamed into getTimeout(...)

Show
Christophe DENEUX added a comment - Fri, 24 Feb 2017 - 12:30:59 +0100 Visibility of method changed, and method renamed into getTimeout(...)
Christophe DENEUX made changes - Fri, 24 Feb 2017 - 12:30:59 +0100
Status In Progress [ 10003 ] Resolved [ 10004 ]
Fix Version/s 5.6.2 [ 10672 ]
Resolution Fixed [ 1 ]
Christophe DENEUX made changes - Fri, 24 Feb 2017 - 12:36:12 +0100
Link This issue blocks PETALSBCREST-40 [ PETALSBCREST-40 ]
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
43s
1
Christophe DENEUX
Fri, 24 Feb 2017 - 12:29:42 +0100
Open Open In Progress In Progress
3s
1
Christophe DENEUX
Fri, 24 Feb 2017 - 12:29:45 +0100
In Progress In Progress Resolved Resolved
1m 14s
1
Christophe DENEUX
Fri, 24 Feb 2017 - 12:30:59 +0100



People

Dates

  • Created:
    Fri, 24 Feb 2017 - 12:28:59 +0100
    Updated:
    Fri, 24 Feb 2017 - 12:36:11 +0100
    Resolved:
    Fri, 24 Feb 2017 - 12:30:59 +0100