org.sciplore.resources
Class Alert

java.lang.Object
  extended by org.sciplore.resources.Resource
      extended by org.sciplore.resources.Alert

@Entity
public class Alert
extends Resource

Resource class for Alerts.

Author:
Mario Lipinski <lipinski@sciplore.org>
See Also:
Resource

Constructor Summary
Alert()
           
 
Method Summary
static Alert getAlert(Alert a)
          Returns an Alert object from the database for an Alert object.
static Alert getAlert(Integer id)
          Gets the Alert object from the database.
static Alert getAlert(User u, Document d)
          Gets the Alert object from the database for a User and a Document.
 Document getDocument()
          Returns the associated Document.
 Short getFrequency()
          Returns the frequency how often to alert the user.
 Boolean getFulltextAvailable()
          Returns whether to alert on the fulltext becoming available.
 Integer getId()
          Returns the identifier.
 Boolean getMetadataChanges()
          Returns wheter to alert on metadata changes.
 Boolean getNewUsageData()
          Returns whether to alert on new usage data becoming available.
 Boolean getRelatedDocuments()
          Returns whether to alert on new related documents becoming available.
 User getUser()
          Returns the User.
 Short getValid()
          Returns information about the validity of the record.
 void setDocument(Document document)
          Sets the Document.
 void setFrequency(Short frequency)
          Sets the frequency how often to alert the user.
 void setFulltextAvailable(Boolean fulltextAvailable)
          Sets whether to alert on the fulltext becoming available.
 void setId(Integer id)
          Sets the identifier.
 void setMetadataChanges(Boolean metadataChanges)
          Sets whether to alert on metadata changes.
 void setNewUsageData(Boolean newUsageData)
          Sets whether to alert on new usage data becoming available.
 void setRelatedDocuments(Boolean relatedDocuments)
          Sets whether to alert on new related documents becoming available.
 void setUser(User user)
          Sets the User.
 void setValid(Short valid)
          Sets information about the validity of the record.
static Alert sync(Alert alert)
          Synchronizes an Alert object with a record from the database.
 
Methods inherited from class org.sciplore.resources.Resource
save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Alert

public Alert()
Method Detail

getAlert

public static Alert getAlert(Alert a)
Returns an Alert object from the database for an Alert object.

Parameters:
a - the Alert object
Returns:
the Alert object from the database, null if not in database

getAlert

public static Alert getAlert(Integer id)
Gets the Alert object from the database.

Parameters:
id - The identifier of the Alert object
Returns:
the Alert object, null if not in database

getAlert

public static Alert getAlert(User u,
                             Document d)
Gets the Alert object from the database for a User and a Document.

Parameters:
u - the User
d - the Document
Returns:
the Alert object, null if not in database
See Also:
User, Document

sync

public static Alert sync(Alert alert)
Synchronizes an Alert object with a record from the database. If the object does not exist, it is added to the database. In any case related objects are synchronized as well.

Parameters:
alert - the Alert
Returns:
the synchronized Alert which is stored in the database

getDocument

public Document getDocument()
Returns the associated Document.

Returns:
the Document
See Also:
Document

getFrequency

public Short getFrequency()
Returns the frequency how often to alert the user. TODO: what metrics are used here?

Returns:
the frequency

getFulltextAvailable

public Boolean getFulltextAvailable()
Returns whether to alert on the fulltext becoming available.

Returns:
whether to alert on the fulltext becoming available

getId

public Integer getId()
Returns the identifier.

Returns:
the id

getMetadataChanges

public Boolean getMetadataChanges()
Returns wheter to alert on metadata changes.

Returns:
wheter to alert on metadata changes

getNewUsageData

public Boolean getNewUsageData()
Returns whether to alert on new usage data becoming available.

Returns:
whether to alert on new usage data becoming available

getRelatedDocuments

public Boolean getRelatedDocuments()
Returns whether to alert on new related documents becoming available.

Returns:
whether to alert on new related documents becoming available

getUser

public User getUser()
Returns the User.

Returns:
the User
See Also:
User

getValid

public Short getValid()
Returns information about the validity of the record.

Returns:
the validity

setDocument

public void setDocument(Document document)
Sets the Document.

Parameters:
document - the Document
See Also:
Document

setFrequency

public void setFrequency(Short frequency)
Sets the frequency how often to alert the user.

Parameters:
frequency - the frequency

setFulltextAvailable

public void setFulltextAvailable(Boolean fulltextAvailable)
Sets whether to alert on the fulltext becoming available.

Parameters:
fulltextAvailable - whether to alert on the fulltext becoming available

setId

public void setId(Integer id)
Sets the identifier.

Parameters:
id - the identifier

setMetadataChanges

public void setMetadataChanges(Boolean metadataChanges)
Sets whether to alert on metadata changes.

Parameters:
metadataChanges - whether to alert on metadata chanes

setNewUsageData

public void setNewUsageData(Boolean newUsageData)
Sets whether to alert on new usage data becoming available.

Parameters:
newUsageData - whether to alert on new usage data becoming available

setRelatedDocuments

public void setRelatedDocuments(Boolean relatedDocuments)
Sets whether to alert on new related documents becoming available.

Parameters:
relatedDocuments - whether to alert on new related documents becoming available

setUser

public void setUser(User user)
Sets the User.

Parameters:
user - the User
See Also:
User

setValid

public void setValid(Short valid)
Sets information about the validity of the record.

Parameters:
valid - the information about the validity of the record