diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java index 76f66eab4..2d1140270 100644 --- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java @@ -980,7 +980,7 @@ private void handleNewCall(Call sourceCall, String direction) currentCallRecords.add(newRecord); // if has already perticipants Dispatch them - Iterator iter = sourceCall.getCallPeers(); + Iterator iter = sourceCall.getCallPeers(); while (iter.hasNext()) { handlePeerAdded(iter.next()); diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java index 6b909cba5..7d18e97d5 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java @@ -25,7 +25,7 @@ /** * The dialog created for a given call. - * + * * @author Yana Stamcheva */ public class CallDialog @@ -240,7 +240,7 @@ private void actionPerformedOnHangupButton() /** * Returns the Call corresponding to this CallDialog. - * + * * @return the Call corresponding to this CallDialog. */ public Call getCall() @@ -259,12 +259,12 @@ protected void close(boolean isEscaped) /** * Returns the DialpadDialog corresponding to this CallDialog. - * + * * @return the DialpadDialog corresponding to this CallDialog. */ private DialpadDialog getDialpadDialog() { - Iterator callPeers = + Iterator callPeers = (call == null) ? new Vector().iterator() : call.getCallPeers(); @@ -275,7 +275,7 @@ private DialpadDialog getDialpadDialog() /** * Returns true if the hold button is selected, * false - otherwise. - * + * * @return true if the hold button is selected, * false - otherwise. */ @@ -286,7 +286,7 @@ public boolean isHoldButtonSelected() /** * Selects or unselects the hold button in this call dialog. - * + * * @param isSelected indicates if the hold button should be selected or not */ public void setHoldButtonSelected(boolean isSelected) @@ -297,7 +297,7 @@ public void setHoldButtonSelected(boolean isSelected) /** * Returns true if the mute button is selected, * false - otherwise. - * + * * @return true if the mute button is selected, * false - otherwise. */ @@ -308,7 +308,7 @@ public boolean isMuteButtonSelected() /** * Selects or unselects the mute button in this call dialog. - * + * * @param isSelected indicates if the mute button should be selected or not */ public void setMuteButtonSelected(boolean isSelected) @@ -319,7 +319,7 @@ public void setMuteButtonSelected(boolean isSelected) /** * Returns true if the video button is selected, * false - otherwise. - * + * * @return true if the video button is selected, * false - otherwise. */ @@ -330,7 +330,7 @@ public boolean isVideoButtonSelected() /** * Selects or unselects the video button in this call dialog. - * + * * @param isSelected indicates if the video button should be selected or not */ public void setVideoButtonSelected(boolean isSelected) @@ -424,7 +424,7 @@ public void callStateChanged(CallChangeEvent evt) /** * Checks if the contained call is a conference call. - * + * * @return true if the contained Call is a conference * call, otherwise - returns false. */ @@ -436,7 +436,7 @@ private boolean isConference() // If one of our peers is a conference focus, we're in a // conference call. - Iterator callPeers = call.getCallPeers(); + Iterator callPeers = call.getCallPeers(); while (callPeers.hasNext()) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java index 1f40f9afe..fb467ba1e 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java @@ -321,7 +321,7 @@ public AnswerCallThread(Call call) public void run() { ProtocolProviderService pps = call.getProtocolProvider(); - Iterator peers = call.getCallPeers(); + Iterator peers = call.getCallPeers(); while (peers.hasNext()) { @@ -460,7 +460,7 @@ public HangupCallThread(Call call) public void run() { ProtocolProviderService pps = call.getProtocolProvider(); - Iterator peers = call.getCallPeers(); + Iterator peers = call.getCallPeers(); while (peers.hasNext()) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java index 0645d72c7..5ae712c02 100755 --- a/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/DialPanel.java @@ -32,6 +32,9 @@ public class DialPanel extends JPanel implements MouseListener { + /** + * Our class logger + */ private final Logger logger = Logger.getLogger(DialPanel.class); /** @@ -74,7 +77,7 @@ public DialPanel(MainCallPanel parentCallPanel) * @param callPeers the CallPeers, for which the * dialpad will be opened. */ - public DialPanel(Iterator callPeers) + public DialPanel(Iterator callPeers) { // We need to send DTMF tones to all peers each time the user // presses a dial button, so we put the iterator into a list. @@ -409,7 +412,7 @@ public void actionPerformed(ActionEvent e) */ private void sendDtmfTone(DTMFTone dtmfTone) { - Iterator callPeers = this.callPeersList.iterator(); + Iterator callPeers = this.callPeersList.iterator(); try { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/DialpadDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/DialpadDialog.java index 3d495c4e9..8a8990365 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/DialpadDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/DialpadDialog.java @@ -25,6 +25,12 @@ public class DialpadDialog extends JDialog implements WindowFocusListener { + /** + * Creates a new instance of this class using the specified + * dialPanel. + * + * @param dialPanel the DialPanel that we'd like to wrap. + */ private DialpadDialog(DialPanel dialPanel) { dialPanel.setOpaque(false); @@ -48,7 +54,7 @@ private DialpadDialog(DialPanel dialPanel) * * @param callPeers The corresponding call peers. */ - public DialpadDialog(Iterator callPeers) + public DialpadDialog(Iterator callPeers) { this(new DialPanel(callPeers)); @@ -71,6 +77,12 @@ public DialpadDialog(MainCallPanel mainCallPanel) */ private static class BackgroundPanel extends JPanel { + /** + * Calls super's paintComponent method and then adds + * background with gradient. + * + * @param g a reference to the currently valid Graphics object + */ public void paintComponent(Graphics g) { super.paintComponent(g); @@ -94,10 +106,20 @@ public void paintComponent(Graphics g) } } + /** + * Dummy implementation. + * + * @param e unused + */ public void windowGainedFocus(WindowEvent e) { } + /** + * Dummy implementation. + * + * @param e unused + */ public void windowLostFocus(WindowEvent e) { this.setVisible(false); diff --git a/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java b/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java index ed1a96d30..e3c795562 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java @@ -125,7 +125,7 @@ public void actionPerformed(ActionEvent evt) (OperationSetBasicTelephony) call.getProtocolProvider() .getOperationSet(OperationSetBasicTelephony.class); - Iterator peers = call.getCallPeers(); + Iterator peers = call.getCallPeers(); while (peers.hasNext()) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java b/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java index 7d6672c60..842316e79 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java @@ -112,7 +112,7 @@ public void actionPerformed(ActionEvent evt) { if (call != null) { - Iterator peers + Iterator peers = call.getCallPeers(); while (peers.hasNext()) diff --git a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java index 0dbb05f78..f4eac50d1 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java @@ -121,7 +121,7 @@ private void initComponents() */ private void initCallLabel(JLabel callLabel) { - Iterator peersIter = incomingCall.getCallPeers(); + Iterator peersIter = incomingCall.getCallPeers(); boolean hasMorePeers = false; String text = ""; diff --git a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java index 1d1c62761..a4036ec97 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java @@ -20,29 +20,32 @@ import net.java.sip.communicator.util.swing.*; /** - * Represents an UI means to transfer (the Call of) an associated - * CallPariticant. + * Represents an UI means to transfer (the Call of) an associated + * CallPariticant. * * @author Lubomir Marinov */ public class TransferCallButton extends SIPCommButton { + /** + * Our class logger. + */ private static final Logger logger = Logger.getLogger(TransferCallButton.class); /** - * The CallPeer (whose Call is) to be + * The CallPeer (whose Call is) to be * transfered. */ private final CallPeer callPeer; /** - * Initializes a new TransferCallButton instance which is to - * transfer (the Call of) a specific - * CallPeer. + * Initializes a new TransferCallButton instance which is to + * transfer (the Call of) a specific + * CallPeer. * - * @param callPeer the CallPeer to be associated + * @param callPeer the CallPeer to be associated * with the new instance and to be transfered */ public TransferCallButton(CallPeer callPeer) @@ -59,7 +62,7 @@ public TransferCallButton(CallPeer callPeer) /** * Invoked when an action occurs. * - * @param evt the ActionEvent instance containing the + * @param evt the ActionEvent instance containing the * data associated with the action and the act of its * performing */ @@ -72,11 +75,11 @@ public void actionPerformed(ActionEvent evt) /** * Handles actions performed on this button on behalf of a specific - * ActionListener. + * ActionListener. * - * @param listener the ActionListener notified about the + * @param listener the ActionListener notified about the * performing of the action - * @param evt the ActionEvent containing the data associated + * @param evt the ActionEvent containing the data associated * with the action and the act of its performing */ private void actionPerformed(ActionListener listener, ActionEvent evt) @@ -169,7 +172,7 @@ private CallPeer findCallPeer( { Call call = callIter.next(); - for (Iterator peerIter = call.getCallPeers(); + for (Iterator peerIter = call.getCallPeers(); peerIter.hasNext();) { CallPeer peer = peerIter.next(); @@ -182,13 +185,15 @@ private CallPeer findCallPeer( } /** - * Returns the first CallPeer among all existing ones + * Returns the first CallPeer among all existing ones * who has a specific address. * - * @param address the address of the CallPeer to be - * located - * @return the first CallPeer among all existing ones - * who has the specified address + * @param address the address of the CallPeer to be located + * @return the first CallPeer among all existing ones + * who has the specified address + * + * @throws OperationFailedException in case we fail retrieving a reference + * to ProtocolProviderServices */ private CallPeer findCallPeer(String address) throws OperationFailedException @@ -231,18 +236,18 @@ private CallPeer findCallPeer(String address) } /** - * Gets the first Frame in the ancestor Component - * hierarchy of a specific Component. + * Gets the first Frame in the ancestor Component + * hierarchy of a specific Component. *

