Package de.fu_berlin.inf.dpp.net

Examples of de.fu_berlin.inf.dpp.net.JID


        @Override
        public JingleMediaSession createMediaSession(PayloadType payload,
            TransportCandidate remoteCandidate,
            TransportCandidate localCandidate, JingleSession jingleSession) {

            final JID remoteJID = isInitiator(jingleSession) ? new JID(
                jingleSession.getResponder()) : new JID(
                jingleSession.getInitiator());

            final JingleFileTransferSession newSession = new JingleFileTransferSession(
                payload, remoteCandidate, localCandidate, null, jingleSession);

            if (newSession.isConnected()) {
                log.debug("Jingle [" + remoteJID.getName()
                    + "] Media Session - Success using "
                    + NetTransferMode.JINGLETCP);
                if (!isInitiator(jingleSession)) {

                    try {
                        final BinaryChannel channel = new BinaryChannel(
                            newSession, getDefaultNetTransferMode());
                        listener.connectionChanged(remoteJID,
                            new BinaryChannelConnection(remoteJID, channel,
                                listener), true);
                    } catch (IOException e) {
                        log.error(
                            "could not connect to " + remoteJID.getName(), e);
                        // throw new CausedIOException("Could not connect to "
                        // + remoteJID.getName(), e);
                    }

                } else {
                    sessions.put(remoteJID.toString(), newSession);
                }
            } else {
                log.debug("Jingle [" + remoteJID.getName()
                    + "] Media Session - Failure");
            }
            return newSession;
        }
View Full Code Here


            }
        });
    }

    protected void updatePageCompletion() {
        JID ownJid = saros.getSarosNet().getMyJID();
        JID foreignJid = this.getBuddy();

        if (foreignJid.isValid() && !foreignJid.equals(ownJid)) {
            /*
             * Page is complete
             */

            wasJIDValid = true;

            Roster roster = saros.getSarosNet().getRoster();
            if (roster != null && roster.contains(foreignJid.getBase())) {
                setMessage(Messages.roster_alreadyadded_errorMessage
                    + "\n" + Messages.wizard_finish_noeffect, //$NON-NLS-1$
                    IMessageProvider.INFORMATION);
                isBuddyAlreadyAdded = true;
            } else {
                this.setMessage(DESCRIPTION);
                isBuddyAlreadyAdded = false;
            }

            this.setErrorMessage(null);
            setPageComplete(true);
        } else {
            /*
             * Page is incomplete
             */

            if (foreignJid.equals(ownJid)) {
                this.setErrorMessage(Messages.roster_addself_errorMessage);
            } else if (wasJIDValid) {
                this.setErrorMessage(Messages.jid_format_errorMessage);
            }
            this.setPageComplete(false);
View Full Code Here

        this.jidCombo.setFocus();
    }

    public JID getBuddy() {
        return new JID(getText());
    }
View Full Code Here

        EnterXMPPAccountWizardPage enterXMPPAccountWizardPage = enterXMPPAccountWizardPages
            .get(0);
        ConfigurationSettingsWizardPage configurationSettingsWizardPage = configurationSettingsWizardPages
            .get(0);

        JID jid = enterXMPPAccountWizardPage.getJID();
        boolean autoConnect = configurationSettingsWizardPage.isAutoConnect();
        boolean uPnPEnabled = configurationSettingsWizardPage
            .getPortmappingDevice() != null;
        String skypeUsername = configurationSettingsWizardPage.isSkypeUsage() ? configurationSettingsWizardPage
            .getSkypeUsername() : ""; //$NON-NLS-1$
        boolean statisticSubmissionAllowed = configurationSettingsWizardPage
            .isStatisticSubmissionAllowed();
        boolean errorLogSubmissionAllowed = configurationSettingsWizardPage
            .isErrorLogSubmissionAllowed();

        if (this.jid != null) {
            this.jid.setContent(new IllustratedText(ImageManager.ELCL_SPACER,
                jid.getBase()));
        }

        if (this.autoConnection != null) {
            if (autoConnect) {
                this.autoConnection.setContent(new IllustratedText(
View Full Code Here

            }

            public void presenceChanged(Presence presence) {

                if (!presence.isAvailable())
                    if (closeConnection(new JID(presence.getFrom())))
                        log.debug(presence.getFrom()
                            + " is not available anymore. Bytestream connection closed.");
            }

            public void rosterChanged(Roster roster) {
View Full Code Here

        // Think about how to synchronize this, that multiple people can connect
        // at the same time.
        log.trace("sending data ... from " + sarosNet.getMyJID() + " to "
            + transferData.getRecipient());

        JID recipient = transferData.recipient;

        IBytestreamConnection connection = getConnection(recipient,
            progress.newChild(1));

        synchronized (outgoingTransfers) {
View Full Code Here

    protected void removeIncomingFileTransfer(
        TransferDescription transferDescription) {

        synchronized (incomingTransfers) {

            JID from = transferDescription.sender;

            List<TransferDescription> transfers = getIncomingTransfers(from);
            if (!transfers.remove(transferDescription)) {
                log.warn("Removing incoming transfer description that was never added!:"
                    + transferDescription);
View Full Code Here

    protected void addIncomingFileTransfer(
        TransferDescription transferDescription) {

        synchronized (incomingTransfers) {
            JID from = transferDescription.sender;
            List<TransferDescription> transfers = getIncomingTransfers(from);
            transfers.add(transferDescription);
        }
    }
View Full Code Here

        if (rosterEntry == null) {
            log.error("RosterEntry should not be null at this point!"); //$NON-NLS-1$
            return;
        }

        final JID recipient = new JID(rosterEntry.getUser());

        final TestResult[] testResult = new TestResult[1];
        try {
            new ProgressMonitorDialog(null).run(true, true,
                new IRunnableWithProgress() {
View Full Code Here

     */
    public List<JID> getSelectedBuddies() {
        List<JID> buddies = new ArrayList<JID>();
        for (Object element : ((CheckboxTreeViewer) this.viewer)
            .getCheckedElements()) {
            JID buddy = (JID) ((ITreeElement) element).getAdapter(JID.class);
            if (buddy != null)
                buddies.add(buddy);
        }
        return buddies;
    }
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.net.JID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.