src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
/**
     * Creates the specified group on the server stored contact list.
     * @param groupName a String containing the name of the new group.
     * @throws OperationFailedException with code CONTACT_GROUP_ALREADY_EXISTS
     * if the group we're trying to create is already in our contact list.
     */
Creates the specified group on the server stored contact list.
@param groupName a String containing the name of the new group.
@throws OperationFailedException with code CONTACT_GROUP_ALREADY_EXISTS
if the group we're trying to create is already in our contact list.
Creates the specified group on the server stored contact list . @param groupName a String containing the name of the new group . @throws OperationFailedException with code CONTACT_GROUP_ALREADY_EXISTS if the group we ' re trying to create is already in our contact list .
public void createGroup(String groupName)
        throws OperationFailedException
    {
        if (logger.isTraceEnabled())
            logger.trace("Creating group: " + groupName);
        ContactGroupJabberImpl existingGroup = findContactGroup(groupName);
        if( existingGroup != null && existingGroup.isPersistent() )
        {
            if (logger.isDebugEnabled())
                logger.debug("ContactGroup " + groupName + " already exists.");
            throw new OperationFailedException(
                           "ContactGroup " + groupName + " already exists.",
                OperationFailedException.CONTACT_GROUP_ALREADY_EXISTS);
        }
        RosterGroup newRosterGroup = roster.createGroup(groupName);
        ContactGroupJabberImpl newGroup =
            new ContactGroupJabberImpl(newRosterGroup,
                                       new ArrayList<RosterEntry>().iterator(),
                                       this,
                                       true);
        rootGroup.addSubGroup(newGroup);
        fireGroupEvent(newGroup, ServerStoredGroupEvent.GROUP_CREATED_EVENT);
        if (logger.isTraceEnabled())
            logger.trace("Group " +groupName+ " created.");
    }
public void createGroup ( String groupName ) throws OperationFailedException { if ( logger . isTraceEnabled ( ) ) logger . trace ( "Creating group: " + groupName ) ; ContactGroupJabberImpl existingGroup = findContactGroup ( groupName ) ; if ( existingGroup != null && existingGroup . isPersistent ( ) ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "ContactGroup " + groupName + " already exists." ) ; throw new OperationFailedException ( "ContactGroup " + groupName + " already exists." , OperationFailedException . CONTACT_GROUP_ALREADY_EXISTS ) ; } RosterGroup newRosterGroup = roster . createGroup ( groupName ) ; ContactGroupJabberImpl newGroup = new ContactGroupJabberImpl ( newRosterGroup , new ArrayList < RosterEntry > ( ) . iterator ( ) , this , true ) ; rootGroup . addSubGroup ( newGroup ) ; fireGroupEvent ( newGroup , ServerStoredGroupEvent . GROUP_CREATED_EVENT ) ; if ( logger . isTraceEnabled ( ) ) logger . trace ( "Group " + groupName + " created." ) ; }
Creates the specified group on the server stored contact list.
Creates the specified group on the server stored contact list .