|
Ila | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.topoweb.ila.protocol.RemoteService | +--org.topoweb.ila.protocol.RemoteIla
Ila implementation over an XML/DOM protocol. This is a client-side interface implementation.
Field Summary |
Fields inherited from interface org.topoweb.ila.NodeConstants |
BACK, FIRST_PAGE, FORE, LAST_PAGE, LINK_MASK, PAGE_MASK |
Fields inherited from interface org.topoweb.ila.protocol.ProtocolConstants |
PC_BACKLINK_COUNT, PC_BACKLINKS, PC_CO_BACKLINK_COUNT, PC_CO_FORELINK_COUNT, PC_CONTENT_LENGTH, PC_CONTENT_TYPE, PC_ERROR_CODE, PC_EXPIRATION, PC_FAIL, PC_FIRST, PC_FORELINK_COUNT, PC_FORELINKS, PC_GET_KNOWN, PC_GET_LINK_NODE, PC_GET_LINKS, PC_GET_NODE, PC_HI, PC_HTTP, PC_ID, PC_ILA, PC_INCOMMUNICADO, PC_LAST, PC_LAST_MODIFIED, PC_LINK_NODE, PC_LINK_TYPE, PC_LO, PC_MAX_COUNT, PC_NODE, PC_NODE_SET, PC_OKAY, PC_ORI, PC_PAGE, PC_REGISTER, PC_REQUEST, PC_RESPONSE, PC_SIZE, PC_STATE, PC_STATUS, PC_SYNC_VERSION_ID, PC_SYNC_VERSION_TIMESTAMP, PC_TITLE, PC_USER, PC_USER_AGENT, PC_USER_NAMESPACE, PC_VERSION, PC_VERSION_ID, PC_VERSION_TIMESTAMP |
Constructor Summary | |
RemoteIla(PLinkNode plinknode,
PNodeSet pnodeset,
PNode pnode,
org.topoweb.xml.DomProtocol phandler)
Creates a new instance with the given entity translators and protocol handler. |
Method Summary | |
NodeSet |
getKnown(org.topoweb.util.StringRange range,
int pageOrder,
int maxCount)
Returns a list of nodes known by Ila in the given lexical range as a NodeSet . |
LinkNode |
getLinkNode(org.topoweb.net.Ori src,
int linkType,
org.topoweb.util.StringRange linkRange,
int pageOrder,
int maxCount)
Returns a linked-node containing links with the specified type and in the specified lexical range. |
NodeSet |
getLinks(org.topoweb.net.Ori src,
int linkType,
org.topoweb.util.StringRange linkRange,
int pageOrder,
int maxCount)
Returns the links of the specified type for the node with the given Ori as a NodeSet . |
Node |
getNode(org.topoweb.net.Ori src)
Returns the node for the specified Ori . |
LinkNode |
register(org.topoweb.net.Ori ori)
Registers the given resource. |
Methods inherited from class org.topoweb.ila.protocol.RemoteService |
checkVersion, getAnswerElement, getVersion, newTransactionId |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RemoteIla(PLinkNode plinknode, PNodeSet pnodeset, PNode pnode, org.topoweb.xml.DomProtocol phandler) throws java.lang.IllegalArgumentException
plinknode
,
pnodeset
and pnode
encapsulate the
XML representations of LinkNode
, NodeSet
and Node
instances, respectively. The protocol handler
phandler
encapsulates the network communication logic
(e.g. server resolution, redirects, and so on).
plinknode
- LinkNode
protocol translatorpnodeset
- NodeSet
protocol translatorpnode
- Node
protocol translatorphandler
- the protocol handler that retrieves responses
java.lang.IllegalArgumentException
- if any of the parameters is null
Method Detail |
public Node getNode(org.topoweb.net.Ori src) throws IlaException
Ila
Ori
. The returned
node encapsulates Ila's state of knowledge about the resource
represented by the given ORI. That is, getNode(src,
..).getOri().equals(src)
must evaluate to true
.
getNode
in interface Ila
src
- the ORI of the resource
null
.
IlaException
- if an error occurspublic NodeSet getLinks(org.topoweb.net.Ori src, int linkType, org.topoweb.util.StringRange linkRange, int pageOrder, int maxCount) throws IlaException
Ila
Ori
as a NodeSet
.
The type of links returned, forelinks or backlinks, is determined by
bitwise ORing the linkType
parameter with NodeConstants mask.
The lexical range of the links to be returned is determined by the
linkRange
parameter.
Some nodes can have very many links, and it may be infeasible for
an Ila server to return all the links that match a given request.
In such an event the returned links will either start
from the linkRange
's lower bound if (pageOrder &
PAGE_MASK
) ==
FIRST_PAGE
, or end
at its upper bound, otherwise. The
user can detect whether the returned links were truncated by examining
the returned NodeSet
.
FORE
) and they were just added, then it is
likely they will be returned in the NK
state. For any
given linked node, authoritative state information is retrieved using the
getNode
method.
getLinks
in interface Ila
src
- the Ori of the return linked-nodelinkType
- specifies whether the returned node set
contains forelinks or backlinkslinkRange
- the lexical range of the links returnedpageOrder
- specifies whether if truncated, the links
should begin from the first page or end
on the last page of the link result setmaxCount
- the maximum number of links that may be returned;
a value <= 0 indicates an unlimited number
IlaException
- if an error occursNodeConstants
,
NodeConstants.FIRST_PAGE
,
NodeConstants.LAST_PAGE
public LinkNode getLinkNode(org.topoweb.net.Ori src, int linkType, org.topoweb.util.StringRange linkRange, int pageOrder, int maxCount) throws IlaException
Ila
src
. That is, the expression
true
.
This method is equivalent to invoking getNode
followed by getLinks
.
That is, for example,
Ila ila = .. ; LinkNode node = ila.getLinkNode( srcOri, NodeConstants.BACK, StringRange.ALL, FIRST_PAGE, 100); ..
The goal here is not a convenience method. Rather, we
expect if implemented over the wire, the returned LinkNode
will be marshalled in one pass, not two.
getLinkNode
in interface Ila
src
- the ORI of the return linked-nodelinkType
- specifies whether the returned linked-node
contains forelinks or backlinkslinkRange
- the lexical range of the links returnedpageOrder
- specifies whether if truncated, the links
should begin from the first page or endmaxCount
- the maximum number of links that may be returned;
a value <= 0 indicates an unlimited number
IlaException
- if an error occursNodeConstants
,
NodeConstants.FIRST_PAGE
,
NodeConstants.LAST_PAGE
public NodeSet getKnown(org.topoweb.util.StringRange range, int pageOrder, int maxCount) throws IlaException
Ila
NodeSet
.
getKnown
in interface Ila
range
- the lexical range of the ORIs of the nodes to be
returnedpageOrder
- the page ordermaxCount
- the maximum number of links that may be returned;
a value <= 0 indicates an unlimited number
IlaException
- if an error occursNodeConstants.FIRST_PAGE
,
NodeConstants.LAST_PAGE
public LinkNode register(org.topoweb.net.Ori ori) throws IlaException
Ila
ori
, retrieving
its links, and adding that information into the Ila distributed database.
An implementation may postpone registration until the server is less
busy. In such an event, the LinkNode
returned will be
in the NK
state.
register
in interface Ila
ori
- the ORI of the resource
IlaException
- if an error occurs
|
Ila | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |