Ila

org.topoweb.ila.server.spi
Interface DataAccessor

All Superinterfaces:
NodeConstants, StateConstants

public interface DataAccessor
extends NodeConstants, StateConstants

The data access layer. This is the local database implementation. The typical implementation is expected to work under single thread access and is allowed to be stateful.

The methods in this interface are designed to abstract away the database representation of nodes and their links. The application logic and state transitions are not in the domain of responsibility of this interface; object serialization is.

Author:
Babak Farhang

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
 
Method Summary
 void commit()
          Commits updates since the last commit or rollback.
 NodeSet getKnown(org.topoweb.util.StringRange range, int pageOrder, int maxCount)
          Returns a list of known nodes in the given lexical range.
 State getLink(org.topoweb.net.Ori src, int type, org.topoweb.net.Ori dtn)
          Returns the state information for the given link.
 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 given node.
 State getState(org.topoweb.net.Ori ori)
          Returns the state information for the given ORI.
 void removeLink(org.topoweb.net.Ori src, int type, org.topoweb.net.Ori dtn)
          Removes the state information for the given link.
 void removeState(org.topoweb.net.Ori ori)
          Removes state information about the given ORI.
 void rollback()
          Rolls back updates since the last commit or rollback.
 void setLink(org.topoweb.net.Ori src, int type, Node dtn)
          Sets the state information for the given destination.
 void setState(org.topoweb.net.Ori ori, State state)
          Sets the state information for the given ORI.
 

Method Detail

setState

public void setState(org.topoweb.net.Ori ori,
                     State state)
              throws DataAccessorException
Sets the state information for the given ORI.

DataAccessorException

removeState

public void removeState(org.topoweb.net.Ori ori)
                 throws DataAccessorException
Removes state information about the given ORI.

DataAccessorException

getState

public State getState(org.topoweb.net.Ori ori)
               throws DataAccessorException
Returns the state information for the given ORI.

Returns:
the state info for ori, or null, if there was no such entry
DataAccessorException

setLink

public void setLink(org.topoweb.net.Ori src,
                    int type,
                    Node dtn)
             throws DataAccessorException
Sets the state information for the given destination.

DataAccessorException

removeLink

public void removeLink(org.topoweb.net.Ori src,
                       int type,
                       org.topoweb.net.Ori dtn)
                throws DataAccessorException
Removes the state information for the given link.

DataAccessorException

getLink

public State getLink(org.topoweb.net.Ori src,
                     int type,
                     org.topoweb.net.Ori dtn)
              throws DataAccessorException
Returns the state information for the given link.

Returns:
the state information about the dtn, or null, if there is no such link entry.
DataAccessorException

getKnown

public NodeSet getKnown(org.topoweb.util.StringRange range,
                        int pageOrder,
                        int maxCount)
                 throws DataAccessorException
Returns a list of known nodes in the given lexical range.

Returns:
a NodeSet (possibly empty) representing the specified nodes; never returns null
DataAccessorException
See Also:
Ila.getKnown(StringRange,int,int)

getLinks

public NodeSet getLinks(org.topoweb.net.Ori src,
                        int linkType,
                        org.topoweb.util.StringRange linkRange,
                        int pageOrder,
                        int maxCount)
                 throws DataAccessorException
Returns the links of the specified type for the given node.

Returns:
a NodeSet (possibly empty) representing the specified links; never returns null
DataAccessorException
See Also:
Ila.getLinks(Ori,int,StringRange,int,int)

commit

public void commit()
            throws DataAccessorException
Commits updates since the last commit or rollback.

DataAccessorException
See Also:
rollback()

rollback

public void rollback()
              throws DataAccessorException
Rolls back updates since the last commit or rollback.

DataAccessorException
See Also:
commit()

Ila

Copyright (C) 2002 Babak Farhang

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.