Class GspApp

java.lang.Object
ru.vyarus.guicey.gsp.info.model.GspApp

public class GspApp extends Object
Information model for registered gsp application.
Since:
03.12.2019
  • Constructor Details

    • GspApp

      public GspApp()
  • Method Details

    • getName

      public String getName()
      Returns:
      application name
    • setName

      public void setName(String name)
      Parameters:
      name - application name
    • isMainContext

      public boolean isMainContext()
      Returns:
      true for main context, false for admin
    • setMainContext

      public void setMainContext(boolean mainContext)
      Parameters:
      mainContext - true to identify main context, false for admin context
    • getMappingUrl

      public String getMappingUrl()
      Returns:
      application mapping url (relative to context)
    • setMappingUrl

      public void setMappingUrl(String mappingUrl)
      Parameters:
      mappingUrl - application mapping url
    • getRootUrl

      public String getRootUrl()
      Returns:
      application mapping url prefixed with context (full url relative to server root)
    • setRootUrl

      public void setRootUrl(String rootUrl)
      Parameters:
      rootUrl - application mapping url prefixed with context
    • getRequiredRenderers

      public List<String> getRequiredRenderers()
      Returns:
      list of required renderers or empty list
    • setRequiredRenderers

      public void setRequiredRenderers(List<String> requiredRenderers)
      Parameters:
      requiredRenderers - list of required renderers
    • getMainAssetsLocation

      public String getMainAssetsLocation()
      Never starts with slash and always ends with slash.
      Returns:
      main assets classpath location
    • setMainAssetsLocation

      public void setMainAssetsLocation(String mainAssetsLocation)
      Parameters:
      mainAssetsLocation - main assets location
    • getAssets

      public com.google.common.collect.Multimap<String,String> getAssets()
      Returned assets are sorted for resolution: registration order of packages is preserved in order to be able to override resources from previous registrations. In returned model registration order is reversed, so the latest registered package will be the first (simply to check it first - correctly handle overrides).

      Contexts never starts with slash, but always ends (for proper matching). Root context is empty string. Classpath locations never starts with slash and always ends with slash.

      Returns:
      all application asset mappings (including extensions)
    • setAssets

      public void setAssets(com.google.common.collect.Multimap<String,String> assets)
      Parameters:
      assets - application asset mappings
    • getViews

      public Map<String,String> getViews()
      When root mapping is not explicitly declared, its set to application name (so map will never be empty).

      Contexts never starts with slash, but always ends (for proper matching). Root context is empty string. Rest prefixes never starts with slash and always ends with slash (for proper matching).

      Returns:
      all application view mappings (including extensions)
    • setViews

      public void setViews(Map<String,String> views)
      Parameters:
      views - all application view mappings
    • getMainRestPrefix

      public String getMainRestPrefix()
      Returns:
      main rest mapping prefix
    • getAssetExtensions

      public com.google.common.collect.Multimap<String,String> getAssetExtensions()
      Returns:
      only extension asset declarations or empty map
    • setAssetExtensions

      public void setAssetExtensions(com.google.common.collect.Multimap<String,String> assetExtensions)
      Parameters:
      assetExtensions - additional assets locations
    • getViewExtensions

      public Map<String,String> getViewExtensions()
      Returns:
      only extension view rest mappings or empty map
    • setViewExtensions

      public void setViewExtensions(Map<String,String> viewExtensions)
      Parameters:
      viewExtensions - extension view rest mappings
    • getRestRootUrl

      public String getRestRootUrl()
      May be used to construct full rest urls (relative to server root).
      Returns:
      rest context mapping url or null when jetty not yet started
    • setRestRootUrl

      public void setRestRootUrl(String restRootUrl)
      Parameters:
      restRootUrl - rest context mapping url
    • getIndexFile

      public String getIndexFile()
      Returns:
      configured index file (empty string by default, meaning index.html)
    • setIndexFile

      public void setIndexFile(String indexFile)
      Parameters:
      indexFile - index file
    • getFilesRegex

      public String getFilesRegex()
      Returns:
      asset (static resources) calls detection regexp
    • setFilesRegex

      public void setFilesRegex(String filesRegex)
      Parameters:
      filesRegex - asset detection regexp
    • isHasDefaultFilesRegex

      public boolean isHasDefaultFilesRegex()
      Returns:
      true when default assets detection regexp used, false otherwise
    • setHasDefaultFilesRegex

      public void setHasDefaultFilesRegex(boolean hasDefaultFilesRegex)
      Parameters:
      hasDefaultFilesRegex - true when default assets detection regexp used
    • isSpa

      public boolean isSpa()
      Returns:
      true when spa routing enabled (serve index page for all requested paths, except assets), false when disabled (default)
    • setSpa

      public void setSpa(boolean spa)
      Parameters:
      spa - true to identify SPA application
    • getSpaRegex

      public String getSpaRegex()
      Returns:
      non spa route path recognition regexp
    • setSpaRegex

      public void setSpaRegex(String spaRegex)
      Parameters:
      spaRegex - non spa route path recognition regexp
    • isHasDefaultSpaRegex

      public boolean isHasDefaultSpaRegex()
      Returns:
      true when default regexp used, false otherwise
    • setHasDefaultSpaRegex

      public void setHasDefaultSpaRegex(boolean hasDefaultSpaRegex)
      Parameters:
      hasDefaultSpaRegex - true when default regexp used
    • getErrorPages

      public Map<Integer,String> getErrorPages()
      Default error page has -1 code.
      Returns:
      configured error pages (mapping by code) or empty map if nothing configured
    • setErrorPages

      public void setErrorPages(Map<Integer,String> errorPages)
      Parameters:
      errorPages - error pages
    • getDefaultErrorPage

      public String getDefaultErrorPage()
      Returns:
      default error page (for all non mapped error codes) or null if not declared
    • getViewPaths

      public List<MappedViewPath> getViewPaths()
      Returns:
      mapped view rest methods
    • setViewPaths

      public void setViewPaths(List<MappedViewPath> viewPaths)
      Parameters:
      viewPaths - mapped view rest methods
    • getHiddenViewPaths

      public List<HiddenViewPath> getHiddenViewPaths()
      Hidden methods appear when sub url mapped to different rest prefix, making all root rest paths under the same prefix unreachable.
      Returns:
      hidden view rest method
    • setHiddenViewPaths

      public void setHiddenViewPaths(List<HiddenViewPath> hiddenViewPaths)
      Parameters:
      hiddenViewPaths - hidden view path