AbstractPacketProxy.java 2.53 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4
/**
 * $RCSfile$
 * $Revision$
 * $Date$
Matt Tucker's avatar
Matt Tucker committed
5
 *
Matt Tucker's avatar
Matt Tucker committed
6
 * Copyright (C) 2004 Jive Software. All rights reserved.
Matt Tucker's avatar
Matt Tucker committed
7
 *
Matt Tucker's avatar
Matt Tucker committed
8 9
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
Matt Tucker's avatar
Matt Tucker committed
10
 */
Matt Tucker's avatar
Matt Tucker committed
11

Matt Tucker's avatar
Matt Tucker committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
package org.jivesoftware.messenger.spi;

import org.jivesoftware.messenger.Session;
import org.jivesoftware.messenger.XMPPAddress;
import org.jivesoftware.messenger.XMPPError;
import org.jivesoftware.messenger.XMPPPacket;
import org.jivesoftware.messenger.auth.AuthToken;
import org.jivesoftware.messenger.auth.Permissions;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

abstract public class AbstractPacketProxy extends FragmentProxy implements XMPPPacket {

    protected XMPPPacket packet;

    public AbstractPacketProxy(XMPPPacket packet, AuthToken token, Permissions permissions) {
        super(packet, token, permissions);
        this.packet = packet;
    }

    public boolean isSending() {
        return packet.isSending();
    }

    public void setSending(boolean isSending) {
        packet.setSending(isSending);
    }

    public XMPPPacket.RoutePriority getRoutePriority() {
        return packet.getRoutePriority();
    }

    public void setRoutePriority(XMPPPacket.RoutePriority priority) {
        packet.setRoutePriority(priority);
    }

    public void setError(XMPPError.Code errorCode) {
        packet.setError(errorCode);
    }

    public XMPPError getError() {
        return packet.getError();
    }

    public String getID() {
        return packet.getID();
    }

    public void setID(String id) {
        packet.setID(id);
    }

    public void setOriginatingSession(Session session) {
        packet.setOriginatingSession(session);
    }

    public XMPPAddress getRecipient() {
        return packet.getRecipient();
    }

    public void setRecipient(XMPPAddress recipient) {
        packet.setRecipient(recipient);
    }

    public void setSender(XMPPAddress sender) {
        packet.setSender(sender);
    }

    public XMPPAddress getSender() {
        return packet.getSender();
    }

    public Session getOriginatingSession() {
        return packet.getOriginatingSession();
    }

    public void parse(XMLStreamReader xpp) throws XMLStreamException {
        packet.parse(xpp);
    }

    public XMPPPacket.Type typeFromString(String type) {
        return packet.typeFromString(type);
    }

    public void setType(XMPPPacket.Type type) {
        packet.setType(type);
    }

    public XMPPPacket.Type getType() {
        return packet.getType();
    }
}