Ila

org.topoweb.ila.protocol
Class RemoteMirror

java.lang.Object
  |
  +--org.topoweb.ila.protocol.RemoteService
        |
        +--org.topoweb.ila.protocol.RemoteMirror
All Implemented Interfaces:
Mirror, NodeConstants, ProtocolConstants, SpiProtocolConstants

public class RemoteMirror
extends RemoteService
implements Mirror, SpiProtocolConstants

Mirror implementation over an XML/DOM protocol. This is a client-side interface implementation.

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.protocol.SpiProtocolConstants
SPC_REGISTER, SPC_REMOVE_BACKLINK, SPC_SET_LINK, SPC_SPI, SPC_SPI_NAMESPACE
 
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
RemoteMirror(PNode pnode, org.topoweb.xml.DomProtocol phandler)
          Creates a new instance with the given entity translator and protocol handler.
 
Method Summary
 void removeBacklink(org.topoweb.net.Ori src, Node dtn)
          Removes the specified backlink.
 Node setLink(org.topoweb.net.Ori src, int linkType, Node dtn)
          Sets a link of the specified type from the given source to destination node.
 
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

RemoteMirror

public RemoteMirror(PNode pnode,
                    org.topoweb.xml.DomProtocol phandler)
             throws java.lang.IllegalArgumentException
Creates a new instance with the given entity translator and protocol handler. The protocol handler phandler encapsulates the network communication logic (e.g. server resolution, redirects, and so on).

Parameters:
pnode - Node protocol translator
phandler - the protocol handler that retrieves responses
Throws:
java.lang.IllegalArgumentException - if any of the parameters is null
Method Detail

setLink

public Node setLink(org.topoweb.net.Ori src,
                    int linkType,
                    Node dtn)
             throws IlaException
Description copied from interface: Mirror
Sets a link of the specified type from the given source to destination node. The caller is the authority on the destination node (dtn) and passes in state information about that node; the callee is the authority on the source node (src) and returns state information about the source. The callee typically updates state information about the src node (as a result of the invocation), as well as updating link entries before returning the src node.

Specified by:
setLink in interface Mirror
Parameters:
src - the ORI of the source node
linkType - the link type (either FORE or BACK)
dtn - information about the destination node
Returns:
a Node instance encapsulating authoritative knowledge about the state of the specified src node
Throws:
IlaException - if an error occurs

removeBacklink

public void removeBacklink(org.topoweb.net.Ori src,
                           Node dtn)
                    throws IlaException
Description copied from interface: Mirror
Removes the specified backlink. Backlinks are removed when the destination node (dtn) no longer points to (no longer has a forelink to) to the source node (src).

Note

If the semantics of this seems confusing, recall that methods in this interface are named from the perspective of the callee, not the caller. It is the caller who is the authority on the dtn node and who knows that it no longer points to the src. Also, recall that we are removing a backlink, not a forelink: the forelink is handled directly by the callee.

Specified by:
removeBacklink in interface Mirror
Parameters:
src - the ORI of the source node
dtn - information about the destination node
Throws:
IlaException - if an error occurs

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.