Class ExpirationAttributes

    • Constructor Detail

      • ExpirationAttributes

        public ExpirationAttributes()
        Constructs a default ExpirationAttributes, which indicates no expiration will take place.
      • ExpirationAttributes

        public ExpirationAttributes​(int expirationTime)
        Constructs an ExpirationAttributes with the specified expiration time and the default expiration action ExpirationAction.INVALIDATE.
        Parameters:
        expirationTime - The number of seconds before expiration
        Throws:
        IllegalArgumentException - if expirationTime is nonpositive
      • ExpirationAttributes

        public ExpirationAttributes​(int expirationTime,
                                    ExpirationAction expirationAction)
        Constructs an ExpirationAttributes with the specified expiration time and expiration action.
        Parameters:
        expirationTime - The number of seconds for a value to live before it expires. If this parameter is negative, the expiration time will be set to 0, indicating no expiration.
        expirationAction - the action to take when the value expires
    • Method Detail

      • getTimeout

        public int getTimeout()
        Returns the number of seconds before a region or value expires.
        Returns:
        the relative number of seconds before a region or value expires or zero if it will never expire
      • getAction

        public ExpirationAction getAction()
        Returns the action that should take place when this value or region expires.
        Returns:
        the action to take when expiring
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Returns a string representation of this ExpirationAttributes. If the timeout is zero, returns "NO EXPIRATION".
        Overrides:
        toString in class Object
        Returns:
        the String representation of this expiration attribute
      • toData

        public void toData​(DataOutput out)
                    throws IOException
        Description copied from interface: DataSerializable
        Writes the state of this object as primitive data to the given DataOutput.

        Since 5.7 it is possible for any method call to the specified DataOutput to throw GemFireRethrowable. It should not be caught by user code. If it is it must be rethrown.

        Specified by:
        toData in interface DataSerializable
        Parameters:
        out - the DataOutput to write to
        Throws:
        IOException - A problem occurs while writing to out
      • isDefault

        public boolean isDefault()