public abstract class ConnectionsToadlet extends Toadlet
Modifier and Type | Class and Description |
---|---|
protected class |
ConnectionsToadlet.ComparatorByStatus |
static class |
ConnectionsToadlet.PeerAdditionReturnCodes |
Modifier and Type | Field and Description |
---|---|
protected NodeClientCore |
core |
protected boolean |
isReversed |
protected Node |
node |
protected PeerManager |
peers |
protected boolean |
showTrivialFoafConnections |
protected NodeStats |
stats |
HANDLE_METHOD_PREFIX
Modifier | Constructor and Description |
---|---|
protected |
ConnectionsToadlet(Node n,
NodeClientCore core,
HighLevelSimpleClient client) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
acceptRefPosts() |
protected java.util.Comparator<PeerNodeStatus> |
comparator(java.lang.String sortBy,
boolean reversed) |
protected abstract java.lang.String |
defaultRedirectLocation()
Where to redirect to if there is an error
|
protected void |
drawAddPeerBox(HTMLNode contentNode,
ToadletContext ctx)
Draw the add a peer box.
|
protected static void |
drawAddPeerBox(HTMLNode contentNode,
ToadletContext ctx,
boolean isOpennet,
java.lang.String formTarget) |
protected abstract void |
drawNameColumn(HTMLNode peerRow,
PeerNodeStatus peerNodeStatus,
boolean advanced)
Draw the name column, if there is one.
|
protected abstract void |
drawPeerActionSelectBox(HTMLNode peerForm,
boolean advancedModeEnabled)
If showPeerActionsBox() is true, this will be called directly after drawing the peers table.
|
protected abstract void |
drawPrivateNoteColumn(HTMLNode peerRow,
PeerNodeStatus peerNodeStatus,
boolean fProxyJavascriptEnabled)
Draw the private note column.
|
protected void |
drawTrustColumn(HTMLNode peerRow,
PeerNodeStatus peerNodeStatus) |
protected void |
drawVisibilityColumn(HTMLNode peerRow,
PeerNodeStatus peerNodeStatus,
boolean advancedModeEnabled) |
protected abstract SimpleFieldSet |
getNoderef() |
protected abstract java.lang.String |
getPageTitle(java.lang.String titleCountString) |
protected abstract java.lang.String |
getPeerListTitle()
What should the heading (before "(more detailed)") be on the peers table?
|
protected abstract PeerNodeStatus[] |
getPeerNodeStatuses(boolean noHeavy) |
protected void |
handleAltPost(java.net.URI uri,
HTTPRequest request,
ToadletContext ctx,
boolean logMINOR)
Rest of handlePost() method - supplied by subclass.
|
void |
handleMethodGET(java.net.URI uri,
HTTPRequest request,
ToadletContext ctx)
Handle a GET request.
|
void |
handleMethodPOST(java.net.URI uri,
HTTPRequest request,
ToadletContext ctx) |
protected abstract boolean |
hasNameColumn()
Is there a name column?
|
protected abstract boolean |
hasPrivateNoteColumn()
Is there a private note column?
|
protected boolean |
hasTrustColumn() |
protected boolean |
hasVisibilityColumn() |
protected abstract boolean |
isOpennet()
Adding a darknet node or an opennet node?
|
protected void |
sendErrorPage(ToadletContext ctx,
int code,
java.lang.String desc,
java.lang.String message,
boolean returnToAddFriends)
Send a simple error page.
|
protected abstract boolean |
shouldDrawNoderefBox(boolean advancedModeEnabled) |
protected abstract boolean |
showPeerActionsBox()
Should there be a checkbox for each peer, and drawPeerActionSelectBox() be called directly
after drawing the peers list?
|
addHomepageLink, allowPOSTWithoutPassword, findSupportedMethods, getClientImpl, path, sendErrorPage, sendErrorPage, sendErrorPage, showAsToadlet, showAsToadlet, writeHTMLReply, writeHTMLReply, writeHTMLReply, writeInternalError, writeReply, writeReply, writeReply, writeReply, writeReply, writeReply, writeTemporaryRedirect, writeTextReply, writeTextReply
protected final Node node
protected final NodeClientCore core
protected final NodeStats stats
protected final PeerManager peers
protected boolean isReversed
protected boolean showTrivialFoafConnections
protected ConnectionsToadlet(Node n, NodeClientCore core, HighLevelSimpleClient client)
public void handleMethodGET(java.net.URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, java.io.IOException, RedirectException
Toadlet
handleMethodGET
in class Toadlet
uri
- The URI being fetched.request
- The original HTTPRequest, convenient for e.g. fetching ?blah=blah parameters.ctx
- The request context. Mainly used for sending a reply; this identifies which
request we are replying to. Also gives access to lots of important objects e.g. PageMaker.ToadletContextClosedException
java.io.IOException
RedirectException
protected abstract boolean acceptRefPosts()
protected abstract java.lang.String defaultRedirectLocation()
public void handleMethodPOST(java.net.URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, java.io.IOException, RedirectException, ConfigException
ToadletContextClosedException
java.io.IOException
RedirectException
ConfigException
protected abstract boolean isOpennet()
protected void handleAltPost(java.net.URI uri, HTTPRequest request, ToadletContext ctx, boolean logMINOR) throws ToadletContextClosedException, java.io.IOException, RedirectException
java.io.IOException
ToadletContextClosedException
RedirectException
protected abstract java.lang.String getPeerListTitle()
protected abstract boolean showPeerActionsBox()
protected abstract void drawPeerActionSelectBox(HTMLNode peerForm, boolean advancedModeEnabled)
protected abstract boolean shouldDrawNoderefBox(boolean advancedModeEnabled)
protected abstract java.lang.String getPageTitle(java.lang.String titleCountString)
protected void drawAddPeerBox(HTMLNode contentNode, ToadletContext ctx)
protected static void drawAddPeerBox(HTMLNode contentNode, ToadletContext ctx, boolean isOpennet, java.lang.String formTarget)
protected java.util.Comparator<PeerNodeStatus> comparator(java.lang.String sortBy, boolean reversed)
protected abstract PeerNodeStatus[] getPeerNodeStatuses(boolean noHeavy)
protected abstract SimpleFieldSet getNoderef()
protected boolean hasTrustColumn()
protected void drawTrustColumn(HTMLNode peerRow, PeerNodeStatus peerNodeStatus)
protected boolean hasVisibilityColumn()
protected void drawVisibilityColumn(HTMLNode peerRow, PeerNodeStatus peerNodeStatus, boolean advancedModeEnabled)
protected abstract boolean hasNameColumn()
protected abstract void drawNameColumn(HTMLNode peerRow, PeerNodeStatus peerNodeStatus, boolean advanced)
protected abstract boolean hasPrivateNoteColumn()
protected abstract void drawPrivateNoteColumn(HTMLNode peerRow, PeerNodeStatus peerNodeStatus, boolean fProxyJavascriptEnabled)
protected void sendErrorPage(ToadletContext ctx, int code, java.lang.String desc, java.lang.String message, boolean returnToAddFriends) throws ToadletContextClosedException, java.io.IOException
ToadletContextClosedException
java.io.IOException