001/**
002 *
003 * Copyright 2003-2007 Jive Software.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.jivesoftware.smackx.workgroup.agent;
019
020import java.util.Date;
021
022import org.jxmpp.jid.Jid;
023
024/**
025 * An immutable simple class to embody the information concerning a revoked offer, this is namely
026 *  the reason, the workgroup, the userJID, and the timestamp which the message was received.<br>
027 *
028 * @author loki der quaeler
029 */
030public class RevokedOffer {
031
032    private final Jid userJID;
033    private final Jid userID;
034    private final Jid workgroupName;
035    private final String sessionID;
036    private final String reason;
037    private final Date timestamp;
038
039    /**
040     *
041     * @param userJID the JID of the user for which this revocation was issued.
042     * @param userID the user ID of the user for which this revocation was issued.
043     * @param workgroupName the fully qualified name of the workgroup
044     * @param sessionID the session id attributed to this chain of packets
045     * @param reason the server issued message as to why this revocation was issued.
046     * @param timestamp the timestamp at which the revocation was issued
047     */
048    RevokedOffer(Jid userJID, Jid userID, Jid workgroupName, String sessionID,
049            String reason, Date timestamp) {
050        super();
051
052        this.userJID = userJID;
053        this.userID = userID;
054        this.workgroupName = workgroupName;
055        this.sessionID = sessionID;
056        this.reason = reason;
057        this.timestamp = timestamp;
058    }
059
060    public Jid getUserJID() {
061        return userJID;
062    }
063
064    /**
065     * Get user id.
066     * @return the jid of the user for which this revocation was issued
067     */
068    public Jid getUserID() {
069        return this.userID;
070    }
071
072    /**
073     * Get workgroup name.
074     * @return the fully qualified name of the workgroup
075     */
076    public Jid getWorkgroupName() {
077        return this.workgroupName;
078    }
079
080    /**
081     * Get the session id.
082     * @return the session id which will associate all packets for the pending chat
083     */
084    public String getSessionID() {
085        return this.sessionID;
086    }
087
088    /**
089     * Get reason.
090     * @return the server issued message as to why this revocation was issued
091     */
092    public String getReason() {
093        return this.reason;
094    }
095
096    /**
097     * Get the timestamp.
098     * @return the timestamp at which the revocation was issued
099     */
100    public Date getTimestamp() {
101        return this.timestamp;
102    }
103}