java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
edu.internet2.middleware.grouper.hooks.logic.HookVeto
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RuleVeto

public class HookVeto extends RuntimeException
base class for grouper hook veto. Throw this or a subclass to veto an action (needs to be thrown before a commit)
See Also:
  • Constructor Details

    • HookVeto

      public HookVeto(String theReasonKey, String theReason)
      construct a veto
      Parameters:
      theReasonKey - key of the reason, e.g. something that could be used in an externalized string file e.g. for the UI. e.g. hook.veto.group.invalidExtension
      theReason - default text that would be shown to user if there is no externalized string available. e.g. 'Invalid ID for group. ID must be less than 20 characters.
  • Method Details

    • getVetoType

      public VetoType getVetoType()
      veto type. this will be assigned automatically if not manually
      Returns:
      the vetoType
    • setVetoType

      public void setVetoType(VetoType vetoType1)
      veto type. this will be assigned automatically if not manually
      Parameters:
      vetoType1 - the vetoType to set
    • assignVetoType

      public void assignVetoType(VetoType vetoType1, boolean overwriteIfExisting)
      veto type. this will be assigned automatically if not manually
      Parameters:
      vetoType1 - the vetoType to set
      overwriteIfExisting - true to overwrite if existing
    • getAttribute

      public Object getAttribute(String key)
      get the value of a key or null if not there
      Parameters:
      key -
      Returns:
      the value or null if not there
    • putAttribute

      public void putAttribute(String key, Object value)
      put an attribute
      Parameters:
      key -
      value -
    • attributeKeySet

      public Set<String> attributeKeySet()
      return the keyset of attributes, but never return null.
      Returns:
      the keyset
    • getReasonKey

      public String getReasonKey()
      key of the reason, e.g. something that could be used in an externalized string file e.g. for the UI. e.g. hook.veto.group.invalidExtension
      Returns:
      the reasonKey
    • getReason

      public String getReason()
      default text that would be shown to user if there is no externalized string available. e.g. 'Invalid ID for group. ID must be less than 20 characters.
      Returns:
      the reason