Package io.inversion

Class Chain

java.lang.Object
io.inversion.Chain

public final class Chain extends Object
  • Field Details

    • APPEND_PARAMS

      public static final Set<String> APPEND_PARAMS
    • engine

      protected final Engine engine
    • actions

      protected final List<Chain.ActionMatch> actions
    • request

      protected final Request request
    • response

      protected final Response response
    • vars

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

      protected int next
    • canceled

      protected boolean canceled
    • user

      protected User user
    • parent

      protected Chain parent
    • pathParamsToRemove

      protected Set<String> pathParamsToRemove
  • Method Details

    • resetAll

      public static void resetAll()
    • get

      protected static Stack<Chain> get()
    • getDepth

      public static int getDepth()
    • isRoot

      public static boolean isRoot()
    • first

      public static Chain first()
    • top

      public static Chain top() throws ApiException
      Throws:
      ApiException
    • peek

      public static Chain peek()
    • push

      public static Chain push(Engine engine, Request req, Response res)
    • pop

      public static Chain pop()
    • getUser

      public static User getUser()
    • size

      public static int size()
    • debug

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

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

      public static String buildLink(Collection collection)
    • buildLink

      public static String buildLink(Collection collection, String resourceKey)
    • buildLink

      public static String buildLink(Collection collection, String resourceKey, String relationshipKey)
    • withUser

      public Chain withUser(User user)
    • getParent

      public Chain getParent()
    • setParent

      public void setParent(Chain parent)
    • put

      public void put(String key, Object value)
    • isDebug

      public boolean isDebug()
    • get

      public Object get(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 Object remove(String key)
    • go

      public void go() throws ApiException
      Throws:
      ApiException
    • 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()
    • next

      public boolean next() throws ApiException
      Throws:
      ApiException
    • 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()
    • getActions

      public List<Chain.ActionMatch> getActions()
    • withActions

      public Chain withActions(List<Chain.ActionMatch> actions)
    • withAction

      public Chain withAction(Chain.ActionMatch action)
    • getRequest

      public Request getRequest()
    • getResponse

      public Response getResponse()