Package org.opencms.notification
Class CmsExtendedNotificationCause
- java.lang.Object
-
- org.opencms.notification.CmsExtendedNotificationCause
-
- All Implemented Interfaces:
java.lang.Comparable<CmsExtendedNotificationCause>
public class CmsExtendedNotificationCause extends java.lang.Object implements java.lang.Comparable<CmsExtendedNotificationCause>
Class to encapsulate a resource and the cause of its notification.
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description CmsExtendedNotificationCause(CmsResource resource, int cause, java.util.Date date)
Creates a new CmsNotificationResourceInfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(CmsExtendedNotificationCause 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.
-
-
-
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 resourcecause
- that the resource occures in the notificationdate
- when the event will happen
-
-
Method Detail
-
compareTo
public int compareTo(CmsExtendedNotificationCause o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<CmsExtendedNotificationCause>
- 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 classjava.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 classjava.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
-
-