beepcore-java-commits Mailing List for Java BEEP Core
Status: Beta
Brought to you by:
huston
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(22) |
Aug
(1) |
Sep
|
Oct
(16) |
Nov
(60) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(3) |
Feb
|
Mar
(4) |
Apr
(2) |
May
(13) |
Jun
|
Jul
|
Aug
(10) |
Sep
(34) |
Oct
(27) |
Nov
(2) |
Dec
(2) |
2003 |
Jan
|
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(14) |
Jul
(5) |
Aug
(1) |
Sep
(24) |
Oct
(4) |
Nov
(26) |
Dec
(1) |
2004 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Huston F. <hu...@us...> - 2006-02-25 18:02:57
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/serialize In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13660/src/org/beepcore/beep/core/serialize Added Files: ErrorElement.java ProfileElement.java GreetingElement.java StartElement.java CloseElement.java ChannelZeroParser.java ChannelIndication.java Log Message: Refactored parsing into a separate package --- NEW FILE: ErrorElement.java --- /* * ErrorElement.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 21, 2004 */ package org.beepcore.beep.core.serialize; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class ErrorElement { private int code; private String xmlLang; private String diagnostic; public ErrorElement() { this(0, null, null); } public ErrorElement(int code, String diagnostic) { this(code, null, diagnostic); } public ErrorElement(int code, String xmlLang, String diagnostic) { this.code = code; this.xmlLang = xmlLang; this.diagnostic = diagnostic; } public int getCode() { return code; } public String getDiagnostic() { return diagnostic; } public String getXmlLang() { return xmlLang; } public void setCode(int code) { this.code = code; } public void setDiagnostic(String diagnostic) { this.diagnostic = diagnostic; } public void setXmlLang(String xmlLang) { this.xmlLang = xmlLang; } } --- NEW FILE: ProfileElement.java --- /* * ProfileElement.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 24, 2004 */ package org.beepcore.beep.core.serialize; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class ProfileElement { String uri; boolean base64Encoding; String data; public ProfileElement(String uri, boolean base64Encoding, String data) { this.uri = uri; this.base64Encoding = base64Encoding; this.data = data; } public ProfileElement(String uri) { this(uri, false, null); } public String getUri() { return uri; } public boolean getBase64Encoding() { return base64Encoding; } public String getData() { return data; } public void setUri(String uri) { this.uri = uri; } public void setBase64Encoding(boolean base64Encoding) { this.base64Encoding = base64Encoding; } public void setData(String data) { this.data = data; } } --- NEW FILE: GreetingElement.java --- /* * GreetingElement.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 19, 2004 */ package org.beepcore.beep.core.serialize; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class GreetingElement { public static final String LOCALIZE_DEFAULT = "i-default"; private static final Collection emptyCollection = Collections.unmodifiableCollection(new LinkedList()); private String features; private String localize; private Collection profiles; public GreetingElement(String features, String localize, Collection profiles) { this.features = features; if (localize != null) { this.localize = localize; } else { this.localize = LOCALIZE_DEFAULT; } this.profiles = Collections.unmodifiableCollection(profiles); } public GreetingElement(String features, Collection profiles) { this(features, null, profiles); } public GreetingElement(Collection profiles) { this(null, null, profiles); } public GreetingElement() { features = null; localize = LOCALIZE_DEFAULT; profiles = emptyCollection; } public String getFeatures() { return features; } public String getLocalize() { return localize; } public Collection getProfiles() { return profiles; } public void setFeatures(String features) { this.features = features; } public void setLocalize(String localize) { this.localize = localize; } public void setProfiles(Collection profiles) { if (profiles == null) { this.profiles = emptyCollection; } else { this.profiles = Collections.unmodifiableCollection(profiles); } } } --- NEW FILE: StartElement.java --- /* * StartElement.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 18, 2004 */ package org.beepcore.beep.core.serialize; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class StartElement extends ChannelIndication { private static final Collection emptyCollection = Collections.unmodifiableCollection(new LinkedList()); private int channelNumber; private String serverName; private Collection profiles; public StartElement(int channelNumber, String serverName, Collection profiles) { super(ChannelIndication.START); this.channelNumber = channelNumber; this.serverName = serverName; this.profiles = Collections.unmodifiableCollection(profiles); } public StartElement(int channelNumber, Collection profiles) { this(channelNumber, null, profiles); } public StartElement() { super(ChannelIndication.START); channelNumber = 0; serverName = null; profiles = emptyCollection; } public int getChannelNumber() { return channelNumber; } public String getServerName() { return serverName; } public Collection getProfiles() { return profiles; } public void setChannelNumber(int channelNumber) { this.channelNumber = channelNumber; } public void setServerName(String serverName) { this.serverName = serverName; } public void setProfiles(Collection profiles) { this.profiles = Collections.unmodifiableCollection(profiles); } } --- NEW FILE: CloseElement.java --- /* * CloseElement.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 21, 2004 */ package org.beepcore.beep.core.serialize; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class CloseElement extends ChannelIndication { private int channelNumber; private int code; private String xmlLang; private String diagnostic; public CloseElement(int channelNumber, int code, String xmlLang, String diagnostic) { super(ChannelIndication.CLOSE); this.channelNumber = channelNumber; this.code = code; this.xmlLang = xmlLang; this.diagnostic = diagnostic; } public int getChannelNumber() { return channelNumber; } public int getCode() { return code; } public String getXmlLang() { return xmlLang; } public String getDiagnostic() { return diagnostic; } public void setChannelNumber(int channelNumber) { this.channelNumber = channelNumber; } public void setCode(int code) { this.code = code; } public void setXmlLang(String xmlLang) { this.xmlLang = xmlLang; } public void setDiagnostic(String diagnostic) { this.diagnostic = diagnostic; } } --- NEW FILE: ChannelZeroParser.java --- /* * ChannelZeroParser.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 14, 2004 */ package org.beepcore.beep.core.serialize; import java.io.IOException; import java.util.Iterator; import java.util.LinkedList; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import org.beepcore.beep.core.BEEPError; import org.beepcore.beep.core.BEEPException; import org.beepcore.beep.core.InputDataStream; import org.beepcore.beep.core.MimeHeaders; import org.beepcore.beep.util.StringUtil; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class ChannelZeroParser { public static final int MAX_PROFILE_CONTENT_LENGTH = 4096; private static final String ERR_MALFORMED_XML_MSG = "Malformed XML"; private static final String ERR_UNKNOWN_OPERATION_ELEMENT_MSG = "Unknown operation element"; private DocumentBuilder builder; // generic XML parser public ChannelZeroParser() throws BEEPException { try { builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new BEEPException("Invalid parser configuration"); } } private Element processMessage(InputDataStream message) throws BEEPException { // check the message content type if (!message.getInputStream().getContentType().equals(MimeHeaders.BEEP_XML_CONTENT_TYPE)) { throw new BEEPException("Invalid content type for this message"); } // parse the stream Document doc; try { doc = builder.parse(message.getInputStream()); } catch (SAXException e) { throw new BEEPException(ERR_MALFORMED_XML_MSG, e); } catch (IOException e) { throw new BEEPException(ERR_MALFORMED_XML_MSG, e); } if (doc == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } Element topElement = doc.getDocumentElement(); if (topElement == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } return topElement; } private StartElement parseStartIndication(Element topElement) throws BEEPError { String channelNumberString = topElement.getAttribute("number"); if (channelNumberString == null) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <start>: no channel number"); } int channelNumber; try { channelNumber = Integer.parseInt(channelNumberString); } catch (NumberFormatException e) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <start>: bad channel number"); } if (channelNumber <= 0) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <start>: invalid channel number"); } String serverName = topElement.getAttribute("serverName"); NodeList profiles = topElement.getElementsByTagName("profile"); if (profiles == null) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <start>: no profiles"); } LinkedList profileList = new LinkedList(); for (int i = 0; i < profiles.getLength(); i++) { Element profile = (Element) profiles.item(i); String uri = profile.getAttribute("uri"); if (uri == null) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "no uri in profile"); } String encoding = profile.getAttribute("encoding"); boolean b64; if ((encoding == null) || encoding.equals("")) { b64 = false; } else if (encoding.equalsIgnoreCase("base64")) { b64 = true; } else if (encoding.equalsIgnoreCase("none")) { b64 = false; } else { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "unknown encoding in start"); } String data = null; Node dataNode = profile.getFirstChild(); if (dataNode != null) { data = dataNode.getNodeValue(); if (data.length() > MAX_PROFILE_CONTENT_LENGTH) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Element's PCDATA exceeds " + "the maximum size"); } } profileList.add(new ProfileElement(uri, b64, data)); } return new StartElement(channelNumber, serverName, profileList); } private CloseElement parseCloseIndication(Element topElement) throws BEEPError { String channelNumberString = topElement.getAttribute("number"); int channelNumber = 0; if (channelNumberString != null) { try { channelNumber = Integer.parseInt(channelNumberString); } catch (NumberFormatException e) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <close>: bad channel number"); } } String codeString = topElement.getAttribute("code"); if (codeString == null) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <close>: no code attribute"); } int code; try { code = Integer.parseInt(codeString); } catch (NumberFormatException e) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <close>: bad code"); } // this attribute is implied String xmlLang = topElement.getAttribute("xml:lang"); String data = null; Node dataNode = topElement.getFirstChild(); if (dataNode != null) { data = dataNode.getNodeValue(); if (data.length() > MAX_PROFILE_CONTENT_LENGTH) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Element's PCDATA exceeds " + "the maximum size"); } } return new CloseElement(channelNumber, code, xmlLang, data); } public ChannelIndication parseIndication(InputDataStream data) throws BEEPError { Element topElement; try { topElement = processMessage(data); } catch (BEEPException e) { throw new BEEPError(BEEPError.CODE_GENERAL_SYNTAX_ERROR, ERR_MALFORMED_XML_MSG); } String elementName = topElement.getTagName(); if (elementName == null) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ERR_MALFORMED_XML_MSG); } if (elementName.equals("start")) { return parseStartIndication(topElement); } else if (elementName.equals("close")) { return parseCloseIndication(topElement); } else { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ERR_UNKNOWN_OPERATION_ELEMENT_MSG); } } public GreetingElement parseGreetingConfirmation(InputDataStream data) throws BEEPException { Element topElement = processMessage(data); String elementName = topElement.getTagName(); if (elementName == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } else if (!elementName.equals("greeting")) { throw new BEEPException(ERR_UNKNOWN_OPERATION_ELEMENT_MSG); } // this attribute is implied String features = topElement.getAttribute("features"); // This attribute has a default value String localize = topElement.getAttribute("localize"); // Read the profiles - note, the greeting is valid // with 0 profiles NodeList profiles = topElement.getElementsByTagName("profile"); LinkedList profileList = new LinkedList(); for (int i = 0; i < profiles.getLength(); i++) { Element profile = (Element) profiles.item(i); String uri = profile.getAttribute("uri"); if (uri == null) { throw new BEEPException("Malformed profile"); } // Since <profile> elements in greetings cannot contain // pigggyback'd data there won't be an encoding attribute profileList.add(i, uri); } return new GreetingElement(features, localize, profileList); } public ProfileElement parseStartConfirmation(InputDataStream is) throws BEEPException { Element topElement = processMessage(is); String elementName = topElement.getTagName(); if (elementName == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } if (elementName.equals("profile") == false) { throw new BEEPException(ERR_UNKNOWN_OPERATION_ELEMENT_MSG); } try { String uri = topElement.getAttribute("uri"); if (uri == null) { throw new BEEPException("Malformed profile"); } String encoding = topElement.getAttribute("encoding"); boolean base64 = false; if (encoding != null && encoding.equals("base64")) { base64 = true; } Node dataNode = topElement.getFirstChild(); String data = null; if (dataNode != null) { data = dataNode.getNodeValue(); if (data.length() > MAX_PROFILE_CONTENT_LENGTH) { throw new BEEPException("Element's PCDATA " + "exceeds the " + "maximum size"); } } return new ProfileElement(uri, base64, data); } catch (Exception x) { throw new BEEPException(x); } } public void parseCloseConfirmation(InputDataStream is) throws BEEPException { Element topElement = processMessage(is); String elementName = topElement.getTagName(); if (elementName == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } if (elementName.equals("ok") == false) { throw new BEEPException(ERR_UNKNOWN_OPERATION_ELEMENT_MSG); } return; } public ErrorElement parseError(InputDataStream is) throws BEEPException { Element topElement = processMessage(is); if (topElement == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } // check for <error> String elementName = topElement.getTagName(); if (elementName == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } else if (!elementName.equals("error")) { throw new BEEPException("Unknown operation element"); } String codeString = topElement.getAttribute("code"); if (codeString == null) { throw new BEEPException(ERR_MALFORMED_XML_MSG); } int code; try { code = Integer.parseInt(codeString); } catch (NumberFormatException e) { throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, "Malformed <close>: bad code"); } // this attribute is implied String xmlLang = topElement.getAttribute("xml:lang"); Node dataNode = topElement.getFirstChild(); String data = null; if (dataNode != null) { data = dataNode.getNodeValue(); } return new ErrorElement(code, xmlLang, data); } public byte[] serializeStart(StartElement start) { // create the message in a buffer and send it StringBuffer buf = new StringBuffer(); buf.append("<start number='"); buf.append(start.getChannelNumber()); if (start.getServerName() != null) { buf.append("' serverName='"); buf.append(start.getServerName()); } if (start.getProfiles().size() == 0) { // @TODO throw exception } buf.append("'>"); Iterator i = start.getProfiles().iterator(); while (i.hasNext()) { serializeProfile((ProfileElement) i.next(), buf); } buf.append("</start>"); return StringUtil.stringBufferToAscii(buf); } public byte[] serializeClose(CloseElement close) { // Construct Message StringBuffer buf = new StringBuffer(); buf.append("<close number='"); buf.append(close.getChannelNumber()); buf.append("' code='"); buf.append(close.getCode()); if (close.getDiagnostic() != null) { if (close.getXmlLang() != null) { buf.append("' xml:lang='"); buf.append(close.getXmlLang()); } buf.append("'>"); buf.append(close.getDiagnostic()); buf.append("</close>"); } else { buf.append("'/>"); } return StringUtil.stringBufferToAscii(buf); } private void serializeProfile(ProfileElement profile, StringBuffer buf) { buf.append("<profile uri='"); buf.append(profile.getUri()); if (profile.getData() != null) { if (profile.getBase64Encoding()) { buf.append("' encoding='base64"); } buf.append("'><![CDATA["); buf.append(profile.getData()); buf.append("]]></profile>"); } else { buf.append("' />"); } } public byte[] serializeProfile(ProfileElement profile) { StringBuffer buf = new StringBuffer(); serializeProfile(profile, buf); return StringUtil.stringBufferToAscii(buf); } public byte[] serializeGreeting(GreetingElement greeting) { StringBuffer buf = new StringBuffer(); buf.append("<greeting"); if (!greeting.getLocalize().equals(GreetingElement.LOCALIZE_DEFAULT)) { buf.append(" localize='"); buf.append(greeting.getLocalize()); buf.append('\''); } if (greeting.getFeatures() != null) { buf.append(" features='"); buf.append(greeting.getFeatures()); buf.append('\''); } if (greeting.getProfiles().size() == 0) { buf.append("/>"); } else { buf.append('>'); for (Iterator i = greeting.getProfiles().iterator(); i.hasNext(); ) { buf.append("<profile uri='"); buf.append(i.next()); buf.append("' />"); } buf.append("</greeting>"); } return StringUtil.stringBufferToAscii(buf); } private StringBuffer createErrorBuffer(int code, String diagnostic, String xmlLang) { StringBuffer buf = new StringBuffer(128); buf.append("<error code='"); buf.append(code); if (xmlLang != null) { buf.append("' xml:lang='"); buf.append(xmlLang); } if (diagnostic != null) { buf.append("' >"); buf.append(diagnostic); buf.append("</error>"); } else { buf.append("' />"); } return buf; } public String createErrorMessage(ErrorElement error) { StringBuffer buf = createErrorBuffer(error.getCode(), error.getDiagnostic(), error.getXmlLang()); return buf.toString(); } public byte[] serializeError(ErrorElement error) { StringBuffer buf = createErrorBuffer(error.getCode(), error.getDiagnostic(), error.getXmlLang()); return StringUtil.stringBufferToAscii(buf); } } --- NEW FILE: ChannelIndication.java --- /* * ChannelIndication.java $Revision: 1.1 $ $Date: 2006/02/25 18:02:49 $ * * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the * "License"); You may not use this file except in compliance with the License. * * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * */ /* * Created on Apr 21, 2004 */ package org.beepcore.beep.core.serialize; /** * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2006/02/25 18:02:49 $ */ public class ChannelIndication { public static final int START = 1; public static final int CLOSE = 2; private final int type; ChannelIndication(int type) { this.type = type; } public int getType() { return type; } } |
From: Huston F. <hu...@us...> - 2006-02-25 18:02:43
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/serialize In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13617/src/org/beepcore/beep/core/serialize Log Message: Directory /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/serialize added to the repository |
From: Huston F. <hu...@us...> - 2006-02-25 17:48:40
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6616/src/org/beepcore/beep/core Modified Files: ProfileRegistry.java ChannelImpl.java TuningProfile.java MessageMSG.java PiggybackedMSG.java SessionImpl.java StartChannelProfile.java BEEPError.java MessageMSGImpl.java Log Message: Refactored parsing into a separate package Index: ProfileRegistry.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/ProfileRegistry.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** ProfileRegistry.java 7 Nov 2003 17:38:11 -0000 1.14 --- ProfileRegistry.java 25 Feb 2006 17:48:36 -0000 1.15 *************** *** 3,7 **** * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2001,2002 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2001,2002,2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 22,27 **** --- 22,31 ---- import org.apache.commons.logging.LogFactory; + import java.util.Collection; import java.util.Enumeration; import java.util.Hashtable; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.Set; import org.beepcore.beep.util.StringUtil; *************** *** 213,302 **** return this.localize; } ! ! byte[] getGreeting(Session session) { ! return getGreeting(session, null); ! } ! ! byte[] getGreeting(Session session, String features) { ! int bufferSize = "<greeting></greeting>".length(); ! int profileCount = 0; ! ! profileCount = profileListeners.size(); ! ! Enumeration e = profileListeners.keys(); ! ! while (e.hasMoreElements()) { ! bufferSize += ((String) e.nextElement()).length() ! + "<profile>".length(); ! } ! ! bufferSize++; ! ! StringBuffer sb = new StringBuffer(bufferSize); ! ! // Create Greeting ! // Wish I could reset these. ! Enumeration f = profileListeners.keys(); ! ! sb.append("<greeting"); ! ! if ((localize != null) ! &&!localize.equals(Constants.LOCALIZE_DEFAULT)) { ! sb.append(" localize='"); ! sb.append(localize); ! sb.append('\''); ! } ! ! if (features != null) { ! sb.append(" features='"); ! sb.append(features); ! sb.append('\''); ! } ! ! sb.append('>'); ! ! while (f.hasMoreElements()) { ! ! // make sure this profile wants to be advertised ! try { ! String profileName = (String) f.nextElement(); ! InternalProfile profile = ! (InternalProfile) profileListeners.get(profileName); ! boolean callAdvertise = false; ! SessionTuningProperties sessionTuning = ! session.getTuningProperties(); ! ! // check the standard tuning settings first ! for (int i = 0; ! i < SessionTuningProperties.STANDARD_PROPERTIES.length; ! i++) { ! ! if ((profile.tuning != null) && (sessionTuning != null) && ! (profile.tuning.getProperty(SessionTuningProperties.STANDARD_PROPERTIES[i]) != null) && ! (sessionTuning.getProperty(SessionTuningProperties.STANDARD_PROPERTIES[i]) != null)) ! { ! callAdvertise = true; ! } } if ((profile.tuning == null) || (callAdvertise && profile.listener.advertiseProfile(session))) { ! sb.append("<profile uri='"); ! sb.append(profileName); ! sb.append("' />"); } ! } catch (BEEPException x) { ! x.printStackTrace(); ! continue; } } ! ! sb.append("</greeting>"); ! ! return StringUtil.stringBufferToAscii(sb); } } --- 217,262 ---- return this.localize; } ! ! public Collection getAdvertisedProfiles(Session session) { ! LinkedList advertise = new LinkedList(); ! ! SessionTuningProperties sessionTuning = ! session.getTuningProperties(); ! ! Set profiles = profileListeners.keySet(); ! ! for (Iterator p = profileListeners.keySet().iterator(); p.hasNext();) { ! String profileUri = (String) p.next(); ! InternalProfile profile = ! (InternalProfile) profileListeners.get(profileUri); ! boolean callAdvertise = false; ! ! // check the standard tuning settings first ! for (int i = 0; ! i < SessionTuningProperties.STANDARD_PROPERTIES.length; ! i++) { ! ! if ((profile.tuning != null) && (sessionTuning != null) && ! (profile.tuning.getProperty(SessionTuningProperties.STANDARD_PROPERTIES[i]) != null) && ! (sessionTuning.getProperty(SessionTuningProperties.STANDARD_PROPERTIES[i]) != null)) ! { ! callAdvertise = true; } + } + try { if ((profile.tuning == null) || (callAdvertise && profile.listener.advertiseProfile(session))) { ! advertise.add(profileUri); } ! } catch (BEEPException e) { continue; } } ! ! return advertise; } } Index: ChannelImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/ChannelImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** ChannelImpl.java 1 Jan 2004 19:12:51 -0000 1.11 --- ChannelImpl.java 25 Feb 2006 17:48:37 -0000 1.12 *************** *** 94,98 **** /** session this channel sends through. */ ! private SessionImpl session; /** message that we are receiving frames */ --- 94,98 ---- /** session this channel sends through. */ ! SessionImpl session; /** message that we are receiving frames */ Index: TuningProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/TuningProfile.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** TuningProfile.java 1 Jan 2004 19:12:51 -0000 1.13 --- TuningProfile.java 25 Feb 2006 17:48:37 -0000 1.14 *************** *** 24,27 **** --- 24,28 ---- import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.beepcore.beep.core.serialize.ErrorElement; /** *************** *** 113,122 **** // If we're here, the profile didn't succesfully send, so // send an error ! BEEPError error = new BEEPError(451, ! "UnknownError" + x.getMessage()); ! session.sendProfile(profile, error.createErrorMessage(), (ChannelImpl)channel); ! abort(error, channel); } } --- 114,126 ---- // If we're here, the profile didn't succesfully send, so // send an error ! ErrorElement error = ! new ErrorElement(451, "UnknownError " + x.getMessage()); ! String errorString = ! ((ChannelImpl)channel).session.parser.createErrorMessage(error); ! session.sendProfile(profile, errorString, (ChannelImpl)channel); ! abort(new BEEPError(error.getCode(), error.getDiagnostic(), error.getXmlLang()), ! channel); } } Index: MessageMSG.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/MessageMSG.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** MessageMSG.java 3 Jun 2003 16:38:35 -0000 1.10 --- MessageMSG.java 25 Feb 2006 17:48:37 -0000 1.11 *************** *** 2,6 **** * MessageMSG.java $Revision$ $Date$ * ! * Copyright (c) 2003 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the --- 2,6 ---- * MessageMSG.java $Revision$ $Date$ * ! * Copyright (c) 2003-2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 74,77 **** --- 74,87 ---- /** + * Sends an ERR reply to this MSG message. + * + * @param stream Payload to be sent. + * + * @see OutputDataStream + * @see MessageStatus + */ + public MessageStatus sendERR(OutputDataStream stream) throws BEEPException; + + /** * Sends a reply of type NUL to this MSG message. This is sent as the * completion to a MSG/ANS/NUL message exchange. Index: PiggybackedMSG.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/PiggybackedMSG.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** PiggybackedMSG.java 31 Dec 2003 17:46:28 -0000 1.3 --- PiggybackedMSG.java 25 Feb 2006 17:48:37 -0000 1.4 *************** *** 2,6 **** * RequestHandler.java $Revision$ $Date$ * ! * Copyright (c) 2003 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the --- 2,6 ---- * RequestHandler.java $Revision$ $Date$ * ! * Copyright (c) 2003-2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 30,33 **** --- 30,35 ---- class PiggybackedMSG extends MessageMSGImpl implements MessageMSG { + private static final int MAX_PCDATA_SIZE = 4096; + PiggybackedMSG(ChannelImpl channel, byte[] data, boolean base64encoding) { *************** *** 74,82 **** SessionImpl s = (SessionImpl)this.channel.getSession(); ByteArrayOutputStream tmp = ! new ByteArrayOutputStream(SessionImpl.MAX_PCDATA_SIZE); String data; while (stream.availableSegment()) { ! BufferSegment b = stream.getNextSegment(SessionImpl.MAX_PCDATA_SIZE); tmp.write(b.getData(), 0, b.getLength()); --- 76,84 ---- SessionImpl s = (SessionImpl)this.channel.getSession(); ByteArrayOutputStream tmp = ! new ByteArrayOutputStream(MAX_PCDATA_SIZE); String data; while (stream.availableSegment()) { ! BufferSegment b = stream.getNextSegment(MAX_PCDATA_SIZE); tmp.write(b.getData(), 0, b.getLength()); Index: SessionImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/SessionImpl.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** SessionImpl.java 1 Jan 2004 19:12:51 -0000 1.16 --- SessionImpl.java 25 Feb 2006 17:48:37 -0000 1.17 *************** *** 3,7 **** * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2001-2003 Huston Franklin. All rights reserved. * Copyright (c) 2002 Kevin Kress. All rights reserved. * --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2001-2004 Huston Franklin. All rights reserved. * Copyright (c) 2002 Kevin Kress. All rights reserved. * *************** *** 30,42 **** import java.util.List; - import javax.xml.parsers.*; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.w3c.dom.*; - - import org.xml.sax.SAXException; - import sun.misc.BASE64Decoder; --- 30,36 ---- *************** *** 46,49 **** --- 40,46 ---- import org.beepcore.beep.core.event.SessionResetEvent; import org.beepcore.beep.core.event.SessionListener; + + import org.beepcore.beep.core.serialize.*; + import org.beepcore.beep.util.StringUtil; *************** *** 89,93 **** /** @todo check this */ - static final int MAX_PCDATA_SIZE = 4096; private static final int MAX_START_CHANNEL_WAIT = 60000; private static final int MAX_START_CHANNEL_INTERVAL = 100; --- 86,89 ---- *************** *** 104,107 **** --- 100,105 ---- // Instance Data private Log log = LogFactory.getLog(this.getClass()); + + ChannelZeroParser parser = new ChannelZeroParser(); private int state; *************** *** 122,126 **** private boolean overflow; private boolean allowChannelWindowUpdates; - private DocumentBuilder builder; // generic XML parser private String serverName; private boolean sentServerName = false; --- 120,123 ---- *************** *** 157,166 **** this.serverName = serverName; - try { - builder = - DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } catch (ParserConfigurationException e) { - throw new BEEPException("Invalid parser configuration"); - } } --- 154,157 ---- *************** *** 473,512 **** String channelNumber = getNextFreeChannelNumber(); ! // create the message in a buffer and send it ! StringBuffer startBuffer = new StringBuffer(); ! ! startBuffer.append("<start number='"); ! startBuffer.append(channelNumber); ! if (serverName != null && !sentServerName) { ! startBuffer.append("' serverName='"); ! startBuffer.append(serverName); ! } ! startBuffer.append("'>"); ! ! Iterator i = profiles.iterator(); ! ! while (i.hasNext()) { ! StartChannelProfile p = (StartChannelProfile) i.next(); ! ! // @todo maybe we should check these against peerSupportedProfiles ! startBuffer.append("<profile uri='"); ! startBuffer.append(p.uri); ! startBuffer.append("' "); ! ! if (p.data == null) { ! startBuffer.append(" />"); ! } else { ! if (p.base64Encoding) { ! startBuffer.append("encoding='base64' "); ! } ! ! startBuffer.append("><![CDATA["); ! startBuffer.append(p.data); ! startBuffer.append("]]></profile>"); ! } } ! ! startBuffer.append("</start>"); ! // @todo handle the data element // Create a channel --- 464,476 ---- String channelNumber = getNextFreeChannelNumber(); ! StartElement start; ! ! if (sentServerName) { ! start = new StartElement(Integer.parseInt(channelNumber), profiles); ! } else { ! start = new StartElement(Integer.parseInt(channelNumber), ! serverName, profiles); } ! // @todo handle the data element // Create a channel *************** *** 517,521 **** OutputDataStream ds = new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! StringUtil.stringBufferToAscii(startBuffer)); if (tuning) { --- 481,485 ---- OutputDataStream ds = new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! parser.serializeStart(start)); if (tuning) { *************** *** 898,919 **** throws BEEPException { ! ! // Send the profile ! StringBuffer sb = new StringBuffer(); ! ! sb.append("<profile uri='"); ! sb.append(uri); ! ! if (datum != null) { ! sb.append("'><![CDATA["); ! sb.append(datum); ! sb.append("]]></profile>"); ! } else { ! sb.append("' />"); ! } OutputDataStream ds = new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! StringUtil.stringBufferToAscii(sb)); // Store the Channel --- 862,870 ---- throws BEEPException { ! ProfileElement p = new ProfileElement(uri, false, datum); OutputDataStream ds = new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! parser.serializeProfile(p)); // Store the Channel *************** *** 1005,1010 **** * @throws BEEPException */ ! private void receiveCloseChannel(String channelNumber, String code, ! String xmlLang, String data) throws BEEPError { --- 956,961 ---- * @throws BEEPException */ ! private void receiveCloseChannel(String channelNumber, int code, ! String xmlLang, String diagnostic) throws BEEPError { *************** *** 1205,1213 **** while (i.hasNext()) { ! StartChannelProfile p = (StartChannelProfile) i.next(); scl = profileRegistry.getStartChannelListener(this.tuningProperties, ! p.uri); if (scl == null) { --- 1156,1164 ---- while (i.hasNext()) { ! ProfileElement p = (ProfileElement) i.next(); scl = profileRegistry.getStartChannelListener(this.tuningProperties, ! p.getUri()); if (scl == null) { *************** *** 1215,1224 **** } ! ch = new ChannelImpl(p.uri, channelNumber, this); try { ! String encoding = p.base64Encoding ? "base64" : "none"; ! scl.startChannel(ch, encoding, p.data); } catch (StartChannelException e) { this.enableIO(); --- 1166,1175 ---- } ! ch = new ChannelImpl(p.getUri(), channelNumber, this); try { ! String encoding = p.getBase64Encoding() ? "base64" : "none"; ! scl.startChannel(ch, encoding, p.getData()); } catch (StartChannelException e) { this.enableIO(); *************** *** 1233,1241 **** } ! if (p.data != null && ch.getStartData() == null) { byte[] data; ! if (p.base64Encoding) { try { ! data = new BASE64Decoder().decodeBuffer(p.data); } catch (IOException e) { ch.abort(); --- 1184,1192 ---- } ! if (p.getData() != null && ch.getStartData() == null) { byte[] data; ! if (p.getBase64Encoding()) { try { ! data = new BASE64Decoder().decodeBuffer(p.getData()); } catch (IOException e) { ch.abort(); *************** *** 1246,1250 **** } else { try { ! data = p.data.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { terminate("UTF-8 not supported"); --- 1197,1201 ---- } else { try { ! data = p.getData().getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { terminate("UTF-8 not supported"); *************** *** 1254,1258 **** PiggybackedMSG msg = new PiggybackedMSG(ch, data, ! p.base64Encoding); ch.setState(ChannelImpl.STATE_STARTING); --- 1205,1209 ---- PiggybackedMSG msg = new PiggybackedMSG(ch, data, ! p.getBase64Encoding()); ch.setState(ChannelImpl.STATE_STARTING); *************** *** 1267,1271 **** } else { try { ! sendProfile(p.uri, ch.getStartData(), ch); ch.setState(ChannelImpl.STATE_ACTIVE); } catch (BEEPException e) { --- 1218,1222 ---- } else { try { ! sendProfile(p.getUri(), ch.getStartData(), ch); ch.setState(ChannelImpl.STATE_ACTIVE); } catch (BEEPException e) { *************** *** 1277,1281 **** fireChannelStarted(ch); ! if (p.data == null && ch.getState() != ChannelImpl.STATE_TUNING) { this.enableIO(); } --- 1228,1232 ---- fireChannelStarted(ch); ! if (p.getData() == null && ch.getState() != ChannelImpl.STATE_TUNING) { this.enableIO(); } *************** *** 1294,1329 **** } - private Element processMessage(Message message) throws BEEPException - { - - // check the message content type - if (!message.getDataStream().getInputStream().getContentType().equals(MimeHeaders.BEEP_XML_CONTENT_TYPE)) { - throw new BEEPException("Invalid content type for this message"); - } - - // parse the stream - Document doc; - - try { - doc = builder.parse(message.getDataStream().getInputStream()); - } catch (SAXException se) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } catch (IOException ioe) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - if (doc == null) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - Element topElement = doc.getDocumentElement(); - - if (topElement == null) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - return topElement; - } - private void sendGreeting() throws BEEPException { --- 1245,1248 ---- *************** *** 1331,1338 **** // get the greeting from the session ! byte[] greeting = SessionImpl.this.getProfileRegistry().getGreeting(this); ByteOutputDataStream f = new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! greeting); MessageMSG m = new MessageMSGImpl(this.zero, 0, null); --- 1250,1260 ---- // get the greeting from the session ! Collection profiles = getProfileRegistry().getAdvertisedProfiles(this); ! GreetingElement greeting = ! new GreetingElement(null, getProfileRegistry().getLocalization(), ! profiles); ByteOutputDataStream f = new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! parser.serializeGreeting(greeting)); MessageMSG m = new MessageMSGImpl(this.zero, 0, null); *************** *** 1358,1487 **** public void processMSG(MessageMSG message) throws BEEPError { ! Element topElement; try { ! topElement = processMessage(message); ! } catch (BEEPException e) { ! throw new BEEPError(BEEPError.CODE_GENERAL_SYNTAX_ERROR, ! ERR_MALFORMED_XML_MSG); ! } ! ! String elementName = topElement.getTagName(); ! ! if (elementName == null) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! ERR_MALFORMED_XML_MSG); } ! ! // is this MSG a <start> ! if (elementName.equals("start")) { ! log.debug("Received a start channel request"); ! ! String channelNumber = topElement.getAttribute("number"); ! ! if (channelNumber == null) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "Malformed <start>: no channel number"); ! } ! ! // this attribute is implied ! String serverName = topElement.getAttribute("serverName"); ! NodeList profiles = ! topElement.getElementsByTagName("profile"); ! ! if (profiles == null) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "Malformed <start>: no profiles"); ! } ! ! LinkedList profileList = new LinkedList(); ! ! for (int i = 0; i < profiles.getLength(); i++) { ! Element profile = (Element) profiles.item(i); ! String uri = profile.getAttribute("uri"); ! ! if (uri == null) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "no profiles in start"); ! } ! ! String encoding = profile.getAttribute("encoding"); ! boolean b64; ! ! if ((encoding == null) || encoding.equals("")) { ! b64 = false; ! } else if (encoding.equalsIgnoreCase("base64")) { ! b64 = true; ! } else if (encoding.equalsIgnoreCase("none")) { ! b64 = false; ! } else { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "unkown encoding in start"); ! } ! ! String data = null; ! Node dataNode = profile.getFirstChild(); ! ! if (dataNode != null) { ! data = dataNode.getNodeValue(); ! ! if (data.length() > MAX_PCDATA_SIZE) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "Element's PCDATA exceeds " + ! "the maximum size"); ! } ! } ! ! profileList.add(new StartChannelProfile(uri, b64, data)); ! } ! SessionImpl.this.zero.setAppData(message); ! SessionImpl.this.processStartChannel(channelNumber, profileList); ! } ! ! // is this MSG a <close> ! else if (elementName.equals("close")) { ! log.debug("Received a channel close request"); ! ! try { ! String channelNumber = topElement.getAttribute("number"); ! ! if (channelNumber == null) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "Malformed <close>: no channel number"); ! } ! ! String code = topElement.getAttribute("code"); ! ! if (code == null) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "Malformed <close>: no code attribute"); ! } ! ! // this attribute is implied ! String xmlLang = topElement.getAttribute("xml:lang"); ! String data = null; ! Node dataNode = topElement.getFirstChild(); ! ! if (dataNode != null) { ! data = dataNode.getNodeValue(); ! ! if (data.length() > MAX_PCDATA_SIZE) { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! "Element's PCDATA exceeds " + ! "the maximum size"); ! } ! } ! SessionImpl.this.zero.setAppData(message); ! SessionImpl.this.receiveCloseChannel(channelNumber, code, ! xmlLang, data); ! } catch (BEEPError e) { ! enableIO(); ! throw e; ! } ! } else { ! throw new BEEPError(BEEPError.CODE_PARAMETER_ERROR, ! ERR_UNKNOWN_OPERATION_ELEMENT_MSG); } } --- 1280,1304 ---- public void processMSG(MessageMSG message) throws BEEPError { ! ChannelIndication indication; try { ! indication = parser.parseIndication(message.getDataStream()); ! } catch (BEEPError e) { ! enableIO(); ! throw e; } ! ! if (indication.getType() == ChannelIndication.START) { ! StartElement start = (StartElement)indication; SessionImpl.this.zero.setAppData(message); ! SessionImpl.this.processStartChannel(Integer.toString(start.getChannelNumber()), ! start.getProfiles()); } else { ! CloseElement close = (CloseElement)indication; ! SessionImpl.this.zero.setAppData(message); ! SessionImpl.this.receiveCloseChannel(Integer.toString(close.getChannelNumber()), ! close.getCode(), ! close.getXmlLang(), ! close.getDiagnostic()); } } *************** *** 1492,1560 **** public void receiveRPY(Message message) { ! try { ! Element topElement = processMessage(message); ! ! // is this RPY a <greeting> ! String elementName = topElement.getTagName(); ! ! if (elementName == null) { ! throw new BEEPException(ERR_MALFORMED_XML_MSG); ! } else if (!elementName.equals("greeting")) { ! throw new BEEPException(ERR_UNKNOWN_OPERATION_ELEMENT_MSG); ! } ! log.debug("Received a greeting"); ! ! // this attribute is implied ! String features = topElement.getAttribute("features"); ! ! // This attribute has a default value ! String localize = topElement.getAttribute("localize"); ! ! if (localize == null) { ! localize = Constants.LOCALIZE_DEFAULT; ! } ! ! // Read the profiles - note, the greeting is valid ! // with 0 profiles ! NodeList profiles = ! topElement.getElementsByTagName("profile"); ! ! if (profiles.getLength() > 0) { ! LinkedList profileList = new LinkedList(); ! ! for (int i = 0; i < profiles.getLength(); i++) { ! Element profile = (Element) profiles.item(i); ! String uri = profile.getAttribute("uri"); ! ! if (uri == null) { ! throw new BEEPException("Malformed profile"); ! } ! ! String encoding = profile.getAttribute("encoding"); ! ! // encoding is not allowed in greetings ! if (encoding != null) { ! ! // @todo check this ! // terminate("Invalid attribute 'encoding' in greeting."); ! // return; ! } ! ! profileList.add(i, uri); ! } ! SessionImpl.this.peerSupportedProfiles = ! Collections.unmodifiableCollection(profileList); ! } changeState(Session.SESSION_STATE_ACTIVE); - - synchronized (this) { - this.notifyAll(); - } } catch (BEEPException e) { terminate("Problem with RPY: " + e.getMessage()); } } --- 1309,1328 ---- public void receiveRPY(Message message) { ! log.debug("Received a greeting"); ! try { ! GreetingElement greeting = ! parser.parseGreetingConfirmation(message.getDataStream()); ! SessionImpl.this.peerSupportedProfiles = greeting.getProfiles(); changeState(Session.SESSION_STATE_ACTIVE); } catch (BEEPException e) { terminate("Problem with RPY: " + e.getMessage()); } + + synchronized (this) { + this.notifyAll(); + } } *************** *** 1596,1663 **** public void receiveRPY(Message message) { try { ! Element topElement = processMessage(message); ! // is this RPY a <greeting> ! String elementName = topElement.getTagName(); ! if (elementName == null) { ! throw new BEEPException(ERR_MALFORMED_XML_MSG); ! // is this RPY a <profile> ! } else if (elementName.equals("profile")) { ! try { ! String uri = topElement.getAttribute("uri"); ! if (uri == null) { ! throw new BEEPException("Malformed profile"); ! } ! ! String encoding = ! topElement.getAttribute("encoding"); ! ! if (encoding == null) { ! encoding = Constants.ENCODING_NONE; ! } ! ! // see if there is data and then turn it into a message ! Node dataNode = topElement.getFirstChild(); ! String data = null; ! ! if (dataNode != null) { ! data = dataNode.getNodeValue(); ! ! if (data.length() > MAX_PCDATA_SIZE) { ! throw new BEEPException("Element's PCDATA " + ! "exceeds the " + ! "maximum size"); ! } ! } ! ! channel.setEncoding(encoding); ! channel.setProfile(uri); ! channel.setStartData(data); ! ! // set the state ! channel.setState(ChannelImpl.STATE_ACTIVE); ! channels.put(channel.getNumberAsString(), channel); ! ! /** ! * @todo something with data ! */ ! ! // release the block waiting for the channel ! // to start or close ! synchronized (this) { ! this.notify(); ! } ! } catch (Exception x) { ! throw new BEEPException(x); ! } ! } else { ! throw new BEEPException(ERR_UNKNOWN_OPERATION_ELEMENT_MSG); ! } ! } catch (BEEPException e) { ! terminate("Problem with RPY: " + e.getMessage()); } } --- 1364,1392 ---- public void receiveRPY(Message message) { + ProfileElement profile; try { ! profile = ! parser.parseStartConfirmation(message.getDataStream()); ! } catch (BEEPException e) { ! terminate("Problem with RPY: " + e.getMessage()); ! return; ! } ! channel.setEncoding(profile.getBase64Encoding() ? "base64" : "none"); ! channel.setProfile(profile.getUri()); ! channel.setStartData(profile.getData()); ! // set the state ! channel.setState(ChannelImpl.STATE_ACTIVE); ! channels.put(channel.getNumberAsString(), channel); ! /** ! * @todo something with data ! */ ! // release the block waiting for the channel ! // to start or close ! synchronized (this) { ! this.notify(); } } *************** *** 1668,1672 **** try { ! err = BEEPError.convertMessageERRToException(message); } catch (BEEPException e) { terminate(e.getMessage()); --- 1397,1404 ---- try { ! ErrorElement error = parser.parseError(message.getDataStream()); ! ! err = new BEEPError(error.getCode(), error.getDiagnostic(), ! error.getXmlLang()); } catch (BEEPException e) { terminate(e.getMessage()); *************** *** 1722,1753 **** { try { ! Element topElement = processMessage(message); ! String elementName = topElement.getTagName(); ! ! if (elementName == null) { ! throw new BEEPException(ERR_MALFORMED_XML_MSG); ! ! // is this RPY an <ok> (the positive response to a ! // channel close) ! } else if (elementName.equals("ok")) { log.debug("Received an OK for channel close"); - - // @todo we should fire an event instead. - // set the state - channel.setState(ChannelImpl.STATE_CLOSING); - channels.remove(channel.getNumberAsString()); - channel.setState(ChannelImpl.STATE_CLOSED); - - // release the block waiting for the channel to - // start or close - synchronized (this) { - this.notify(); - } - } else { - throw new BEEPException(ERR_UNKNOWN_OPERATION_ELEMENT_MSG); - } } catch (BEEPException e) { terminate("Problem with RPY: " + e.getMessage()); } } --- 1454,1474 ---- { try { ! parser.parseCloseConfirmation(message.getDataStream()); log.debug("Received an OK for channel close"); } catch (BEEPException e) { terminate("Problem with RPY: " + e.getMessage()); } + + // @todo we should fire an event instead. + // set the state + channel.setState(ChannelImpl.STATE_CLOSING); + channels.remove(channel.getNumberAsString()); + channel.setState(ChannelImpl.STATE_CLOSED); + + // release the block waiting for the channel to + // start or close + synchronized (this) { + this.notify(); + } } *************** *** 1757,1761 **** try { ! err = BEEPError.convertMessageERRToException(message); } catch (BEEPException e) { terminate(e.getMessage()); --- 1478,1485 ---- try { ! ErrorElement error = parser.parseError(message.getDataStream()); ! ! err = new BEEPError(error.getCode(), error.getDiagnostic(), ! error.getXmlLang()); } catch (BEEPException e) { terminate(e.getMessage()); Index: StartChannelProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/StartChannelProfile.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** StartChannelProfile.java 8 Nov 2001 05:51:34 -0000 1.2 --- StartChannelProfile.java 25 Feb 2006 17:48:37 -0000 1.3 *************** *** 2,6 **** * StartChannelProfile.java $Revision$ $Date$ * ! * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the --- 2,6 ---- * StartChannelProfile.java $Revision$ $Date$ * ! * Copyright (c) 2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 17,37 **** package org.beepcore.beep.core; /** * Class StartChannelProfile * ! * ! * @author Eric Dixon ! * @author Huston Franklin ! * @author Jay Kint ! * @author Scott Pead * @version $Revision$, $Date$ */ ! public class StartChannelProfile { ! ! String uri; ! boolean base64Encoding; ! String data; ! /** * Constructor StartChannelProfile --- 17,30 ---- package org.beepcore.beep.core; + import org.beepcore.beep.core.serialize.ProfileElement; + /** * Class StartChannelProfile * ! * @deprecated Use org.beepcore.beep.core.serialize.ProfileElement instead. * @version $Revision$, $Date$ */ ! public class StartChannelProfile extends ProfileElement { /** * Constructor StartChannelProfile *************** *** 46,52 **** String data) { ! this.uri = uri; ! this.base64Encoding = base64Encoding; ! this.data = data; } --- 39,43 ---- String data) { ! super(uri, base64Encoding, data); } *************** *** 60,66 **** public StartChannelProfile(String uri) { ! this.uri = uri; ! this.base64Encoding = false; ! this.data = null; } } --- 51,55 ---- public StartChannelProfile(String uri) { ! super(uri); } } Index: BEEPError.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/BEEPError.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** BEEPError.java 18 Nov 2003 14:03:07 -0000 1.9 --- BEEPError.java 25 Feb 2006 17:48:37 -0000 1.10 *************** *** 3,7 **** * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2002 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2002,2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 19,31 **** - import java.io.IOException; - - import javax.xml.parsers.*; - - import org.w3c.dom.*; - - import org.xml.sax.SAXException; - - /** * Class BEEPError --- 19,22 ---- *************** *** 132,262 **** } - /** - * Method createErrorMessage - * - * - * @return the XML error element that can be sent in a BEEP ERR message - * - */ - public String createErrorMessage() - { - return createErrorMessage(this.code, this.getMessage(), this.xmlLang); - } - - /** - * Creates a <code>String</code> for an error element that can be sent - * in a BEEP ERR message. - * - * @param code Error code. - * @param diagnostic Error diagnostic. - */ - public static String createErrorMessage(int code, String diagnostic) - { - return createErrorMessage(code, diagnostic, null); - } - - /** - * Creates a <code>String</code> for an error element that can be sent - * in a BEEP ERR message. - * - * @param code Error code. - * @param diagnostic Error diagnostic. - * @param xmlLang Language of the diagnostic message. - */ - public static String createErrorMessage(int code, String diagnostic, - String xmlLang) - { - StringBuffer sb = new StringBuffer(128); - - sb.append("<error code='"); - sb.append(code); - - if (xmlLang != null) { - sb.append("' xml:lang='"); - sb.append(xmlLang); - } - - if (diagnostic != null) { - sb.append("' >"); - sb.append(diagnostic); - sb.append("</error>"); - } else { - sb.append("' />"); - } - - return sb.toString(); - } - - /** - * Method convertMessageERRToException - * - * - * @param message - * - * @return New <code>BEEPError</code> for the specified BEEP ERR message - * - * @throws BEEPException - * - */ - protected static BEEPError convertMessageERRToException(Message message) - throws BEEPException - { - if (message.getMessageType() != Message.MESSAGE_TYPE_ERR) { - throw new IllegalArgumentException("messageType != ERR"); - } - - // parse the stream - Document doc = null; - - try { - DocumentBuilder builder = - DocumentBuilderFactory.newInstance().newDocumentBuilder(); - - doc = builder.parse(message.getDataStream().getInputStream()); - } catch (ParserConfigurationException e) { - throw new BEEPException("Invalid parser configuration"); - } catch (SAXException e) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } catch (IOException ioe) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - if (doc == null) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - Element topElement = doc.getDocumentElement(); - - if (topElement == null) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - // check for <error> - String elementName = topElement.getTagName(); - - if (elementName == null) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } else if (!elementName.equals("error")) { - throw new BEEPException("Unknown operation element"); - } - - String code = topElement.getAttribute("code"); - - if (code == null) { - throw new BEEPException(ERR_MALFORMED_XML_MSG); - } - - // this attribute is implied - String xmlLang = topElement.getAttribute("xml:lang"); - Node dataNode = topElement.getFirstChild(); - String data = null; - - if (dataNode != null) { - data = dataNode.getNodeValue(); - } - - return new BEEPError(Integer.parseInt(code), data, xmlLang); - } - /** Success */ public static final int CODE_SUCCESS = 200; --- 123,126 ---- Index: MessageMSGImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/MessageMSGImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MessageMSGImpl.java 3 Jun 2003 16:38:35 -0000 1.1 --- MessageMSGImpl.java 25 Feb 2006 17:48:37 -0000 1.2 *************** *** 3,7 **** * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2003 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. ! * Copyright (c) 2003-2004 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 18,21 **** --- 18,23 ---- package org.beepcore.beep.core; + import org.beepcore.beep.core.serialize.ErrorElement; + /** * Represents received BEEP MSG messages. Provides methods to reply to *************** *** 79,84 **** public MessageStatus sendERR(BEEPError error) throws BEEPException { OutputDataStream stream = ! new StringOutputDataStream(error.createErrorMessage()); MessageStatus m = new MessageStatus(this.channel, Message.MESSAGE_TYPE_ERR, --- 81,89 ---- public MessageStatus sendERR(BEEPError error) throws BEEPException { + byte[] errorString = + channel.session.parser.serializeError(new ErrorElement(error.getCode(), + error.getXMLLang(), error.getDiagnostic())); OutputDataStream stream = ! new ByteOutputDataStream(errorString); MessageStatus m = new MessageStatus(this.channel, Message.MESSAGE_TYPE_ERR, *************** *** 103,111 **** throws BEEPException { ! String error = BEEPError.createErrorMessage(code, diagnostic); MessageStatus m = new MessageStatus(this.channel, Message.MESSAGE_TYPE_ERR, this.msgno, ! new StringOutputDataStream(error)); this.channel.sendMessage(m); return m; --- 108,117 ---- throws BEEPException { ! ErrorElement error = new ErrorElement(code, diagnostic); ! byte[] errorString = channel.session.parser.serializeError(error); MessageStatus m = new MessageStatus(this.channel, Message.MESSAGE_TYPE_ERR, this.msgno, ! new ByteOutputDataStream(errorString)); this.channel.sendMessage(m); return m; *************** *** 129,137 **** throws BEEPException { ! String error = BEEPError.createErrorMessage(code, diagnostic, xmlLang); MessageStatus m = new MessageStatus(this.channel, Message.MESSAGE_TYPE_ERR, this.msgno, ! new StringOutputDataStream(error)); this.channel.sendMessage(m); return m; --- 135,154 ---- throws BEEPException { ! ErrorElement error = new ErrorElement(code, xmlLang, diagnostic); ! byte[] errorString = channel.session.parser.serializeError(error); ! MessageStatus m = new MessageStatus(this.channel, ! Message.MESSAGE_TYPE_ERR, ! this.msgno, ! new ByteOutputDataStream(errorString)); ! this.channel.sendMessage(m); ! return m; ! } ! ! public MessageStatus sendERR(OutputDataStream stream) throws BEEPException ! { MessageStatus m = new MessageStatus(this.channel, Message.MESSAGE_TYPE_ERR, this.msgno, ! stream); this.channel.sendMessage(m); return m; |
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv21592/src/org/beepcore/beep/core Modified Files: Channel.java ChannelImpl.java Session.java TuningProfile.java SessionImpl.java Removed Files: MessageListener.java Log Message: Removed MessageListener Index: Channel.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Channel.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** Channel.java 7 Nov 2003 17:39:21 -0000 1.34 --- Channel.java 1 Jan 2004 19:12:51 -0000 1.35 *************** *** 66,84 **** /** - * Sets the <code>MessageListener</code> for this channel. - * - * @param listener - * @return The previous MessageListener or null if none was set. - * @deprecated - */ - public MessageListener setMessageListener(MessageListener listener); - - /** - * Returns the message listener for this channel. - * @deprecated - */ - public MessageListener getMessageListener(); - - /** * Returns the <code>RequestHandler</code> registered with this channel. */ --- 66,69 ---- Index: ChannelImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/ChannelImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** ChannelImpl.java 7 Nov 2003 17:39:21 -0000 1.10 --- ChannelImpl.java 1 Jan 2004 19:12:51 -0000 1.11 *************** *** 278,308 **** /** - * Sets the <code>MessageListener</code> for this channel. - * - * @param ml - * @return The previous MessageListener or null if none was set. - */ - public MessageListener setMessageListener(MessageListener ml) - { - MessageListener tmp = getMessageListener(); - - this.handler = new MessageListenerAdapter(ml); - - return tmp; - } - - /** - * Returns the message listener for this channel. - */ - public MessageListener getMessageListener() - { - if (!(this.handler instanceof MessageListenerAdapter)) { - return null; - } - - return ((MessageListenerAdapter)this.handler).getMessageListener(); - } - - /** * Returns the <code>RequestHandler</code> registered with this channel. */ --- 278,281 ---- *************** *** 1119,1153 **** } - static class MessageListenerAdapter implements RequestHandler { - MessageListenerAdapter(MessageListener listener) { - this.listener = listener; - } - - public void receiveMSG(MessageMSG message) { - try { - listener.receiveMSG(message); - } catch (BEEPError e) { - try { - message.sendERR(e); - } catch (BEEPException e2) { - log.error("Error sending ERR", e2); - } - } catch (AbortChannelException e) { - try { - message.getChannel().close(); - } catch (BEEPException e2) { - log.error("Error closing channel", e2); - } - } - } - - public MessageListener getMessageListener() { - return this.listener; - } - - private Log log = LogFactory.getLog(this.getClass()); - private MessageListener listener; - } - private static class DefaultMSGHandler implements RequestHandler { public void receiveMSG(MessageMSG message) { --- 1092,1095 ---- *************** *** 1164,1168 **** private Log log = LogFactory.getLog(this.getClass()); - private MessageListener listener; } } --- 1106,1109 ---- Index: Session.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Session.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** Session.java 18 Nov 2003 14:03:07 -0000 1.37 --- Session.java 1 Jan 2004 19:12:51 -0000 1.38 *************** *** 149,174 **** * Sends a request to start a new Channel on this Session for the * specified profile. This version of <code>startChannel</code> allows a - * <code>MessageListener</code> to be specified to be registered once the - * Channel is started. This is useful for profiles that are peer-to-peer in - * nature. - * - * @param profile The URI of the profile for the new Channel. - * @param listener A <code>MessageListener</code> to receive MSG messages - * sent by the remote peer of this Session. - * - * @throws BEEPError Thrown if the remote peer is unable or refuses to - * start a new Channel for the requested profile. - * @throws BEEPException Thrown for errors other than those defined by - * the BEEP protocol (e.g. the Session is not in a - * state to create a new Channel). - * @see MessageListener - * @deprecated - */ - public Channel startChannel(String profile, MessageListener listener) - throws BEEPException, BEEPError; - - /** - * Sends a request to start a new Channel on this Session for the - * specified profile. This version of <code>startChannel</code> allows a * <code>RequestHandler</code> to be specified to be registered once the * Channel is started. This is useful for profiles that are peer-to-peer in --- 149,152 ---- *************** *** 217,249 **** * Sends a request to start a new Channel on this Session for the * specified profile. This version of <code>startChannel</code> allows a - * <code>MessageListener</code> to be specified to be registered once the - * Channel is started. This is useful for profiles that are peer-to-peer in - * nature. - * - * @param profile The URI of the profile for the new Channel. - * @param base64Encoding Indicates whether or not <code>data</code> is - * base64 encoded. <code>data</code> must be base64 - * encoded if it is not valid XML CDATA. - * @param data An initial request to be sent piggyback'd along with the - * request to start the Channel. This request can be at most - * 4K in size. - * @param listener A <code>MessageListener</code> to receive MSG messages - * sent by the remote peer of this Session. - * - * @throws BEEPError Thrown if the remote peer is unable or refuses to - * start a new Channel for the requested profile. - * @throws BEEPException Thrown for errors other than those defined by - * the BEEP protocol (e.g. the Session is not in a - * state to create a new Channel). - * @see MessageListener - * @deprecated - */ - public Channel startChannel(String profile, boolean base64Encoding, - String data, MessageListener listener) - throws BEEPException, BEEPError; - - /** - * Sends a request to start a new Channel on this Session for the - * specified profile. This version of <code>startChannel</code> allows a * <code>RequestHandler</code> to be specified to be registered once the * Channel is started. --- 195,198 ---- *************** *** 261,283 **** public Channel startChannel(StartChannelProfile profile, RequestHandler handler) throws BEEPException, BEEPError; - - /** - * Sends a start channel request using the given list of profiles. - * - * @param profiles A collection of <code>StartChannelProfile</code>(s). - * @param listener A <code>MessageListener</code> to receive MSG messages - * sent by the remote peer of this Session. - * - * @throws BEEPError Thrown if the remote peer is unable or refuses to - * start a new Channel for the requested profile. - * @throws BEEPException Thrown for errors other than those defined by - * the BEEP protocol (e.g. the Session is not in a - * state to create a new Channel). - * @see StartChannelProfile - * @see MessageListener - * @deprecated - */ - public Channel startChannel(Collection profiles, MessageListener listener) - throws BEEPException, BEEPError; /** --- 210,213 ---- Index: TuningProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/TuningProfile.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** TuningProfile.java 18 Nov 2003 14:03:08 -0000 1.12 --- TuningProfile.java 1 Jan 2004 19:12:51 -0000 1.13 *************** *** 248,252 **** public Channel startChannel(Session session, String profile, boolean base64Encoding, String data, ! MessageListener listener) throws BEEPException, BEEPError { --- 248,252 ---- public Channel startChannel(Session session, String profile, boolean base64Encoding, String data, ! RequestHandler handler) throws BEEPException, BEEPError { *************** *** 257,261 **** l.add(p); ! return ((SessionImpl)session).startChannelRequest(l, listener, true); } } --- 257,261 ---- l.add(p); ! return ((SessionImpl)session).startChannelRequest(l, handler, true); } } Index: SessionImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/SessionImpl.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** SessionImpl.java 1 Jan 2004 16:45:56 -0000 1.15 --- SessionImpl.java 1 Jan 2004 19:12:51 -0000 1.16 *************** *** 178,182 **** zero = ChannelImpl.createChannelZero(this, greetingListener, ! new ChannelImpl.MessageListenerAdapter(new ChannelZeroListener())); channels.put(CHANNEL_ZERO, zero); --- 178,182 ---- zero = ChannelImpl.createChannelZero(this, greetingListener, ! new ChannelZeroListener()); channels.put(CHANNEL_ZERO, zero); *************** *** 229,233 **** zero = ChannelImpl.createChannelZero(this, greetingListener, ! new ChannelImpl.MessageListenerAdapter(new ChannelZeroListener())); channels.put(CHANNEL_ZERO, zero); --- 229,233 ---- zero = ChannelImpl.createChannelZero(this, greetingListener, ! new ChannelZeroListener()); channels.put(CHANNEL_ZERO, zero); *************** *** 430,444 **** } - public Channel startChannel(String profile, MessageListener listener) - throws BEEPException, BEEPError - { - StartChannelProfile p = new StartChannelProfile(profile); - LinkedList l = new LinkedList(); - - l.add(p); - - return startChannelRequest(l, listener, false); - } - public Channel startChannel(String profile, RequestHandler handler) throws BEEPException, BEEPError --- 430,433 ---- *************** *** 461,477 **** } - public Channel startChannel(String profile, boolean base64Encoding, - String data, MessageListener listener) - throws BEEPException, BEEPError - { - StartChannelProfile p = new StartChannelProfile(profile, - base64Encoding, data); - LinkedList l = new LinkedList(); - - l.add(p); - - return startChannelRequest(l, listener, false); - } - public Channel startChannel(StartChannelProfile profile, RequestHandler handler) throws BEEPException, BEEPError --- 450,453 ---- *************** *** 484,502 **** } - public Channel startChannel(Collection profiles, MessageListener listener) - throws BEEPException, BEEPError - { - return startChannelRequest(profiles, listener, false); - } - - Channel startChannelRequest(Collection profiles, MessageListener listener, - boolean tuning) - throws BEEPException, BEEPError - { - return startChannelRequest(profiles, - listener == null ? null : new ChannelImpl.MessageListenerAdapter(listener), - tuning); - } - public Channel startChannel(Collection profiles, RequestHandler handler) throws BEEPException, BEEPError --- 460,463 ---- *************** *** 1381,1388 **** } ! private class ChannelZeroListener implements MessageListener { ! public void receiveMSG(Message message) ! throws BEEPError, AbortChannelException { Element topElement; --- 1342,1360 ---- } ! private class ChannelZeroListener implements RequestHandler { ! ! public void receiveMSG(MessageMSG message) { ! try { ! processMSG(message); ! } catch (BEEPError e) { ! try { ! message.sendERR(e); ! } catch (BEEPException e2) { ! log.error("Error sending ERR", e2); ! } ! } ! } ! public void processMSG(MessageMSG message) throws BEEPError { Element topElement; --- MessageListener.java DELETED --- |
From: Huston F. <hu...@us...> - 2004-01-01 16:46:01
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv29092/src/org/beepcore/beep/core Modified Files: SessionImpl.java Removed Files: TuningResetException.java Log Message: Removed TuningResetException Index: SessionImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/SessionImpl.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** SessionImpl.java 19 Nov 2003 17:30:06 -0000 1.14 --- SessionImpl.java 1 Jan 2004 16:45:56 -0000 1.15 *************** *** 1260,1269 **** scl.startChannel(ch, encoding, p.data); - } catch (TuningResetException e) { - log.debug("Leaving profile response to Tuning Profile CCL"); - - fireChannelStarted(ch); - - return; } catch (StartChannelException e) { this.enableIO(); --- 1260,1263 ---- --- TuningResetException.java DELETED --- |
From: Huston F. <hu...@us...> - 2004-01-01 16:40:43
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv28221/src/org/beepcore/beep/core Modified Files: Message.java MessageImpl.java Log Message: Removed deprecated methods Index: Message.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Message.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Message.java 31 Dec 2003 17:46:28 -0000 1.13 --- Message.java 1 Jan 2004 16:40:38 -0000 1.14 *************** *** 88,122 **** */ public int getMessageType(); - - /** - * @deprecated use method on MessageMSG instead. - */ - public MessageStatus sendANS(OutputDataStream stream) throws BEEPException; - - /** - * @deprecated use method on MessageMSG instead. - */ - public MessageStatus sendERR(BEEPError error) throws BEEPException; - - /** - * @deprecated use method on MessageMSG instead. - */ - public MessageStatus sendERR(int code, String diagnostic) - throws BEEPException; - - /** - * @deprecated use method on MessageMSG instead. - */ - public MessageStatus sendERR(int code, String diagnostic, String xmlLang) - throws BEEPException; - - /** - * @deprecated use method on MessageMSG instead. - */ - public MessageStatus sendNUL() throws BEEPException; - - /** - * @deprecated use method on MessageMSG instead. - */ - public MessageStatus sendRPY(OutputDataStream stream) throws BEEPException; } --- 88,90 ---- Index: MessageImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/MessageImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MessageImpl.java 3 Jun 2003 16:38:35 -0000 1.1 --- MessageImpl.java 1 Jan 2004 16:40:38 -0000 1.2 *************** *** 177,291 **** } - /** - * Sends a message of type ANS. - * - * @param stream Data to send in the form of <code>OutputDataStream</code>. - * - * @see OutputDataStream - * @see MessageStatus - * @see #sendNUL - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered or if messageType is - * not MESSAGE_TYPE_MSG. - */ - public MessageStatus sendANS(OutputDataStream stream) throws BEEPException - { - throw new BEEPException(NOT_MESSAGE_TYPE_MSG); - } - - /** - * Sends a message of type ERR. - * - * @param error Error to send in the form of <code>BEEPError</code>. - * - * @see BEEPError - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered or if messageType is - * not MESSAGE_TYPE_MSG. - */ - public MessageStatus sendERR(BEEPError error) throws BEEPException - { - throw new BEEPException(NOT_MESSAGE_TYPE_MSG); - } - - /** - * Sends a message of type ERR. - * - * @param code <code>code</code> attibute in <code>error</code> element. - * @param diagnostic Message for <code>error</code> element. - * - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered or if messageType is - * not MESSAGE_TYPE_MSG. - */ - public MessageStatus sendERR(int code, String diagnostic) - throws BEEPException - { - throw new BEEPException(NOT_MESSAGE_TYPE_MSG); - } - - /** - * Sends a message of type ERR. - * - * @param code <code>code</code> attibute in <code>error</code> element. - * @param diagnostic Message for <code>error</code> element. - * @param xmlLang <code>xml:lang</code> attibute in <code>error</code> - * element. - * - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered or if messageType is - * not MESSAGE_TYPE_MSG. - */ - public MessageStatus sendERR(int code, String diagnostic, String xmlLang) - throws BEEPException - { - throw new BEEPException(NOT_MESSAGE_TYPE_MSG); - } - - /** - * Sends a message of type NUL. - * - * @see MessageStatus - * @see #sendANS - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered or if messageType is - * not MESSAGE_TYPE_MSG. - */ - public MessageStatus sendNUL() throws BEEPException - { - throw new BEEPException(NOT_MESSAGE_TYPE_MSG); - } - - /** - * Sends a message of type RPY. - * - * @param stream Data to send in the form of <code>OutputDataStream</code>. - * - * @see OutputDataStream - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered or if messageType is - * not MESSAGE_TYPE_MSG. - */ - public MessageStatus sendRPY(OutputDataStream stream) throws BEEPException - { - throw new BEEPException(NOT_MESSAGE_TYPE_MSG); - } - boolean isNotified() { --- 177,180 ---- |
From: Huston F. <hu...@us...> - 2003-12-31 17:46:33
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv32022/src/org/beepcore/beep/core Modified Files: Message.java PiggybackedMSG.java Log Message: Added constant for Piggybacked msgno Index: Message.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Message.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Message.java 3 Jun 2003 16:38:35 -0000 1.12 --- Message.java 31 Dec 2003 17:46:28 -0000 1.13 *************** *** 57,60 **** --- 57,61 ---- public static final int MESSAGE_TYPE_NUL = 5; + public static final int PIGGYBACKED_MSGNO = -1; /** * Returns <code>InputDataStream</code> containing the payload for this Index: PiggybackedMSG.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/PiggybackedMSG.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** PiggybackedMSG.java 15 Sep 2003 15:23:30 -0000 1.2 --- PiggybackedMSG.java 31 Dec 2003 17:46:28 -0000 1.3 *************** *** 32,36 **** PiggybackedMSG(ChannelImpl channel, byte[] data, boolean base64encoding) { ! super(channel, -1, new InputDataStream()); try { this.getDataStream().add(new BufferSegment("\r\n".getBytes("UTF-8"))); --- 32,36 ---- PiggybackedMSG(ChannelImpl channel, byte[] data, boolean base64encoding) { ! super(channel, PIGGYBACKED_MSGNO, new InputDataStream()); try { this.getDataStream().add(new BufferSegment("\r\n".getBytes("UTF-8"))); *************** *** 107,111 **** s.fireChannelStarted(this.channel); ! return new MessageStatus(this.channel, Message.MESSAGE_TYPE_RPY, -1, stream); } --- 107,111 ---- s.fireChannelStarted(this.channel); ! return new MessageStatus(this.channel, Message.MESSAGE_TYPE_RPY, PIGGYBACKED_MSGNO, stream); } |
From: Huston F. <hu...@us...> - 2003-11-20 15:32:52
|
Update of /cvsroot/beepcore-java/beepcore-java In directory sc8-pr-cvs1:/tmp/cvs-serv30032 Modified Files: build.xml Log Message: Added commons-logging to dist Index: build.xml =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** build.xml 15 Nov 2003 18:51:33 -0000 1.26 --- build.xml 20 Nov 2003 15:32:49 -0000 1.27 *************** *** 148,151 **** --- 148,155 ---- basedir="${build.dir}/src"/> + <copy file="${commons-logging.jar}" + tofile="${release.dir}/lib/commons-logging.jar"/> + <copy file="lib/LICENSE.commons-logging" + tofile="${release.dir}/LICENSE.commons-logging"/> <copy file="${concurrent.jar}" tofile="${release.dir}/lib/concurrent.jar"/> |
From: Huston F. <hu...@us...> - 2003-11-19 17:30:09
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv10545/src/org/beepcore/beep/core Modified Files: SessionImpl.java Log Message: Handle trying to close a session after it is already closed Index: SessionImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/SessionImpl.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** SessionImpl.java 18 Nov 2003 14:03:08 -0000 1.13 --- SessionImpl.java 19 Nov 2003 17:30:06 -0000 1.14 *************** *** 1980,1984 **** public void changeState(SessionImpl s, int newState) throws BEEPException { if (newState == Session.SESSION_STATE_ABORTED) { ! log.equals("Error aborting, session already in a closed state."); } else { throw new BEEPException("Illegal session state transition (" + --- 1980,1986 ---- public void changeState(SessionImpl s, int newState) throws BEEPException { if (newState == Session.SESSION_STATE_ABORTED) { ! log.info("Error aborting, session already in a closed state."); ! } else if (newState == Session.SESSION_STATE_CLOSE_PENDING) { ! log.info("Error changing state to close pending, session already in a closed state."); } else { throw new BEEPException("Illegal session state transition (" + |
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/core Modified Files: BEEPError.java Session.java SessionImpl.java StartChannelListener.java TuningProfile.java TuningResetException.java Log Message: fixed javadoc warnings Index: BEEPError.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/BEEPError.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** BEEPError.java 23 Apr 2003 15:23:04 -0000 1.8 --- BEEPError.java 18 Nov 2003 14:03:07 -0000 1.9 *************** *** 150,154 **** * @param code Error code. * @param diagnostic Error diagnostic. - * @param xmlLang Language of the diagnostic message. */ public static String createErrorMessage(int code, String diagnostic) --- 150,153 ---- Index: Session.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Session.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** Session.java 10 Jun 2003 18:59:18 -0000 1.36 --- Session.java 18 Nov 2003 14:03:07 -0000 1.37 *************** *** 202,207 **** * request to start the Channel. This request can be at most * 4K in size. - * @param listener A <code>MessageListener</code> to receive MSG messages - * sent by the remote peer of this Session. * * @throws BEEPError Thrown if the remote peer is unable or refuses to --- 202,205 ---- Index: SessionImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/SessionImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** SessionImpl.java 8 Nov 2003 20:58:02 -0000 1.12 --- SessionImpl.java 18 Nov 2003 14:03:08 -0000 1.13 *************** *** 131,141 **** * (to prevent new channel collision) so that the initiator starts odd * channels and the listener starts channels with even numbers. ! * @param The Profile Registry summarizing the profiles this Session will ! * support ! * @param cred ! * ! * @param registry * @param firstChannel used internally in the API, an indication of the * ordinality of the channels this peer can start, odd, or even. */ protected SessionImpl(ProfileRegistry registry, int firstChannel, --- 131,142 ---- * (to prevent new channel collision) so that the initiator starts odd * channels and the listener starts channels with even numbers. ! * @param registry The Profile Registry summarizing the profiles this ! * Session will support * @param firstChannel used internally in the API, an indication of the * ordinality of the channels this peer can start, odd, or even. + * @param localCred + * @param peerCred + * @param tuning + * @param serverName */ protected SessionImpl(ProfileRegistry registry, int firstChannel, *************** *** 651,666 **** * or NUL frames. * - * @param messageType indicates whether a <code>Frame</code> is a MSG, - * RPY, ERR, ANS or NUL. - * @param channelNum Channel on which the <code>Frame</code> was sent. - * @param msgno Message number of the <code>Frame</code>. - * @param seqno Sequence number of the <code>Frame</code>. - * @param payload Payload of the <code>Frame</code>. - * @param last Indicates if this is the last <code>Frame</code> sent in a - * sequence of frames. - * * @return a <code>Frame</code> for the specified values * - * * @throws BEEPException */ --- 652,657 ---- *************** *** 732,738 **** * Method postFrame * - * * @param f - * @param number * * @throws BEEPException --- 723,727 ---- *************** *** 772,776 **** * * ! * @param BEEP frame to send. * * --- 761,765 ---- * * ! * @param f BEEP frame to send. * * *************** *** 834,842 **** * * @param channel - * @param previouslySeq * @param currentSeq ! * @param previouslyUsed ! * @param currentlyUsed ! * @param bufferSize * * @return true if the Receive Buffer Size was updated --- 823,828 ---- * * @param channel * @param currentSeq ! * @param currentAvail * * @return true if the Receive Buffer Size was updated Index: StartChannelListener.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/StartChannelListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** StartChannelListener.java 8 Nov 2001 05:51:34 -0000 1.3 --- StartChannelListener.java 18 Nov 2003 14:03:08 -0000 1.4 *************** *** 41,45 **** * @param session to check other properties such as the credentials of * of the session - * @param tuning properties in effect on the session * @see SessionTuningProperties for standard properties and their values */ --- 41,44 ---- Index: TuningProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/TuningProfile.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** TuningProfile.java 15 Sep 2003 15:23:30 -0000 1.11 --- TuningProfile.java 18 Nov 2003 14:03:08 -0000 1.12 *************** *** 134,143 **** * Method complete * - * - * @param channel - * @param cred - * @param registry - * @param argument - * * @throws BEEPException * --- 134,137 ---- *************** *** 222,230 **** * * - * @param session - * @param cred - * @param registry - * @param argument - * * @throws BEEPException * --- 216,219 ---- *************** *** 238,242 **** throws BEEPException { ! return ((SessionImpl)session).reset(localCred, peerCred, tuning, registry, argument); } --- 227,232 ---- throws BEEPException { ! return ((SessionImpl)session).reset(localCred, peerCred, tuning, ! registry, argument); } *************** *** 244,252 **** * Method sendProfile * - * - * @param session - * @param uri - * @param data - * @param channel * * @throws BEEPException --- 234,237 ---- Index: TuningResetException.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/TuningResetException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** TuningResetException.java 15 Sep 2003 15:23:30 -0000 1.4 --- TuningResetException.java 18 Nov 2003 14:03:08 -0000 1.5 *************** *** 1,4 **** /* ! * TuningResetException.java $Revision$ $Date$ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. --- 1,4 ---- /* ! * TuningResetException.java $Revision$ $Date$ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:13
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/algorithm In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/profile/sasl/otp/algorithm Modified Files: AlgorithmImpl.java Log Message: fixed javadoc warnings Index: AlgorithmImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/algorithm/AlgorithmImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AlgorithmImpl.java 13 Sep 2003 21:19:10 -0000 1.4 --- AlgorithmImpl.java 18 Nov 2003 14:03:10 -0000 1.5 *************** *** 41,47 **** * Method AlgorithmImpl * ! * @param String internal is the data used by the JVM internally ! * to represent a certain MessageDigest hash algorithm. This ! * is defined in JVM documentation and in constants in SASLOTPProfile., * */ --- 41,48 ---- * Method AlgorithmImpl * ! * @param internal The data used by the JVM internally to represent ! * a certain MessageDigest hash algorithm. This is ! * defined in JVM documentation and in constants in ! * SASLOTPProfile. * */ *************** *** 53,60 **** /** * Method getName - * - * - * @param String the algorithm's name. - * */ public abstract String getName(); --- 54,57 ---- *************** *** 64,68 **** * hash function. * ! * @param String s is the data to be hashed * @return byte[] the hash value in binary form. * --- 61,65 ---- * hash function. * ! * @param s The data to be hashed * @return byte[] the hash value in binary form. * *************** *** 81,85 **** * hash function. * ! * @param byte[] data is the data to be hashed * @return byte[] the hash value in binary form. * --- 78,82 ---- * hash function. * ! * @param data The data to be hashed * @return byte[] the hash value in binary form. * *************** *** 107,111 **** * it can be used by the SASLOTPProfile and its supporting classes. * ! * @param byte[] data the hash value to be folded * @return byte[] is the folded hash. * --- 104,108 ---- * it can be used by the SASLOTPProfile and its supporting classes. * ! * @param hash The hash value to be folded * @return byte[] is the folded hash. * |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:13
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse In directory sc8-pr-cvs1:/tmp/cvs-serv11039/tls/org/beepcore/beep/profile/tls/jsse Modified Files: TLSProfileJSSE.java Log Message: fixed javadoc warnings Index: TLSProfileJSSE.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSE.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** TLSProfileJSSE.java 16 Nov 2003 00:17:14 -0000 1.12 --- TLSProfileJSSE.java 18 Nov 2003 14:03:10 -0000 1.13 *************** *** 638,643 **** * * @see #init init - profile configuration ! * @param session session - the session to encrypt communcation for ! * @param arg arg - not used currently * * @return new <code>Session</code> with TLS negotiated. --- 638,642 ---- * * @see #init init - profile configuration ! * @param session The session to encrypt communcation for * * @return new <code>Session</code> with TLS negotiated. *************** *** 750,757 **** /** * add a listener for completed handshakes. ! * @param TLSProfileJSSEHandshakeCompletedListener receives handshake complete ! * events * - * @param x */ public void addHandshakeCompletedListener(TLSProfileJSSEHandshakeCompletedListener x) --- 749,754 ---- /** * add a listener for completed handshakes. ! * @param x receives handshake complete events * */ public void addHandshakeCompletedListener(TLSProfileJSSEHandshakeCompletedListener x) *************** *** 763,770 **** /** * remove a listener for completed handshakes. ! * @param TLSProfileJSSEHandshakeCompletedListener receives handshake complete ! * events * - * @param x */ public void removeHandshakeCompletedListener(TLSProfileJSSEHandshakeCompletedListener x) --- 760,765 ---- /** * remove a listener for completed handshakes. ! * @param x receives handshake complete events * */ public void removeHandshakeCompletedListener(TLSProfileJSSEHandshakeCompletedListener x) |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:13
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/transport/tcp Modified Files: TCPSession.java TCPSessionCreator.java Log Message: fixed javadoc warnings Index: TCPSession.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp/TCPSession.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** TCPSession.java 7 Nov 2003 23:01:11 -0000 1.35 --- TCPSession.java 18 Nov 2003 14:03:10 -0000 1.36 *************** *** 370,380 **** * * - * @param channel - * @param previouslySeq - * @param currentSeq - * @param previouslyUsed - * @param currentlyUsed - * @param bufferSize - * * @return true if the Receive Buffer Size was updated * --- 370,373 ---- Index: TCPSessionCreator.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp/TCPSessionCreator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** TCPSessionCreator.java 7 Nov 2003 23:01:12 -0000 1.8 --- TCPSessionCreator.java 18 Nov 2003 14:03:10 -0000 1.9 *************** *** 62,66 **** * @param host * @param port - * @param registry * * @throws BEEPException --- 62,65 ---- *************** *** 127,132 **** * @param host * @param port - * @param profiles - * @param ccls * * @throws BEEPException --- 126,129 ---- *************** *** 149,154 **** * @param host * @param port ! * @param profiles ! * @param ccls * * @throws BEEPException --- 146,150 ---- * @param host * @param port ! * @param registry * * @throws BEEPException |
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/profile/sasl/otp/database Modified Files: NoMorePasswordsException.java UserDBNotFoundException.java UserDatabaseManager.java UserDatabasePool.java Log Message: fixed javadoc warnings Index: NoMorePasswordsException.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database/NoMorePasswordsException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** NoMorePasswordsException.java 8 Nov 2001 05:51:35 -0000 1.2 --- NoMorePasswordsException.java 18 Nov 2003 14:03:10 -0000 1.3 *************** *** 41,45 **** * Default Constructor * ! * @param String username denotes the identity of the peer * wishing to authenticate via SASL OTP * --- 41,45 ---- * Default Constructor * ! * @param username Denotes the identity of the peer * wishing to authenticate via SASL OTP * Index: UserDBNotFoundException.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database/UserDBNotFoundException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** UserDBNotFoundException.java 8 Nov 2001 05:51:35 -0000 1.2 --- UserDBNotFoundException.java 18 Nov 2003 14:03:10 -0000 1.3 *************** *** 43,47 **** * Default Constructor * ! * @param String username denotes the identity of the user that had * been attempting to authenticate via SASL OTP. * --- 43,47 ---- * Default Constructor * ! * @param username Denotes the identity of the user that had * been attempting to authenticate via SASL OTP. * Index: UserDatabaseManager.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database/UserDatabaseManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** UserDatabaseManager.java 23 Apr 2003 15:23:05 -0000 1.4 --- UserDatabaseManager.java 18 Nov 2003 14:03:10 -0000 1.5 *************** *** 55,59 **** * is slightly trickier than doing a dual parameter lookup. * ! * @param String username indicates which OTP database should * be retrieved, based on who wishes to authenticate using it. * --- 55,59 ---- * is slightly trickier than doing a dual parameter lookup. * ! * @param username Indicates which OTP database should * be retrieved, based on who wishes to authenticate using it. * *************** *** 71,76 **** * Method addUser * ! * @param String username is the identity of the user for ! * whom this OTP database is used. * */ --- 71,76 ---- * Method addUser * ! * @param username The identity of the user for whom this OTP ! * database is used. * */ *************** *** 87,91 **** * * ! * @param UserDatabase ud is the updated form of the OTP database. * * @throws SASLException if any issues are encountered during the --- 87,91 ---- * * ! * @param ud The updated form of the OTP database. * * @throws SASLException if any issues are encountered during the *************** *** 100,104 **** * for the removal of a user db. * ! * @param String username the username associated with a given db. * * @throws SASLException if any errors are encountered in the --- 100,104 ---- * for the removal of a user db. * ! * @param username The username associated with a given db. * * @throws SASLException if any errors are encountered in the Index: UserDatabasePool.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database/UserDatabasePool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** UserDatabasePool.java 23 Apr 2003 15:23:05 -0000 1.4 --- UserDatabasePool.java 18 Nov 2003 14:03:10 -0000 1.5 *************** *** 1,5 **** - /* ! * UserDatabasePool.java $Revision$ $Date$ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. --- 1,4 ---- /* ! * UserDatabasePool.java $Revision$ $Date$ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. *************** *** 68,72 **** * is slightly trickier than doing a dual parameter lookup. * ! * @param String username indicates which OTP database should * be retrieved, based on who wishes to authenticate using it. * --- 67,71 ---- * is slightly trickier than doing a dual parameter lookup. * ! * @param username Indicates which OTP database should * be retrieved, based on who wishes to authenticate using it. * *************** *** 164,168 **** * * ! * @param UserDatabase ud is the updated form of the OTP database. * * @throws SASLException if any issues are encountered during the --- 163,167 ---- * * ! * @param ud The updated form of the OTP database. * * @throws SASLException if any issues are encountered during the *************** *** 199,203 **** * (e.g. file) of the user's OTP database to be removed. * ! * @param String authenticator, the user of the OTP database. * * @throws SASLException if any issues are encountered during the --- 198,202 ---- * (e.g. file) of the user's OTP database to be removed. * ! * @param authenticator The user of the OTP database. * * @throws SASLException if any issues are encountered during the |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:12
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/anonymous In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/profile/sasl/anonymous Modified Files: SASLAnonymousProfile.java Log Message: fixed javadoc warnings Index: SASLAnonymousProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/anonymous/SASLAnonymousProfile.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** SASLAnonymousProfile.java 15 Sep 2003 15:23:31 -0000 1.12 --- SASLAnonymousProfile.java 18 Nov 2003 14:03:09 -0000 1.13 *************** *** 126,131 **** * to allow a peer to authenticate to another one. * ! * @param Session session the current session ! * @param String id the identity of the peer withing to authenticate * * @throws SASLException if any failure occurs. --- 126,131 ---- * to allow a peer to authenticate to another one. * ! * @param session Session the current session ! * @param id The identity of the peer withing to authenticate * * @throws SASLException if any failure occurs. *************** *** 172,177 **** * authentication request on the startChannel request. * ! * @param Session session the current session ! * @param String id the identity of the peer withing to authenticate * * @throws SASLException if any failure occurs. --- 172,177 ---- * authentication request on the startChannel request. * ! * @param session Session the current session ! * @param id The identity of the peer withing to authenticate * * @throws SASLException if any failure occurs. |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:12
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/profile/sasl/otp Modified Files: SASLOTPProfile.java Log Message: fixed javadoc warnings Index: SASLOTPProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/SASLOTPProfile.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** SASLOTPProfile.java 30 Oct 2003 14:32:57 -0000 1.14 --- SASLOTPProfile.java 18 Nov 2003 14:03:09 -0000 1.15 *************** *** 245,259 **** * If you want to do that (I recommend it, then use the NEXT one). * ! * @param Session session is the session the user is authenticating on, * in other words, represents the peer we want to * authenticate to. ! * @param String authorizeId is the identity this peer wants to be ! * authorized to act as. ! * @param String authenticateId is the identity this peer will ! * authenticate as ! * @param String pwd is the passphrase to authenticate with (it isn't ! * stored or kept around very long at all, it's only used in computation). * @throws SASLException if any issue is encountered (usually ! * rejection by the other peer). */ public static Session AuthenticateSASLOTP(Session session, --- 245,259 ---- * If you want to do that (I recommend it, then use the NEXT one). * ! * @param session Session is the session the user is authenticating on, * in other words, represents the peer we want to * authenticate to. ! * @param authorizeId The identity this peer wants to be ! * authorized to act as. ! * @param authenticateId The identity this peer will ! * authenticate as ! * @param pwd The passphrase to authenticate with (it isn't stored or ! * kept around very long at all, it's only used in computation). * @throws SASLException if any issue is encountered (usually ! * rejection by the other peer). */ public static Session AuthenticateSASLOTP(Session session, |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:12
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/profile/sasl Modified Files: Blob.java Log Message: fixed javadoc warnings Index: Blob.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/Blob.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** Blob.java 30 Oct 2003 14:29:55 -0000 1.9 --- Blob.java 18 Nov 2003 14:03:08 -0000 1.10 *************** *** 91,95 **** * @param status the status to construct the blob with (see the constants * in this class). - * @param data the data to be embedded in the blob element * * @throws SASLException --- 91,94 ---- *************** *** 268,272 **** * Constructor for those that want to 'receive' or 'digest' a blob. * ! * @param Blob blob is the data to digest. * * @throws SASLException in the event that errors occur during the --- 267,271 ---- * Constructor for those that want to 'receive' or 'digest' a blob. * ! * @param blob The data to digest. * * @throws SASLException in the event that errors occur during the |
From: Huston F. <hu...@us...> - 2003-11-18 14:03:11
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib In directory sc8-pr-cvs1:/tmp/cvs-serv11039/src/org/beepcore/beep/lib Modified Files: ChannelPool.java SharedChannel.java Log Message: fixed javadoc warnings Index: ChannelPool.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/ChannelPool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ChannelPool.java 10 Jun 2003 18:59:22 -0000 1.9 --- ChannelPool.java 18 Nov 2003 14:03:08 -0000 1.10 *************** *** 208,212 **** * @param profile Name of profile for the requested * <code>SharedChannel</code>. ! * @param listener <code>DataListener</code> for the requested * <code>SharedChannel</code>. * --- 208,212 ---- * @param profile Name of profile for the requested * <code>SharedChannel</code>. ! * @param handler <code>RequestHandler</code> for the requested * <code>SharedChannel</code>. * Index: SharedChannel.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/SharedChannel.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** SharedChannel.java 7 Nov 2003 23:01:12 -0000 1.12 --- SharedChannel.java 18 Nov 2003 14:03:08 -0000 1.13 *************** *** 111,117 **** * */ ! public MessageListener setMessageListener(MessageListener dl) { ! return channel.setMessageListener(dl); } --- 111,117 ---- * */ ! public MessageListener setMessageListener(MessageListener ml) { ! return channel.setMessageListener(ml); } |
From: Huston F. <hu...@us...> - 2003-11-17 15:17:45
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/tls In directory sc8-pr-cvs1:/tmp/cvs-serv26343/src/org/beepcore/beep/profile/tls Modified Files: TLSProfile.java Log Message: Changed to use the class loader from the current thread Index: TLSProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/tls/TLSProfile.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** TLSProfile.java 7 Nov 2003 23:01:11 -0000 1.16 --- TLSProfile.java 17 Nov 2003 15:17:01 -0000 1.17 *************** *** 113,117 **** { try { ! ClassLoader cl = ClassLoader.getSystemClassLoader(); Class whatever = cl.loadClass(provider); --- 113,117 ---- { try { ! ClassLoader cl = Thread.currentThread().getContextClassLoader(); Class whatever = cl.loadClass(provider); |
From: Huston F. <hu...@us...> - 2003-11-16 00:17:59
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse In directory sc8-pr-cvs1:/tmp/cvs-serv5329/tls/org/beepcore/beep/profile/tls/jsse Modified Files: TLSProfileJSSE.java Log Message: Changed imports to work for 1.3 and 1.4 Index: TLSProfileJSSE.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSE.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** TLSProfileJSSE.java 7 Nov 2003 23:01:34 -0000 1.11 --- TLSProfileJSSE.java 16 Nov 2003 00:17:14 -0000 1.12 *************** *** 28,34 **** import org.beepcore.beep.transport.tcp.*; ! import com.sun.net.ssl.*; ! import javax.net.ssl.*; import java.security.NoSuchAlgorithmException; --- 28,42 ---- import org.beepcore.beep.transport.tcp.*; ! import com.sun.net.ssl.KeyManager; ! import com.sun.net.ssl.KeyManagerFactory; ! import com.sun.net.ssl.SSLContext; ! import com.sun.net.ssl.TrustManager; ! import com.sun.net.ssl.TrustManagerFactory; ! import javax.net.ssl.HandshakeCompletedEvent; ! import javax.net.ssl.HandshakeCompletedListener; ! import javax.net.ssl.SSLPeerUnverifiedException; ! import javax.net.ssl.SSLSocket; ! import javax.net.ssl.SSLSocketFactory; import java.security.NoSuchAlgorithmException; |
From: Huston F. <hu...@us...> - 2003-11-15 18:51:37
|
Update of /cvsroot/beepcore-java/beepcore-java In directory sc8-pr-cvs1:/tmp/cvs-serv15685 Modified Files: build.xml Log Message: updated version number Index: build.xml =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/build.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** build.xml 20 May 2003 21:46:54 -0000 1.25 --- build.xml 15 Nov 2003 18:51:33 -0000 1.26 *************** *** 6,10 **** <property name="name" value="beepcore" /> <property name="Name" value="BEEP Core" /> ! <property name="version" value="0.9.07" /> <property name="release.name" value="${name}-${version}" /> --- 6,10 ---- <property name="name" value="beepcore" /> <property name="Name" value="BEEP Core" /> ! <property name="version" value="0.9.08" /> <property name="release.name" value="${name}-${version}" /> |
From: Huston F. <hu...@us...> - 2003-11-15 16:17:01
|
Update of /cvsroot/beepcore-java/beepcore-java In directory sc8-pr-cvs1:/tmp/cvs-serv22868 Modified Files: build.properties.sample Log Message: removed " from properties Index: build.properties.sample =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/build.properties.sample,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** build.properties.sample 15 Oct 2002 05:00:53 -0000 1.1 --- build.properties.sample 15 Nov 2003 16:16:54 -0000 1.2 *************** *** 1,6 **** ! debug="on" ! optimize="on" ! deprecation="off" concurrent.jar=${basedir}/lib/concurrent.jar --- 1,6 ---- ! debug=on ! optimize=on ! deprecation=off concurrent.jar=${basedir}/lib/concurrent.jar |
From: Huston F. <hu...@us...> - 2003-11-08 20:58:06
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory sc8-pr-cvs1:/tmp/cvs-serv13292/src/org/beepcore/beep/core Modified Files: SessionImpl.java Log Message: Added fireChannelClosed when a close is received and also for all open channels when channel zero is close. Index: SessionImpl.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/SessionImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** SessionImpl.java 7 Nov 2003 23:01:12 -0000 1.11 --- SessionImpl.java 8 Nov 2003 20:58:02 -0000 1.12 *************** *** 1108,1111 **** --- 1108,1112 ---- channel.setState(ChannelImpl.STATE_CLOSED); channels.remove(channel.getNumberAsString()); + fireChannelClosed(channel); } *************** *** 1159,1162 **** --- 1160,1164 ---- } } + fireChannelClosed(ch); } |
From: Huston F. <hu...@us...> - 2003-11-07 23:01:39
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls In directory sc8-pr-cvs1:/tmp/cvs-serv8175/tls/org/beepcore/beep/profile/tls/ptls Modified Files: TLSProfilePureTLS.java TLSProfilePureTLSPemInit.java Log Message: Added exception chaining for exceptions that were being remapped Index: TLSProfilePureTLS.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLS.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** TLSProfilePureTLS.java 15 Sep 2003 15:23:32 -0000 1.8 --- TLSProfilePureTLS.java 7 Nov 2003 23:01:35 -0000 1.9 *************** *** 282,286 **** policy.setCipherSuites(ciphers); } catch (Exception e) { ! throw new BEEPException(e.getMessage()); } } --- 282,286 ---- policy.setCipherSuites(ciphers); } catch (Exception e) { ! throw new BEEPException(e); } } *************** *** 667,673 **** peerCred = new SessionCredential(ht); } catch (Exception e) { ! e.printStackTrace(); ! ! throw new BEEPException(e.getMessage()); } finally {} --- 667,671 ---- peerCred = new SessionCredential(ht); } catch (Exception e) { ! throw new BEEPException(e); } finally {} *************** *** 738,742 **** PureTLSPackageBridge.setPrivateKey(context, key); } catch (Exception e) { ! throw new BEEPException(e.getMessage()); } } --- 736,740 ---- PureTLSPackageBridge.setPrivateKey(context, key); } catch (Exception e) { ! throw new BEEPException(e); } } *************** *** 769,773 **** e.printStackTrace(); ! throw new BEEPException(e.getMessage()); } } --- 767,771 ---- e.printStackTrace(); ! throw new BEEPException(e); } } *************** *** 802,806 **** e.printStackTrace(); ! throw new BEEPException(e.getMessage()); } } --- 800,804 ---- e.printStackTrace(); ! throw new BEEPException(e); } } *************** *** 831,835 **** policy.setCipherSuites(ciphers); } catch (Exception e) { ! throw new BEEPException(e.getMessage()); } } --- 829,833 ---- policy.setCipherSuites(ciphers); } catch (Exception e) { ! throw new BEEPException(e); } } Index: TLSProfilePureTLSPemInit.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLSPemInit.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** TLSProfilePureTLSPemInit.java 7 Jun 2003 17:29:47 -0000 1.5 --- TLSProfilePureTLSPemInit.java 7 Nov 2003 23:01:36 -0000 1.6 *************** *** 186,190 **** tlsp.setCipherSuite(ciphers); } catch (Exception e) { ! throw new BEEPException(e.getMessage()); } } --- 186,190 ---- tlsp.setCipherSuite(ciphers); } catch (Exception e) { ! throw new BEEPException(e); } } |
From: Huston F. <hu...@us...> - 2003-11-07 23:01:38
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse In directory sc8-pr-cvs1:/tmp/cvs-serv8175/tls/org/beepcore/beep/profile/tls/jsse Modified Files: TLSProfileJSSE.java Log Message: Added exception chaining for exceptions that were being remapped Index: TLSProfileJSSE.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSE.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** TLSProfileJSSE.java 30 Oct 2003 14:30:45 -0000 1.10 --- TLSProfileJSSE.java 7 Nov 2003 23:01:34 -0000 1.11 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2003 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 502,506 **** log.error(e); ! throw new BEEPException(e.getMessage()); } } --- 503,507 ---- log.error(e); ! throw new BEEPException(e); } } *************** *** 694,698 **** } catch (javax.net.ssl.SSLException e) { log.error(e); ! throw new BEEPException(e.getMessage()); } catch (java.io.IOException e) { log.error(e); --- 695,699 ---- } catch (javax.net.ssl.SSLException e) { log.error(e); ! throw new BEEPException(e); } catch (java.io.IOException e) { log.error(e); |