|
Ila | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.topoweb.ila.server.spi.IlaImpl
Base local Ila
implementation class. This is just a
thin wrapper around a DataAccessor
instance. The methods
in this class throw the following more specific IlaException
s:
ResolutionException
If this server is not the authority on the src
ORI
DataAccessorException
If the underlying DataAccessor
throws it.
DataAccessor
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.StateConstants |
NF, NK, NV, OK |
Constructor Summary | |
IlaImpl(DataAccessor db,
ServiceProviderResolver resolver)
Creates a new instance with the given DataAccessor . |
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 ori)
Returns the node for the specified Ori . |
LinkNode |
register(org.topoweb.net.Ori ori)
This base implementation just returns a node in the NK
state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IlaImpl(DataAccessor db, ServiceProviderResolver resolver)
DataAccessor
.
The resolver
is used to ensure
that the instance is the authority server for any given
src
ORI.
db
- the data accessor implementation classresolver
- the service resolver (used to do sanity checks
on the arguments)Method Detail |
public Node getNode(org.topoweb.net.Ori ori) throws ResolutionException, DataAccessorException, 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
ori
- the ORI of the resource
null
.
ResolutionException
- if this server is not the authority on the
ori
DataAccessorException
- if the underlying data accessor throws it
IlaException
- if an error occurspublic NodeSet getLinks(org.topoweb.net.Ori src, int linkType, org.topoweb.util.StringRange linkRange, int pageOrder, int maxCount) throws ResolutionException, DataAccessorException, 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
ResolutionException
- if this server is not the authority on the
src
ORI
DataAccessorException
- if the underlying data accessor throws it
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 ResolutionException, DataAccessorException, 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
ResolutionException
- if this server is not the authority on the
src
ORI
DataAccessorException
- if the underlying data accessor throws it
IlaException
- if an error occursNodeConstants
,
NodeConstants.FIRST_PAGE
,
NodeConstants.LAST_PAGE
public NodeSet getKnown(org.topoweb.util.StringRange range, int pageOrder, int maxCount) throws DataAccessorException
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
DataAccessorException
- if the underlying data accessor throws itNodeConstants.FIRST_PAGE
,
NodeConstants.LAST_PAGE
public LinkNode register(org.topoweb.net.Ori ori) throws ResolutionException, IlaException
NK
state. It does not even log the invocation.
register
in interface Ila
ori
- the ORI of the resource
ResolutionException
- if this server is not the authority on the
ori
IlaException
- if an error occurs
|
Ila | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |