mirror of https://github.com/sipwise/jitsi.git
Added multichat operation set definition and Gibberish protocol implementation. Related issues: Issue #241 , Issue #244, Issue #250
Added to repository.cusax-fix
parent
1126c99a5f
commit
47cd18281c
@ -0,0 +1,308 @@
|
||||
/*
|
||||
* 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.plugin.gibberishaccregwizz;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.*;
|
||||
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* The <tt>FirstWizardPage</tt> is the page, where user could enter the user ID
|
||||
* and the password of the account.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class FirstWizardPage
|
||||
extends JPanel implements WizardPage, DocumentListener
|
||||
{
|
||||
|
||||
public static final String FIRST_PAGE_IDENTIFIER = "FirstPageIdentifier";
|
||||
|
||||
private JPanel userPassPanel = new JPanel(new BorderLayout(10, 10));
|
||||
|
||||
private JPanel labelsPanel = new JPanel();
|
||||
|
||||
private JPanel valuesPanel = new JPanel();
|
||||
|
||||
private JLabel userID = new JLabel(Resources.getString("userID"));
|
||||
|
||||
private JLabel passLabel = new JLabel(Resources.getString("password"));
|
||||
|
||||
private JLabel existingAccountLabel
|
||||
= new JLabel(Resources.getString("existingAccount"));
|
||||
|
||||
private JPanel emptyPanel = new JPanel();
|
||||
|
||||
private JLabel userIDExampleLabel = new JLabel("Ex: random.user.name");
|
||||
|
||||
private JTextField userIDField = new JTextField();
|
||||
|
||||
private JPasswordField passField = new JPasswordField();
|
||||
|
||||
private JCheckBox rememberPassBox = new JCheckBox(
|
||||
Resources.getString("rememberPassword"));
|
||||
|
||||
private JPanel mainPanel = new JPanel();
|
||||
|
||||
private Object nextPageIdentifier = WizardPage.SUMMARY_PAGE_IDENTIFIER;
|
||||
|
||||
private GibberishAccountRegistration registration = null;
|
||||
|
||||
private WizardContainer wizardContainer;
|
||||
|
||||
/**
|
||||
* Creates an instance of <tt>FirstWizardPage</tt>.
|
||||
* @param registration the <tt>GibberishAccountRegistration</tt>, where
|
||||
* all data through the wizard are stored
|
||||
* @param wizardContainer the wizardContainer, where this page will
|
||||
* be added
|
||||
*/
|
||||
public FirstWizardPage(GibberishAccountRegistration registration,
|
||||
WizardContainer wizardContainer)
|
||||
{
|
||||
|
||||
super(new BorderLayout());
|
||||
|
||||
this.wizardContainer = wizardContainer;
|
||||
|
||||
this.registration = registration;
|
||||
|
||||
this.setPreferredSize(new Dimension(300, 150));
|
||||
|
||||
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
|
||||
|
||||
this.init();
|
||||
|
||||
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
||||
|
||||
this.labelsPanel.setLayout(new BoxLayout(labelsPanel, BoxLayout.Y_AXIS));
|
||||
|
||||
this.valuesPanel.setLayout(new BoxLayout(valuesPanel, BoxLayout.Y_AXIS));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes all panels, buttons, etc.
|
||||
*/
|
||||
private void init()
|
||||
{
|
||||
this.userIDField.getDocument().addDocumentListener(this);
|
||||
this.rememberPassBox.setSelected(true);
|
||||
|
||||
this.existingAccountLabel.setForeground(Color.RED);
|
||||
|
||||
this.userIDExampleLabel.setForeground(Color.GRAY);
|
||||
this.userIDExampleLabel.setFont(
|
||||
userIDExampleLabel.getFont().deriveFont(8));
|
||||
this.emptyPanel.setMaximumSize(new Dimension(40, 35));
|
||||
this.userIDExampleLabel.setBorder(
|
||||
BorderFactory.createEmptyBorder(0, 0, 8,0));
|
||||
|
||||
labelsPanel.add(userID);
|
||||
labelsPanel.add(emptyPanel);
|
||||
labelsPanel.add(passLabel);
|
||||
|
||||
valuesPanel.add(userIDField);
|
||||
valuesPanel.add(userIDExampleLabel);
|
||||
valuesPanel.add(passField);
|
||||
|
||||
userPassPanel.add(labelsPanel, BorderLayout.WEST);
|
||||
userPassPanel.add(valuesPanel, BorderLayout.CENTER);
|
||||
userPassPanel.add(rememberPassBox, BorderLayout.SOUTH);
|
||||
|
||||
userPassPanel.setBorder(BorderFactory
|
||||
.createTitledBorder(Resources.getString(
|
||||
"userAndPassword")));
|
||||
|
||||
this.add(userPassPanel, BorderLayout.NORTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>WizardPage.getIdentifier</code> to return
|
||||
* this page identifier.
|
||||
*
|
||||
* @return the Identifier of the first page in this wizard.
|
||||
*/
|
||||
public Object getIdentifier()
|
||||
{
|
||||
return FIRST_PAGE_IDENTIFIER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>WizardPage.getNextPageIdentifier</code> to return
|
||||
* the next page identifier - the summary page.
|
||||
*
|
||||
* @return the identifier of the page following this one.
|
||||
*/
|
||||
public Object getNextPageIdentifier()
|
||||
{
|
||||
return nextPageIdentifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>WizardPage.getBackPageIdentifier</code> to return
|
||||
* the next back identifier - the default page.
|
||||
*
|
||||
* @return the identifier of the default wizard page.
|
||||
*/
|
||||
public Object getBackPageIdentifier()
|
||||
{
|
||||
return WizardPage.DEFAULT_PAGE_IDENTIFIER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>WizardPage.getWizardForm</code> to return
|
||||
* this panel.
|
||||
*
|
||||
* @return the component to be displayed in this wizard page.
|
||||
*/
|
||||
public Object getWizardForm()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Before this page is displayed enables or disables the "Next" wizard
|
||||
* button according to whether the UserID field is empty.
|
||||
*/
|
||||
public void pageShowing()
|
||||
{
|
||||
this.setNextButtonAccordingToUserID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the user input when the "Next" wizard buttons is clicked.
|
||||
*/
|
||||
public void pageNext()
|
||||
{
|
||||
String userID = userIDField.getText();
|
||||
|
||||
if (isExistingAccount(userID))
|
||||
{
|
||||
nextPageIdentifier = FIRST_PAGE_IDENTIFIER;
|
||||
userPassPanel.add(existingAccountLabel, BorderLayout.NORTH);
|
||||
this.revalidate();
|
||||
}
|
||||
else
|
||||
{
|
||||
nextPageIdentifier = SUMMARY_PAGE_IDENTIFIER;
|
||||
userPassPanel.remove(existingAccountLabel);
|
||||
|
||||
registration.setUserID(userIDField.getText());
|
||||
registration.setPassword(new String(passField.getPassword()));
|
||||
registration.setRememberPassword(rememberPassBox.isSelected());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables or disables the "Next" wizard button according to whether the
|
||||
* User ID field is empty.
|
||||
*/
|
||||
private void setNextButtonAccordingToUserID()
|
||||
{
|
||||
if (userIDField.getText() == null || userIDField.getText().equals(""))
|
||||
{
|
||||
wizardContainer.setNextFinishButtonEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
wizardContainer.setNextFinishButtonEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the <tt>DocumentEvent</tt> triggered when user types in the
|
||||
* User ID field. Enables or disables the "Next" wizard button according to
|
||||
* whether the User ID field is empty.
|
||||
*
|
||||
* @param event the event containing the update.
|
||||
*/
|
||||
public void insertUpdate(DocumentEvent event)
|
||||
{
|
||||
this.setNextButtonAccordingToUserID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the <tt>DocumentEvent</tt> triggered when user deletes letters
|
||||
* from the UserID field. Enables or disables the "Next" wizard button
|
||||
* according to whether the UserID field is empty.
|
||||
*
|
||||
* @param event the event containing the update.
|
||||
*/
|
||||
public void removeUpdate(DocumentEvent event)
|
||||
{
|
||||
this.setNextButtonAccordingToUserID();
|
||||
}
|
||||
|
||||
public void changedUpdate(DocumentEvent event)
|
||||
{
|
||||
}
|
||||
|
||||
public void pageHiding()
|
||||
{
|
||||
}
|
||||
|
||||
public void pageShown()
|
||||
{
|
||||
}
|
||||
|
||||
public void pageBack()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills the UserID and Password fields in this panel with the data comming
|
||||
* from the given protocolProvider.
|
||||
* @param protocolProvider The <tt>ProtocolProviderService</tt> to load the
|
||||
* data from.
|
||||
*/
|
||||
public void loadAccount(ProtocolProviderService protocolProvider)
|
||||
{
|
||||
AccountID accountID = protocolProvider.getAccountID();
|
||||
String password = (String) accountID.getAccountProperties()
|
||||
.get(ProtocolProviderFactory.PASSWORD);
|
||||
|
||||
this.userIDField.setText(accountID.getUserID());
|
||||
|
||||
if (password != null)
|
||||
{
|
||||
this.passField.setText(password);
|
||||
this.rememberPassBox.setSelected(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies whether there is already an account installed with the same
|
||||
* details as the one that the user has just entered.
|
||||
*
|
||||
* @param userID the name of the user that the account is registered for
|
||||
* @return true if there is already an account for this userID and false
|
||||
* otherwise.
|
||||
*/
|
||||
private boolean isExistingAccount(String userID)
|
||||
{
|
||||
ProtocolProviderFactory factory
|
||||
= GibberishAccRegWizzActivator.getGibberishProtocolProviderFactory();
|
||||
|
||||
ArrayList registeredAccounts = factory.getRegisteredAccounts();
|
||||
|
||||
for (int i = 0; i < registeredAccounts.size(); i++)
|
||||
{
|
||||
AccountID accountID = (AccountID) registeredAccounts.get(i);
|
||||
|
||||
if (userID.equalsIgnoreCase(accountID.getUserID()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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.plugin.gibberishaccregwizz;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import net.java.sip.communicator.service.configuration.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
|
||||
/**
|
||||
* Registers the <tt>GibberishAccountRegistrationWizard</tt> in the UI Service.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class GibberishAccRegWizzActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
private static Logger logger = Logger.getLogger(
|
||||
GibberishAccRegWizzActivator.class.getName());
|
||||
|
||||
/**
|
||||
* A currently valid bundle context.
|
||||
*/
|
||||
public static BundleContext bundleContext;
|
||||
|
||||
/**
|
||||
* A currently valid reference to the configuration service.
|
||||
*/
|
||||
private static ConfigurationService configService;
|
||||
|
||||
/**
|
||||
* Starts this bundle.
|
||||
* @param bc the currently valid <tt>BundleContext</tt>.
|
||||
*/
|
||||
public void start(BundleContext bc)
|
||||
{
|
||||
logger.info("Loading gibberish account wizard.");
|
||||
|
||||
bundleContext = bc;
|
||||
|
||||
ServiceReference uiServiceRef = bundleContext
|
||||
.getServiceReference(UIService.class.getName());
|
||||
|
||||
UIService uiService
|
||||
= (UIService) bundleContext.getService(uiServiceRef);
|
||||
|
||||
AccountRegistrationWizardContainer wizardContainer
|
||||
= uiService.getAccountRegWizardContainer();
|
||||
|
||||
GibberishAccountRegistrationWizard gibberishWizard
|
||||
= new GibberishAccountRegistrationWizard(wizardContainer);
|
||||
|
||||
wizardContainer.addAccountRegistrationWizard(gibberishWizard);
|
||||
|
||||
logger.info("Gibberish account registration wizard [STARTED].");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this bundle is stopped so the Framework can perform the
|
||||
* bundle-specific activities necessary to stop the bundle.
|
||||
*
|
||||
* @param context The execution context of the bundle being stopped.
|
||||
*/
|
||||
public void stop(BundleContext context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>ProtocolProviderFactory</tt> for the Gibberish protocol.
|
||||
* @return the <tt>ProtocolProviderFactory</tt> for the Gibberish protocol
|
||||
*/
|
||||
public static ProtocolProviderFactory getGibberishProtocolProviderFactory()
|
||||
{
|
||||
|
||||
ServiceReference[] serRefs = null;
|
||||
|
||||
String osgiFilter = "("
|
||||
+ ProtocolProviderFactory.PROTOCOL
|
||||
+ "=" + "Gibberish" + ")";
|
||||
|
||||
try
|
||||
{
|
||||
serRefs = bundleContext.getServiceReferences(
|
||||
ProtocolProviderFactory.class.getName(), osgiFilter);
|
||||
}
|
||||
catch (InvalidSyntaxException ex)
|
||||
{
|
||||
logger.error(ex);
|
||||
}
|
||||
|
||||
return (ProtocolProviderFactory) bundleContext.getService(serRefs[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bundleContext that we received when we were started.
|
||||
*
|
||||
* @return a currently valid instance of a bundleContext.
|
||||
*/
|
||||
public BundleContext getBundleContext()
|
||||
{
|
||||
return bundleContext;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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.plugin.gibberishaccregwizz;
|
||||
|
||||
/**
|
||||
* The <tt>GibberishAccountRegistration</tt> is used to store all user input data
|
||||
* through the <tt>GibberishAccountRegistrationWizard</tt>.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class GibberishAccountRegistration
|
||||
{
|
||||
private String userID;
|
||||
private String password;
|
||||
private boolean rememberPassword;
|
||||
|
||||
/**
|
||||
* Returns the User ID of the gibberish registration account.
|
||||
* @return the User ID of the gibberish registration account.
|
||||
*/
|
||||
public String getUserID()
|
||||
{
|
||||
return userID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user ID of the gibberish registration account.
|
||||
* @param userID the userID of the gibberish registration account.
|
||||
*/
|
||||
public void setUserID(String userID)
|
||||
{
|
||||
this.userID = userID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the password of the Gibberish registration account.
|
||||
*
|
||||
* @return the password of the Gibberish registration account.
|
||||
*/
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password of the Gibberish registration account.
|
||||
*
|
||||
* @param password the password of the Gibberish registration account.
|
||||
*/
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if password has to remembered, <tt>false</tt>
|
||||
* otherwise.
|
||||
*
|
||||
* @return <tt>true</tt> if password has to remembered, <tt>false</tt>
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean isRememberPassword()
|
||||
{
|
||||
return rememberPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rememberPassword value of this Gibberish account registration.
|
||||
*
|
||||
* @param rememberPassword <tt>true</tt> if password has to remembered,
|
||||
* <tt>false</tt> otherwise.
|
||||
*/
|
||||
public void setRememberPassword(boolean rememberPassword)
|
||||
{
|
||||
this.rememberPassword = rememberPassword;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,189 @@
|
||||
/*
|
||||
* 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.plugin.gibberishaccregwizz;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import net.java.sip.communicator.impl.gui.customcontrols.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* The <tt>GibberishAccountRegistrationWizard</tt> is an implementation of the
|
||||
* <tt>AccountRegistrationWizard</tt> for the Gibberish protocol. It allows
|
||||
* the user to create and configure a new Gibberish account.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class GibberishAccountRegistrationWizard
|
||||
implements AccountRegistrationWizard
|
||||
{
|
||||
|
||||
/**
|
||||
* The first page of the gibberish account registration wizard.
|
||||
*/
|
||||
private FirstWizardPage firstWizardPage;
|
||||
|
||||
/**
|
||||
* The object that we use to store details on an account that we will be
|
||||
* creating.
|
||||
*/
|
||||
private GibberishAccountRegistration registration
|
||||
= new GibberishAccountRegistration();
|
||||
|
||||
private WizardContainer wizardContainer;
|
||||
|
||||
private ProtocolProviderService protocolProvider;
|
||||
|
||||
private String propertiesPackage
|
||||
= "net.java.sip.communicator.plugin.gibberishaccregwizz";
|
||||
|
||||
private boolean isModification;
|
||||
|
||||
/**
|
||||
* Creates an instance of <tt>GibberishAccountRegistrationWizard</tt>.
|
||||
* @param wizardContainer the wizard container, where this wizard
|
||||
* is added
|
||||
*/
|
||||
public GibberishAccountRegistrationWizard(WizardContainer wizardContainer)
|
||||
{
|
||||
this.wizardContainer = wizardContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>AccountRegistrationWizard.getIcon</code> method.
|
||||
* Returns the icon to be used for this wizard.
|
||||
* @return byte[]
|
||||
*/
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return Resources.getImage(Resources.GIBBERISH_LOGO);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>AccountRegistrationWizard.getProtocolName</code>
|
||||
* method. Returns the protocol name for this wizard.
|
||||
* @return String
|
||||
*/
|
||||
public String getProtocolName()
|
||||
{
|
||||
return Resources.getString("protocolName");
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <code>AccountRegistrationWizard.getProtocolDescription
|
||||
* </code> method. Returns the description of the protocol for this wizard.
|
||||
* @return String
|
||||
*/
|
||||
public String getProtocolDescription()
|
||||
{
|
||||
return Resources.getString("protocolDescription");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of pages contained in this wizard.
|
||||
* @return Iterator
|
||||
*/
|
||||
public Iterator getPages()
|
||||
{
|
||||
ArrayList pages = new ArrayList();
|
||||
firstWizardPage = new FirstWizardPage(registration, wizardContainer);
|
||||
|
||||
pages.add(firstWizardPage);
|
||||
|
||||
return pages.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of data that user has entered through this wizard.
|
||||
* @return Iterator
|
||||
*/
|
||||
public Iterator getSummary()
|
||||
{
|
||||
Hashtable summaryTable = new Hashtable();
|
||||
|
||||
summaryTable.put("User ID", registration.getUserID());
|
||||
|
||||
return summaryTable.entrySet().iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs the account created through this wizard.
|
||||
* @return ProtocolProviderService
|
||||
*/
|
||||
public ProtocolProviderService finish()
|
||||
{
|
||||
firstWizardPage = null;
|
||||
ProtocolProviderFactory factory
|
||||
= GibberishAccRegWizzActivator.getGibberishProtocolProviderFactory();
|
||||
|
||||
return this.installAccount(factory,
|
||||
registration.getUserID());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an account for the given user and password.
|
||||
* @param providerFactory the ProtocolProviderFactory which will create
|
||||
* the account
|
||||
* @param user the user identifier
|
||||
* @param passwd the password
|
||||
* @return the <tt>ProtocolProviderService</tt> for the new account.
|
||||
*/
|
||||
public ProtocolProviderService installAccount(
|
||||
ProtocolProviderFactory providerFactory,
|
||||
String user)
|
||||
{
|
||||
|
||||
Hashtable accountProperties = new Hashtable();
|
||||
|
||||
if (registration.isRememberPassword())
|
||||
{
|
||||
accountProperties.put(ProtocolProviderFactory.PASSWORD
|
||||
, registration.getPassword());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
AccountID accountID = providerFactory.installAccount(
|
||||
user, accountProperties);
|
||||
|
||||
ServiceReference serRef = providerFactory
|
||||
.getProviderForAccount(accountID);
|
||||
|
||||
protocolProvider = (ProtocolProviderService)
|
||||
GibberishAccRegWizzActivator.bundleContext
|
||||
.getService(serRef);
|
||||
}
|
||||
catch (IllegalArgumentException exc)
|
||||
{
|
||||
new ErrorDialog(null, exc.getMessage(), exc).showDialog();
|
||||
}
|
||||
catch (IllegalStateException exc)
|
||||
{
|
||||
new ErrorDialog(null, exc.getMessage(), exc).showDialog();
|
||||
}
|
||||
|
||||
return protocolProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills the UserID and Password fields in this panel with the data comming
|
||||
* from the given protocolProvider.
|
||||
* @param protocolProvider The <tt>ProtocolProviderService</tt> to load the
|
||||
* data from.
|
||||
*/
|
||||
public void loadAccount(ProtocolProviderService protocolProvider)
|
||||
{
|
||||
|
||||
this.protocolProvider = protocolProvider;
|
||||
|
||||
this.firstWizardPage.loadAccount(protocolProvider);
|
||||
|
||||
isModification = true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* 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.service.protocol;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.protocol.event.*;
|
||||
|
||||
/**
|
||||
* Allows creating, configuring, joining and administrating of individual
|
||||
* text-based conference rooms.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface OperationSetMultiUserChat
|
||||
{
|
||||
/**
|
||||
* Returns the <tt>List</tt> of <tt>ChatRoom</tt>s currently available on
|
||||
* the server that this protocol provider is connected to.
|
||||
*
|
||||
* @return a <tt>java.util.List</tt> of <tt>ChatRoom</tt>s that are
|
||||
* currently available on the server that this protocol provider is
|
||||
* connected to.
|
||||
*
|
||||
* @throws OperationFailedException if we faile retrieving this list from
|
||||
* the server.
|
||||
*/
|
||||
public List getExistingChatRooms()
|
||||
throws OperationFailedException;
|
||||
|
||||
/**
|
||||
* Returns a list of the chat rooms that we have joined and are currently
|
||||
* active in.
|
||||
*
|
||||
* @return a <tt>List</tt> of the rooms where the user has joined using a
|
||||
* given connection.
|
||||
*/
|
||||
public List getCurrentlyJoinedChatRooms();
|
||||
|
||||
/**
|
||||
* Returns a list of the chat rooms that <tt>contact</tt> has joined and is
|
||||
* currently active in.
|
||||
*
|
||||
* @param contact the contact whose current ChatRooms we will be querying.
|
||||
* @return a list of the chat rooms that <tt>contact</tt> has joined and is
|
||||
* currently active in.
|
||||
*/
|
||||
public List getCurrentlyJoinedChatRooms(Contact contact);
|
||||
|
||||
/**
|
||||
* Creates a room with the named <tt>roomName</tt> and according to the
|
||||
* specified <tt>roomProperties</tt> on the server that this protocol
|
||||
* provider is currently connected to. When the method returns the room the
|
||||
* local user will not have joined it and thus will not receive messages on
|
||||
* it until the <tt>ChatRoom.join()</tt> method is called.
|
||||
* <p>
|
||||
* @param roomName the name of the <tt>ChatRoom</tt> to create.
|
||||
* @param roomProperties properties specifying how the room should be
|
||||
* created.
|
||||
* @throws OperationFailedException if the room couldn't be created for some
|
||||
* reason (e.g. room already exists; user already joined to an existant
|
||||
* room or user has no permissions to create a chat room).
|
||||
*/
|
||||
public ChatRoom createChatRoom(String roomName, Hashtable roomProperties)
|
||||
throws OperationFailedException;
|
||||
|
||||
/**
|
||||
* Returns a reference to a chatRoom named <tt>roomName</tt> or null if
|
||||
* no such room exists.
|
||||
* <p>
|
||||
* @param roomName the name of the <tt>ChatRoom</tt> that we're looking for.
|
||||
* @return the <tt>ChatRoom</tt> named <tt>roomName</tt> or null if no such
|
||||
* room exists on the server that this provider is currently connected to.
|
||||
*/
|
||||
public ChatRoom findRoom(String roomName);
|
||||
|
||||
/**
|
||||
* Informs the sender of an invitation that we decline their invitation.
|
||||
*
|
||||
* @param conn the connection to use for sending the rejection.
|
||||
* @param room the room that sent the original invitation.
|
||||
* @param inviter the inviter of the declined invitation.
|
||||
* @param reason the reason why the invitee is declining the invitation.
|
||||
*/
|
||||
public void rejectInvitation(ChatRoomInvitation invitation);
|
||||
|
||||
/**
|
||||
* Adds a listener to invitation notifications. The listener will be fired
|
||||
* anytime an invitation is received.
|
||||
*
|
||||
* @param listener an invitation listener.
|
||||
*/
|
||||
public void addInvitationListener(InvitationListener listener);
|
||||
|
||||
/**
|
||||
* Removes <tt>listener</tt> from the list of invitation listeners
|
||||
* registered to receive invitation events.
|
||||
*
|
||||
* @param listener the invitation listener to remove.
|
||||
*/
|
||||
public void removeInvitationListener(InvitationListener listener);
|
||||
|
||||
/**
|
||||
* Adds a listener to invitation notifications. The listener will be fired
|
||||
* anytime an invitation is received.
|
||||
*
|
||||
* @param listener an invitation listener.
|
||||
*/
|
||||
public void addInvitationRejectionListener(
|
||||
InvitationRejectionListener listener);
|
||||
|
||||
/**
|
||||
* Removes <tt>listener</tt> from the list of invitation listeners
|
||||
* registered to receive invitation rejection events.
|
||||
*
|
||||
* @param listener the invitation listener to remove.
|
||||
*/
|
||||
public void removeInvitationRejectionListener(
|
||||
InvitationRejectionListener listener);
|
||||
|
||||
/**
|
||||
* Returns true if <tt>contact</tt> 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 <tt>contact</tt> supports chatrooms.
|
||||
*/
|
||||
public boolean isMultiChatSupportedByContact(Contact contact);
|
||||
}
|
||||
Loading…
Reference in new issue