src/net/java/sip/communicator/impl/gui/main/call/CallInfoFrame.java
/**
     * Constructs peer info.
     *
     * @param callPeer the <tt>CallPeer</tt>, for which we'll construct the info
     * @param stringBuffer the <tt>StringBuffer</tt>, where call peer info will
     * be added
     */
Constructs peer info.
@param callPeer the CallPeer, for which we'll construct the info
@param stringBuffer the StringBuffer, where call peer info will
be added
Constructs peer info . @param callPeer the CallPeer for which we ' ll construct the info @param stringBuffer the StringBuffer where call peer info will be added
private void constructPeerInfo(CallPeer callPeer, StringBuffer stringBuffer)
    {
        stringBuffer.append(getLineString(callPeer.getAddress(), ""));
        if(callPeer.getCallDurationStartTime() !=
                CallPeer.CALL_DURATION_START_TIME_UNKNOWN)
        {
            Date startTime = new Date(callPeer.getCallDurationStartTime());
            stringBuffer.append(getLineString(
                resources.getI18NString("service.gui.callinfo.CALL_DURATION"),
                GuiUtils.formatTime(startTime.getTime(),
                                    System.currentTimeMillis())));
        }
        if(callPeer instanceof MediaAwareCallPeer)
        {
            CallPeerMediaHandler<?> callPeerMediaHandler
                = ((MediaAwareCallPeer<?,?,?>) callPeer).getMediaHandler();
            if(callPeerMediaHandler != null)
            {
                MediaStream mediaStream =
                    callPeerMediaHandler.getStream(MediaType.AUDIO);
                if (mediaStream != null && mediaStream.isStarted())
                {
                    stringBuffer.append("<br/>");
                    stringBuffer.append(getLineString(resources.getI18NString(
                        "service.gui.callinfo.AUDIO_INFO"), ""));
                    this.appendStreamEncryptionMethod(
                            stringBuffer,
                            callPeerMediaHandler,
                            mediaStream,
                            MediaType.AUDIO);
                    constructAudioVideoInfo(
                            callPeerMediaHandler,
                            mediaStream,
                            stringBuffer,
                            MediaType.AUDIO);
                }
                mediaStream = callPeerMediaHandler.getStream(MediaType.VIDEO);
                if (mediaStream != null && mediaStream.isStarted())
                {
                    stringBuffer.append("<br/>");
                    stringBuffer.append(getLineString(resources.getI18NString(
                        "service.gui.callinfo.VIDEO_INFO"), ""));
                    this.appendStreamEncryptionMethod(
                            stringBuffer,
                            callPeerMediaHandler,
                            mediaStream,
                            MediaType.VIDEO);
                    constructAudioVideoInfo(
                            callPeerMediaHandler,
                            mediaStream,
                            stringBuffer,
                            MediaType.VIDEO);
                }
                stringBuffer.append("<br/>");
                String iceState = callPeerMediaHandler.getICEState();
                if(iceState != null && !iceState.equals("Terminated"))
                {
                    stringBuffer.append(getLineString(
                        resources.getI18NString(
                            "service.gui.callinfo.ICE_STATE"),
                        resources.getI18NString(
                            "service.gui.callinfo.ICE_STATE."
                                + iceState.toUpperCase())));
                }
                stringBuffer.append("<br/>");
                long harvestingTime
                    = callPeerMediaHandler.getTotalHarvestingTime();
                if(harvestingTime != 0)
                {
                    stringBuffer.append(getLineString(resources.getI18NString(
                                    "service.gui.callinfo.TOTAL_HARVESTING_TIME"
                                    ),
                                harvestingTime
                                + " "
                                + resources.getI18NString(
                                    "service.gui.callinfo.HARVESTING_MS_FOR")
                                + " "
                                + callPeerMediaHandler.getNbHarvesting()
                                + " "
                                + resources.getI18NString(
                                    "service.gui.callinfo.HARVESTS")));
                }
                String[] harvesterNames =
                {
                    "GoogleTurnCandidateHarvester",
                    "GoogleTurnSSLCandidateHarvester",
                    "HostCandidateHarvester",
                    "JingleNodesHarvester",
                    "StunCandidateHarvester",
                    "TurnCandidateHarvester",
                    "UPNPHarvester"
                };
                for(int i = 0; i < harvesterNames.length; ++i)
                {
                    harvestingTime = callPeerMediaHandler.getHarvestingTime(
                            harvesterNames[i]);
                    if(harvestingTime != 0)
                    {
                        stringBuffer.append(getLineString(
                                    resources.getI18NString(
                                        "service.gui.callinfo.HARVESTING_TIME")
                                    + " " + harvesterNames[i],
                                    harvestingTime
                                    + " "
                                    + resources.getI18NString(
                                        "service.gui.callinfo.HARVESTING_MS_FOR"
                                        )
                                    + " "
                                    + callPeerMediaHandler.getNbHarvesting(
                                        harvesterNames[i])
                                    + " "
                                    + resources.getI18NString(
                                        "service.gui.callinfo.HARVESTS")));
                    }
                }
            }
        }
    }
