public abstract class Credential extends Object implements Serializable
Settings system assumes that subclasses implement a constructor that takes a name only.
Modifier and Type | Field and Description |
---|---|
protected String |
domain
The root domain this credential goes against: E.g.
|
Constructor and Description |
---|
Credential()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
attach(CrawlURI curi)
Attach this credentials avatar to the passed
curi . |
boolean |
detach(CrawlURI curi)
Detach this credential from passed curi.
|
boolean |
detachAll(CrawlURI curi)
Detach all credentials of this type from passed curi.
|
String |
getDomain() |
abstract String |
getKey() |
abstract String |
getPrerequisite(CrawlURI curi)
Return the authentication URI, either absolute or relative, that serves
as prerequisite the passed
curi . |
abstract boolean |
hasPrerequisite(CrawlURI curi) |
abstract boolean |
isEveryTime() |
abstract boolean |
isPost() |
abstract boolean |
isPrerequisite(CrawlURI curi) |
abstract boolean |
populate(CrawlURI curi,
org.apache.commons.httpclient.HttpClient http,
org.apache.commons.httpclient.HttpMethod method,
Map<String,String> httpAuthChallenges) |
boolean |
rootUriMatch(ServerCache cache,
CrawlURI curi)
Test passed curi matches this credentials rootUri.
|
void |
setDomain(String domain) |
protected String domain
public String getDomain()
context
- Context to use when searching for credential domain.AttributeNotFoundException
- If attribute not found.public void setDomain(String domain)
public void attach(CrawlURI curi)
curi
.
Override if credential knows internally what it wants to attach as
payload. Otherwise, if payload is external, use the below
#attach(CrawlURI, String)
.curi
- CrawlURI to load with credentials.public boolean detach(CrawlURI curi)
curi
- public boolean detachAll(CrawlURI curi)
curi
- public abstract boolean isPrerequisite(CrawlURI curi)
curi
- CrawlURI to look at.public abstract boolean hasPrerequisite(CrawlURI curi)
curi
- CrawlURI to look at.public abstract String getPrerequisite(CrawlURI curi)
curi
.curi
- CrawlURI to look at.public abstract String getKey()
context
- Context to use when searching for credential domain.AttributeNotFoundException
public abstract boolean isEveryTime()
public abstract boolean populate(CrawlURI curi, org.apache.commons.httpclient.HttpClient http, org.apache.commons.httpclient.HttpMethod method, Map<String,String> httpAuthChallenges)
curi
- CrawlURI to as for context.http
- Instance of httpclient.method
- Method to populate.httpAuthChallenges
- public abstract boolean isPost()
curi
- CrawlURI to look at.public boolean rootUriMatch(ServerCache cache, CrawlURI curi)
controller
- curi
- CrawlURI to test.Copyright © 2003-2014 Internet Archive. All Rights Reserved.