@ThreadSafe public final class PointerRevision extends PageRevision1 implements CoreRevision
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PointerRevision.MalformedContent
Thrown when a request cannot be met because the content of a page is not in the
form required for a draft pointer.
|
(package private) static class |
PointerRevision.MalformedURL
Thrown when a request cannot be met because a draft pointer encodes an external
link with a malformed URL.
|
CoreRevision.U
Modifier and Type | Field and Description |
---|---|
(package private) static Pattern |
EXTERNAL_LINK_PATTERN
The search pattern for an external link to a remote draft in an obsolete draft
pointer page.
|
(package private) static Pattern |
TEMPLATE_CALL_PATTERN_1
The search pattern for a draft pointer template call in an obsolete draft pointer
page.
|
(package private) static Pattern |
TEMPLATE_CALL_PATTERN_2
The search pattern for a draft pointer template call in a draft pointer page.
|
Constructor and Description |
---|
PointerRevision(PollwikiVS wiki,
int _pageID,
String _pageName,
int _rev,
int _revLatest,
String _draftName,
URI _remoteWikiURI,
URI _remoteWikiScriptURI,
String _content0)
Partically constructs a PointerRevision for init to finish.
|
Modifier and Type | Method and Description |
---|---|
List<Integer> |
addDraftRevisionPath(List<Integer> path)
Adds to the list the revision path from this core revision (inclusive) to the
terminal draft (inclusive).
|
CoreRevision |
contextView(String _contextPersonName)
Constructs a view of this core revision suited for viewing in the context of the
specified person, or returns this same (==) core revision if it is already suited.
|
RemoteDraftRevision |
draft()
The position draft.
|
String |
draftName()
The page name of the remote draft including the namespace.
|
void |
init(PollwikiVS wiki,
String _contextPersonName,
CountSource _countSource)
Finishes the construction of this CoreRevision and sets isFullyConstructed true.
|
void |
init(RemoteDraftRevision _draft)
Finishes the construction of this PointerRevision and sets isFullyConstructed true.
|
static void |
initConsume(List<PointerRevision> pointers,
PollwikiVS wiki,
URI remoteWikiScriptURI,
boolean toContinue)
Attempts to finish constructing the specifed pointer revisions by constructing
their remote drafts, each to the latest revision.
|
boolean |
isFullyConstructed()
Answers whether the construction of this CoreRevision is complete.
|
IDPair |
person()
The identifier of the person who takes the position.
|
String |
pollName()
The name of the poll in which the person takes a position.
|
URI |
remoteWikiScriptURI()
The base URI for script execution in the remote wiki, without a trailing slash
(/).
|
boolean |
remoteWikiURI_maybeUgly()
Answers whether the remote wiki URI might be based on the standard access URL
ending in "index.php" for example, or is definitely based on an alias.
|
URI |
remoteWikiURI()
The base URI for requesting pages from the remote wiki, without a trailing slash
(/).
|
equals, isLatestRevision, pageID, pageName, pageURI, readPageRevision, rev, revLatest, revURI, toString, wikiScriptURI
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isLatestRevision, pageID, pageName, pageURI, rev, revLatest, revURI, wikiScriptURI
static final Pattern EXTERNAL_LINK_PATTERN
static final Pattern TEMPLATE_CALL_PATTERN_1
static final Pattern TEMPLATE_CALL_PATTERN_2
PointerRevision(PollwikiVS wiki, int _pageID, String _pageName, int _rev, int _revLatest, String _draftName, URI _remoteWikiURI, URI _remoteWikiScriptURI, String _content0) throws PositionIDPair.MalformedPageName, PipeRevision.MalformedContent
_pageName
- it will be normalized._draftName
- it will be normalized._content0
- the wikitext of the revision including at least section 0.PositionIDPair.MalformedPageName
PipeRevision.MalformedContent
PageRevision1.pageID()
,
PageRevision1.rev()
,
PageRevision1.revLatest()
,
remoteWikiURI()
,
remoteWikiScriptURI()
@ThreadRestricted(value="constructor") public void init(RemoteDraftRevision _draft)
IllegalStateException
- if called a second time.draft()
@ThreadRestricted(value="constructor") public void init(PollwikiVS wiki, String _contextPersonName, CountSource _countSource) throws IOException
CoreRevision
init
in interface CoreRevision
_contextPersonName
- the name of the person from whose viewpoint the
revision will be viewed (context person), or null if there is no context
person._countSource
- for possible use during this call. It is never used if
there is no context person.IOException
@ThreadRestricted(value="constructor") public static void initConsume(List<PointerRevision> pointers, PollwikiVS wiki, URI remoteWikiScriptURI, boolean toContinue) throws IOException
pointers
- the list of pointer revisions from which the fully constructed
ones are to be removed.toContinue
- whether to continue in the event of a missing draft and to
leave the incompletely constructed pointer in the list with a null
draft (true), or to throw a NoSuchPage exception
(false).MediaWiki.NoSuchPage
- if toContinue is false and a remote draft is
missing.IOException
public URI remoteWikiScriptURI()
public URI remoteWikiURI()
public boolean remoteWikiURI_maybeUgly()
$wgUsePathInfo
may be assumed true.public List<Integer> addDraftRevisionPath(List<Integer> path)
CoreRevision
addDraftRevisionPath
in interface CoreRevision
public CoreRevision contextView(String _contextPersonName)
CoreRevision
contextView
in interface CoreRevision
public RemoteDraftRevision draft()
CoreRevision
draft
in interface CoreRevision
public boolean isFullyConstructed()
CoreRevision
isFullyConstructed
in interface CoreRevision
init(RemoteDraftRevision)
public IDPair person()
PositionalRevision
person
in interface PositionalRevision
public String pollName()
PositionalRevision
pollName
in interface PositionalRevision
Poll.name()