@SpecCompliant(spec = "rfc3921bis-08", section = "2.1.5", status = FINISHED, coverage = PARTIAL),
@SpecCompliant(spec = "rfc3921bis-08", section = "2.2", status = FINISHED, coverage = COMPLETE) })
@Override
protected Stanza handleGet(IQStanza stanza, ServerRuntimeContext serverRuntimeContext, SessionContext sessionContext) {
ResourceRegistry registry = serverRuntimeContext.getResourceRegistry();
RosterManager rosterManager = (RosterManager) serverRuntimeContext.getStorageProvider(RosterManager.class);
if (rosterManager == null) {
return handleCannotRetrieveRoster(stanza, sessionContext);
}
Entity from = extractUniqueSenderJID(stanza, sessionContext);
if (from == null || !from.isResourceSet()) {
return ServerErrorResponses.getInstance().getStanzaError(StanzaErrorCondition.UNKNOWN_SENDER, stanza,
StanzaErrorType.MODIFY,
"sender info insufficient: " + ((from == null) ? "no from" : from.getFullQualifiedName()), null,
null);
}
String resourceId = from.getResource();
ResourceState currentState = registry.getResourceState(resourceId);
if (currentState != null) {
registry.setResourceState(resourceId, ResourceState.makeInterested(currentState));
}
Roster roster = null;
try {
roster = rosterManager.retrieve(from.getBareJID());