use of com.att.cdp.exceptions.NotLoggedInException in project AJSC by att.
the class AbstractService method checkLogin.
/**
* This method checks to see if the client has successfully logged in to the provider before attempting to make a
* service request. If the client is logged in, the method returns silently. If not, then an exception is thrown.
*
* @throws NotLoggedInException
* If the client is not logged in.
*/
public void checkLogin() throws NotLoggedInException {
if (!context.isLoggedIn()) {
Provider provider = context.getProvider();
String msg = EELFResourceManager.format(Msg.NOT_LOGGED_INTO_PROVIDER, provider.getName());
appLogger.error(msg);
throw new NotLoggedInException(msg);
}
}
use of com.att.cdp.exceptions.NotLoggedInException in project AJSC by att.
the class AbstractIdentity method checkLoggedIn.
/**
* Convenience method to check the logged in state of the caller. If the context is logged in, the method returns
* silently. If not logged in, a RimeException is thrown.
*
* @throws ZoneException
* If the user is not logged in
*/
protected void checkLoggedIn() throws ZoneException {
Context context = getContext();
getLogger().info("checkLoggedIn(): context={} isLoggedIn={}", context, context.isLoggedIn());
if (context.isLoggedIn()) {
return;
}
throw new NotLoggedInException("Not logged in!");
}
Aggregations