Class EPPLoginSecPolicyEvent

java.lang.Object
com.verisign.epp.codec.loginsecpolicy.v04.EPPLoginSecPolicyEvent
All Implemented Interfaces:
EPPCodecComponent, Serializable, Cloneable

public class EPPLoginSecPolicyEvent extends Object implements EPPCodecComponent
This class is encoded into the <loginSecPolicy:event> element that represents the policies of an individual login security event (warning or error). The <loginSecPolicy:event> element contains the following child elements:
  • <loginSecPolicy:level> - One or two <loginSecPolicy:level> elements that indicate the possible set of event levels ("warning" or "error") the server will return to the client for the event type.
  • <loginSecPolicy:exDate> - OPTIONAL boolean element that indicates whether the event type includes a <loginSec:exDate> element with the default value of "0" (or "false").
  • <loginSecPolicy:exPeriod> - OPTIONAL duration element that the event type must be reset. For example, the password will expire 30 days after being set.
  • <loginSecPolicy:warningPeriod> - OPTIONAL duration element that indicates how long prior to expiry the server will include a warning event. For example, the server will include a password expiry warning event 15 days prior to expiry.
  • <loginSecPolicy:exError> - OPTIONAL indication of what will error will occur at expiry.
  • <loginSecPolicy:threshold> - OPTIONAL threshold value that triggers a warning event for a specific "stat" event. For example, a "failedLogins" "stat" warning event will occur if the number of failed logins exceeds 100.
  • <loginSecPolicy:period> - OPTIONAL period value that is associated with a warning event for a specific "stat" event.
