Package com.day.cq.rewriter.linkchecker
Class LinkInfo
- java.lang.Object
-
- com.day.cq.rewriter.linkchecker.LinkInfo
-
public class LinkInfo extends Object
Stores information about the validity of an external link.
-
-
Field Summary
Fields Modifier and Type Field Description static intX_STATUS_CONNECT_ERRORstatic intX_STATUS_IO_ERRORstatic intX_STATUS_NO_ROUTE_TO_HOSTstatic intX_STATUS_NOT_CHECKEDstatic intX_STATUS_READ_TIME_OUT_ERRORstatic intX_STATUS_SSL_ERRORstatic intX_STATUS_UNKOWN_HOSTstatic intX_STATUS_UNSUPPORTEDstatic intX_STATUS_URI_SYNTAX_ERROR
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReferrer(String path)Adds (if not already present) a referrer to this link.booleanequals(Object o)CalendargetLastAccessed()Returns the date a check for validity of the URL has last been requested.CalendargetLastAvailable()Returns the date the resource described by the URL has last been available.CalendargetLastChecked()Returns the date the URL has last been checked by the asynchronous LinkCheckerTask.intgetLastStatus()Returns the last statusStringgetLastStatusAsString()String[]getReferrer()Returns the paths referencing this linkStringgetUrl()Returns the URL about which validity information is stored.inthashCode()booleanisSame(LinkInfo linkInfo)booleanisValid()Returns whether the resource described by the URL is currently available.voidsetLastAccessed(Calendar lastAccessed)Sets the date a check for validity of the URL has last been requested.voidsetLastAvailable(Calendar lastAvailable)Sets the date the resource described by the URL has last been available.voidsetLastChecked(Calendar lastChecked)Sets the date the URL has last been checked by the asynchronous LinkCheckerTask.voidsetLastStatus(int lastStatus)Sets the last statusvoidsetValid(boolean valid)Sets whether the resource described by the URL is currently available.
-
-
-
Field Detail
-
X_STATUS_NOT_CHECKED
public static final int X_STATUS_NOT_CHECKED
- See Also:
- Constant Field Values
-
X_STATUS_UNSUPPORTED
public static final int X_STATUS_UNSUPPORTED
- See Also:
- Constant Field Values
-
X_STATUS_URI_SYNTAX_ERROR
public static final int X_STATUS_URI_SYNTAX_ERROR
- See Also:
- Constant Field Values
-
X_STATUS_CONNECT_ERROR
public static final int X_STATUS_CONNECT_ERROR
- See Also:
- Constant Field Values
-
X_STATUS_NO_ROUTE_TO_HOST
public static final int X_STATUS_NO_ROUTE_TO_HOST
- See Also:
- Constant Field Values
-
X_STATUS_UNKOWN_HOST
public static final int X_STATUS_UNKOWN_HOST
- See Also:
- Constant Field Values
-
X_STATUS_IO_ERROR
public static final int X_STATUS_IO_ERROR
- See Also:
- Constant Field Values
-
X_STATUS_SSL_ERROR
public static final int X_STATUS_SSL_ERROR
- See Also:
- Constant Field Values
-
X_STATUS_READ_TIME_OUT_ERROR
public static final int X_STATUS_READ_TIME_OUT_ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLastAccessed
public Calendar getLastAccessed()
Returns the date a check for validity of the URL has last been requested.- Returns:
- The date the check for validity of the URL has last been requested
-
setLastAccessed
public void setLastAccessed(Calendar lastAccessed)
Sets the date a check for validity of the URL has last been requested.- Parameters:
lastAccessed- The date the check for validity of the URL has last been requested
-
getLastChecked
public Calendar getLastChecked()
Returns the date the URL has last been checked by the asynchronous LinkCheckerTask.- Returns:
- The date the URL has last been checked
-
setLastChecked
public void setLastChecked(Calendar lastChecked)
Sets the date the URL has last been checked by the asynchronous LinkCheckerTask.- Parameters:
lastChecked- The date the URL has last been checked
-
getLastAvailable
public Calendar getLastAvailable()
Returns the date the resource described by the URL has last been available.- Returns:
- The date the resource described by the URL has last been available.
-
setLastAvailable
public void setLastAvailable(Calendar lastAvailable)
Sets the date the resource described by the URL has last been available.- Parameters:
lastAvailable- The date the resource described by the URL has last been available.
-
getUrl
public String getUrl()
Returns the URL about which validity information is stored.- Returns:
- The URL about which validity information is stored
-
isValid
public boolean isValid()
Returns whether the resource described by the URL is currently available.- Returns:
- true, if the resource described by the URL is currently available
-
setValid
public void setValid(boolean valid)
Sets whether the resource described by the URL is currently available.- Parameters:
valid- Whether the resource described by the URL is currently available
-
getLastStatus
public int getLastStatus()
Returns the last status- Returns:
- the last status
-
getLastStatusAsString
public String getLastStatusAsString()
-
setLastStatus
public void setLastStatus(int lastStatus)
Sets the last status- Parameters:
lastStatus- the last status
-
addReferrer
public void addReferrer(String path)
Adds (if not already present) a referrer to this link.- Parameters:
path- the path of the node referencing this link
-
getReferrer
public String[] getReferrer()
Returns the paths referencing this link- Returns:
- the paths referencing this link
-
isSame
public boolean isSame(LinkInfo linkInfo)
-
-