private void constructPeerInfo ( CallPeer callPeer , StringBuffer stringBuffer ) { stringBuffer . append ( getLineString ( callPeer . getAddress ( ) , "" ) ) ; if ( callPeer . getCallDurationStartTime ( ) != CallPeer . CALL_DURATION_START_TIME_UNKNOWN ) { Date startTime = new Date ( callPeer . getCallDurationStartTime ( ) ) ; stringBuffer . append ( getLineString ( resources . getI18NString ( "service.gui.callinfo.CALL_DURATION" ) , GuiUtils . formatTime ( startTime . getTime ( ) , System . currentTimeMillis ( ) ) ) ) ; } if ( callPeer instanceof MediaAwareCallPeer ) { CallPeerMediaHandler < ? > callPeerMediaHandler = ( ( MediaAwareCallPeer < ? , ? , ? > ) callPeer ) . getMediaHandler ( ) ; if ( callPeerMediaHandler != null ) { MediaStream mediaStream = callPeerMediaHandler . getStream ( MediaType . AUDIO ) ; if ( mediaStream != null && mediaStream . isStarted ( ) ) { stringBuffer . append ( "<br/>" ) ; stringBuffer . append ( getLineString ( resources . getI18NString ( "service.gui.callinfo.AUDIO_INFO" ) , "" ) ) ; this . appendStreamEncryptionMethod ( stringBuffer , callPeerMediaHandler , mediaStream , MediaType . AUDIO ) ; constructAudioVideoInfo ( callPeerMediaHandler , mediaStream , stringBuffer , MediaType . AUDIO ) ; } mediaStream = callPeerMediaHandler . getStream ( MediaType . VIDEO ) ; if ( mediaStream != null && mediaStream . isStarted ( ) ) { stringBuffer . append ( "<br/>" ) ; stringBuffer . append ( getLineString ( resources . getI18NString ( "service.gui.callinfo.VIDEO_INFO" ) , "" ) ) ; this . appendStreamEncryptionMethod ( stringBuffer , callPeerMediaHandler , mediaStream , MediaType . VIDEO ) ; constructAudioVideoInfo ( callPeerMediaHandler , mediaStream , stringBuffer , MediaType . VIDEO ) ; } stringBuffer . append ( "<br/>" ) ; String iceState = callPeerMediaHandler . getICEState ( ) ; if ( iceState != null && ! iceState . equals ( "Terminated" ) ) { stringBuffer . append ( getLineString ( resources . getI18NString ( "service.gui.callinfo.ICE_STATE" ) , resources . getI18NString ( "service.gui.callinfo.ICE_STATE." + iceState . toUpperCase ( ) ) ) ) ; } stringBuffer . append ( "<br/>" ) ; long harvestingTime = callPeerMediaHandler . getTotalHarvestingTime ( ) ; if ( harvestingTime != 0 ) { stringBuffer . append ( getLineString ( resources . getI18NString ( "service.gui.callinfo.TOTAL_HARVESTING_TIME" ) , harvestingTime + " " + resources . getI18NString ( "service.gui.callinfo.HARVESTING_MS_FOR" ) + " " + callPeerMediaHandler . getNbHarvesting ( ) + " " + resources . getI18NString ( "service.gui.callinfo.HARVESTS" ) ) ) ; } String [ ] harvesterNames = { "GoogleTurnCandidateHarvester" , "GoogleTurnSSLCandidateHarvester" , "HostCandidateHarvester" , "JingleNodesHarvester" , "StunCandidateHarvester" , "TurnCandidateHarvester" , "UPNPHarvester" } ; for ( int i = 0 ; i < harvesterNames . length ; ++ i ) { harvestingTime = callPeerMediaHandler . getHarvestingTime ( harvesterNames [ i ] ) ; if ( harvestingTime != 0 ) { stringBuffer . append ( getLineString ( resources . getI18NString ( "service.gui.callinfo.HARVESTING_TIME" ) + " " + harvesterNames [ i ] , harvestingTime + " " + resources . getI18NString ( "service.gui.callinfo.HARVESTING_MS_FOR" ) + " " + callPeerMediaHandler . getNbHarvesting ( harvesterNames [ i ] ) + " " + resources . getI18NString ( "service.gui.callinfo.HARVESTS" ) ) ) ; } } } } }
Constructs peer info.
Constructs peer info .
// ICE state // Total harvesting time. // Current harvester time if ICE agent is harvesting.