public interface Peer
Modifier and Type | Field and Description |
---|---|
static int |
ATTR_CHANGED |
static int |
CHILD_ADDED |
static int |
CHILD_REMOVED |
static int |
DESCENDENT_ADDED |
static int |
DESCENDENT_ATTR_CHANGED |
static int |
DESCENDENT_REMOVED |
static int |
DESCENDENT_VALUE_CHANGED |
static int |
PARENT_CHANGED |
static int |
PERMS_LOCK_CLEARED |
static int |
PERMS_LOCK_SET |
static int |
PROTO_ATTR_CHANGED |
static int |
PROTO_CHILD_ADDED |
static int |
PROTO_CHILD_REMOVED |
static int |
PROTO_DESCENDENT_ADDED |
static int |
PROTO_DESCENDENT_ATTR_CHANGED |
static int |
PROTO_DESCENDENT_REMOVED |
static int |
PROTO_DESCENDENT_VALUE_CHANGED |
static int |
PROTO_VALUE_CHANGED |
static int |
UPDATED
This interface must be implemented by objects that use the
PeerList.add() and PeerList.remove()
methods. |
static int |
VALUE_CHANGED |
Modifier and Type | Method and Description |
---|---|
void |
addPeer(Peer peerNode)
Add a peer node to be notified of state changes.
|
void |
addPeeredNode(Peer peer) |
void |
clearPeers()
Removes this node from all peer relationships.
|
void |
deafen()
Makes this peer deaf to any updateFromPeer calls made by notifyPeers
|
Peer |
getPeer(int nPeer)
return the requested peer
|
boolean |
isDeaf()
Checks if this peer is deaf.
|
boolean |
isMute()
Checks if this peer is mute.
|
void |
mute()
Makes this peer no longer notify its peers when notifyPeers is called
|
void |
notifyPeers(int eventType,
String arg1,
Object arg2)
Sends notification to the peer nodes that this object has changed.
|
void |
peerRemoved(Peer peer)
Called when this Peer is removed from
peer . |
void |
removePeer(Peer peerNode)
Remove a peer node from the notification list.
|
void |
removePeeredNode(Peer peer) |
void |
unDeafen()
Allows this peer to receive updateFromPeer calls
|
void |
unMute()
Allows this peer to notify its peers when notifyPeers is called.
|
void |
updateFromPeer(Object peerNode,
int eventType,
String arg1,
Object arg2)
This method will be called by the peer whenever its
state changes.
|
static final int UPDATED
PeerList.add()
and PeerList.remove()
methods.
A Peer
can add another Peer
to its peer
list via addPeer()
. All Peers
in the peer
list will be notified of peer changes when updateFromPeer()
is called.
static final int ATTR_CHANGED
static final int VALUE_CHANGED
static final int PARENT_CHANGED
static final int CHILD_ADDED
static final int CHILD_REMOVED
static final int DESCENDENT_ATTR_CHANGED
static final int DESCENDENT_VALUE_CHANGED
static final int DESCENDENT_ADDED
static final int DESCENDENT_REMOVED
static final int PERMS_LOCK_SET
static final int PERMS_LOCK_CLEARED
static final int PROTO_ATTR_CHANGED
static final int PROTO_VALUE_CHANGED
static final int PROTO_CHILD_ADDED
static final int PROTO_CHILD_REMOVED
static final int PROTO_DESCENDENT_ATTR_CHANGED
static final int PROTO_DESCENDENT_VALUE_CHANGED
static final int PROTO_DESCENDENT_ADDED
static final int PROTO_DESCENDENT_REMOVED
void addPeer(Peer peerNode)
peerNode
- -
The reference to the peer object to be added.void addPeeredNode(Peer peer)
void clearPeers()
void deafen()
Peer getPeer(int nPeer)
nPeer
- -
the 0-based position of the peer to retrieve.boolean isDeaf()
true
if this peer does not listen to notifyPeer calls, else false
.boolean isMute()
true
if this peer does not notify its peers when notifyPeers is called, else false
.void mute()
void notifyPeers(int eventType, String arg1, Object arg2)
eventType
- the event type as enumerated in this classarg1
- additional event informationarg2
- additional event informationvoid removePeer(Peer peerNode)
peerNode
- the peer object to be removedvoid removePeeredNode(Peer peer)
void unDeafen()
void unMute()
void updateFromPeer(Object peerNode, int eventType, String arg1, Object arg2)
eventType (String)arg1 (Object)arg2 UPDATED update type (optional) ATTR_CHANGED attr name (optional) CHILD_ADDED (optional) added node CHILD_REMOVED (optional) removed node VALUE_CHANGED new data (optional) PARENT_CHANGED (optional) new parent DESCENDENT_ATTR_CHANGED attr name changed node DESCENDENT_VALUE_CHANGED (optional) changed node DESCENDENT_ADDED (optional) added node DESCENDENT_REMOVED (optional) removed node PERMS_LOCK_SET (optional) (optional) PERMS_LOCK_CLEARED (optional) (optional) PROTO_ATTR_CHANGED attr name changed node PROTO_CHILD_ADDED (optional) added node of the protoype PROTO_CHILD_REMOVED (optional) removed node from the prototype PROTO_VALUE_CHANGED new data prototype node PROTO_DESCENDENT_ATTR_CHANGED attr name changed prototype node PROTO_DESCENDENT_VALUE_CHANGED (optional) changed prototype node PROTO_DESCENDENT_ADDED (optional) added node to the prototype PROTO_DESCENDENT_REMOVED (optional) removed node from the prototype
peerNode
- the peer to this object.eventType
- the event type as enumerated in this classarg1
- additional event informationarg2
- additional event informationvoid peerRemoved(Peer peer)
peer
.
Derived classes can override this method to receive direct notifications
when a peer is removed.peer
- the Peer from which this Peer has been removed from notification.Copyright © 2010 - 2020 Adobe. All Rights Reserved