cusax-fix
Emil Ivov 20 years ago
parent 3ab08b257b
commit 2aa1c430c9

@ -240,7 +240,7 @@ public ContactGroup getGroup(String groupName)
*
* @return an empty iterator
*/
public Iterator subGroups()
public Iterator subgroups()
{
return dummyGroupsList.iterator();
}

@ -32,8 +32,6 @@
* status of our buddies. It also offers methods for retrieving and modifying
* the buddy contact list and adding listeners for changes in its layout.
*
* @todo add consistent logging
*
* @author Emil Ivov
*/
public class OperationSetPersistentPresenceIcqImpl
@ -178,9 +176,6 @@ protected OperationSetPersistentPresenceIcqImpl(
//add a listener that'll follow the provider's state.
icqProvider.addRegistrationStateChangeListener(
registrationStateListener);
/** @todo create local contact here */
}
/**
@ -259,7 +254,7 @@ public void removeSubscriptionListener(SubscriptionListener listener)
public PresenceStatus queryContactStatus(String contactIdentifier)
throws IllegalStateException, IllegalArgumentException
{
verifyConnected();
assertConnected();
//these are commented since we now use identifiers.
// if (!(contact instanceof ContactIcqImpl))
@ -379,7 +374,7 @@ public void subscribe(String contactIdentifier)
IllegalStateException,
OperationFailedException
{
verifyConnected();
assertConnected();
ssContactList.addContact(contactIdentifier);
}
@ -412,7 +407,7 @@ public void subscribe(ContactGroup parent, String contactIdentifier)
IllegalStateException,
OperationFailedException
{
verifyConnected();
assertConnected();
if(! (parent instanceof ContactGroupIcqImpl) )
throw new IllegalArgumentException(
@ -435,7 +430,7 @@ public void subscribe(ContactGroup parent, String contactIdentifier)
public void unsubscribe(Contact contact) throws IllegalArgumentException,
IllegalStateException, OperationFailedException
{
verifyConnected();
assertConnected();
if(! (contact instanceof ContactIcqImpl) )
throw new IllegalArgumentException(
@ -493,7 +488,7 @@ public void publishPresenceStatus(PresenceStatus status,
IllegalArgumentException, IllegalStateException,
OperationFailedException
{
verifyConnected();
assertConnected();
if (!(status instanceof IcqStatusEnum))
throw new IllegalArgumentException(
@ -552,7 +547,7 @@ public Contact getLocalContact()
public void createServerStoredContactGroup(ContactGroup parent,
String groupName)
{
verifyConnected();
assertConnected();
if (!parent.canContainSubgroups())
throw new IllegalArgumentException(
@ -575,7 +570,7 @@ public void createServerStoredContactGroup(ContactGroup parent,
*/
public void removeServerStoredContactGroup(ContactGroup group)
{
verifyConnected();
assertConnected();
if( !(group instanceof ContactGroupIcqImpl) )
throw new IllegalArgumentException(
@ -603,7 +598,7 @@ public void removeServerStoredContactGroup(ContactGroup group)
public void renameServerStoredContactGroup(
ContactGroup group, String newName)
{
verifyConnected();
assertConnected();
if( !(group instanceof ContactGroupIcqImpl) )
throw new IllegalArgumentException(
@ -622,7 +617,7 @@ public void renameServerStoredContactGroup(
public void moveContactToGroup(Contact contactToMove,
ContactGroup newParent)
{
verifyConnected();
assertConnected();
if( !(contactToMove instanceof ContactIcqImpl) )
throw new IllegalArgumentException(
@ -759,7 +754,7 @@ public void handleTimeout(SnacRequestTimeoutEvent event) {
* @throws java.lang.IllegalStateException if the underlying ICQ stack is
* not registered and initialized.
*/
private void verifyConnected() throws IllegalStateException
private void assertConnected() throws IllegalStateException
{
if (icqProvider == null)
throw new IllegalStateException(

@ -141,7 +141,7 @@ public ContactGroup getGroup(int index)
*/
public ContactGroup getGroup(String groupName)
{
Iterator subgroups = subGroups();
Iterator subgroups = subgroups();
while (subgroups.hasNext())
{
ContactGroupIcqImpl grp = (ContactGroupIcqImpl)subgroups.next();
@ -173,7 +173,7 @@ public Contact getContact(String id)
* @return a java.util.Iterator over the <tt>ContactGroup</tt>
* children of this group (i.e. subgroups).
*/
public Iterator subGroups()
public Iterator subgroups()
{
return subGroups.iterator();
}
@ -223,7 +223,7 @@ public String toString()
StringBuffer buff = new StringBuffer(getGroupName());
buff.append(".subGroups="+countSubgroups()+":\n");
Iterator subGroups = subGroups();
Iterator subGroups = subgroups();
while (subGroups.hasNext())
{
ContactGroup group = (ContactGroup) subGroups.next();

@ -28,7 +28,7 @@ public interface ContactGroup
* @return a java.util.Iterator over the <tt>ContactGroup</tt> children
* of this group (i.e. subgroups).
*/
public Iterator subGroups();
public Iterator subgroups();
/**
* Returns the number of subgroups contained by this <tt>ContactGroup</tt>.

@ -1,3 +1,9 @@
/*
* 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.event;
import java.util.*;
@ -11,9 +17,27 @@
public interface MessageListener
extends EventListener
{
public void messageReceived(MessageEvent evt);
/**
* Called when a new incoming <tt>Message</tt> has been received.
* @param evt the <tt>MessageReceivedEvent</tt> containing the newly
* received message, its sender and other details.
*/
public void messageReceived(MessageReceivedEvent evt);
public void messageDelivered(MessageEvent evt);
/**
* Called when the underlying implementation has received an indication
* that a message, sent earlier has been successfully received by the
* destination.
* @param evt the MessageDeliveredEvent containing the id of the message
* that has caused the event.
*/
public void messageDelivered(MessageDeliveredEvent evt);
public void messageDeliveryFailed(MessageEvent evt);
/**
* Called to indicated that delivery of a message sent earlier has failed.
* Reason code and phrase are contained by the <tt>MessageFailedEvent</tt>
* @param evt the <tt>MessageFailedEvent</tt> containing the ID of the
* message whose delivery has failed.
*/
public void messageDeliveryFailed(MessageDeliveryFailedEvent evt);
}

@ -25,18 +25,21 @@ public class ServerStoredGroupEvent
private int eventID = -1;
private ProtocolProviderService sourceProvider = null;
private OperationSetPersistentPresence parentOperationSet = null;
private ContactGroup parentGroup = null;
/**
* Creates a ServerStoredGroupChangeEvent instance.
* @param sourceGroup the group that this event is pertaining to.
* @param eventID an int describing the cause of the event
* @param parentGroup the group that the source group is a child of.
* @param sourceProvider a reference to the protocol provider where this is
* happening
* @param opSet a reference to the operation set responsible for the event
*/
public ServerStoredGroupEvent(ContactGroup sourceGroup,
int eventID,
ContactGroup parentGroup,
ProtocolProviderService sourceProvider,
OperationSetPersistentPresence opSet)
{
@ -45,6 +48,7 @@ public ServerStoredGroupEvent(ContactGroup sourceGroup,
this.eventID = eventID;
this.sourceProvider = sourceProvider;
this.parentOperationSet = opSet;
this.parentGroup = parentGroup;
}
/**
@ -87,6 +91,16 @@ public OperationSetPersistentPresence getSourceOperationSet()
return this.parentOperationSet;
}
/**
* Returns the group containing the event source group
* @return a reference to the <tt>ContactGroup</tt> instance that is parent
* of the <tt>ContactGroup</tt> which is the source of this event.
*/
public ContactGroup getParentGroup()
{
return parentGroup;
}
/**
* Returns a String representation of this event.
* @return a String containing details describin this event.

@ -128,7 +128,7 @@ public void testRetrievingServerStoredContactList()
//Go through the contact list retrieved by the persistence presence set
//and remove the name of every contact and group that we find there from
//the expected contct list hashtable.
Iterator groups = rootGroup.subGroups();
Iterator groups = rootGroup.subgroups();
while (groups.hasNext() ){
ContactGroup group = (ContactGroup)groups.next();

@ -206,6 +206,7 @@ public void endTest(Test test) {
// even tests with the same name - disambiguate them.
currentTest.setAttribute(ATTR_CLASSNAME,
test.getClass().getName());
rootElement.appendChild(currentTest);
testElements.put(test, currentTest);
} else {

Loading…
Cancel
Save