Class View

java.lang.Object
org.apache.hadoop.yarn.webapp.View
All Implemented Interfaces:
Params
Direct Known Subclasses:
TextView

@LimitedPrivate({"YARN","MapReduce"}) public abstract class View extends Object implements Params
Base class for all views
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

  • Method Details

    • render

      public abstract void render()
      The API to render the view
    • context

      public View.ViewContext context()
    • error

      public Throwable error()
    • status

      public int status()
    • inDevMode

      public boolean inDevMode()
    • injector

      public com.google.inject.Injector injector()
    • getInstance

      public <T> T getInstance(Class<T> cls)
    • request

      public javax.servlet.http.HttpServletRequest request()
    • response

      public javax.servlet.http.HttpServletResponse response()
    • moreParams

      public Map<String,String> moreParams()
    • cookies

      public Map<String,javax.servlet.http.Cookie> cookies()
      Get the cookies
      Returns:
      the cookies map
    • outputStream

      public javax.servlet.ServletOutputStream outputStream()
    • writer

      public PrintWriter writer()
    • $

      public String $(String key, String defaultValue)
      Lookup a value from the current context.
      Parameters:
      key - to lookup
      defaultValue - if key is missing
      Returns:
      the value of the key or the default value
    • $

      public String $(String key)
      Lookup a value from the current context
      Parameters:
      key - to lookup
      Returns:
      the value of the key or empty string
    • set

      public void set(String key, String value)
      Set a context value. (e.g. UI properties for sub views.) Try to avoid any application (vs view/ui) logic.
      Parameters:
      key - to set
      value - to set
    • root

      public String root()
    • prefix

      public String prefix()
    • setTitle

      public void setTitle(String title)
    • setTitle

      public void setTitle(String title, String url)
    • root_url

      public String root_url(String... parts)
      Create an url from url components
      Parameters:
      parts - components to join
      Returns:
      an url string
    • url

      public String url(String... parts)
      Create an url from url components
      Parameters:
      parts - components to join
      Returns:
      an url string
    • info

      public ResponseInfo info(String about)
    • render

      public void render(Class<? extends SubView> cls)
      Render a sub-view
      Parameters:
      cls - the class of the sub-view