SessionOperations.java revision 7d46f125408af7521e0e8021e0da5609fb8f7ec2
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott/**
7d46f125408af7521e0e8021e0da5609fb8f7ec2Tom Rumsey * Copyright 2014-2016 ForgeRock AS.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * The contents of this file are subject to the terms of the Common Development and
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Distribution License (the License). You may not use this file except in compliance with the
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * License.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * specific language governing permission and limitations under the License.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * When distributing Covered Software, include this CDDL Header Notice in each file and include
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Header, with the fields enclosed by brackets [] replaced by your own identifying
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * information: "Portions copyright [year] [name of copyright owner]".
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott */
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshottpackage com.iplanet.dpro.session.operations;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshottimport com.iplanet.dpro.session.Session;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshottimport com.iplanet.dpro.session.SessionException;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshottimport com.iplanet.dpro.session.share.SessionInfo;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott/**
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Describes the ability to perform an operation on a Session.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * These operations are specific to the Session Service, therefore all will be
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * keyed by the SessionID key.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * This abstraction layer is important as it will be implementation specific as to
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * how this operation will be performed.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Note: Session instances are the currency of the
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * {@link com.iplanet.dpro.session.Session} Service. The aptly titled
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * {@link com.iplanet.dpro.session.service.SessionService} deals with InternalSessions.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * The common currency between them is the SessionID which is suitably generic to use in
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * this interface.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott */
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshottpublic interface SessionOperations {
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott /**
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Performs a refresh of the Session and return a summary of the Session information.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * This will optionally update the last modified timestamp of the Session.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Note: This method is inconsistent from the other two in that it requires a Session
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * reference. This is because of a dependency which could not be resolved without
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * substantial refactoring in the Remote implementation.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @param reset If true, then update the last modified timestamp of the Session.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @param session Reference to the Session.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @return Null if there was an error locating the Session, otherwise non null.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott */
7d46f125408af7521e0e8021e0da5609fb8f7ec2Tom Rumsey SessionInfo refresh(Session session, boolean reset) throws SessionException;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott /**
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Performs the logout operation on the Session.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * This operation is intended to destroy the Session and perform any appropriate
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Session related logic.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @param session SessionID to logout.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott */
7d46f125408af7521e0e8021e0da5609fb8f7ec2Tom Rumsey void logout(Session session) throws SessionException;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott /**
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Destroys the Session by removing it and moving it to the DESTROY state.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * This operation is similar to the logout and uses similar behaviour.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
6b0b9411405932b5ada376bb06d6bc3d94980d7fPeter Major * @param requester The requester's non null session used to authorize the destroy operation.
6b0b9411405932b5ada376bb06d6bc3d94980d7fPeter Major * @param session The non null session to destroy.
6b0b9411405932b5ada376bb06d6bc3d94980d7fPeter Major * @throws SessionException If there was an error while deleting the token.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott */
7d46f125408af7521e0e8021e0da5609fb8f7ec2Tom Rumsey void destroy(Session requester, Session session) throws SessionException;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott /**
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * Assigns the property to the Session.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott *
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @param session The session to perform the set on.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @param name Non null name of the property.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @param value Non null value.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * @throws SessionException SessionException if the session reached its maximum
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * session time, or the session was destroyed, or there was an error during
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott * communication with session service, or if the property name or value was null.
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott */
7d46f125408af7521e0e8021e0da5609fb8f7ec2Tom Rumsey void setProperty(Session session, String name, String value) throws SessionException;
72450cb9c2ca854c6d3479832c2738196c1d3282Robert Wapshott}