if (rosterManager == null) {
return handleCannotRetrieveRoster(stanza, sessionContext);
}
Entity user = extractUniqueSenderJID(stanza, sessionContext);
if (user == null || !user.isResourceSet()) {
return ServerErrorResponses.getInstance().getStanzaError(StanzaErrorCondition.UNKNOWN_SENDER, stanza, StanzaErrorType.MODIFY, "sender info insufficient: " + ((user == null) ? "no from" : user.getFullQualifiedName()), null, null);
}
RosterItem setRosterItem;
try {
setRosterItem = RosterUtils.parseRosterItem(stanza);
} catch (RosterBadRequestException e) {
return ServerErrorResponses.getInstance().getStanzaError(StanzaErrorCondition.BAD_REQUEST, stanza, StanzaErrorType.MODIFY, e.getMessage(), null, null);
} catch (RosterNotAcceptableException e) {
return ServerErrorResponses.getInstance().getStanzaError(StanzaErrorCondition.NOT_ACCEPTABLE, stanza, StanzaErrorType.MODIFY, e.getMessage(), null, null);
}
Entity contactJid = setRosterItem.getJid().getBareJID();
RosterItem existingItem;
try {
existingItem = rosterManager.getContact(user.getBareJID(), contactJid);
} catch (RosterException e) {