public class WhiteboardSessionJabberImpl extends java.lang.Object implements WhiteboardParticipantListener, WhiteboardSession
Constructor and Description |
---|
WhiteboardSessionJabberImpl(ProtocolProviderServiceJabberImpl sourceProvider,
OperationSetWhiteboardingJabberImpl opSet)
WhiteboardSessionJabberImpl constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addWhiteboardChangeListener(WhiteboardChangeListener listener)
Adds a whiteboard change listener to this whiteboard so that it could
receive events on new whiteboard participants, theme changes and others.
|
void |
addWhiteboardObjectListener(WhiteboardObjectListener listener)
Registers listener so that it would receive events every time a
new WhiteboardObject is received on this whiteboard.
|
void |
addWhiteboardParticipant(WhiteboardParticipant wbParticipant)
Adds wbParticipant to the list of participants in this
white-board.
|
WhiteboardObject |
createWhiteboardObject(java.lang.String name)
Create a WhiteboardObject instance with the specified type.
|
void |
deleteWhiteboardObject(WhiteboardObject obj)
Sends a WhiteboardObject to delete
and delete the local WhiteboardObject
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this whiteboard and returns true if it
the specified object is an instance of a Whiteboard object and if the
extending telephony protocol considers the whiteboards represented by
both objects to be the same.
|
void |
fireMessageEvent(java.util.EventObject evt)
Delivers the specified event to all registered message listeners.
|
void |
fireWhiteboardChangeEvent(java.lang.String type,
java.lang.Object oldValue,
java.lang.Object newValue)
Creates a WhiteboardChangeEvent with this class as
sourceWhiteboard, and the specified eventID and old
and new values and dispatches it on all currently registered listeners.
|
void |
fireWhiteboardParticipantEvent(WhiteboardParticipant sourceWhiteboardParticipant,
int eventID)
Creates a WhiteboardParticipantEvent with
sourceWhiteboardParticipant and eventID and dispatches
it on all currently registered listeners.
|
ProtocolProviderService |
getProtocolProvider()
Returns a reference to the ProtocolProviderService instance
that created this whiteboard.
|
WhiteboardSessionState |
getState()
Returns the state that this whiteboard is currently in.
|
java.lang.String[] |
getSupportedWhiteboardObjects()
Returns all the type of WhiteboardObject that this whiteboard support.
|
java.lang.String |
getWhiteboardID()
Returns the id of the specified Whiteboard.
|
java.util.Vector<WhiteboardObject> |
getWhiteboardObjects()
Returns the WhiteboardObjects in this whiteboard session.
|
java.util.Iterator<WhiteboardParticipant> |
getWhiteboardParticipants()
Returns an iterator over all white-board participants.
|
int |
getWhiteboardParticipantsCount()
Returns the number of participants currently associated
with this white-board session.
|
WhiteboardSession |
getWhiteboardSession()
returns the current WhiteboardSession
|
WhiteboardSessionState |
getWhiteboardSessionState()
Returns the state that this whiteboard is currently in.
|
int |
hashCode()
Returns a hash code value for this whiteboard.
|
void |
invite(java.lang.String contactAddress)
Invites another user to this room.
|
boolean |
isJoined()
Returns true if the local user is currently in the white-board session
(after white-boarding one of the
join() methods). |
boolean |
isOfflineMessagingSupported()
Determines wheter the protocol provider (or the protocol itself) support
sending and receiving offline messages.
|
boolean |
isParticipantContained(java.lang.String participantName)
Checks if the participant given by participantName is contained
in this white-board session.
|
void |
join()
Joins this white-board with the nickname of the local user so that the
user would start receiving events and WhiteboardObject for it.
|
void |
join(byte[] password)
Joins this white-board so that the user would start receiving events and
WhiteboardObject for it.
|
void |
leave()
Leave this whiteboard.
|
void |
moveWhiteboardObject(WhiteboardObject obj)
Sends a WhiteboardObject to modify
and modifies the local WhiteboardObject
|
void |
participantAddressChanged(WhiteboardParticipantChangeEvent evt)
Indicates that a change has occurred in the address of the source
WhiteboardParticipant.
|
void |
participantDisplayNameChanged(WhiteboardParticipantChangeEvent evt)
Indicates that a change has occurred in the display name of the source
WhiteboardParticipant.
|
void |
participantImageChanged(WhiteboardParticipantChangeEvent evt)
Indicates that a change has occurred in the image of the source
WhiteboardParticipant.
|
void |
participantStateChanged(WhiteboardParticipantChangeEvent evt)
Verifies whether the whiteboard participant has entered a state.
|
void |
participantTransportAddressChanged(WhiteboardParticipantChangeEvent evt)
Indicates that a change has occurred in the transport address that we
use to communicate with the participant.
|
void |
removeWhiteboardChangeListener(WhiteboardChangeListener listener)
Removes listener to this whiteboard so that it won't receive
further WhiteboardChangeEvents.
|
void |
removeWhiteboardObjectListener(WhiteboardObjectListener listener)
Removes listener so that it won't receive
any further WhiteboardObject events from this room.
|
void |
removeWhiteboardParticipant(WhiteboardParticipant wbParticipant)
Removes whiteboardParticipant from the list of participants in
this whiteboard.
|
void |
sendWhiteboardObject(WhiteboardObject message)
Sends the message to the destination.
|
void |
setState(WhiteboardSessionState newState)
Sets the state of this whiteboard
|
void |
setWhiteboardSessionState(WhiteboardSessionState newState)
Sets the state of this whiteboard and fires a whiteboard change event
notifying registered listeners for the change.
|
java.lang.String |
toString()
Returns a string textually representing this Whiteboard.
|
public WhiteboardSessionJabberImpl(ProtocolProviderServiceJabberImpl sourceProvider, OperationSetWhiteboardingJabberImpl opSet)
sourceProvider
- Jabber protocol provideropSet
- the whiteboard operation setpublic java.util.Iterator<WhiteboardParticipant> getWhiteboardParticipants()
getWhiteboardParticipants
in interface WhiteboardSession
public int getWhiteboardParticipantsCount()
getWhiteboardParticipantsCount
in interface WhiteboardSession
public void join() throws OperationFailedException
join
in interface WhiteboardSession
OperationFailedException
- with the corresponding code if an error
occurs while joining the room.public void join(byte[] password) throws OperationFailedException
join
in interface WhiteboardSession
password
- the password to use when authenticating on the
white-board session.OperationFailedException
- with the corresponding code if an error
occurs while joining the room.public boolean isJoined()
join()
methods).isJoined
in interface WhiteboardSession
public void leave()
leave
in interface WhiteboardSession
public void invite(java.lang.String contactAddress)
If the room is password-protected, the invitee will receive a password to use to join the room. If the room is members-only, the the invitee may be added to the member list.
invite
in interface WhiteboardSession
contactAddress
- the address of the user to invite to the room.
(one may also invite users not on their contact list).public WhiteboardSession getWhiteboardSession()
public void participantStateChanged(WhiteboardParticipantChangeEvent evt)
participantStateChanged
in interface WhiteboardParticipantListener
evt
- The WhiteboardParticipantChangeEvent instance
containing the source event as well as its previous and its new status.public void participantDisplayNameChanged(WhiteboardParticipantChangeEvent evt)
participantDisplayNameChanged
in interface WhiteboardParticipantListener
evt
- The WhiteboardParticipantChangeEvent instance
containing the source event as well as its previous and its new display
names.public void participantAddressChanged(WhiteboardParticipantChangeEvent evt)
evt
- The WhiteboardParticipantChangeEvent instance
containing the source event as well as its previous and its new address.public void participantTransportAddressChanged(WhiteboardParticipantChangeEvent evt)
evt
- The WhiteboardParticipantChangeEvent instance
containing the source event as well as its previous and its new transport
address.public void participantImageChanged(WhiteboardParticipantChangeEvent evt)
participantImageChanged
in interface WhiteboardParticipantListener
evt
- The WhiteboardParticipantChangeEvent instance
containing the source event as well as its previous and its new image.public void addWhiteboardParticipant(WhiteboardParticipant wbParticipant)
addWhiteboardParticipant
in interface WhiteboardSession
wbParticipant
- the new WhiteboardParticipantpublic void removeWhiteboardParticipant(WhiteboardParticipant wbParticipant)
removeWhiteboardParticipant
in interface WhiteboardSession
wbParticipant
- the WhiteboardParticipant leaving the
whiteboard;public void setWhiteboardSessionState(WhiteboardSessionState newState)
newState
- a reference to the WhiteboardState instance that
the whiteboard is to enter.public WhiteboardSessionState getWhiteboardSessionState()
public void addWhiteboardObjectListener(WhiteboardObjectListener listener)
addWhiteboardObjectListener
in interface WhiteboardSession
listener
- a WhiteboardObjectListener that would be
notified every time a new WhiteboardObject
is received on this whiteboard.public void removeWhiteboardObjectListener(WhiteboardObjectListener listener)
removeWhiteboardObjectListener
in interface WhiteboardSession
listener
- the WhiteboardObjectListener
to remove from this roompublic WhiteboardObject createWhiteboardObject(java.lang.String name)
createWhiteboardObject
in interface WhiteboardSession
name
- the name of the object to create (should be one of the
WhiteboardObjectXXX.NAME fields).public java.lang.String getWhiteboardID()
getWhiteboardID
in interface WhiteboardSession
public boolean isOfflineMessagingSupported()
public void moveWhiteboardObject(WhiteboardObject obj) throws OperationFailedException
moveWhiteboardObject
in interface WhiteboardSession
obj
- the WhiteboardObject to send and modifyOperationFailedException
- if sending
the WhiteboardObject fails for some reason.public void deleteWhiteboardObject(WhiteboardObject obj) throws OperationFailedException
deleteWhiteboardObject
in interface WhiteboardSession
obj
- the WhiteboardObject to send and deleteOperationFailedException
- if sending
the WhiteboardObject fails for some reason.public void sendWhiteboardObject(WhiteboardObject message) throws OperationFailedException
sendWhiteboardObject
in interface WhiteboardSession
message
- the Message to send.java.lang.IllegalStateException
- if the underlying stack is
not registered and initialized.java.lang.IllegalArgumentException
- if to is not an
instance of ContactImpl.OperationFailedException
- if sending the WhiteboardObject fails
for some reason.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the whiteboard to compare this one with.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void addWhiteboardChangeListener(WhiteboardChangeListener listener)
addWhiteboardChangeListener
in interface WhiteboardSession
listener
- the listener to registerpublic void removeWhiteboardChangeListener(WhiteboardChangeListener listener)
removeWhiteboardChangeListener
in interface WhiteboardSession
listener
- the listener to registerpublic ProtocolProviderService getProtocolProvider()
getProtocolProvider
in interface WhiteboardSession
public void fireWhiteboardParticipantEvent(WhiteboardParticipant sourceWhiteboardParticipant, int eventID)
sourceWhiteboardParticipant
- the source
WhiteboardParticipant for the newly created event.eventID
- the ID of the event to create (see CPE member ints)public void fireWhiteboardChangeEvent(java.lang.String type, java.lang.Object oldValue, java.lang.Object newValue)
type
- the type of the event to create (see WhiteboardChangeEvent
member ints)oldValue
- the value of the Whiteboard property that changed, before
the event had occurred.newValue
- the value of the Whiteboard property that changed, after
the event has occurred.public java.util.Vector<WhiteboardObject> getWhiteboardObjects()
getWhiteboardObjects
in interface WhiteboardSession
public void setState(WhiteboardSessionState newState)
setState
in interface WhiteboardSession
newState
- a reference to the WhiteboardState instance that
the whiteboard is to enter.public WhiteboardSessionState getState()
getState
in interface WhiteboardSession
public void fireMessageEvent(java.util.EventObject evt)
evt
- the EventObject that we'd like delivered to all
registered message listeners.public java.lang.String[] getSupportedWhiteboardObjects()
getSupportedWhiteboardObjects
in interface WhiteboardSession
public boolean isParticipantContained(java.lang.String participantName)
participantName
- the name of the participant to search fortrue
if a participant with the given name is
contained in this session, false
- otherwise
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.