Class StdCallbackContext

java.lang.Object
software.amazon.cloudformation.proxy.StdCallbackContext

@ThreadSafe
public class StdCallbackContext
extends java.lang.Object
StdCallbackContext provide a mechanism that automatically provides the memoization for retention and callback of request, responses, stabilize handles during handler invocations. During replay callbacks, this automatically replays responses for different calls along the call graph ensuring that we only execute the portions of the call graph that needs execution and dedupe calls as needed. This is not a sophisticated class that does request inspection based call result, it is primarily a function result memoization that is ensured that it is invoked once. Attempts to call the function multiple times with different arguments will yield the same result for the same call graph key for request(String, Function) and response(String, BiFunction). For stabilize(String, CallChain.Callback), only when True is returned it is memoized.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  StdCallbackContext.Deserializer  
    static class  StdCallbackContext.Serializer  
  • Constructor Summary

    Constructors
    Constructor Description
    StdCallbackContext()  
  • Method Summary

    Modifier and Type Method Description
    int attempts​(java.lang.String callGraph)  
    void attempts​(java.lang.String callGraph, int attempts)  
    java.util.Map<java.lang.String,​java.lang.Object> callGraphs()  
    <R> R evictRequestRecord​(java.lang.String callGraph)  
    <RequestT> java.util.List<RequestT> findAllRequestByContains​(java.lang.String contains)  
    <ResponseT>
    java.util.List<ResponseT>
    findAllResponseByContains​(java.lang.String contains)  
    <RequestT> RequestT findFirstRequestByContains​(java.lang.String contains)  
    <ResponseT>
    ResponseT
    findFirstResponseByContains​(java.lang.String contains)  
    <M,​ R> java.util.function.Function<M,​R> request​(java.lang.String callGraph, java.util.function.Function<M,​R> func)  
    <ResponseT>
    ResponseT
    response​(java.lang.String callGraph)  
    <R,​ C,​ RT> java.util.function.BiFunction<R,​C,​RT> response​(java.lang.String callGraph, java.util.function.BiFunction<R,​C,​RT> func)  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StdCallbackContext

      public StdCallbackContext()
  • Method Details

    • request

      public <M,​ R> java.util.function.Function<M,​R> request​(java.lang.String callGraph, java.util.function.Function<M,​R> func)
    • evictRequestRecord

      public <R> R evictRequestRecord​(java.lang.String callGraph)
    • response

      public <R,​ C,​ RT> java.util.function.BiFunction<R,​C,​RT> response​(java.lang.String callGraph, java.util.function.BiFunction<R,​C,​RT> func)
    • callGraphs

      public java.util.Map<java.lang.String,​java.lang.Object> callGraphs()
    • response

      public <ResponseT> ResponseT response​(java.lang.String callGraph)
    • findFirstRequestByContains

      public <RequestT> RequestT findFirstRequestByContains​(java.lang.String contains)
    • findAllRequestByContains

      public <RequestT> java.util.List<RequestT> findAllRequestByContains​(java.lang.String contains)
    • findFirstResponseByContains

      public <ResponseT> ResponseT findFirstResponseByContains​(java.lang.String contains)
    • findAllResponseByContains

      public <ResponseT> java.util.List<ResponseT> findAllResponseByContains​(java.lang.String contains)
    • attempts

      public int attempts​(java.lang.String callGraph)
    • attempts

      public void attempts​(java.lang.String callGraph, int attempts)