Search in sources :

Example 1 with NotLoggedInException

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);
    }
}
Also used : NotLoggedInException(com.att.cdp.exceptions.NotLoggedInException) Provider(com.att.cdp.zones.Provider)

Example 2 with NotLoggedInException

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!");
}
Also used : Context(com.att.cdp.zones.Context) NotLoggedInException(com.att.cdp.exceptions.NotLoggedInException)

Aggregations

NotLoggedInException (com.att.cdp.exceptions.NotLoggedInException)2 Context (com.att.cdp.zones.Context)1 Provider (com.att.cdp.zones.Provider)1