edu.internet2.middleware.grouper.hooks.logic
Class HookVeto

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by 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:
Serialized Form

Constructor Summary
HookVeto(String theReasonKey, String theReason)
          construct a veto
 
Method Summary
 void assignVetoType(VetoType vetoType1, boolean overwriteIfExisting)
          veto type.
 Set<String> attributeKeySet()
          return the keyset of attributes, but never return null.
 Object getAttribute(String key)
          get the value of a key or null if not there
 String getReason()
          default text that would be shown to user if there is no externalized string available.
 String getReasonKey()
          key of the reason, e.g.
 VetoType getVetoType()
          veto type.
 void putAttribute(String key, Object value)
          put an attribute
 void setVetoType(VetoType vetoType1)
          veto type.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

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