|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.day.cq.rewriter.linkchecker.impl.LinkCheckerTask
public class LinkCheckerTask
Asynchronous task used to check external links on a regular basis.
| Field Summary | |
|---|---|
protected int |
badLinkTestInterval
The number of hours to wait until a bad link is checked again. |
protected int |
goodLinkTestInterval
The number of hours to wait until a valid link is checked again. |
protected int |
linkUnusedInterval
The number of hours after which validity information about a link is removed from the repository if the link is not used any more. |
protected LinkInfoStorage |
storage
|
| Constructor Summary | |
|---|---|
LinkCheckerTask()
|
|
| Method Summary | |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context)
Activates the LinkChecker service. |
boolean |
check(String url)
Validates and updates the given external link. |
void |
checkLink(LinkInfo info)
|
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext)
Deactivates the LinkChecker service. |
boolean |
isValid(String url)
Checks a link for validity (HTTP response code 2xx or 3xx) |
void |
run()
Walks through the links stored in the repository and checks them for validity if necessary or removes them from the repository if they are no longer used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected LinkInfoStorage storage
protected int goodLinkTestInterval
protected int badLinkTestInterval
protected int linkUnusedInterval
| Constructor Detail |
|---|
public LinkCheckerTask()
| Method Detail |
|---|
protected void activate(org.osgi.service.component.ComponentContext context)
throws RepositoryException
context - The component context providing startup information
RepositoryExceptionprotected void deactivate(org.osgi.service.component.ComponentContext componentContext)
componentContext - The component contextpublic void run()
run in interface Runnablepublic boolean check(String url)
ExternalLinkChecker
check in interface ExternalLinkCheckerurl - external linkpublic void checkLink(LinkInfo info)
public boolean isValid(String url)
url - The link to be checked
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||