Commit 88cc1099 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Added GPL license tag, and cleaned up a couple of warnings.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@7286 b35dd754-fafc-0310-a699-88a17e54d16e
parent 24717dc8
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.gateway.protocols.simple;
import java.io.ByteArrayInputStream;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.dom4j.Document;
import org.dom4j.DocumentFactory;
import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.util.Log;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import org.xmpp.packet.Presence;
/**
* This class performs conversions between presence packets of XMPP and SIMPLE formats.
......@@ -340,7 +344,8 @@ public class SimplePresence {
tupleStatus = TupleStatus.getTupleStatus(data);
}
catch (IllegalArgumentException ex) {
}
// Ignore
}
// if(data.equals("open")) {
// statusType = "online";
// statusName = "Online";
......
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.gateway.protocols.simple;
import java.net.InetAddress;
......@@ -10,7 +20,6 @@ import java.util.TooManyListenersException;
import javax.sip.ClientTransaction;
import javax.sip.ListeningPoint;
import javax.sip.ServerTransaction;
import javax.sip.SipException;
import javax.sip.SipFactory;
import javax.sip.SipProvider;
......@@ -169,14 +178,14 @@ public class SimpleSession extends TransportSession {
seqNum = 1L;
}
/**
* Perform rollback action once the login fails or logout goes on the way.
*/
private void rollback() {
}
public void updateStatus(PresenceType presenceType, String verboseStatus) {
Log.debug("SimpleSession(" + getJID().getNode() + ").updateStatus: Method commenced!");
}
......
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.gateway.protocols.simple;
import java.util.Date;
......@@ -12,19 +22,15 @@ import javax.sip.TransactionTerminatedEvent;
import javax.sip.address.Address;
import javax.sip.address.URI;
import javax.sip.header.CSeqHeader;
import javax.sip.header.CallIdHeader;
import javax.sip.header.ContactHeader;
import javax.sip.header.ExpiresHeader;
import javax.sip.header.FromHeader;
import javax.sip.header.MaxForwardsHeader;
import javax.sip.header.RecordRouteHeader;
import javax.sip.header.SubscriptionStateHeader;
import javax.sip.header.ToHeader;
import javax.sip.message.Request;
import javax.sip.message.Response;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.gateway.TransportLoginStatus;
import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.xmpp.packet.JID;
import org.xmpp.packet.Presence;
......@@ -75,7 +81,6 @@ public class SimpleSessionListener implements SipListener {
FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME);
Address fromAddress = fromHeader.getAddress();
String displayName = fromAddress.getDisplayName();
URI fromUri = fromAddress.getURI();
if (fromUri != null) {
fromAddr = fromUri.toString();
......@@ -222,13 +227,8 @@ public class SimpleSessionListener implements SipListener {
public void processResponse(ResponseEvent responseEvent) {
Log.debug("SimpleSessionListener for " + myUsername + ": Received a response event: " + responseEvent.getResponse().toString());
String fromAddr = "";
String toAddr = "";
Response response = responseEvent.getResponse();
if (response.getHeader(FromHeader.NAME) != null) {
FromHeader fromHeader = (FromHeader) response.getHeader(FromHeader.NAME);
fromAddr = fromHeader.getAddress().getURI().toString();
}
if (response.getHeader(ToHeader.NAME) != null) {
ToHeader toHeader = (ToHeader) response.getHeader(ToHeader.NAME);
toAddr = toHeader.getAddress().getURI().toString();
......@@ -315,7 +315,7 @@ public class SimpleSessionListener implements SipListener {
}
public void finalize() {
Log.debug("SimpleSessionListener for " + myUsername + " is being shut down!!");
Log.debug("SimpleSessionListener for " + myUsername + " is being shut down!!");
mySimpleSession = null;
}
}
\ No newline at end of file
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.gateway.protocols.simple;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Properties;
import java.util.TooManyListenersException;
import javax.sip.InvalidArgumentException;
import javax.sip.ListeningPoint;
import javax.sip.ObjectInUseException;
import javax.sip.PeerUnavailableException;
import javax.sip.SipFactory;
import javax.sip.SipProvider;
import javax.sip.SipStack;
import javax.sip.TransportNotSupportedException;
import javax.sip.address.AddressFactory;
import javax.sip.header.HeaderFactory;
import javax.sip.message.MessageFactory;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.gateway.BaseTransport;
import org.jivesoftware.wildfire.gateway.PresenceType;
import org.jivesoftware.wildfire.gateway.Registration;
import org.jivesoftware.wildfire.gateway.TransportLoginStatus;
import org.jivesoftware.wildfire.gateway.TransportSession;
import org.xmpp.packet.JID;
......@@ -69,9 +63,8 @@ public class SimpleTransport extends BaseTransport {
public String getTerminologyNickname() {
// If this string is needed, then take it. Just put a draft code to ensure integrity.
String result = null;
return result;
return null;
}
public String getTerminologyRegistration() {
......@@ -80,23 +73,20 @@ public class SimpleTransport extends BaseTransport {
public Boolean isPasswordRequired() {
// Just put a draft code to ensure integrity.
Boolean result = true;
return result;
return true;
}
public Boolean isNicknameRequired() {
// Just put a draft code to ensure integrity.
Boolean result = false;
return result;
return false;
}
public Boolean isUsernameValid(String username) {
// Just put a draft code to ensure integrity.
Boolean result = username.matches("\\w+");
return result;
return username.matches("\\w+");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment