public void setName ( String name ) throws NotConnectedException , NoResponseException , XMPPErrorException , InterruptedException { synchronized ( entries ) { for ( RosterEntry entry : entries ) { RosterPacket packet = new RosterPacket ( ) ; packet . setType ( IQ . Type . set ) ; RosterPacket . Item item = RosterEntry . toRosterItem ( entry ) ; item . removeGroupName ( this . name ) ; item . addGroupName ( name ) ; packet . addRosterItem ( item ) ; connection ( ) . createStanzaCollectorAndSend ( packet ) . nextResultOrThrow ( ) ; } } }
Sets the name of the group . Changing the group s name is like moving all the group entries of the group to a new group specified by the new name . Since this group won t have entries it will be removed from the roster . This means that all the references to this object will be invalid and will need to be updated to the new group specified by the new name .