001: // The contents of this file are subject to the Mozilla Public License Version
002: // 1.1
003: //(the "License"); you may not use this file except in compliance with the
004: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005: //
006: //Software distributed under the License is distributed on an "AS IS" basis,
007: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008: //for the specific language governing rights and
009: //limitations under the License.
010: //
011: //The Original Code is "The Columba Project"
012: //
013: //The Initial Developers of the Original Code are Frederik Dietz and Timo
014: // Stich.
015: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016: //
017: //All Rights Reserved.
018: package org.columba.chat.model;
019:
020: import org.columba.chat.model.api.IBuddyStatus;
021: import org.jivesoftware.smack.packet.Presence;
022:
023: /**
024: * @author fdietz
025: *
026: */
027: public class BuddyStatus implements IBuddyStatus {
028: private String name;
029:
030: private String jabberId;
031:
032: private Presence.Mode presenceMode;
033:
034: private String statusMessage;
035:
036: private boolean signedOn;
037:
038: public BuddyStatus(String jabberId) {
039: if (jabberId == null)
040: throw new IllegalArgumentException("jabberId == null");
041:
042: this .jabberId = jabberId;
043: }
044:
045: /*
046: * (non-Javadoc)
047: *
048: * @see org.columba.chat.jabber.IBuddyStatus#getJabberId()
049: */
050: public String getJabberId() {
051: return jabberId;
052: }
053:
054: /*
055: * (non-Javadoc)
056: *
057: * @see org.columba.chat.jabber.IBuddyStatus#getPresenceMode()
058: */
059: public Presence.Mode getPresenceMode() {
060: return presenceMode;
061: }
062:
063: /*
064: * (non-Javadoc)
065: *
066: * @see org.columba.chat.jabber.IBuddyStatus#isSignedOn()
067: */
068: public boolean isSignedOn() {
069: return signedOn;
070: }
071:
072: /*
073: * (non-Javadoc)
074: *
075: * @see org.columba.chat.jabber.IBuddyStatus#getStatusMessage()
076: */
077: public String getStatusMessage() {
078: return statusMessage;
079: }
080:
081: /*
082: * (non-Javadoc)
083: *
084: * @see org.columba.chat.jabber.IBuddyStatus#getChatMediator()
085: */
086: // public IChatMediator getChatMediator() {
087: // return mediator;
088: // }
089: /*
090: * (non-Javadoc)
091: *
092: * @see org.columba.chat.jabber.IBuddyStatus#setChatMediator(org.columba.chat.api.IChatMediator)
093: */
094: // public void setChatMediator(IChatMediator mediator) {
095: // this.mediator = mediator;
096: // }
097: /*
098: * (non-Javadoc)
099: *
100: * @see org.columba.chat.jabber.IBuddyStatus#setPresenceMode(org.jivesoftware.smack.packet.Presence.Mode)
101: */
102: public void setPresenceMode(Presence.Mode presenceMode) {
103: this .presenceMode = presenceMode;
104: }
105:
106: /*
107: * (non-Javadoc)
108: *
109: * @see org.columba.chat.jabber.IBuddyStatus#setSignedOn(boolean)
110: */
111: public void setSignedOn(boolean signedOn) {
112: this .signedOn = signedOn;
113: }
114:
115: /*
116: * (non-Javadoc)
117: *
118: * @see org.columba.chat.jabber.IBuddyStatus#setStatusMessage(java.lang.String)
119: */
120: public void setStatusMessage(String statusMessage) {
121: this .statusMessage = statusMessage;
122: }
123:
124: /*
125: * (non-Javadoc)
126: *
127: * @see org.columba.chat.jabber.IBuddyStatus#getName()
128: */
129: public String getName() {
130: return name;
131: }
132:
133: /**
134: * @param user
135: * The user to set.
136: */
137: public void setName(String user) {
138: this.name = user;
139: }
140: }
|