/** * Get the XMPPConnection of this Manager if it's authenticated, i.e. logged in. Otherwise throw a {@link NotLoggedInException}. * * @return the XMPPConnection of this Manager. * @throws NotLoggedInException if the connection is not authenticated. */ protected final XMPPConnection getAuthenticatedConnectionOrThrow() throws NotLoggedInException { XMPPConnection connection = connection(); if (!connection.isAuthenticated()) { throw new NotLoggedInException(); } return connection; }
/** * Get the XMPPConnection of this Manager if it's authenticated, i.e. logged in. Otherwise throw a {@link NotLoggedInException}. * * @return the XMPPConnection of this Manager. * @throws NotLoggedInException if the connection is not authenticated. */ protected final XMPPConnection getAuthenticatedConnectionOrThrow() throws NotLoggedInException { XMPPConnection connection = connection(); if (!connection.isAuthenticated()) { throw new NotLoggedInException(); } return connection; }