private void migrateMemberships ( ) throws Exception { Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( usersStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( usersStorageOld ) ) . getNodesLazily ( ) ; MembershipHandlerImpl mh = ( ( MembershipHandlerImpl ) service . getMembershipHandler ( ) ) ; while ( iterator . hasNext ( ) ) { Node oldUserNode = iterator . nextNode ( ) ; mh . migrateMemberships ( oldUserNode ) ; oldUserNode . remove ( ) ; session . save ( ) ; } } } finally { session . logout ( ) ; } }
Method for memberships migration .