- * The located Frame (if any) is often used as the owner of - * Dialogs opened by the specified Component in - * order to provide natural Frame ownership. - * + * The located Frame (if any) is often used as the owner of + * Dialogs opened by the specified Component in + * order to provide natural Frame ownership. + * * @param component the Component which is to have its * Component hierarchy examined for Frame - * @return the first Frame in the ancestor - * Component hierarchy of the specified Component; - * null, if no such Frame was located + * @return the first Frame in the ancestor + * Component hierarchy of the specified Component; + * null, if no such Frame was located */ public static Frame getFrame(Component component) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceCallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceCallPanel.java index 278403af5..007ec2795 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceCallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/conference/ConferenceCallPanel.java @@ -60,7 +60,7 @@ public ConferenceCallPanel(CallDialog callDialog, Call c) this.addLocalCallPeer(); - Iterator iterator = this.call.getCallPeers(); + Iterator iterator = this.call.getCallPeers(); while (iterator.hasNext()) { this.addCallPeerPanel(iterator.next()); diff --git a/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java b/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java index 72fa565eb..d2dea0800 100644 --- a/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java +++ b/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java @@ -35,21 +35,39 @@ */ public class SecurityEventManager extends ZrtpUserCallback { + /** + * Our class logger. + */ private static final Logger logger = Logger.getLogger(SecurityEventManager.class); + /** + * A warning String that we display to the user. + */ public static final String WARNING_NO_RS_MATCH = MediaActivator .getResources().getI18NString( "impl.media.security.WARNING_NO_RS_MATCH"); + /** + * A warning String that we display to the user. + */ public static final String WARNING_NO_EXPECTED_RS_MATCH = MediaActivator .getResources().getI18NString( "impl.media.security.WARNING_NO_EXPECTED_RS_MATCH"); + /** + * A reference to the CallPeer that we will be interacting with. + */ private CallPeer callPeer; + /** + * The session that this manager is associated with. + */ private final CallSession callSession; + /** + * A callback to the instance that created us. + */ private final SessionCreatorCallback peerSecurityCallback; /** @@ -79,6 +97,9 @@ public class SecurityEventManager extends ZrtpUserCallback /** * The class constructor. + * + * @param callSession the call session that this manager is to be associated + * with. */ public SecurityEventManager(CallSession callSession) { @@ -90,7 +111,7 @@ public SecurityEventManager(CallSession callSession) // At this moment we're supporting a security call between only two // peers. In the future the call peer would be passed // as a parameter to the SecurityEventManager. - Iterator callPeers + Iterator callPeers = callSession.getCall().getCallPeers(); while (callPeers.hasNext()) @@ -356,16 +377,24 @@ public void confirmGoClear() + ": GoClear confirmation requested."); } + /** + * Converts the sessionType into into a String. + * + * @param sessionType one of the + * CallPeerSecurityStatusEvent.XXX_SESSION fields + * + * @return a String representation of sessionType. + */ private String sessionTypeToString(int sessionType) { switch (sessionType) { - case CallPeerSecurityStatusEvent.AUDIO_SESSION: - return "AUDIO_SESSION"; - case CallPeerSecurityStatusEvent.VIDEO_SESSION: - return "VIDEO_SESSION"; - default: - throw new IllegalArgumentException("sessionType"); + case CallPeerSecurityStatusEvent.AUDIO_SESSION: + return "AUDIO_SESSION"; + case CallPeerSecurityStatusEvent.VIDEO_SESSION: + return "VIDEO_SESSION"; + default: + throw new IllegalArgumentException("sessionType"); } } } diff --git a/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java b/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java index e0b7d4612..6281050b8 100644 --- a/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java +++ b/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java @@ -90,7 +90,10 @@ public void callPeerRemoved( CallPeerEvent callPeerEvent) * CallState.CALL_IN_PROGRESS, puts the other existing * Calls on hold. * - * @see .CallChangeListener#callStateChanged(CallChangeEvent) + * @param callChangeEvent the CallChangeEvent that we are to + * deliver. + * + * @see CallChangeListener#callStateChanged(CallChangeEvent) */ public void callStateChanged(CallChangeEvent callChangeEvent) { @@ -143,6 +146,9 @@ public void serviceChanged(ServiceEvent serviceEvent) } } + /** + * Our class logger + */ private static final Logger logger = Logger.getLogger(SingleCallInProgressPolicy.class); @@ -312,7 +318,7 @@ private void putOnHold(Call call) if (telephony != null) { - for (Iterator peerIter = + for (Iterator peerIter = call.getCallPeers(); peerIter.hasNext();) { CallPeer peer = peerIter.next(); diff --git a/src/net/java/sip/communicator/impl/protocol/facebook/OperationSetPersistentPresenceFacebookImpl.java b/src/net/java/sip/communicator/impl/protocol/facebook/OperationSetPersistentPresenceFacebookImpl.java index 34f335728..e6f48ac10 100644 --- a/src/net/java/sip/communicator/impl/protocol/facebook/OperationSetPersistentPresenceFacebookImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/facebook/OperationSetPersistentPresenceFacebookImpl.java @@ -137,6 +137,7 @@ public Contact findContactByID(String contactID) * * @param statusMessage a String containing the new status message. */ + @Deprecated public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; @@ -279,7 +280,7 @@ public void publishPresenceStatus(PresenceStatus status, { PresenceStatus oldPresenceStatus = this.presenceStatus; this.presenceStatus = status; - + //OK, now post the new status message! if(statusMessage != null && !statusMessage.equals("")) { @@ -290,11 +291,11 @@ public void publishPresenceStatus(PresenceStatus status, adapter.setStatusMessage(statusMessage); } } - + this.statusMessage = statusMessage; this.fireProviderStatusChangeEvent(oldPresenceStatus); - + try { if(this.presenceStatus == FacebookStatusEnum.OFFLINE) @@ -325,7 +326,7 @@ else if(this.presenceStatus == FacebookStatusEnum.INVISIBLE) throw new OperationFailedException( "unable to change facebook visibility", -1, e); } - + /*// since we are not a real protocol, we set the contact presence status // ourselves and make them have the same status as ours. diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java index 212bb48ed..826c883b7 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetAdHocMultiUserChatIcqImpl.java @@ -1,6 +1,6 @@ /* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. - * + * * Distributable under LGPL license. See terms of license at gnu.org. */ package net.java.sip.communicator.impl.protocol.icq; @@ -15,7 +15,7 @@ /** * A ICQ implementation of the ad-hoc multi user chat operation set. - * + * * @author Valentin Martinet */ public class OperationSetAdHocMultiUserChatIcqImpl @@ -81,7 +81,7 @@ public class OperationSetAdHocMultiUserChatIcqImpl /** * Instantiates the user operation set with a currently valid instance of * the Icq protocol provider. - * + * * @param icqProvider a currently valid instance of * ProtocolProviderServiceIcqImpl. */ @@ -94,7 +94,7 @@ public class OperationSetAdHocMultiUserChatIcqImpl /** * Adds a listener to invitation notifications. - * + * * @param listener an invitation listener. */ public void addInvitationListener(AdHocChatRoomInvitationListener listener) @@ -109,7 +109,7 @@ public void addInvitationListener(AdHocChatRoomInvitationListener listener) /** * Subscribes listener so that it would receive events indicating * rejection of a multi user chat invitation that we've sent earlier. - * + * * @param listener the listener that we'll subscribe for invitation * rejection events. */ @@ -126,7 +126,7 @@ public void addInvitationRejectionListener( /** * Adds a listener that will be notified of changes in our status in a chat * room such as us being kicked, banned or dropped. - * + * * @param listener the LocalUserAdHocChatRoomPresenceListener. */ public void addPresenceListener( @@ -141,7 +141,7 @@ public void addPresenceListener( /** * Returns a list of all currently joined AdHocChatRoom-s. - * + * * @return a list of all currently joined AdHocChatRoom-s */ public List getAdHocChatRooms() @@ -153,18 +153,18 @@ public List getAdHocChatRooms() * Creates a room with the named roomName and according to the * specified roomProperties on the server that this protocol * provider is currently connected to. - * + * * @param roomName the name of the AdHocChatRoom to create. * @param roomProperties properties specifying how the room should be * created. Contains list of invitees and the invitation message. - * + * * @throws OperationFailedException if the room couldn't be created for some * reason (e.g. room already exists; user already joined to an * existent room or user has no permissions to create an ad-hoc * chat room). * @throws OperationNotSupportedException if ad-hoc chat room creation is * not supported by this server - * + * * @return AdHocChatRoom the ad-hoc chat room that we've just created. */ public AdHocChatRoom createAdHocChatRoom(String roomName, @@ -194,7 +194,7 @@ public AdHocChatRoom createAdHocChatRoom(String roomName, * * @param adHocRoomName the name of the ad-hoc room * @param contacts the list of contacts - * + * * @throws OperationFailedException * @throws OperationNotSupportedException */ @@ -203,8 +203,8 @@ public AdHocChatRoom createAdHocChatRoom(String adHocRoomName, throws OperationFailedException, OperationNotSupportedException { - AdHocChatRoom adHocChatRoom - = createAdHocChatRoom(adHocRoomName, new Hashtable()); + AdHocChatRoom adHocChatRoom = createAdHocChatRoom( + adHocRoomName, new Hashtable()); if (adHocChatRoom != null && contacts != null) { @@ -270,7 +270,7 @@ private AdHocChatRoom createLocalChatRoomInstance( /** * Returns true if contact supports multi user chat sessions. - * + * * @param contact reference to the contact whose support for chat rooms we * are currently querying. * @return a boolean indicating whether contact supports chat @@ -287,7 +287,7 @@ public boolean isMultiChatSupportedByContact(Contact contact) /** * Informs the sender of an invitation that we decline their invitation. - * + * * @param invitation the connection to use for sending the rejection. * @param rejectReason the reason to reject the given invitation */ @@ -309,7 +309,7 @@ public void rejectInvitation(AdHocChatRoomInvitation invitation, /** * Removes listener from the list of invitation listeners * registered to receive invitation events. - * + * * @param listener the invitation listener to remove. */ public void removeInvitationListener( @@ -324,7 +324,7 @@ public void removeInvitationListener( /** * Removes listener from the list of invitation listeners * registered to receive invitation rejection events. - * + * * @param listener the invitation listener to remove. */ public void removeInvitationRejectionListener( @@ -339,7 +339,7 @@ public void removeInvitationRejectionListener( /** * Removes a listener that was being notified of changes in our status in a * room such as us being joined or dropped. - * + * * @param listener the LocalUserAdHocChatRoomPresenceListener. */ public void removePresenceListener( @@ -354,7 +354,7 @@ public void removePresenceListener( /** * Delivers a AdHocChatRoomInvitationReceivedEvent to all * registered AdHocChatRoomInvitationListeners. - * + * * @param targetChatRoom the ad-hoc room that invitation refers to * @param inviter the inviter that sent the invitation * @param reason the reason why the inviter sent the invitation @@ -391,7 +391,7 @@ public void fireInvitationEvent(AdHocChatRoom targetChatRoom, /** * Delivers a LocalUserAdHocChatRoomPresenceChangeEvent to all * registered LocalUserAdHocChatRoomPresenceListeners. - * + * * @param chatRoom the AdHocChatRoom which has been joined, left, * etc. * @param eventType the type of this event; one of LOCAL_USER_JOINED, @@ -433,7 +433,7 @@ private class RegistrationStateListener * The method is called by a ProtocolProvider implementation whenever a * change in the registration state of the corresponding provider had * occurred. - * + * * @param evt ProviderStatusChangeEvent the event describing the status * change. */ diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomConfigurationFormFieldJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomConfigurationFormFieldJabberImpl.java index ae986c52a..5aeecd346 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomConfigurationFormFieldJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomConfigurationFormFieldJabberImpl.java @@ -149,7 +149,7 @@ else if(smackType.equals(FormField.TYPE_LIST_MULTI)) */ public Iterator getValues() { - Iterator valuesIter = null; + Iterator valuesIter = null; List values = new ArrayList(); Iterator smackValues = smackFormField.getValues(); @@ -169,9 +169,9 @@ public Iterator getValues() valuesIter = values.iterator(); } else - valuesIter = (Iterator) smackValues; + valuesIter = (Iterator) smackValues; - return valuesIter; + return (Iterator)valuesIter; } /** diff --git a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java index e4f97ed2b..eb2dd1ba2 100644 --- a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetAdHocMultiUserChatMsnImpl.java @@ -17,10 +17,10 @@ /** * A MSN implementation of the ad-hoc multi user chat operation set. - * + * * @author Valentin Martinet */ -public class OperationSetAdHocMultiUserChatMsnImpl +public class OperationSetAdHocMultiUserChatMsnImpl implements OperationSetAdHocMultiUserChat { private static final Logger logger @@ -53,7 +53,7 @@ public class OperationSetAdHocMultiUserChatMsnImpl * A list of listeners subscribed for events indicating rejection of a multi * user chat invitation sent by us. */ - private Vector + private Vector invitationRejectionListeners = new Vector(); @@ -78,7 +78,7 @@ public OperationSetAdHocMultiUserChatMsnImpl( /** * Adds the given presence listener to existing presence listeners list. - * + * * @param listener the listener to add */ public void addPresenceListener( @@ -93,7 +93,7 @@ public void addPresenceListener( /** * Adds a listener to invitation notifications. - * + * * @param listener an invitation listener. */ public void addInvitationListener(AdHocChatRoomInvitationListener listener) @@ -108,7 +108,7 @@ public void addInvitationListener(AdHocChatRoomInvitationListener listener) /** * Removes listener from the list of invitation listeners * registered to receive invitation events. - * + * * @param listener the invitation listener to remove. */ public void removeInvitationListener( @@ -122,7 +122,7 @@ public void removeInvitationListener( /** * Adds a listener to invitation notifications. - * + * * @param listener an invitation listener. */ public void addInvitationRejectionListener( @@ -138,7 +138,7 @@ public void addInvitationRejectionListener( /** * Removes listener from the list of invitation listeners * registered to receive invitation events. - * + * * @param listener the invitation listener to remove. */ public void removeInvitationRejectionListener( @@ -152,7 +152,7 @@ public void removeInvitationRejectionListener( /** * Creates a message by a given message text. - * + * * @param messageText The message text. * @return the newly created message. */ @@ -164,12 +164,12 @@ public Message createMessage(String messageText) } /** - * Creates an ad-hoc room with the named adHocRoomName and in + * Creates an ad-hoc room with the named adHocRoomName and in * including to the specified contacts. - * + * * @param adHocRoomName the name of the ad-hoc room * @param contacts the list of contacts - * + * * @throws OperationFailedException * @throws OperationNotSupportedException */ @@ -177,8 +177,8 @@ public AdHocChatRoom createAdHocChatRoom( String adHocRoomName, List contacts) throws OperationFailedException, OperationNotSupportedException { - AdHocChatRoom adHocChatRoom - = createAdHocChatRoom(adHocRoomName, new Hashtable()); + AdHocChatRoom adHocChatRoom = createAdHocChatRoom( + adHocRoomName, new Hashtable()); if (adHocChatRoom != null && contacts != null) { @@ -196,10 +196,10 @@ public AdHocChatRoom createAdHocChatRoom( String adHocRoomName, /** * Creates an AdHocChatRoom whose name is _adHocRoomName with the * properties contained in _adHocRoomProperties - * + * * @param adHocRoomName the name of the ad-hoc room * @param adHocRoomProperties the ad-hoc room's properties - * + * * @throws OperationFailedException * @throws OperationNotSupportedException */ @@ -227,7 +227,7 @@ public AdHocChatRoom createAdHocChatRoom(String adHocRoomName, /** * Creates a ChatRoom from the specified chatRoomName. - * + * * @param adHocChatRoomName the specific ad-hoc chat room name. * @param switchboardId the identifier of the switchboard * @return the ad-hoc chat room that we've just created. @@ -253,16 +253,16 @@ private AdHocChatRoomMsnImpl createLocalAdHocChatRoomInstance( /** * Returns the AdHocChatRoomMsnImpl corresponding to the given * switchboard, if one exists, otherwise returns null. - * + * * @param switchboard the Msn switchboard corresponding to a chat room - * + * * @return the AdHocChatRoomMsnImpl corresponding to the given * switchboard, otherwise null */ private AdHocChatRoomMsnImpl getLocalAdHocChatRoomInstance( MsnSwitchboard switchboard) { - AdHocChatRoomMsnImpl adHocRoom = (AdHocChatRoomMsnImpl) + AdHocChatRoomMsnImpl adHocRoom = (AdHocChatRoomMsnImpl) this.adHocChatRoomCache.get(switchboard); return adHocRoom; @@ -279,7 +279,7 @@ private AdHocChatRoomMsnImpl getLocalAdHocChatRoomInstance( private AdHocChatRoomMsnImpl createLocalAdHocChatRoomInstance( MsnSwitchboard switchboard) { - AdHocChatRoomMsnImpl adHocChatRoom = (AdHocChatRoomMsnImpl) + AdHocChatRoomMsnImpl adHocChatRoom = (AdHocChatRoomMsnImpl) this.adHocChatRoomCache.get(String.valueOf(switchboard.hashCode())); if (adHocChatRoom == null) @@ -305,7 +305,7 @@ private AdHocChatRoomMsnImpl createLocalAdHocChatRoomInstance( /** * Delivers a LocalUserAdHocChatRoomPresenceChangeEvent to all * registered LocalUserAdHocChatRoomPresenceListeners. - * + * * @param adHocChatRoom the AdHocChatRoom which has been joined, * left, etc. * @param eventType the type of this event; one of LOCAL_USER_JOINED, @@ -342,7 +342,7 @@ public void fireLocalUserPresenceEvent( AdHocChatRoom adHocChatRoom, * by the switchboard, if it is not created by the user, its an active file * transfer switchboard or the user count is too low then this method return * false. - * + * * @param switchboard The corresponding MSNswitchboard. * @return true if it is a group chat message or false in the other case. */ @@ -367,18 +367,18 @@ public boolean isGroupChatMessage(MsnSwitchboard switchboard) } } - public boolean isMultiChatSupportedByContact(Contact contact) + public boolean isMultiChatSupportedByContact(Contact contact) { return false; } /** * Removes the given listener from presence listeners' list. - * + * * @param listener the listener to remove */ public void removePresenceListener( - LocalUserAdHocChatRoomPresenceListener listener) + LocalUserAdHocChatRoomPresenceListener listener) { synchronized (this.presenceListeners) { @@ -391,7 +391,7 @@ public void removePresenceListener( /** * Makes sure that we are properly connected. - * + * * @throws OperationFailedException if the provider is not connected. * @throws OperationNotSupportedException if the service is not supported by * the server. @@ -420,7 +420,7 @@ private class RegistrationStateListener * The method is called by a ProtocolProvider implementation whenever a * change in the registration state of the corresponding provider had * occurred. - * + * * @param evt ProviderStatusChangeEvent the event describing the status * change. */ @@ -506,7 +506,7 @@ public void activityEmailNotificationReceived( /** * The Switchboard Listener, listens to all four switchboard events: * Switchboard started/closed and User joins/left. - * + * */ private class MsnSwitchboardListener extends MsnSwitchboardAdapter @@ -630,7 +630,7 @@ public void switchboardStarted(MsnSwitchboard switchboard) * Note: Not supported inside the MSN. */ public void rejectInvitation(AdHocChatRoomInvitation invitation, - String rejectReason) + String rejectReason) { // there is no way to block invitations, because there arn't any // invitations. diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java b/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java index 9867327d8..adf84bc8e 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java @@ -25,6 +25,9 @@ public class ActiveCallsRepository extends CallChangeAdapter { + /** + * Our class logger. + */ private static final Logger logger = Logger.getLogger(ActiveCallsRepository.class); @@ -199,7 +202,8 @@ public CallPeerSipImpl findCallPeer(String callID, if (!callID.equals(call.getCallID())) continue; - for (Iterator callPeerIter = call.getCallPeers(); + for (Iterator callPeerIter + = call.getCallPeers(); callPeerIter.hasNext();) { CallPeerSipImpl callPeer = @@ -250,11 +254,11 @@ public CallPeerSipImpl findCallPeer(String branchID, String callID) while (activeCallsIter.hasNext()) { CallSipImpl activeCall = activeCallsIter.next(); - Iterator callPeersIter = activeCall.getCallPeers(); + Iterator callPeersIter = activeCall.getCallPeers(); while (callPeersIter.hasNext()) { - CallPeerSipImpl cp = (CallPeerSipImpl) callPeersIter.next(); + CallPeerSipImpl cp = callPeersIter.next(); Dialog cpDialog = cp.getDialog(); Transaction cpTran = cp.getLatestInviteTransaction(); diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java index 81b91b857..eaf2a6141 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerSipImpl.java @@ -1402,6 +1402,185 @@ public synchronized void answer() "Failed to send an OK response to an INVITE request", OperationFailedException.NETWORK_FAILURE, ex, logger); } + } + + /** + * Puts the CallPeer represented by this instance on or off hold. + * + * @param on true to have the CallPeer put on hold; + * false, otherwise + * + * @throws OperationFailedException if we fail to construct or send the + * INVITE request putting the remote side on/off hold. + */ + public void putOnHold(boolean on) + throws OperationFailedException + { + CallSession callSession = getMediaCallSession(); + + try + { + sendReInvite(callSession.createSdpDescriptionForHold( + getSdpDescription(), on)); + } + catch (MediaException ex) + { + ProtocolProviderServiceSipImpl.throwOperationFailedException( + "Failed to create SDP offer to hold.", + OperationFailedException.INTERNAL_ERROR, ex, logger); + } + + /* + * Putting on hold isn't a negotiation (i.e. the issuing side takes the + * decision and executes it) so we're muting now regardless of the + * desire of the peer to accept the offer. + */ + callSession.putOnHold(on, true); + + CallPeerState state = getState(); + if (CallPeerState.ON_HOLD_LOCALLY.equals(state)) + { + if (!on) + setState(CallPeerState.CONNECTED); + } + else if (CallPeerState.ON_HOLD_MUTUALLY.equals(state)) + { + if (!on) + setState(CallPeerState.ON_HOLD_REMOTELY); + } + else if (CallPeerState.ON_HOLD_REMOTELY.equals(state)) + { + if (on) + setState(CallPeerState.ON_HOLD_MUTUALLY); + } + else if (on) + { + setState(CallPeerState.ON_HOLD_LOCALLY); + } + } + /** + * Sends a reINVITE request with a specific sdpOffer (description) + * within the current Dialog with a the call peer represented by + * this instance. + * + * @param sdpOffer the offer that we'd like to use for the newly created + * INVITE request. + * + * @throws OperationFailedException if sending the request fails for some + * reason. + */ + private void sendReInvite(String sdpOffer) + throws OperationFailedException + { + Dialog dialog = getDialog(); + Request invite = messageFactory.createRequest(dialog, Request.INVITE); + + try + { + invite.setContent(sdpOffer, getProtocolProvider().getHeaderFactory() + .createContentTypeHeader("application", "sdp")); + } + catch (ParseException ex) + { + ProtocolProviderServiceSipImpl.throwOperationFailedException( + "Failed to parse SDP offer for the new invite.", + OperationFailedException.INTERNAL_ERROR, ex, logger); + } + + getProtocolProvider().sendInDialogRequest( + getJainSipProvider(), invite, dialog); + } + + /** + * Modifies the local media setup to reflect the requested setting for the + * streaming of the local video and then re-invites the peer represented by + * this class using a corresponding SDP description.. + * + * @param allowed true if local video transmission is allowed and + * false otherwise. + * + * @throws OperationFailedException if video initialization fails. + */ + public void setLocalVideoAllowed(boolean allowed) + throws OperationFailedException + { + CallSession callSession = getMediaCallSession(); + + if(callSession.isLocalVideoAllowed() == allowed) + return; + + try + { + /* + * Modify the local media setup to reflect the requested setting for + * the streaming of the local video. + */ + callSession.setLocalVideoAllowed(allowed); + } + catch (MediaException ex) + { + throw new OperationFailedException( + "Failed to allow/disallow the streaming of local video.", + OperationFailedException.INTERNAL_ERROR, ex); + } + + String sdpOffer = null; + + try + { + sdpOffer = callSession.createSdpOffer(getSdpDescription()); + } + catch (MediaException ex) + { + throw new OperationFailedException( + "Failed to create re-invite offer for peer " + + this,OperationFailedException.INTERNAL_ERROR, ex); + } + + sendReInvite(sdpOffer); + } + + /** + * Determines whether we are currently streaming video toward whoever this + * CallPeerSipImpl represents. + * + * @return true if we are currently streaming video toward this + * CallPeer and false otherwise. + */ + public boolean isLocalVideoStreaming() + { + return getMediaCallSession().isLocalVideoStreaming(); + } + + /** + * Adds a specific PropertyChangeListener to the list of + * listeners which get notified when the properties (e.g. + * LOCAL_VIDEO_STREAMING) associated with this CallPeer change + * their values. + * + * @param listener the PropertyChangeListener to be notified + * when the properties associated with the specified Call change + * their values + */ + public void addVideoPropertyChangeListener(PropertyChangeListener listener) + { + getMediaCallSession().addPropertyChangeListener(listener); + } + + /** + * Removes a specific PropertyChangeListener from the list of + * listeners which get notified when the properties (e.g. + * LOCAL_VIDEO_STREAMING) associated with this CallPeer change + * their values. + * + * @param listener the PropertyChangeListener to no longer be + * notified when the properties associated with the specified Call + * change their values + */ + public void removeVideoPropertyChangeListener( + PropertyChangeListener listener) + { + getMediaCallSession().removePropertyChangeListener(listener); } } diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java index 0c5c322ac..f4b02b5f2 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java @@ -53,6 +53,11 @@ public class CallSipImpl */ private final OperationSetBasicTelephonySipImpl parentOpSet; + /** + * Our video streaming policy. + */ + private boolean isLocalVideoAllowed = false; + /** * Crates a CallSipImpl instance belonging to sourceProvider and * initiated by CallCreator. @@ -129,9 +134,9 @@ public void removeCallPeer(CallPeerSipImpl callPeer) * * @return an Iterator over all peers currently involved in the call. */ - public Iterator getCallPeers() + public Iterator getCallPeers() { - return new LinkedList(callPeers).iterator(); + return new LinkedList(callPeers).iterator(); } /** @@ -238,7 +243,7 @@ public boolean contains(Dialog dialog) */ public CallPeerSipImpl findCallPeer(Dialog dialog) { - Iterator callPeers = this.getCallPeers(); + Iterator callPeers = this.getCallPeers(); if (logger.isTraceEnabled()) { @@ -248,8 +253,7 @@ public CallPeerSipImpl findCallPeer(Dialog dialog) while (callPeers.hasNext()) { - CallPeerSipImpl cp = - (CallPeerSipImpl) callPeers.next(); + CallPeerSipImpl cp = callPeers.next(); if (cp.getDialog() == dialog) { @@ -566,4 +570,108 @@ public static void logAndFailCallPeer(String message, logger.error(message, throwable); peer.setState(CallPeerState.FAILED, message); } + + /** + * Modifies the local media setup of all peers in the call to reflect the + * requested setting for the streaming of the local video and then passes + * the setting to the participating CallPeerSipImpl instances. + * + * @param allowed true if local video transmission is allowed and + * false otherwise. + * + * @throws OperationFailedException if video initialization fails. + */ + public void setLocalVideoAllowed(boolean allowed) + throws OperationFailedException + { + this.isLocalVideoAllowed = allowed; + + /* + * Record the setting locally and notify all peers. + */ + Iterator peers = getCallPeers(); + while (peers.hasNext()) + { + CallPeerSipImpl peer = peers.next(); + + peer.setLocalVideoAllowed(allowed); + } + } + + /** + * Determines whether the streaming of local video in this Call + * is currently allowed. The setting does not reflect the availability of + * actual video capture devices, it just expresses the local policy (or + * desire of the user) to have the local video streamed in the case the + * system is actually able to do so. + * + * @return true if the streaming of local video for this + * Call is allowed; otherwise, false + */ + public boolean isLocalVideoAllowed() + { + return isLocalVideoAllowed; + } + + /** + * Determines whether we are currently streaming video toward at least one + * of the peers in this call. + * + * @return true if we are currently streaming video toward at least + * one of the peers in this call and false otherwise. + */ + public boolean isLocalVideoStreaming() + { + + Iterator peers = getCallPeers(); + while (peers.hasNext()) + { + CallPeerSipImpl peer = peers.next(); + + if (peer.isLocalVideoStreaming()) + return true; + } + + return false; + } + + /** + * Registers a listener with all CallPeer currently + * participating with the call so that it would be notified of changes in + * video related properties (e.g. LOCAL_VIDEO_STREAMING). + * + * @param listener the PropertyChangeListener to be notified + * when the properties associated with member CallPeers change + * their values. + */ + public void addVideoPropertyChangeListener( + PropertyChangeListener listener) + { + Iterator peers = getCallPeers(); + while (peers.hasNext()) + { + CallPeerSipImpl peer = peers.next(); + peer.addVideoPropertyChangeListener(listener); + } + } + + /** + * Removes listener from all CallPeers currently + * participating with the call so that it won't receive furher notifications + * on changes in video related properties (e.g. + * LOCAL_VIDEO_STREAMING). + * + * @param listener the PropertyChangeListener to unregister from + * member CallPeers change their values. + */ + public void removeVideoPropertyChangeListener( + PropertyChangeListener listener) + { + Iterator peers = getCallPeers(); + while (peers.hasNext()) + { + CallPeerSipImpl peer = peers.next(); + peer.removeVideoPropertyChangeListener(listener); + } + } } diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java index 4ba58f4ed..0b1b394bc 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java @@ -9,6 +9,7 @@ import gov.nist.javax.sip.header.HeaderFactoryImpl; // disambiguates Contact import gov.nist.javax.sip.header.extensions.*; +import java.net.*; import java.text.*; import java.util.*; @@ -237,82 +238,7 @@ private void putOnHold(CallPeer peer, boolean on) throws OperationFailedException { CallPeerSipImpl sipPeer = (CallPeerSipImpl) peer; - CallSession callSession = sipPeer.getMediaCallSession(); - - try - { - sendInviteRequest(sipPeer, callSession.createSdpDescriptionForHold( - sipPeer.getSdpDescription(), on)); - } - catch (MediaException ex) - { - ProtocolProviderServiceSipImpl.throwOperationFailedException( - "Failed to create SDP offer to hold.", - OperationFailedException.INTERNAL_ERROR, ex, logger); - } - - /* - * Putting on hold isn't a negotiation (i.e. the issuing side takes the - * decision and executes it) so we're muting now regardless of the - * desire of the peer to accept the offer. - */ - callSession.putOnHold(on, true); - - CallPeerState state = sipPeer.getState(); - if (CallPeerState.ON_HOLD_LOCALLY.equals(state)) - { - if (!on) - sipPeer.setState(CallPeerState.CONNECTED); - } - else if (CallPeerState.ON_HOLD_MUTUALLY.equals(state)) - { - if (!on) - sipPeer.setState(CallPeerState.ON_HOLD_REMOTELY); - } - else if (CallPeerState.ON_HOLD_REMOTELY.equals(state)) - { - if (on) - sipPeer.setState(CallPeerState.ON_HOLD_MUTUALLY); - } - else if (on) - { - sipPeer.setState(CallPeerState.ON_HOLD_LOCALLY); - } - } - - /** - * Sends an invite request with a specific SDP offer (description) within - * the current Dialog with a specific call peer. - * - * @param sipPeer the SIP-specific call peer to send the to within the - * current Dialog @param sdpOffer the description of the SDP offer - * to be made to the specified call peer with the sent invite - * @param sdpOffer the offer that we'd like to use for the newly created - * INVITE request. - * - * @throws OperationFailedException if sending the request fails for some - * reason. - */ - void sendInviteRequest(CallPeerSipImpl sipPeer, String sdpOffer) - throws OperationFailedException - { - Dialog dialog = sipPeer.getDialog(); - Request invite = messageFactory.createRequest(dialog, Request.INVITE); - - try - { - invite.setContent(sdpOffer, protocolProvider.getHeaderFactory() - .createContentTypeHeader("application", "sdp")); - } - catch (ParseException ex) - { - ProtocolProviderServiceSipImpl.throwOperationFailedException( - "Failed to parse SDP offer for the new invite.", - OperationFailedException.INTERNAL_ERROR, ex, logger); - } - - protocolProvider.sendInDialogRequest( - sipPeer.getJainSipProvider(), invite, dialog); + sipPeer.putOnHold(on); } /** @@ -1518,7 +1444,7 @@ public synchronized void shutdown() { CallSipImpl call = activeCalls.next(); - Iterator callPeers = call.getCallPeers(); + Iterator callPeers = call.getCallPeers(); // go through all call peers and say bye to every one. while (callPeers.hasNext()) @@ -1661,10 +1587,12 @@ public void transfer(CallPeer transferee, CallPeer transferTarget) } try { - sipURI.setHeader(ReplacesHeader.NAME, replacesHeader.encodeBody()); + sipURI.setHeader(ReplacesHeader.NAME, + URLEncoder.encode(replacesHeader.encodeBody(), "UTF-8")); } - catch (ParseException ex) + catch (Exception ex) { + //ParseException or UnsupportedEncodingException ProtocolProviderServiceSipImpl.throwOperationFailedException( "Failed to set Replaces header " + replacesHeader + " to SipURI " + sipURI, diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java index 80279cba0..557992095 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java @@ -15,17 +15,17 @@ import net.java.sip.communicator.util.*; /** - * Implements OperationSetVideoTelephony in order to give access to + * Implements OperationSetVideoTelephony in order to give access to * video-specific functionality in the SIP protocol implementation such as - * visual Components displaying video and listening to dynamic - * availability of such Components. Because the video in the SIP - * protocol implementation is provided by the CallSession, this - * OperationSetVideoTelephony just delegates to the - * CallSession while hiding the CallSession as the + * visual Components displaying video and listening to dynamic + * availability of such Components. Because the video in the SIP + * protocol implementation is provided by the CallSession, this + * OperationSetVideoTelephony just delegates to the + * CallSession while hiding the CallSession as the * provider of the video and pretending this - * OperationSetVideoTelephony is the provider because other + * OperationSetVideoTelephony is the provider because other * implementation may not provider their video through the - * CallSession. + * CallSession. * * @author Lubomir Marinov */ @@ -39,11 +39,11 @@ public class OperationSetVideoTelephonySipImpl private final OperationSetBasicTelephonySipImpl basicTelephony; /** - * Initializes a new OperationSetVideoTelephonySipImpl instance + * Initializes a new OperationSetVideoTelephonySipImpl instance * which builds upon the telephony-related functionality of a specific - * OperationSetBasicTelephonySipImpl. + * OperationSetBasicTelephonySipImpl. * - * @param basicTelephony the OperationSetBasicTelephonySipImpl + * @param basicTelephony the OperationSetBasicTelephonySipImpl * the new extension should build upon */ public OperationSetVideoTelephonySipImpl( @@ -52,36 +52,46 @@ public OperationSetVideoTelephonySipImpl( this.basicTelephony = basicTelephony; } - /* + /** * Delegates to the CallSession of the Call of the specified CallPeer * because the video is provided by the CallSession in the SIP protocol * implementation. Because other OperationSetVideoTelephony implementations * may not provide their video through the CallSession, this implementation * promotes itself as the provider of the video by replacing the CallSession * in the VideoEvents it fires. + * + * @param peer the CallPeer that we will be registering + * listener with. + * @param listener the VideoListener that we'd like to register. */ - public void addVideoListener(CallPeer peer, - VideoListener listener) + public void addVideoListener(CallPeer peer, VideoListener listener) { if (listener == null) throw new NullPointerException("listener"); - ((CallSipImpl) peer.getCall()).getMediaCallSession() - .addVideoListener( - new InternalVideoListener(this, peer, listener)); + ((CallPeerSipImpl) peer).getMediaCallSession() + .addVideoListener(new InternalVideoListener(this, peer, listener)); } - /* + /** * Implements OperationSetVideoTelephony#createLocalVisualComponent( - * CallPeer, VideoListener). Delegates to CallSession#createLocalVisualComponent( - * VideoListener) of the Call of the specified CallPeer because the - * CallSession manages the visual components which represent local video. + * CallPeer, VideoListener). Delegates to + * CallSession#createLocalVisualComponent(VideoListener) of the Call of the + * specified CallPeer because the CallSession manages the visual components + * which represent local video. + * + * @param peer the CallPeer that we are sending our local video to. + * @param listener the VideoListener where we'd like to retrieve + * the Component containing the local video. + * + * @return the Component containing the local video. + * + * @throws OperationFailedException if we fail extracting the local video. */ public Component createLocalVisualComponent(CallPeer peer, VideoListener listener) throws OperationFailedException { - CallSession callSession = - ((CallSipImpl) peer.getCall()).getMediaCallSession(); + CallSession callSession =((CallPeerSipImpl) peer).getMediaCallSession(); if (callSession != null) { @@ -92,213 +102,206 @@ public Component createLocalVisualComponent(CallPeer peer, catch (MediaException ex) { throw new OperationFailedException( - "Failed to create visual Component for local video (capture).", - OperationFailedException.INTERNAL_ERROR, ex); + "Failed to create visual Component for local " + +"video (capture).", + OperationFailedException.INTERNAL_ERROR, ex); } } return null; } - /* + /** * Implements OperationSetVideoTelephony#disposeLocalVisualComponent( * CallPeer, Component). Delegates to CallSession#disposeLocalVisualComponent( * Component) of the Call of the specified CallPeer because the * CallSession manages the visual components which represent local video. + * + * @param peer the CallPeer whose local video component we'd like + * to dispose of. + * @param component the Component that we'll be disposing of. */ - public void disposeLocalVisualComponent(CallPeer peer, - Component component) + public void disposeLocalVisualComponent(CallPeer peer, Component component) { - CallSession callSession = - ((CallSipImpl) peer.getCall()).getMediaCallSession(); + CallSession callSession =((CallPeerSipImpl) peer).getMediaCallSession(); if (callSession != null) callSession.disposeLocalVisualComponent(component); } - /* + /** * Delegates to the CallSession of the Call of the specified CallPeer * because the video is provided by the CallSession in the SIP protocol * implementation. + * + * @param peer the peer whose visual Components we'd like to + * retrieve. + * + * @return all visual Components for the specified peer. */ public Component[] getVisualComponents(CallPeer peer) { - CallSession callSession = - ((CallSipImpl) peer.getCall()).getMediaCallSession(); + CallSession callSession =((CallPeerSipImpl)peer).getMediaCallSession(); return (callSession != null) ? callSession.getVisualComponents() : new Component[0]; } - /* + /** * Delegates to the CallSession of the Call of the specified CallPeer * because the video is provided by the CallSession in the SIP protocol * implementation. Because other OperationSetVideoTelephony implementations * may not provide their video through the CallSession, this implementation * promotes itself as the provider of the video by replacing the CallSession * in the VideoEvents it fires. + * + * @param peer the CallPeer that we'd like to unregister our + * VideoListener from. + * @param listener the VideoListener that we'd like to unregister. */ - public void removeVideoListener(CallPeer peer, - VideoListener listener) + public void removeVideoListener(CallPeer peer, VideoListener listener) { if (listener != null) { - ((CallSipImpl) peer.getCall()).getMediaCallSession() + ((CallPeerSipImpl) peer).getMediaCallSession() .removeVideoListener( new InternalVideoListener(this, peer, listener)); } } - /* + /** * Implements OperationSetVideoTelephony#setLocalVideoAllowed(Call, * boolean). Modifies the local media setup to reflect the requested setting * for the streaming of the local video and then re-invites all * CallPeers to re-negotiate the modified media setup. + * + * @param call the call where we'd like to allow sending local video. + * @param allowed true if local video transmission is allowed and + * false otherwise. + * + * @throws OperationFailedException if video initialization fails. */ public void setLocalVideoAllowed(Call call, boolean allowed) throws OperationFailedException { - - /* - * Modify the local media setup to reflect the requested setting for the - * streaming of the local video. - */ - CallSipImpl sipCall = (CallSipImpl) call; - CallSession callSession = sipCall.getMediaCallSession(); - - try - { - callSession.setLocalVideoAllowed(allowed); - } - catch (MediaException ex) - { - throw new OperationFailedException( - "Failed to allow/disallow the streaming of local video.", - OperationFailedException.INTERNAL_ERROR, ex); - } - - /* - * Once the local state has been modified, re-invite all - * CallPeers to re-negotiate the modified media setup. - */ - Iterator peers = call.getCallPeers(); - while (peers.hasNext()) - { - CallPeerSipImpl peer - = (CallPeerSipImpl) peers.next(); - String sdpOffer = null; - - try - { - sdpOffer - = callSession.createSdpOffer( - peer.getSdpDescription()); - } - catch (MediaException ex) - { - throw new OperationFailedException( - "Failed to create re-invite offer for peer " - + peer, - OperationFailedException.INTERNAL_ERROR, - ex); - } - - basicTelephony.sendInviteRequest(peer, sdpOffer); - } + ((CallSipImpl)call).setLocalVideoAllowed(allowed); } - /* - * Implements OperationSetVideoTelephony#isLocalVideoAllowed(Call). - * Delegates to CallSession#isLocalVideoAllowed() of the specified Call. + /** + * Determines whether the streaming of local video in a specific + * Call is currently allowed. The setting does not reflect + * the availability of actual video capture devices, it just expresses the + * desire of the user to have the local video streamed in the case the + * system is actually able to do so. + * + * @param call the Call whose video transmission properties we are + * interested in. + * + * @return true if the streaming of local video for the specified + * Call is allowed; otherwise, false */ public boolean isLocalVideoAllowed(Call call) { - return ((CallSipImpl) call).getMediaCallSession().isLocalVideoAllowed(); + return ((CallSipImpl) call).isLocalVideoAllowed(); } - /* - * Implements OperationSetVideoTelephony#isLocalVideoStreaming(Call). - * Delegates to CallSession#isLocalVideoStreaming() of the specified Call. + /** + * Determines whether a specific Call is currently streaming the + * local video (to a remote destination). + * + * @param call the Call whose video transmission we are interested + * in. + * + * @return true if the specified Call is currently + * streaming the local video (to a remote destination); otherwise, + * false */ public boolean isLocalVideoStreaming(Call call) { - return ((CallSipImpl) call) - .getMediaCallSession().isLocalVideoStreaming(); + return ((CallSipImpl) call).isLocalVideoStreaming(); } - /* - * Implements OperationSetVideoTelephony#addPropertyChangeListener(Call, - * PropertyChangeListener). Delegates to CallSession#addPropertyChangeListener( - * PropertyChangeListener) of the specified Call because CallSession - * contains the properties associated with a Call. + /** + * Adds a specific PropertyChangeListener to the list of + * listeners which get notified when the properties (e.g. + * {@link #LOCAL_VIDEO_STREAMING}) associated with a specific + * Call change their values. + * + * @param call the Call to start listening to the changes of + * the property values of + * @param listener the PropertyChangeListener to be notified + * when the properties associated with the specified Call change + * their values */ - public void addPropertyChangeListener( - Call call, PropertyChangeListener listener) + public void addPropertyChangeListener(Call call, + PropertyChangeListener listener) { - ((CallSipImpl) call) - .getMediaCallSession().addPropertyChangeListener(listener); + ((CallSipImpl) call).addVideoPropertyChangeListener(listener); } - /* - * Implements OperationSetVideoTelephony#removePropertyChangeListener(Call, - * PropertyChangeListener). Delegates to CallSession#removePropertyChangeListener( - * PropertyChangeListener) of the specified Call because CallSession - * contains the properties associated with a Call. + /** + * Removes a specific PropertyChangeListener from the list of + * listeners which get notified when the properties (e.g. + * {@link #LOCAL_VIDEO_STREAMING}) associated with a specific + * Call change their values. + * + * @param call the Call to stop listening to the changes of the + * property values of + * @param listener the PropertyChangeListener to no longer be + * notified when the properties associated with the specified Call + * change their values */ - public void removePropertyChangeListener( - Call call, PropertyChangeListener listener) + public void removePropertyChangeListener(Call call, + PropertyChangeListener listener) { - ((CallSipImpl) call) - .getMediaCallSession().removePropertyChangeListener(listener); + ((CallSipImpl) call).removeVideoPropertyChangeListener(listener); } /** - * Represents a VideoListener which forwards notifications to a - * specific delegate VideoListener and hides the original - * VideoEvent sender from it by pretending the sender is a - * specific OperationSetVideoTelephony. It's necessary in order - * to hide from the VideoListeners the fact that the video of - * the SIP protocol implementation is managed by CallSession. + * Represents a VideoListener which forwards notifications to a + * specific delegate VideoListener and hides the original + * VideoEvent sender from it by pretending the sender is a + * specific OperationSetVideoTelephony. It's necessary in order + * to hide from the VideoListeners the fact that the video of + * the SIP protocol implementation is managed by CallSession. */ private static class InternalVideoListener implements VideoListener { /** - * The VideoListener this implementation hides the original - * VideoEvent source from. + * The VideoListener this implementation hides the original + * VideoEvent source from. */ private final VideoListener delegate; /** - * The CallPeer whose videos {@link #delegate} is + * The CallPeer whose videos {@link #delegate} is * interested in. */ private final CallPeer peer; /** - * The OperationSetVideoTelephony which is to be presented - * as the source of the VideoEvents forwarded to + * The OperationSetVideoTelephony which is to be presented + * as the source of the VideoEvents forwarded to * {@link #delegate}. */ private final OperationSetVideoTelephony telephony; /** - * Initializes a new InternalVideoListener which is to - * impersonate the sources of VideoEvents with a specific - * OperationSetVideoTelephony for a specific - * VideoListener interested in the videos of a specific - * CallPeer. + * Initializes a new InternalVideoListener which is to + * impersonate the sources of VideoEvents with a specific + * OperationSetVideoTelephony for a specific + * VideoListener interested in the videos of a specific + * CallPeer. * - * @param telephony the OperationSetVideoTelephony which is - * to be stated as the source of the VideoEvent - * sent to the specified delegate VideoListener - * @param peer the CallPeer whose videos the - * specified delegate VideoListener is - * interested in - * @param delegate the VideoListener which shouldn't know - * that the videos in the SIP protocol implementation is - * managed by the CallSession and not by the specified - * telephony + * @param telephony the OperationSetVideoTelephony which is + * to be stated as the source of the VideoEvent sent to the + * specified delegate VideoListener + * @param peer the CallPeer whose videos the specified delegate + * VideoListener is interested in + * @param delegate the VideoListener which shouldn't know + * that the videos in the SIP protocol implementation is managed by the + * CallSession and not by the specified telephony */ public InternalVideoListener(OperationSetVideoTelephony telephony, CallPeer peer, VideoListener delegate) @@ -311,10 +314,16 @@ public InternalVideoListener(OperationSetVideoTelephony telephony, this.delegate = delegate; } - /* - * Two InternalVideoListeners are equal if they impersonate the sources - * of VideoEvents with equal OperationSetVideoTelephonies for equal - * delegate VideoListeners added to equal CallPeer-s. + /** + * Compares two InternalVideoListeners and determines they are equal + * if they impersonate the sources of VideoEvents with equal + * OperationSetVideoTelephonies for equal delegate VideoListeners added + * to equal CallPeer-s. + * + * @param other the object that we'd be compared to. + * + * @return true if the underlying peer, telephony operation set and + * delegate are equal to those of the other instance. */ public boolean equals(Object other) { @@ -330,17 +339,26 @@ public boolean equals(Object other) && otherListener.delegate.equals(delegate); } + /** + * Returns a hashcode based on the hash codes of the wrapped telephony + * operation set and VideoListener delegate. + * + * @return a hashcode based on the hash codes of the wrapped telephony + * operation set and VideoListener delegate. + */ public int hashCode() { return (telephony.hashCode() << 16) + (delegate.hashCode() >> 16); } - /* + /** * Upon receiving a VideoEvent, sends to delegate a new VideoEvent of * the same type and with the same visual Component but with the source * of the event being set to #telephony. Thus the fact that the * CallSession is the original source is hidden from the clients of * OperationSetVideoTelephony. + * + * @param event the VideoEvent containing the visual component */ public void videoAdded(VideoEvent event) { @@ -348,12 +366,15 @@ public void videoAdded(VideoEvent event) .getVisualComponent(), event.getOrigin())); } - /* + /** * Upon receiving a VideoEvent, sends to delegate a new VideoEvent of * the same type and with the same visual Component but with the source * of the event being set to #telephony. Thus the fact that the * CallSession is the original source is hidden from the clients of * OperationSetVideoTelephony. + * + * @param event the VideoEvent containing video details and + * the event component. */ public void videoRemoved(VideoEvent event) { diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipMessageFactory.java b/src/net/java/sip/communicator/impl/protocol/sip/SipMessageFactory.java index ee59c2f05..51fbce334 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipMessageFactory.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipMessageFactory.java @@ -10,6 +10,7 @@ import gov.nist.javax.sip.header.extensions.*; import gov.nist.javax.sip.message.*; +import java.net.URLDecoder; //disamgibuates javax.sip.address.URI import java.text.*; import java.util.*; @@ -840,9 +841,9 @@ public Request createInviteRequest( Address toAddress, *

* * @param cause the SIP Message from which the information is - * to be copied + * to be copied * @param effect the SIP Message into which the information is - * to be copied + * to be copied */ private void reflectCauseOnEffect(javax.sip.message.Message cause, javax.sip.message.Message effect) @@ -902,12 +903,13 @@ private Header stripReplacesHeader( Address address ) try { - replacesHeader = - protocolProvider.getHeaderFactory().createHeader( - ReplacesHeader.NAME, replacesHeaderValue); + replacesHeader = protocolProvider.getHeaderFactory() + .createHeader(ReplacesHeader.NAME, + URLDecoder.decode(replacesHeaderValue, "UTF-8")); } - catch (ParseException ex) + catch (Exception ex) { + //ParseException, EncodingNotSupportedException. throw new OperationFailedException( "Failed to create ReplacesHeader from " + replacesHeaderValue, diff --git a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java index 2d39cb291..150a566e7 100644 --- a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java +++ b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java @@ -612,7 +612,7 @@ private void hangupCall(Call call) OperationSetBasicTelephony.class); logger.info("Max Message Length Reached, Mailbox is" +" disconnecting the call"); - Iterator callPeers = call.getCallPeers(); + Iterator callPeers = call.getCallPeers(); while(callPeers.hasNext()) { diff --git a/src/net/java/sip/communicator/service/protocol/Call.java b/src/net/java/sip/communicator/service/protocol/Call.java index 4a8661230..646970e33 100644 --- a/src/net/java/sip/communicator/service/protocol/Call.java +++ b/src/net/java/sip/communicator/service/protocol/Call.java @@ -22,6 +22,9 @@ */ public abstract class Call { + /** + * Our class logger. + */ private static final Logger logger = Logger.getLogger(Call.class); /** @@ -123,7 +126,7 @@ public int hashCode() * Returns an iterator over all call peers. * @return an Iterator over all peers currently involved in the call. */ - public abstract Iterator getCallPeers(); + public abstract Iterator getCallPeers(); /** * Returns the number of peers currently associated with this call. diff --git a/src/net/java/sip/communicator/service/protocol/OperationSetVideoTelephony.java b/src/net/java/sip/communicator/service/protocol/OperationSetVideoTelephony.java index 2058f85bc..7bfe45072 100644 --- a/src/net/java/sip/communicator/service/protocol/OperationSetVideoTelephony.java +++ b/src/net/java/sip/communicator/service/protocol/OperationSetVideoTelephony.java @@ -13,9 +13,9 @@ import net.java.sip.communicator.util.*; /** - * Represents an OperationSet giving access to video-specific - * functionality in telephony such as visual Components displaying - * video and listening to dynamic availability of such Components. + * Represents an OperationSet giving access to video-specific + * functionality in telephony such as visual Components displaying + * video and listening to dynamic availability of such Components. * * @author Lubomir Marinov */ @@ -24,157 +24,160 @@ public interface OperationSetVideoTelephony { /** - * Adds a specific VideoListener to this telephony in order to - * receive notifications when visual/video Components are being - * added and removed for a specific CallPeer. + * Adds a specific VideoListener to this telephony in order to + * receive notifications when visual/video Components are being + * added and removed for a specific CallPeer. * - * @param peer the CallPeer whose video the - * specified listener is to be notified about - * @param listener the VideoListener to be notified when - * visual/video Components are being added or - * removed for peer + * @param peer the CallPeer whose video the specified listener + * is to be notified about + * @param listener the VideoListener to be notified when + * visual/video Components are being added or removed for + * peer */ public void addVideoListener( CallPeer peer, VideoListener listener); /** - * Creates a visual Component which depicts the local video - * being streamed to a specific CallPeer. The returned - * visual Component should be disposed when it is no longer - * required through {@link #disposeLocalVisualComponent(CallPeer, Component) disposeLocalVisualComponent}. + * Creates a visual Component which depicts the local video + * being streamed to a specific CallPeer. The returned + * visual Component should be disposed when it is no longer + * required through {@link #disposeLocalVisualComponent(CallPeer, + * Component) disposeLocalVisualComponent}. * - * @param peer the CallPeer to whom the local - * video which is to be depicted by the returned visual - * Component is being streamed - * @param listener if not null, a VideoListener to - * track the progress of the creation in case this telephony - * chooses to perform it asynchronously and to not return the - * created visual Component immediately/as the - * result of this method call - * @return a visual Component which depicts the local video - * being streamed to the specified CallPeer if - * this telephony chooses to carry out the creation synchronously; - * null if this telephony chooses to create the requested - * visual Component asynchronously. + * @param peer the CallPeer to whom the local video which is to be + * depicted by the returned visual Component is being streamed + * @param listener if not null, a VideoListener to track + * the progress of the creation in case this telephony chooses to perform it + * asynchronously and to not return the created visual Component + * immediately/as the result of this method call + * + * @return a visual Component which depicts the local video being + * streamed to the specified CallPeer if this telephony chooses to + * carry out the creation synchronously; null if this telephony + * chooses to create the requested visual Component asynchronously. + * + * @throws OperationFailedException if creating the component fails for + * whatever reason. */ - public Component createLocalVisualComponent( - CallPeer peer, VideoListener listener) + public Component createLocalVisualComponent(CallPeer peer, + VideoListener listener) throws OperationFailedException; /** - * Disposes of a visual Component depicting the local video for - * a specific CallPeer (previously obtained through - * {@link #createLocalVisualComponent(CallPeer, VideoListener) createLocalVisualComponent}). + * Disposes of a visual Component depicting the local video for + * a specific CallPeer (previously obtained through + * {@link #createLocalVisualComponent(CallPeer, VideoListener) + * createLocalVisualComponent}). * The disposal may include, but is not limited to, releasing the - * Player which provides the component and renders + * Player which provides the component and renders * the local video into it, disconnecting from the video capture device. * - * @param peer the CallPeer for whom the visual - * Component depicts the local video - * @param component the visual Component depicting the local - * video to be disposed + * @param peer the CallPeer for whom the visual Component + * depicts the local video + * @param component the visual Component depicting the local video + * to be disposed */ - public void disposeLocalVisualComponent( - CallPeer peer, Component component); + public void disposeLocalVisualComponent(CallPeer peer, Component component); /** - * Gets the visual/video Components available in this telephony - * for a specific CallPeer. + * Gets the visual/video Components available in this telephony + * for a specific CallPeer. * - * @param peer the CallPeer whose videos are to - * be retrieved - * @return an array of the visual Components available in this - * telephony for the specified peer + * @param peer the CallPeer whose videos are to be retrieved + * + * @return an array of the visual Components available in this + * telephony for the specified peer */ public Component[] getVisualComponents(CallPeer peer); /** - * Removes a specific VideoListener from this telephony in + * Removes a specific VideoListener from this telephony in * order to no longer have it receive notifications when visual/video - * Components are being added and removed for a specific - * CallPeer. + * Components are being added and removed for a specific + * CallPeer. * - * @param peer the CallPeer whose video the - * specified listener is to no longer be notified about - * @param listener the VideoListener to no longer be notified - * when visual/video Components are being added or - * removed for peer + * @param peer the CallPeer whose video the specified listener is + * to no longer be notified about + * @param listener the VideoListener to no longer be notified + * when visual/video Components are being added or removed for + * peer */ - public void removeVideoListener( - CallPeer peer, VideoListener listener); + public void removeVideoListener(CallPeer peer, VideoListener listener); /** * Sets the indicator which determines whether the streaming of local video - * in a specific Call is allowed. The setting does not reflect + * in a specific Call is allowed. The setting does not reflect * the availability of actual video capture devices, it just expresses the * desire of the user to have the local video streamed in the case the * system is actually able to do so. * - * @param call the Call to allow/disallow the streaming of - * local video for + * @param call the Call to allow/disallow the streaming of local + * video for * @param allowed true to allow the streaming of local video for - * the specified Call; false to disallow it + * the specified Call; false to disallow it + * + * @throws OperationFailedException if initializing local video fails. */ public void setLocalVideoAllowed(Call call, boolean allowed) throws OperationFailedException; /** * Gets the indicator which determines whether the streaming of local video - * in a specific Call is allowed. The setting does not reflect + * in a specific Call is allowed. The setting does not reflect * the availability of actual video capture devices, it just expresses the * desire of the user to have the local video streamed in the case the * system is actually able to do so. * - * @param call the Call to get the indicator of + * @param call the Call to get the indicator of * @return true if the streaming of local video for the specified - * Call is allowed; otherwise, false + * Call is allowed; otherwise, false */ public boolean isLocalVideoAllowed(Call call); /** - * The property which indicates whether a specific Call is + * The property which indicates whether a specific Call is * currently streaming the local video (to a remote destination). */ public static final String LOCAL_VIDEO_STREAMING = CallSession.LOCAL_VIDEO_STREAMING; /** - * Gets the indicator which determines whether a specific Call + * Gets the indicator which determines whether a specific Call * is currently streaming the local video (to a remote destination). * - * @param call the Call to get the indicator of - * @return true if the specified Call is currently - * streaming the local video (to a remote destination); otherwise, - * false + * @param call the Call to get the indicator of + * @return true if the specified Call is currently + * streaming the local video (to a remote destination); otherwise, + * false */ public boolean isLocalVideoStreaming(Call call); /** - * Adds a specific PropertyChangeListener to the list of + * Adds a specific PropertyChangeListener to the list of * listeners which get notified when the properties (e.g. * {@link #LOCAL_VIDEO_STREAMING}) associated with a specific - * Call change their values. + * Call change their values. * - * @param call the Call to start listening to the changes of - * the property values of - * @param listener the PropertyChangeListener to be notified - * when the properties associated with the specified - * Call change their values + * @param call the Call to start listening to the changes of + * the property values of + * @param listener the PropertyChangeListener to be notified + * when the properties associated with the specified Call change + * their values */ - public void addPropertyChangeListener( - Call call, PropertyChangeListener listener); + public void addPropertyChangeListener(Call call, + PropertyChangeListener listener); /** - * Removes a specific PropertyChangeListener from the list of + * Removes a specific PropertyChangeListener from the list of * listeners which get notified when the properties (e.g. * {@link #LOCAL_VIDEO_STREAMING}) associated with a specific - * Call change their values. + * Call change their values. * - * @param call the Call to stop listening to the changes of the - * property values of - * @param listener the PropertyChangeListener to no longer be - * notified when the properties associated with the specified - * Call change their values + * @param call the Call to stop listening to the changes of the + * property values of + * @param listener the PropertyChangeListener to no longer be + * notified when the properties associated with the specified Call + * change their values */ - public void removePropertyChangeListener( - Call call, PropertyChangeListener listener); + public void removePropertyChangeListener(Call call, + PropertyChangeListener listener); } diff --git a/src/net/java/sip/communicator/util/PropertyChangeListener.java b/src/net/java/sip/communicator/util/PropertyChangeListener.java index c130c3c0b..01e01d476 100644 --- a/src/net/java/sip/communicator/util/PropertyChangeListener.java +++ b/src/net/java/sip/communicator/util/PropertyChangeListener.java @@ -12,7 +12,7 @@ * A "ConfigurationChange" event gets fired whenever a configuration property * changes. Depending on whether the property was constrained or not, the * propertyChange or vetoableChange methods get called. - * + * * @author Emil Ivov */ public interface PropertyChangeListener @@ -20,9 +20,9 @@ public interface PropertyChangeListener { /** * This method gets called when a bound property is changed. - * + * * @param evt A PropertyChangeEvent object describing the event source and - * the property that has changed. + * the property that has changed. */ void propertyChange(PropertyChangeEvent evt); }