org.alliance.core.comm
Class RPC

java.lang.Object
  extended by org.alliance.core.comm.RPC
Direct Known Subclasses:
BlockMaskResult, Broadcast, ChatMessage, ConnectionInfo, GetBlockMask, GetIsFriend, GetMyExternalIp, GetUserInfo, GetUserList, GracefulClose, IsFriend, NewVersionAvailable, NoRouteToHost, PersistantRPC, Ping, Pong, PostMessage, Route, Search, SearchHits, UserInfo, UserList

public abstract class RPC
extends java.lang.Object

Created by IntelliJ IDEA. User: maciek Date: 2005-dec-21 Time: 16:30:20 To change this template use File | Settings | File Templates.


Field Summary
protected  boolean broadcastable
          Can this RPC be broadcasted in an exponential fashion to my friends and their friends?
protected  FriendConnection con
           
protected  CoreSubsystem core
           
protected  int fromGuid
           
protected  int hops
           
protected  FriendManager manager
           
protected  boolean routable
          Can this RPC be router through several nodes to reach its destination?
 
Constructor Summary
RPC()
           
 
Method Summary
abstract  void execute(Packet in)
           
 RPC init(FriendConnection rpcc)
          Initializes this RCP in a mode where it has not been recived from anyone - fromGuid is 0
 RPC init(FriendConnection rpcc, int fromGuid, int numHops)
          Might be ran several times when broadcasting a packet..
 boolean isBroadcastable()
           
 boolean isInitialized()
           
 boolean isRoutable()
           
protected  void send(int dstGuid, RPC rpc)
           
protected  void send(RPC rpc)
           
abstract  Packet serializeTo(Packet out)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

con

protected transient FriendConnection con

manager

protected transient FriendManager manager

core

protected transient CoreSubsystem core

routable

protected transient boolean routable
Can this RPC be router through several nodes to reach its destination? This is not used right now - RPCs are only sent to ones friends


broadcastable

protected transient boolean broadcastable
Can this RPC be broadcasted in an exponential fashion to my friends and their friends? Not used right now


fromGuid

protected transient int fromGuid

hops

protected transient int hops
Constructor Detail

RPC

public RPC()
Method Detail

execute

public abstract void execute(Packet in)
                      throws java.io.IOException
Throws:
java.io.IOException

serializeTo

public abstract Packet serializeTo(Packet out)

init

public RPC init(FriendConnection rpcc)
Initializes this RCP in a mode where it has not been recived from anyone - fromGuid is 0

Parameters:
rpcc -

init

public RPC init(FriendConnection rpcc,
                int fromGuid,
                int numHops)
Might be ran several times when broadcasting a packet.. is this bad?

Parameters:
rpcc -
fromGuid -
numHops -

send

protected void send(RPC rpc)
             throws java.io.IOException
Throws:
java.io.IOException

send

protected void send(int dstGuid,
                    RPC rpc)
             throws java.io.IOException
Throws:
java.io.IOException

isInitialized

public boolean isInitialized()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRoutable

public boolean isRoutable()

isBroadcastable

public boolean isBroadcastable()