See Also:
  • Field Details

  • Constructor Details

    • EPPLoginSecPolicyEvent

      public EPPLoginSecPolicyEvent()
      EPPLoginSecPolicyEvent default constructor. At least one level must be defined period to calling encode(Document).
    • EPPLoginSecPolicyEvent

      public EPPLoginSecPolicyEvent(EPPLoginSecPolicyEvent.EventType aType, EPPLoginSecPolicyEvent.EventLevel aLevel)
      EPPLoginSecPolicyEvent constructor that takes the required type and an single level attributes.
      Parameters:
      aType - Event type
      aLevel - Single event level the server will return
    • EPPLoginSecPolicyEvent

      public EPPLoginSecPolicyEvent(EPPLoginSecPolicyEvent.EventType aType, List<EPPLoginSecPolicyEvent.EventLevel> aLevels)
      EPPLoginSecPolicyEvent constructor that takes the required type and levels attributes.
      Parameters:
      aType - Event type
      aLevels - Possible set of event levels the server will return
    • EPPLoginSecPolicyEvent

      public EPPLoginSecPolicyEvent(EPPLoginSecPolicyEvent.EventType aType, List<EPPLoginSecPolicyEvent.EventLevel> aLevels, String aName, Boolean aExDate, String aExPeriod, String aWarningPeriod, EPPLoginSecPolicyEvent.EventErrorAction aErrorAction, Integer aThreshold, String aPeriod)
      EPPLoginSecPolicyEvent constructor that takes all attributes.
      Parameters:
      aType - Event type
      aLevels - Possible set of event levels the server will return
      aName - OPTIONAL custom event type or specific statistical event. Set to null if undefined.
      aExDate - OPTIONAL boolean element that indicates whether the event type includes a <loginSec:exDate> element with a default value of false. Set to null will set the default.
      aExPeriod - OPTIONAL duration element that the event type must be reset. Set to null if undefined.
      aWarningPeriod - OPTIONAL duration element that indicates how long prior to expiry the server will include a warning event. Set to null if undefined.
      aErrorAction - OPTIONAL indication of what action will occur with an error Set to null if undefined.
      aThreshold - OPTIONAL threshold value that triggers a warning event for a specific "stat" event. Set to null if undefined.
      aPeriod - OPTIONAL period value that is associated with a warning event for a specific "stat" event. Set to null if undefined.
  • Method Details

    • clone

      public Object clone() throws CloneNotSupportedException
      Clone EPPLoginSecPolicyEvent instance.
      Specified by:
      clone in interface EPPCodecComponent
      Overrides:
      clone in class Object
      Returns:
      clone of EPPLoginSecPolicyEvent
      Throws:
      CloneNotSupportedException - standard Object.clone exception
    • validateState

      public void validateState() throws EPPCodecException
      Validate the state of the EPPLoginSecPolicyEvent instance. A valid state means that all of the required attributes have been set. If validateState returns without an exception, the state is valid. If the state is not valid, the EPPCodecException will contain a description of the error. throws EPPCodecException State error. This will contain the name of the attribute that is not valid.
      Throws:
      EPPCodecException - On invalid state
    • encode

      public Element encode(Document aDocument) throws EPPEncodeException
      Encode a DOM Element tree from the attributes of the EPPLoginSecPolicyEvent instance.
      Specified by:
      encode in interface EPPCodecComponent
      Parameters:
      aDocument - - DOM Document that is being built. Used as an Element factory.
      Returns:
      Element - Root DOM Element representing the EPPLoginSecPolicyEvent instance.
      Throws:
      EPPEncodeException - - Unable to encode EPPLoginSecPolicyEvent instance.
    • decode

      public void decode(Element aElement) throws EPPDecodeException
      Decode the EPPLoginSecPolicyEvent element aElement DOM Element tree.
      Specified by:
      decode in interface EPPCodecComponent
      Parameters:
      aElement - - Root DOM Element to decode EPPLoginSecPolicyEvent from.
      Throws:
      EPPDecodeException - Unable to decode aElement
    • equals

      public boolean equals(Object aObject)
      implements a deep EPPLoginSecPolicyEvent compare.
      Overrides:
      equals in class Object
      Parameters:
      aObject - EPPLoginSecPolicyEvent instance to compare with
      Returns:
      true if equal; false otherwise
    • toString

      public String toString()
      Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
      Overrides:
      toString in class Object
      Returns:
      Indented XML String if successful; ERROR otherwise.
    • getNamespace

      public String getNamespace()
      Returns the XML namespace associated with the EPPCodecComponent.
      Specified by:
      getNamespace in interface EPPCodecComponent
      Returns:
      XML namespace for the EPPCodecComponent.
    • hasType

      public boolean hasType()
      Is the type defined?
      Returns:
      true if the type is defined; false otherwise.
    • getType

      Gets the event type value.
      Returns:
      EPPLoginSecPolicyEvent.EventType enumerated value if set; null otherwise.
    • setType

      public void setType(EPPLoginSecPolicyEvent.EventType aType)
      Sets the event type value.
      Parameters:
      aType - Sets the event type value.
    • hasName

      public boolean hasName()
      Is the name defined?
      Returns:
      true if the name is defined; false otherwise.
    • getName

      public String getName()
      Gets the OPTIONAL event name value.
      Returns:
      The event type name if defined; null otherwise.
    • setName

      public void setName(String aName)
      Sets the OPTIONAL event name value.
      Parameters:
      aName - Event type name. Set to null if undefined.
    • hasLevels

      public boolean hasLevels()
      Is the level list defined?
      Returns:
      true if the level list is defined; false otherwise.
    • getLevels

      Gets the level list.
      Returns:
      Level list
    • setLevels

      public void setLevels(List<EPPLoginSecPolicyEvent.EventLevel> aLevels)
      Sets the level list.
      Parameters:
      aLevels - List of levels.
    • addLevel

      public void addLevel(EPPLoginSecPolicyEvent.EventLevel aLevel)
      Add a level to the list of levels.
      Parameters:
      aLevel - Level to add to the list of levels.
    • getExDate

      public Boolean getExDate()
      Gets the OPTIONAL boolean element that indicates whether the event type includes a <loginSec:exDate> element with the default value of false.
      Returns:
      true or false indicating whether the event type includes a <loginSec:exDate> element.
    • setExDate

      public void setExDate(Boolean aExDate)
      Sets the OPTIONAL boolean element that indicates whether the event type includes a <loginSec:exDate> element with the default value of false.
      Parameters:
      aExDate - true or false indicating whether the server event type includes a <loginSec:exDate> element. If null is passed, the default value of false will be set.
    • hasExPeriod

      public boolean hasExPeriod()
      Is the expiry period defined?
      Returns:
      true if the expiry period is defined; false otherwise.
    • getExPeriod

      public String getExPeriod()
      Gets the OPTIONAL expiry period value, which identifies the duration that the event type must be set using the XML schema "duration" type. An example is a value of "P90D" for define 90 days.
      Returns:
      expiry period if defined; null otherwise.
    • setExPeriod

      public void setExPeriod(String aExPeriod)
      Sets the OPTIONAL expiry period value, which identifies the duration that the event type must be set using the XML schema "duration" type. An example is a value of "P90D" for define 90 days.
      Parameters:
      aExPeriod - Expiry period using the XML schema "duration" type. Set to null if undefined.
    • hasWarningPeriod

      public boolean hasWarningPeriod()
      Is the warning period defined?
      Returns:
      true if the warning period is defined; false otherwise.
    • getWarningPeriod

      public String getWarningPeriod()
      Gets the OPTIONAL warning period value, which indicates how long prior to expiry the server will include a warning event using the XML schema "duration" type. An example is a value of "P15D" for define 15 days.
      Returns:
      warning period if defined; null otherwise.
    • setWarningPeriod

      public void setWarningPeriod(String aWarningPeriod)
      Sets the OPTIONAL warning period value, which indicates how long prior to expiry the server will include a warning event using the XML schema "duration" type. An example is a value of "P15D" for define 15 days.
      Parameters:
      aWarningPeriod - Warning period using the XML schema "duration" type. Set to null if undefined.
    • hasErrorAction

      public boolean hasErrorAction()
      Is the error action defined?
      Returns:
      true if the error action is defined; false otherwise.
    • getErrorAction

      public EPPLoginSecPolicyEvent.EventErrorAction getErrorAction()
      Gets the error action.
      Returns:
      The error action if defined; null otherwise.
    • setErrorAction

      public void setErrorAction(EPPLoginSecPolicyEvent.EventErrorAction aErrorAction)
      Sets the error action.
      Parameters:
      aErrorAction - Action that will occur with an error. Set to null if undefined.
    • hasThreshold

      public boolean hasThreshold()
      Is the threshold defined?
      Returns:
      true if the threshold is defined; false otherwise.
    • getThreshold

      public Integer getThreshold()
      Gets the OPTIONAL threshold value that triggers a warning event for a specific "stat" event.
      Returns:
      Threshold value that triggers a warning event for a specific "stat" event if defined; null otherwise.
    • setThreshold

      public void setThreshold(Integer aThreshold)
      Sets the OPTIONAL threshold value that triggers a warning event for a specific "stat" event.
      Parameters:
      aThreshold - Threshold value that triggers a warning event for a specific "stat" event. Set to null if undefined.
    • hasPeriod

      public boolean hasPeriod()
      Is the period defined?
      Returns:
      true if the period is defined; false otherwise.
    • getPeriod

      public String getPeriod()
      Gets the OPTIONAL period value, which indicates the period value that is associated with a warning event for a specific "stat" event. using the XML schema "duration" type. An example is a value of "P1D" for define 1 day.
      Returns:
      period if defined; null otherwise.
    • setPeriod

      public void setPeriod(String aPeriod)
      Sets the OPTIONAL period value, which indicates the period value that is associated with a warning event for a specific "stat" event. using the XML schema "duration" type. An example is a value of "P1D" for define 1 day.
      Parameters:
      aPeriod - Period value, which indicates the period value that is associated with a warning event for a specific "stat" event. using the XML schema "duration" type. Set to null if undefined.