Search in sources :

Example 1 with SessionOperations

use of com.iplanet.dpro.session.operations.SessionOperations in project OpenAM by OpenRock.

the class Session method doRefresh.

/*
    * Refreshes the Session Information
    * @param <code>true</code> refreshes the Session Information
    */
private void doRefresh(boolean reset) throws SessionException {
    boolean flag = reset || needToReset;
    needToReset = false;
    SessionOperations operation = sessionOperationStrategy.getOperation(this);
    SessionInfo info = operation.refresh(this, flag);
    long oldMaxCachingTime = maxCachingTime;
    long oldMaxIdleTime = maxIdleTime;
    long oldMaxSessionTime = maxSessionTime;
    update(info);
    if ((!isScheduled()) || (oldMaxCachingTime > maxCachingTime) || (oldMaxIdleTime > maxIdleTime) || (oldMaxSessionTime > maxSessionTime)) {
        scheduleToTimerPool();
    }
}
Also used : SessionInfo(com.iplanet.dpro.session.share.SessionInfo) SessionOperations(com.iplanet.dpro.session.operations.SessionOperations)

Example 2 with SessionOperations

use of com.iplanet.dpro.session.operations.SessionOperations in project OpenAM by OpenRock.

the class Session method logout.

/**
     * Logs out a session.
     *
     * @throws SessionException if there was an error during communication
     *         with session service. If the session logged out already,
     *         no exception will be thrown.
     */
public void logout() throws SessionException {
    try {
        SessionOperations operation = sessionOperationStrategy.getOperation(this);
        operation.logout(this);
        sessionCache.removeSID(sessionID);
    } catch (Exception e) {
        throw new SessionException(e);
    }
}
Also used : SessionOperations(com.iplanet.dpro.session.operations.SessionOperations) ThreadPoolException(com.iplanet.am.util.ThreadPoolException) SSOException(com.iplanet.sso.SSOException)

Example 3 with SessionOperations

use of com.iplanet.dpro.session.operations.SessionOperations in project OpenAM by OpenRock.

the class Session method destroySession.

/**
     * Destroys a session.
     *
     * @param session The session to be destroyed.
     * @exception SessionException if there was an error during
     *            communication with session service, or the corresponding
     *            session reached its maximum session/idle time, or the
     *            session was destroyed.
     */
public void destroySession(Session session) throws SessionException {
    try {
        SessionOperations operation = sessionOperationStrategy.getOperation(session);
        operation.destroy(this, session);
    } catch (Exception e) {
        throw new SessionException(e);
    } finally {
        sessionCache.removeSID(session.getID());
    }
}
Also used : SessionOperations(com.iplanet.dpro.session.operations.SessionOperations) ThreadPoolException(com.iplanet.am.util.ThreadPoolException) SSOException(com.iplanet.sso.SSOException)

Example 4 with SessionOperations

use of com.iplanet.dpro.session.operations.SessionOperations in project OpenAM by OpenRock.

the class Session method setProperty.

/**
     * Sets a property for this session.
     *
     * @param name The property name.
     * @param value The property value.
     * @exception SessionException if the session reached its maximum session
     *            time, or the session was destroyed, or there was an error
     *            during communication with session service, or if the property
     *            name or value was null.
     */
public void setProperty(String name, String value) throws SessionException {
    if (name == null || value == null) {
        throw new SessionException("Session property name/value cannot be null");
    }
    try {
        SessionOperations operation = sessionOperationStrategy.getOperation(this);
        operation.setProperty(this, name, value);
        sessionProperties.put(name, value);
    } catch (Exception e) {
        throw new SessionException(e);
    }
}
Also used : SessionOperations(com.iplanet.dpro.session.operations.SessionOperations) ThreadPoolException(com.iplanet.am.util.ThreadPoolException) SSOException(com.iplanet.sso.SSOException)

Aggregations

SessionOperations (com.iplanet.dpro.session.operations.SessionOperations)4 ThreadPoolException (com.iplanet.am.util.ThreadPoolException)3 SSOException (com.iplanet.sso.SSOException)3 SessionInfo (com.iplanet.dpro.session.share.SessionInfo)1