private void removeFromReplicaLayer ( final Node followedReplica ) { final Node prev = NeoUtils . getPrevSingleNode ( followedReplica , SocialGraphRelationshipType . GRAPHITY ) ; final Node next = NeoUtils . getNextSingleNode ( followedReplica , SocialGraphRelationshipType . GRAPHITY ) ; // bridge the user replica in the replica layer prev . getSingleRelationship ( SocialGraphRelationshipType . GRAPHITY , Direction . OUTGOING ) . delete ( ) ; if ( next != null ) { next . getSingleRelationship ( SocialGraphRelationshipType . GRAPHITY , Direction . INCOMING ) . delete ( ) ; prev . createRelationshipTo ( next , SocialGraphRelationshipType . GRAPHITY ) ; } // remove the followship followedReplica . getSingleRelationship ( SocialGraphRelationshipType . FOLLOW , Direction . INCOMING ) . delete ( ) ; // remove the replica node itself followedReplica . getSingleRelationship ( SocialGraphRelationshipType . REPLICA , Direction . OUTGOING ) . delete ( ) ; followedReplica . delete ( ) ; }
remove a followed user from the replica layer