Class EditQuickFilterRuleAction

java.lang.Object
org.apache.struts2.ActionSupport
com.atlassian.bamboo.ww2.BambooActionSupport
com.atlassian.bamboo.configuration.GlobalAdminAction
com.atlassian.bamboo.ww2.actions.admin.EditQuickFilterRuleAction
All Implemented Interfaces:
JsonStreamingAction, ErrorCollection, BambooSessionAware, NavigationAware, DomainObjectSecurityAware, GlobalAdminSecurityAware, GlobalReadSecurityAware, ReturnUrlAware, UserAware, com.atlassian.core.i18n.I18nTextProvider, Serializable, org.apache.struts2.action.Action, org.apache.struts2.interceptor.ValidationAware, org.apache.struts2.locale.LocaleProvider, org.apache.struts2.Preparable, org.apache.struts2.text.TextProvider, org.apache.struts2.Validateable

public class EditQuickFilterRuleAction extends GlobalAdminAction implements org.apache.struts2.Preparable
See Also:
  • Constructor Details

    • EditQuickFilterRuleAction

      public EditQuickFilterRuleAction()
  • Method Details

    • prepare

      public void prepare() throws Exception
      Specified by:
      prepare in interface org.apache.struts2.Preparable
      Throws:
      Exception
    • input

      public String input()
      Input form (for either new or existing rule).
      Overrides:
      input in class org.apache.struts2.ActionSupport
    • execute

      public String execute()
      Save rule (either add or update).
      Specified by:
      execute in interface org.apache.struts2.action.Action
      Overrides:
      execute in class org.apache.struts2.ActionSupport
    • confirm

      public String confirm()
      Confirm deletion of a quick filter rule.
    • delete

      public String delete()
      Delete quick filter rule.
    • getJsonObject

      @NotNull public @NotNull org.json.JSONObject getJsonObject() throws org.json.JSONException
      Description copied from class: BambooActionSupport
      This is default property read by webwork for webwork's result type "json".
      Overrides:
      getJsonObject in class BambooActionSupport
      Returns:
      Throws:
      org.json.JSONException
      See Also:
    • getRuleTypes

      public List<QuickFilterRuleType> getRuleTypes()
    • getRule

      public QuickFilterRule getRule()
    • getRuleConfiguration

      @NotNull public @NotNull Map<String,Object> getRuleConfiguration()
    • getQuickFilterId

      public long getQuickFilterId()
    • setQuickFilterId

      public void setQuickFilterId(long quickFilterId)
    • getRuleId

      public long getRuleId()
    • setRuleId

      public void setRuleId(long ruleId)
    • setRuleTypeKey

      public void setRuleTypeKey(String ruleTypeKey)
    • setRuleName

      public void setRuleName(String ruleName)
    • getCached

      protected static <T> T getCached(@NotNull @NotNull AtomicReference<T> valueHolder, @NotNull @NotNull Supplier<T> valueSupplier)

      Obtain a value from the given supplier, caching it in the passed holder variable. The supplier will be only executed once, and the calculated result will be cached in the holder variable for future calls to avoid unnecessary calculations.

      This method uses synchronization by intrinsic locking on the value holder param.

      Example usage:

      
       class MyClass {
           private final AtomicReference<User> currentUser = new AtomicReference<>();
           ...
           public User getCurrentUser() {
               return getCached(currentUser, () -> userManager.getUser(authenticationContext.getCurrentUserName()));
           }
       }
       
      Type Parameters:
      T - type of returned value
      Parameters:
      valueHolder - a variable to cache the result of calling the supplier
      valueSupplier - supplier of the value to be called once only
      Returns:
      value returned by supplier or obtained from cache if it was already defined; if the value is stored in the cache, supplier will not be called.
      Throws:
      NullPointerException - if the supplier returns a null value