Package io.inversion

Class Chain


  • public final class Chain
    extends java.lang.Object
    • Field Detail

      • APPEND_PARAMS

        public static final java.util.Set<java.lang.String> APPEND_PARAMS
      • engine

        protected final Engine engine
      • request

        protected final Request request
      • response

        protected final Response response
      • vars

        protected final io.inversion.utils.LinkedCaseInsensitiveMap<java.lang.Object> vars
      • next

        protected int next
      • canceled

        protected boolean canceled
      • user

        protected User user
      • parent

        protected Chain parent
      • pathParamsToRemove

        protected java.util.Set<java.lang.String> pathParamsToRemove
    • Method Detail

      • resetAll

        public static void resetAll()
      • get

        protected static java.util.Stack<Chain> get()
      • getDepth

        public static int getDepth()
      • isRoot

        public static boolean isRoot()
      • first

        public static Chain first()
      • peek

        public static Chain peek()
      • pop

        public static Chain pop()
      • getUser

        public static User getUser()
      • size

        public static int size()
      • debug

        public static void debug​(java.lang.String format,
                                 java.lang.Object... args)
      • buildLink

        public static java.lang.String buildLink​(io.inversion.json.JSMap fromHere,
                                                 Relationship toHere)
      • buildLink

        public static java.lang.String buildLink​(Collection collection)
      • buildLink

        public static java.lang.String buildLink​(Collection collection,
                                                 java.lang.String resourceKey)
      • buildLink

        public static java.lang.String buildLink​(Collection collection,
                                                 java.lang.String resourceKey,
                                                 java.lang.String relationshipKey)
      • withUser

        public Chain withUser​(User user)
      • getParent

        public Chain getParent()
      • setParent

        public void setParent​(Chain parent)
      • put

        public void put​(java.lang.String key,
                        java.lang.Object value)
      • isDebug

        public boolean isDebug()
      • get

        public java.lang.Object get​(java.lang.String key)
        Storage for chain steps to communicate with each other.
        Parameters:
        key - the name of the value to retrieve
        Returns:
        the value if it exists otherwise null
      • remove

        public java.lang.Object remove​(java.lang.String key)
      • filterPathParams

        public Chain filterPathParams​(io.inversion.json.JSNode json)
        Recursively removes any url path params that appear as properties in the json
        Parameters:
        json - the json node to clean
        Returns:
        this
      • skipNext

        public Chain skipNext()
      • getNext

        public Action getNext()
      • hasNext

        public boolean hasNext()
      • isCanceled

        public boolean isCanceled()
      • cancel

        public void cancel()
      • getEngine

        public Engine getEngine()
      • getApi

        public Api getApi()
      • getServer

        public Server getServer()
      • getEndpoint

        public Endpoint getEndpoint()
      • getRequest

        public Request getRequest()
      • getResponse

        public Response getResponse()