sdt.mediator
Class Bubble

java.lang.Object
  extended by sdt.mediator.Bubble

public class Bubble
extends java.lang.Object

A bubble represents a group of parties in conversation


Method Summary
 PartyInBubble addParty(PartyURI p)
          adds a party in Read-Write role to this bubble
 PartyInBubble addParty(PartyURI p, Role r)
          adds a party to this bubble, in specified role.
 Bubble copy()
          generate an EMPTY bubble of the same media type, and following the same state machine
 void drop()
          remove self from containing session.
 void dropParty(PartyURI p)
          removes the specified party from the bubble.
 boolean eq(Bubble b1)
          equality comparison
 boolean equals(java.lang.Object o)
           
 Media getMedia()
           
 java.util.Set<PartyInBubble> getParties()
           
 PartyInBubble getParty(PartyURI p)
          finds party-in-bubble corresponding to party p, if it exists.
 Session getSession()
          gets parent session
 java.net.URI getStateMachine()
          returns a URI for the bubble state machine
 int hashCode()
           
 void merge(Bubble in)
          Merge given bubble into this bubble.
 Expr mkEnterState(IState state, PartyInBubbleConst pc)
           
 Expr mkEnterState(IState state, PartyInBubbleVar pv)
           
 Expr mkEvent(IEvent a, PartyInBubbleConst pc)
           
 Expr mkEvent(IEvent a, PartyInBubbleVar pv)
           
 Expr mkInState(IState state, PartyInBubbleConst pc)
           
 Expr mkInState(IState state, PartyInBubbleVar pv)
           
 Expr mkLeaveState(IState state, PartyInBubbleConst pc)
           
 Expr mkLeaveState(IState state, PartyInBubbleVar pv)
           
 int numParties()
           
 boolean sametype(Bubble b1)
          returns true if both bubbles have the same state machine and media type.
 java.lang.String toString()
          The unique ID within bubbles of a session.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

eq

public boolean eq(Bubble b1)
equality comparison


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getStateMachine

public java.net.URI getStateMachine()
returns a URI for the bubble state machine


getSession

public Session getSession()
gets parent session


getParties

public java.util.Set<PartyInBubble> getParties()
                                        throws SDTException
Throws:
SDTException

getParty

public PartyInBubble getParty(PartyURI p)
                       throws SDTException
finds party-in-bubble corresponding to party p, if it exists.

Parameters:
p -
Returns:
null if not found.
Throws:
SDTException

numParties

public int numParties()
               throws SDTException
Throws:
SDTException

getMedia

public Media getMedia()

addParty

public PartyInBubble addParty(PartyURI p,
                              Role r)
                       throws SDTException
adds a party to this bubble, in specified role.

Throws:
SDTException

addParty

public PartyInBubble addParty(PartyURI p)
                       throws SDTException
adds a party in Read-Write role to this bubble

Throws:
SDTException

drop

public void drop()
          throws SDTException
remove self from containing session. Drop all attached parties

Throws:
SDTException

toString

public java.lang.String toString()
The unique ID within bubbles of a session.

Overrides:
toString in class java.lang.Object
Returns:
The unique ID within bubbles of a session.

merge

public void merge(Bubble in)
           throws SDTException
Merge given bubble into this bubble. Both bubbles must belong to the same session.

Parameters:
in - The bubble to merge into this bubble.
Throws:
SDTException

copy

public Bubble copy()
            throws SDTException
generate an EMPTY bubble of the same media type, and following the same state machine

Throws:
SDTException

mkEvent

public Expr mkEvent(IEvent a,
                    PartyInBubbleVar pv)

mkEvent

public Expr mkEvent(IEvent a,
                    PartyInBubbleConst pc)

mkEnterState

public Expr mkEnterState(IState state,
                         PartyInBubbleVar pv)

mkEnterState

public Expr mkEnterState(IState state,
                         PartyInBubbleConst pc)

mkInState

public Expr mkInState(IState state,
                      PartyInBubbleVar pv)

mkInState

public Expr mkInState(IState state,
                      PartyInBubbleConst pc)

mkLeaveState

public Expr mkLeaveState(IState state,
                         PartyInBubbleVar pv)

mkLeaveState

public Expr mkLeaveState(IState state,
                         PartyInBubbleConst pc)

dropParty

public void dropParty(PartyURI p)
               throws SDTException
removes the specified party from the bubble.

Parameters:
p -
Throws:
SDTException - thrown if party p is not in the bubble

sametype

public boolean sametype(Bubble b1)
returns true if both bubbles have the same state machine and media type.