org.opencms.notification
Class CmsExtendedNotificationCause

java.lang.Object
  extended by org.opencms.notification.CmsExtendedNotificationCause
All Implemented Interfaces:
java.lang.Comparable

public class CmsExtendedNotificationCause
extends java.lang.Object
implements java.lang.Comparable

Class to encapsulate a resource and the cause of its notification.

Author:
Jan Baudisch

Field Summary
static int RESOURCE_EXPIRES
          The notification is sent because the resource will expire soon.
static int RESOURCE_OUTDATED
          The notification is sent because the resource will get outdated.
static int RESOURCE_RELEASE
          The notification is sent because the resource will be released soon.
static int RESOURCE_UPDATE_REQUIRED
          constant indicating the cause of the notification for a resource.
 
Constructor Summary
CmsExtendedNotificationCause(CmsResource resource, int cause, java.util.Date date)
          Creates a new CmsNotificationResourceInfo.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
          Returns true if the Object equals to the corresponding CmsResourceInfo, that means a resource info with the same resource and cause.
 int getCause()
          Returns the cause.
 java.util.Date getDate()
          Returns the date.
 CmsResource getResource()
          Returns the resource.
 int hashCode()
           
 void setCause(int cause)
          Sets the cause.
 void setDate(java.util.Date date)
          Sets the date.
 void setResource(CmsResource resource)
          Sets the resource.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_EXPIRES

public static final int RESOURCE_EXPIRES
The notification is sent because the resource will expire soon.

See Also:
Constant Field Values

RESOURCE_OUTDATED

public static final int RESOURCE_OUTDATED
The notification is sent because the resource will get outdated.

See Also:
Constant Field Values

RESOURCE_UPDATE_REQUIRED

public static final int RESOURCE_UPDATE_REQUIRED
constant indicating the cause of the notification for a resource.

See Also:
Constant Field Values

RESOURCE_RELEASE

public static final int RESOURCE_RELEASE
The notification is sent because the resource will be released soon.

See Also:
Constant Field Values
Constructor Detail

CmsExtendedNotificationCause

public CmsExtendedNotificationCause(CmsResource resource,
                                    int cause,
                                    java.util.Date date)
Creates a new CmsNotificationResourceInfo.

Parameters:
resource - the specific resource
cause - that the resource occures in the notification
date - when the event will happen
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(java.lang.Object o)
Returns true if the Object equals to the corresponding CmsResourceInfo, that means a resource info with the same resource and cause.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to check for equality
Returns:
true if the resource info is equal to a notification cause or resource info with the same resource and cause
See Also:
CmsNotificationCause.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

getCause

public int getCause()
Returns the cause.

Returns:
the cause

getDate

public java.util.Date getDate()
Returns the date.

Returns:
the date

getResource

public CmsResource getResource()
Returns the resource.

Returns:
the resource

setCause

public void setCause(int cause)
Sets the cause.

Parameters:
cause - the cause to set

setDate

public void setDate(java.util.Date date)
Sets the date.

Parameters:
date - the date to set

setResource

public void setResource(CmsResource resource)
Sets the resource.

Parameters:
resource - the resource to set