beepcore-java-commits Mailing List for Java BEEP Core (Page 10)
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...> - 2001-11-23 15:10:58
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/util In directory usw-pr-cvs1:/tmp/cvs-serv17438/src/org/beepcore/beep/util Modified Files: BufferSegment.java Log Message: Fixed header Index: BufferSegment.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/util/BufferSegment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** BufferSegment.java 2001/11/08 05:26:29 1.2 --- BufferSegment.java 2001/11/23 15:10:56 1.3 *************** *** 1,4 **** /* ! * TCPSessionCreator.java $Revision$ $Date$ * * Copyright (c) 2001 Huston Franklin. All rights reserved. --- 1,4 ---- /* ! * BufferSegment.java $Revision$ $Date$ * * Copyright (c) 2001 Huston Franklin. All rights reserved. |
From: Huston F. <hu...@us...> - 2001-11-23 04:24:07
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp In directory usw-pr-cvs1:/tmp/cvs-serv12326/src/org/beepcore/beep/transport/tcp Modified Files: TCPSession.java Log Message: Fixed header length (off by one) Index: TCPSession.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp/TCPSession.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** TCPSession.java 2001/11/09 15:49:28 1.16 --- TCPSession.java 2001/11/23 04:24:04 1.17 *************** *** 431,436 **** InputStream is = socket.getInputStream(); - headerBuffer[SEQ_LENGTH] = 0; - while (true) { try { --- 431,434 ---- *************** *** 456,459 **** --- 454,459 ---- throw new BEEPException("Malformed BEEP header"); } + + --length; break; |
From: Huston F. <hu...@us...> - 2001-11-22 15:25:33
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl In directory usw-pr-cvs1:/tmp/cvs-serv21908/src/org/beepcore/beep/profile/sasl Modified Files: SASLSessionTable.java Log Message: Rewrote SessionEvent to follow the java event delegation model Index: SASLSessionTable.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/SASLSessionTable.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SASLSessionTable.java 2001/11/08 05:51:34 1.4 --- SASLSessionTable.java 2001/11/22 15:25:29 1.5 *************** *** 22,27 **** import org.beepcore.beep.core.Session; import org.beepcore.beep.core.SessionCredential; ! import org.beepcore.beep.core.SessionEvent; ! import org.beepcore.beep.core.SessionEventListener; import org.beepcore.beep.profile.sasl.anonymous.SASLAnonymousProfile; import org.beepcore.beep.util.Log; --- 22,27 ---- import org.beepcore.beep.core.Session; import org.beepcore.beep.core.SessionCredential; ! import org.beepcore.beep.core.event.SessionEvent; ! import org.beepcore.beep.core.event.SessionListener; import org.beepcore.beep.profile.sasl.anonymous.SASLAnonymousProfile; import org.beepcore.beep.util.Log; *************** *** 39,43 **** * */ ! public class SASLSessionTable implements SessionEventListener { private Hashtable nameToSession, sessionToName; --- 39,43 ---- * */ ! public class SASLSessionTable implements SessionListener { private Hashtable nameToSession, sessionToName; *************** *** 122,127 **** if(authenticator == null) throw new SASLException(ERR_INVALID_PARAMETERS); ! session.registerForEvent(this, ! SessionEvent.SESSION_TERMINATED_EVENT_CODE); if(sessionToName.contains(session)) nameToSession.remove(authenticator); --- 122,126 ---- if(authenticator == null) throw new SASLException(ERR_INVALID_PARAMETERS); ! session.addSessionListener(this); if(sessionToName.contains(session)) nameToSession.remove(authenticator); *************** *** 151,157 **** } sessionToName.remove(session); printContents(); } ! /** * Method receiveEvent is implemented here so the SASLSessionTable --- 150,159 ---- } sessionToName.remove(session); + session.removeSessionListener(this); printContents(); } ! ! public void greetingReceived(SessionEvent e) {} ! /** * Method receiveEvent is implemented here so the SASLSessionTable *************** *** 160,172 **** * authenticated etc. * ! * @param SessionEvent event the SessionEvent used. */ ! public void receiveEvent(SessionEvent event) { - if(event.getEvent() != SessionEvent.SESSION_TERMINATED_EVENT_CODE) - return; try { ! Session s = (Session)event.getData(); removeEntry(s); } --- 162,172 ---- * authenticated etc. * ! * @param event event the SessionEvent used. */ ! public void sessionClosed(SessionEvent event) { try { ! Session s = (Session)event.getSource(); removeEntry(s); } *************** *** 178,182 **** } } ! /** * Method printContents does a simple dump of the SASLSessionTable --- 178,182 ---- } } ! /** * Method printContents does a simple dump of the SASLSessionTable |
From: Huston F. <hu...@us...> - 2001-11-22 15:25:33
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv21908/src/org/beepcore/beep/core Modified Files: Session.java Removed Files: SessionEvent.java SessionEventListener.java Log Message: Rewrote SessionEvent to follow the java event delegation model Index: Session.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Session.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** Session.java 2001/11/10 21:33:29 1.19 --- Session.java 2001/11/22 15:25:29 1.20 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2001 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 26,29 **** --- 27,31 ---- import java.util.Collections; import java.util.LinkedList; + import java.util.List; import javax.xml.parsers.*; *************** *** 33,36 **** --- 35,42 ---- import org.xml.sax.SAXException; + import org.beepcore.beep.core.event.ChannelEvent; + import org.beepcore.beep.core.event.ChannelListener; + import org.beepcore.beep.core.event.SessionEvent; + import org.beepcore.beep.core.event.SessionListener; import org.beepcore.beep.util.Log; *************** *** 135,138 **** --- 141,146 ---- private static final String TAG_XML_LANG = "xml:lang"; + private static final String DEFAULT_STRING_ENCODING = "UTF-8"; + // Instance Data private int state; *************** *** 140,147 **** private long nextChannelNumber = 0; private Channel zero; - private ChannelZeroListener zeroListener; private Hashtable channels = null; private Hashtable properties = null; ! private Hashtable eventTable = null; private ProfileRegistry profileRegistry = null; private SessionCredential localCredential, peerCredential; --- 148,159 ---- private long nextChannelNumber = 0; private Channel zero; private Hashtable channels = null; private Hashtable properties = null; ! private List sessionListenerList = ! Collections.synchronizedList(new LinkedList()); ! private SessionListener[] sessionListeners = new SessionListener[0]; ! private List channelListenerList = ! Collections.synchronizedList(new LinkedList()); ! private ChannelListener[] channelListeners = new ChannelListener[0]; private ProfileRegistry profileRegistry = null; private SessionCredential localCredential, peerCredential; *************** *** 152,157 **** private DocumentBuilder builder; // generic XML parser - private static final String DEFAULT_STRING_ENCODING = "UTF-8"; - /** * Default Session Constructor. A relationship between peers - a session - --- 164,167 ---- *************** *** 180,184 **** profileRegistry = registry; channels = new Hashtable(DEFAULT_CHANNELS_SIZE); - eventTable = new Hashtable(DEFAULT_CHANNELS_SIZE); properties = new Hashtable(DEFAULT_PROPERTIES_SIZE); tuningProperties = tuning; --- 190,193 ---- *************** *** 209,215 **** zero = new Channel(this, CHANNEL_ZERO, greetingListener); ! zeroListener = new ChannelZeroListener(); - zero.setMessageListener(zeroListener); channels.put(CHANNEL_ZERO, zero); --- 218,223 ---- zero = new Channel(this, CHANNEL_ZERO, greetingListener); ! zero.setMessageListener(new ChannelZeroListener()); channels.put(CHANNEL_ZERO, zero); *************** *** 260,267 **** GreetingListener greetingListener = new GreetingListener(); - zeroListener = new ChannelZeroListener(); zero = new Channel(this, CHANNEL_ZERO, greetingListener); ! ! zero.setMessageListener(zeroListener); channels.put(CHANNEL_ZERO, zero); --- 268,273 ---- GreetingListener greetingListener = new GreetingListener(); zero = new Channel(this, CHANNEL_ZERO, greetingListener); ! zero.setMessageListener(new ChannelZeroListener()); channels.put(CHANNEL_ZERO, zero); *************** *** 275,278 **** --- 281,310 ---- /** + * adds the listener from the list of listeners to be notified + * of future events. + * + * @see removeChannelListener + */ + public void addChannelListener(ChannelListener l) + { + channelListenerList.add(l); + channelListeners = + (ChannelListener[]) channelListenerList.toArray(channelListeners); + } + + /** + * adds the listener from the list of listeners to be notified + * of future events. + * + * @see removeSessionListener + */ + public void addSessionListener(SessionListener l) + { + sessionListenerList.add(l); + sessionListeners = + (SessionListener[]) sessionListenerList.toArray(sessionListeners); + } + + /** * Peer-level call to simply close a session down, no questions * asked. *************** *** 383,412 **** /** ! * Registers a <code>SessionEventListener</code> for various ! * <code>Session</code> events. ! * ! * @param sel A reference to an implementation of a ! * <code>SessionEventListener</code> that will be called back once ! * an event is fired. * ! * @param event The type of event (i.e. ! * <code>SessionEvent.CHANNEL_OPENED_EVENT_CODE</code>) for which the ! * <code>SessionEventListener</code> is registered. ! * ! * @see SessionEvent ! * @see SessionEventListener ! * @see #fireEvent */ ! public void registerForEvent(SessionEventListener sel, int event) { ! Integer i = new Integer(event); ! LinkedList l = (LinkedList) eventTable.get(i); ! ! if (l == null) { ! l = new LinkedList(); ! } ! l.add(sel); ! eventTable.put(i, l); } --- 415,445 ---- /** ! * Removes the listener from the list of listeners to be notified ! * of future events. Note that the listener will be notified of ! * events which have already happened and are in the process of ! * being dispatched. * ! * @see addChannelListener */ ! public void removeChannelListener(ChannelListener l) { ! channelListenerList.remove(l); ! channelListeners = ! (ChannelListener[]) channelListenerList.toArray(channelListeners); ! } ! /** ! * Removes the listener from the list of listeners to be notified ! * of future events. Note that the listener will be notified of ! * events which have already happened and are in the process of ! * being dispatched. ! * ! * @see addSessionListener ! */ ! public void removeSessionListener(SessionListener l) ! { ! sessionListenerList.remove(l); ! sessionListeners = ! (SessionListener[]) sessionListenerList.toArray(sessionListeners); } *************** *** 593,596 **** --- 626,630 ---- } + fireChannelStarted(ch); return ch; } *************** *** 705,738 **** /** - * Publish a session event to registered - * <code>SessionEventListener</code>s. - * - * @param event Event to be passed to <code>SessionEventListener</code>s. - * @param arg Data associated with event. - * - * @see #registerForEvent - * @see SessionEvent - * @see SessionEventListener - */ - protected void fireEvent(int event, Object arg) - { - Integer k = new Integer(event); - LinkedList l = (LinkedList) eventTable.get(k); - - if (l == null) { - return; - } - - // @todo how do those who have registered to receive events call us - // back? - SessionEvent se = new SessionEvent(event, arg); - Iterator i = l.iterator(); - - while (i.hasNext()) { - ((SessionEventListener) i.next()).receiveEvent(se); - } - } - - /** * Returns the channel's available window size. */ --- 739,742 ---- *************** *** 1011,1014 **** --- 1015,1020 ---- channel.getState() + ")"); } + + fireChannelClosed(channel); } *************** *** 1055,1058 **** --- 1061,1124 ---- } + private void fireChannelClosed(Channel c) + { + ChannelListener[] l = this.channelListeners; + if (l.length == 0) + return; + + ChannelEvent e = new ChannelEvent(c); + for (int i=0; i<l.length; ++i) { + l[i].channelClosed(e); + } + } + + private void fireChannelStarted(Channel c) + { + ChannelListener[] l = this.channelListeners; + if (l.length == 0) + return; + + ChannelEvent e = new ChannelEvent(c); + for (int i=0; i<l.length; ++i) { + l[i].channelStarted(e); + } + } + + private void fireGreetingReceived() + { + SessionListener[] l = this.sessionListeners; + if (l.length == 0) + return; + + SessionEvent e = new SessionEvent(this); + for (int i=0; i<l.length; ++i) { + l[i].greetingReceived(e); + } + } + + private void fireSessionClosed() + { + SessionListener[] l = this.sessionListeners; + if (l.length == 0) + return; + + SessionEvent e = new SessionEvent(this); + for (int i=0; i<l.length; ++i) { + l[i].sessionClosed(e); + } + } + + private void fireSessionTerminated() + { + SessionListener[] l = this.sessionListeners; + if (l.length == 0) + return; + + SessionEvent e = new SessionEvent(this); + for (int i=0; i<l.length; ++i) { + l[i].sessionClosed(e); + } + } + /** * This method is called when Channel Zero receives - from our *************** *** 1197,1201 **** } ! fireEvent(SessionEvent.SESSION_CLOSED_EVENT_CODE, this); } --- 1263,1267 ---- } ! fireSessionClosed(); } *************** *** 1305,1313 **** channels.clear(); - zeroListener = null; zero = null; this.changeState(SESSION_STATE_CLOSED); ! fireEvent(SessionEvent.SESSION_TERMINATED_EVENT_CODE, this); } --- 1371,1378 ---- channels.clear(); zero = null; this.changeState(SESSION_STATE_CLOSED); ! fireSessionTerminated(); } *************** *** 1321,1325 **** // parse the stream ! Document doc = null; try { --- 1386,1390 ---- // parse the stream ! Document doc; try { --- SessionEvent.java DELETED --- --- SessionEventListener.java DELETED --- |
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/event In directory usw-pr-cvs1:/tmp/cvs-serv21908/src/org/beepcore/beep/core/event Added Files: ChannelAdapter.java ChannelEvent.java ChannelListener.java SessionAdapter.java SessionEvent.java SessionListener.java Log Message: Rewrote SessionEvent to follow the java event delegation model --- NEW FILE: ChannelAdapter.java --- /* * ChannelAdapter.java $Revision: 1.1 $ $Date: 2001/11/22 15:25:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core.event; /** * This is class provides a default nop implementation for each method * in <code>ChannelListener</code>. * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/22 15:25:29 $ */ public class ChannelAdapter implements ChannelListener { public void channelStarted(ChannelEvent e) {} public void channelClosed(ChannelEvent e) {} } --- NEW FILE: ChannelEvent.java --- /* * ChannelEvent.java $Revision: 1.1 $ $Date: 2001/11/22 15:25:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core.event; import org.beepcore.beep.core.Channel; /** * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/22 15:25:29 $ */ public class ChannelEvent extends java.util.EventObject { public ChannelEvent(Channel session) { super(session); } } --- NEW FILE: ChannelListener.java --- /* * ChannelListener.java $Revision: 1.1 $ $Date: 2001/11/22 15:25:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core.event; import java.util.EventListener; /** * This is an interface defining the methods that must be implemented * to listen for Channel Events. * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/22 15:25:29 $ */ public interface ChannelListener extends EventListener { /** * Invoked when the greeting has been received for a session. */ public void channelStarted(ChannelEvent e); /** * Invoked when the greeting has been received for a session. */ public void channelClosed(ChannelEvent e); } --- NEW FILE: SessionAdapter.java --- /* * SessionAdapter.java $Revision: 1.1 $ $Date: 2001/11/22 15:25:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core.event; /** * This is class provides a default nop implementation for each method * in <code>SessionListener</code>. * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/22 15:25:29 $ */ public class SessionAdapter implements SessionListener { public void greetingReceived(SessionEvent e) {} public void sessionClosed(SessionEvent e) {} } --- NEW FILE: SessionEvent.java --- /* * SessionEvent.java $Revision: 1.1 $ $Date: 2001/11/22 15:25:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core.event; import org.beepcore.beep.core.Session; /** * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/22 15:25:29 $ */ public class SessionEvent extends java.util.EventObject { public final static int GREETING_RECEIVED = 1; public final static int SESSION_ABORTED = 2; public final static int SESSION_CLOSED = 3; public SessionEvent(Session session) { super(session); } } --- NEW FILE: SessionListener.java --- /* * SessionListener.java $Revision: 1.1 $ $Date: 2001/11/22 15:25:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core.event; import java.util.EventListener; /** * This is an interface defining the methods that must be implemented * to listen for Session Events. * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/22 15:25:29 $ */ public interface SessionListener extends EventListener { /** * Invoked when the greeting has been received for a session. */ public void greetingReceived(SessionEvent e); /** * Invoked when the greeting has been received for a session. */ public void sessionClosed(SessionEvent e); } |
From: Huston F. <hu...@us...> - 2001-11-22 15:22:58
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/event In directory usw-pr-cvs1:/tmp/cvs-serv21229/event Log Message: Directory /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/event added to the repository |
From: Huston F. <hu...@us...> - 2001-11-12 16:12:44
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv23001 Modified Files: Channel.java Message.java Log Message: Removed dead code Index: Channel.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Channel.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** Channel.java 2001/11/09 19:10:58 1.18 --- Channel.java 2001/11/12 16:12:41 1.19 *************** *** 1,6 **** /* ! * Channel.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 --- 1,7 ---- /* ! * Channel.java $Revision$ $Date$ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 60,64 **** private static final String ERR_REPLY_RECEIVED_FOR_NO_MESSAGE = "Reply received for a message never sent."; - private static final int MAX_PAYLOAD_SIZE = 4096; private static final BufferSegment zeroLengthSegment = new BufferSegment(new byte[0]); --- 61,64 ---- *************** *** 104,110 **** private LinkedList pendingSendMessages; - /** size of the frames */ - private int frameSize; - /** session this channel sends through. */ private Session session; --- 104,107 ---- *************** *** 131,144 **** private int prevWindowUsed; - - private int waitTimeForPeer; ! private boolean notifyOnFirstFrame; private Object applicationData = null; - /* this is to support deprecated sendXXX methods */ - private MessageMSG currentMSG; - // in shutting down the session // something for waiting synchronous messages (semaphores or something) --- 128,136 ---- private int prevWindowUsed; ! private boolean notifyOnFirstFrame = true; private Object applicationData = null; // in shutting down the session // something for waiting synchronous messages (semaphores or something) *************** *** 165,169 **** this.listener = listener; this.session = session; - this.frameSize = MAX_PAYLOAD_SIZE; sentSequence = 0; recvSequence = 0; --- 157,160 ---- *************** *** 180,185 **** prevWindowUsed = 0; peerWindowSize = DEFAULT_WINDOW_SIZE; - waitTimeForPeer = 0; - this.notifyOnFirstFrame = true; } --- 171,174 ---- *************** *** 323,353 **** /** - * Determines whether calls to the <code>MessageListener</code> are - * made upon receiving the first or last <code>Frame</code> of the message. - * - * @param n If <code>true</code>, calls to <code>MessageListener</code> are - * received on the first <code>Frame</code> of a message. Otherwise, the - * <code>MessageListener</code> will be called once the message is complete - * (when the last <code>Frame</code> is received). - * - * @see MessageListener - */ - void setNotifyMessageListenerOnFirstFrame(boolean n) - { - this.notifyOnFirstFrame = n; - } - - /** - * Returns whether or not calls to the <code>MessageListener</code> are - * made upon receiving the first or last <code>Frame</code> of the message. - * - * @see #setNotifyMessageListenerOnFirstFrame - */ - boolean getNotifyMessageListenerOnFirstFrame() - { - return this.notifyOnFirstFrame; - } - - /** * Sets the <code>MessageListener</code> for this channel. * --- 312,315 ---- *************** *** 520,524 **** } - this.currentMSG = m; ((MessageListener) this.listener).receiveMSG(m); --- 482,485 ---- *************** *** 848,852 **** } ! void sendToPeer(MessageStatus status) throws BEEPException { synchronized (pendingSendMessages) { --- 809,813 ---- } ! private void sendToPeer(MessageStatus status) throws BEEPException { synchronized (pendingSendMessages) { *************** *** 962,1122 **** status.setMessageStatus(MessageStatus.MESSAGE_STATUS_SENT); - } - - /* - synchronized void sendToPeer(MessageStatus status) throws BEEPException - { - Frame frame = null; - int available = 0; - OutputDataStream stream; - byte[] payload; - int sessionBufferSize; - - // allocate a shared buffer for this message - // @todo This call should be changed - sessionBufferSize = session.getMaxFrameSize(); - payload = new byte[sessionBufferSize]; - - // get the message data - stream = status.getMessageData(); - - if (stream == null || - (stream.availableSegment() == false && stream.isComplete())) - { - Log.logEntry(Log.SEV_DEBUG, "Sending NUL or size 0 frame"); - frame = new Frame(status.getMessageType(), - status.getChannel(), status.getMsgno(), true, - sentSequence, 0, status.getAnsno()); - try { - session.sendFrame(frame); - } catch (BEEPException e) { - Log.logEntry(Log.SEV_ERROR, e); - status.setMessageStatus(MessageStatus.MESSAGE_STATUS_NOT_SENT); - - throw e; - } - - // set the status to sent and return it - status.setMessageStatus(MessageStatus.MESSAGE_STATUS_SENT); - - return; - } - - // while we still have data to read - available = stream.availableHeadersAndData(); - - synchronized (this) { - msgsPending++; - } - - // for this message, is there anything waiting? - boolean done = false; - while (!done) { - try { - synchronized (this) { - - // make sure the other peer can accept something - if (peerWindowSize == 0) { - wait(waitTimeForPeer); - - // wait until there is something to send up to - // our timeout - if (peerWindowSize == 0) { - throw new BEEPException("Time expired waiting " + - "for peer."); - } - } - - // how much should we send? - int maxCanRead = 0; - - // we should send the least of these: - // 1) the size of the send buffer in the session - // (transport specific) - maxCanRead = sessionBufferSize; - - // 2) the amount our peer can accept - if (maxCanRead > peerWindowSize) { - maxCanRead = peerWindowSize; - } - - int amountToSend = stream.readHeadersAndData(payload, 0, - maxCanRead); - if ((stream.available() == 0) && stream.isComplete()) { - done = true; - } - else if (amountToSend == -1) { - done = true; - // send an empty payload - payload = new byte[0]; - amountToSend = 0; - } - - // create a frame - frame = - new Frame(status.getMessageType(), - status.getChannel(), status.getMsgno(), - done ? true : false, - sentSequence, status.getAnsno(), - new BufferSegment(payload, 0, - amountToSend)); - - // update the sequence and peer window size - sentSequence += amountToSend; // update the sequence - peerWindowSize -= amountToSend; - } - - // send it - if (done) { - Log.logEntry(Log.SEV_DEBUG_VERBOSE, - "Channel.sendToPeer sending last frame on channel " - + number); - } else { - Log.logEntry(Log.SEV_DEBUG_VERBOSE, - "Channel.sendToPeer sending a frame on channel " - + number); - } - } catch (Exception e) { - Log.logEntry(Log.SEV_ERROR, e); - status.setMessageStatus(MessageStatus.MESSAGE_STATUS_NOT_SENT); - - throw new BEEPException(e.getMessage()); - } - - try { - session.sendFrame(frame); - } catch (BEEPException e) { - Log.logEntry(Log.SEV_ERROR, e); - status.setMessageStatus(MessageStatus.MESSAGE_STATUS_NOT_SENT); - - synchronized (this) { - msgsPending--; - - if (msgsPending == 0) { - notify(); - } - } - - return; - } - } - - // set the status to sent and return it - status.setMessageStatus(MessageStatus.MESSAGE_STATUS_SENT); - - synchronized (this) { - msgsPending--; - - if (msgsPending == 0) { - notify(); - } - } - } - */ - - // used by session to control the frame size of the channel - void setFrameSize(int frameSize) - { - this.frameSize = frameSize; } --- 923,926 ---- Index: Message.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Message.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Message.java 2001/11/08 05:51:34 1.7 --- Message.java 2001/11/12 16:12:41 1.8 *************** *** 67,77 **** public static final int MESSAGE_TYPE_NUL = 5; - /** - * BEEP message type for utility only. - */ - private static final int MESSAGE_TYPE_MAX = 6; - - private static final String NOT_MESSAGE_TYPE_MSG = - "Message is not of type MSG"; /** BEEP message type of <code>Message</code>. */ int messageType = MESSAGE_TYPE_UNK; --- 67,70 ---- *************** *** 85,88 **** --- 78,90 ---- /** Answer number of this BEEP message. */ int ansno; + + /** + * BEEP message type for utility only. + */ + private static final int MESSAGE_TYPE_MAX = 6; + + private static final String NOT_MESSAGE_TYPE_MSG = + "Message is not of type MSG"; + private boolean notified = false; |
From: Huston F. <hu...@us...> - 2001-11-10 21:33:32
|
Update of /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv17519/test/org/beepcore/beep/core Modified Files: TestFileDataStream.java TestInputDataStreamAdapter.java Added Files: TestByteOutputDataStream.java TestStringOutputDataStream.java Removed Files: TestByteDataStream.java TestDataStream.java TestFrameDataStream.java TestInputStreamDataStream.java TestStringDataStream.java Log Message: Rename Byte/StringDataStream to Byte/StringOutputDataStream --- NEW FILE: TestByteOutputDataStream.java --- /* * TestByteOutputDataStream.java $Revision: 1.1 $ $Date: 2001/11/10 21:33:29 $ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. * Copyright (c) 2001 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. * */ package org.beepcore.beep.core; import java.io.InputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Enumeration; import java.util.Hashtable; import org.beepcore.beep.util.BufferSegment; import junit.framework.*; public class TestByteOutputDataStream extends TestCase { protected ByteOutputDataStream data; protected byte[] message; protected int dataOffset = 0; protected Hashtable headers = new Hashtable(); public TestByteOutputDataStream(String name) { super(name); } public static void main (String[] args) { junit.textui.TestRunner.run (suite()); } public void testGetNextSegment() { int i=0; while (data.isComplete() == false || data.availableSegment()) { BufferSegment b = data.getNextSegment(message.length); for (int j=b.getOffset(); j < b.getOffset() + b.getLength(); ++j) { assertEquals((char)message[i++], (char)(b.getData()[j])); } } } public void testGetNextSegmentFragments() { int i=0; while (data.isComplete() == false || data.availableSegment()) { BufferSegment b = data.getNextSegment(10); for (int j=b.getOffset(); j < b.getOffset() + b.getLength(); ++j) { assertEquals((char)message[i++], (char)(b.getData()[j])); } } } protected void setUp() throws UnsupportedEncodingException, BEEPException { Channel channel = new Channel("0", "0", null, null); String s = "12345678901234567890x2345678901234567890"; String EH1 = "EntityHeader1"; String h1 = "header1"; String EH2 = "EntityHeader2"; String h2 = "header2"; data = new ByteOutputDataStream(s.getBytes("UTF-8")); data.setHeaderValue(EH1, h1); data.setHeaderValue(EH2, h2); headers.put(EH1, h1); headers.put(EH2, h2); headers.put(MimeHeaders.CONTENT_TYPE, MimeHeaders.DEFAULT_CONTENT_TYPE); headers.put(MimeHeaders.CONTENT_TRANSFER_ENCODING, MimeHeaders.DEFAULT_CONTENT_TRANSFER_ENCODING); StringBuffer messageBuffer = new StringBuffer(); messageBuffer.append(serializeHeaders(data.getHeaderNames(), headers)); dataOffset = messageBuffer.length(); messageBuffer.append(s); message = messageBuffer.toString().getBytes("UTF8"); } private String serializeHeaders(Enumeration names, Hashtable headers) throws BEEPException { StringBuffer buf = new StringBuffer(); // Enumeration names = data.getHeaderNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); String value = (String) headers.get(name); if ((name.equals(MimeHeaders.CONTENT_TYPE) && value.equals(MimeHeaders.DEFAULT_CONTENT_TYPE)) || (name.equals(MimeHeaders.CONTENT_TRANSFER_ENCODING) && value.equals(MimeHeaders.DEFAULT_CONTENT_TRANSFER_ENCODING))) { // these are default values that don't need to be added // to the payload continue; } buf.append(name); buf.append(": "); buf.append(value); buf.append("\r\n"); } buf.append("\r\n"); return buf.toString(); } public static Test suite() { return new TestSuite(TestByteOutputDataStream.class); } } --- NEW FILE: TestStringOutputDataStream.java --- /* * TestStringOutputDataStream.java * $Revision: 1.1 $ $Date: 2001/11/10 21:33:29 $ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. * Copyright (c) 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. * */ package org.beepcore.beep.core; import java.io.InputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Enumeration; import java.util.Hashtable; import org.beepcore.beep.util.BufferSegment; import junit.framework.*; public class TestStringOutputDataStream extends TestCase { protected StringOutputDataStream data; protected byte[] message; protected int dataOffset = 0; protected Hashtable headers = new Hashtable(); public TestStringOutputDataStream(String name) { super(name); } public void testGetNextSegment() { int i=0; while (data.isComplete() == false || data.availableSegment()) { BufferSegment b = data.getNextSegment(message.length); for (int j=b.getOffset(); j < b.getOffset() + b.getLength(); ++j) { assertEquals((char)message[i++], (char)(b.getData()[j])); } } } public void testGetNextSegmentFragments() { int i=0; while (data.isComplete() == false || data.availableSegment()) { BufferSegment b = data.getNextSegment(10); for (int j=b.getOffset(); j < b.getOffset() + b.getLength(); ++j) { assertEquals((char)message[i++], (char)(b.getData()[j])); } } } protected void setUp() throws UnsupportedEncodingException, BEEPException { String s = "1234567890"; String EH1 = "EntityHeader1"; String h1 = "header1"; String EH2 = "EntityHeader2"; String h2 = "header2"; String te = "TransferEncoding1"; data = new StringOutputDataStream(s); data.setHeaderValue(EH1, h1); data.setHeaderValue(EH2, h2); data.setTransferEncoding(te); data.setContentType(MimeHeaders.BEEP_XML_CONTENT_TYPE); headers.put(MimeHeaders.CONTENT_TYPE, MimeHeaders.BEEP_XML_CONTENT_TYPE); headers.put(MimeHeaders.CONTENT_TRANSFER_ENCODING, te); headers.put(EH1, h1); headers.put(EH2, h2); StringBuffer messageBuffer = new StringBuffer(); messageBuffer.append(serializeHeaders(data.getHeaderNames(), headers)); dataOffset = messageBuffer.length(); messageBuffer.append(s); message = messageBuffer.toString().getBytes("UTF8"); } private String serializeHeaders(Enumeration names, Hashtable headers) throws BEEPException { StringBuffer buf = new StringBuffer(); // Enumeration names = data.getHeaderNames(); while (names.hasMoreElements()) { String name = (String) names.nextElement(); String value = (String) headers.get(name); if ((name.equals(MimeHeaders.CONTENT_TYPE) && value.equals(MimeHeaders.DEFAULT_CONTENT_TYPE)) || (name.equals(MimeHeaders.CONTENT_TRANSFER_ENCODING) && value.equals(MimeHeaders.DEFAULT_CONTENT_TRANSFER_ENCODING))) { // these are default values that don't need to be added // to the payload continue; } buf.append(name); buf.append(": "); buf.append(value); buf.append("\r\n"); } buf.append("\r\n"); return buf.toString(); } public static Test suite() { return new TestSuite(TestStringOutputDataStream.class); } public static void main (String[] args) { junit.textui.TestRunner.run (suite()); } } Index: TestFileDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestFileDataStream.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TestFileDataStream.java 2001/11/08 05:51:35 1.2 --- TestFileDataStream.java 2001/11/10 21:33:29 1.3 *************** *** 26,31 **** import junit.framework.*; ! public class TestFileDataStream extends TestDataStream { ! static public String filename; --- 26,31 ---- import junit.framework.*; ! public class TestFileDataStream /*extends TestDataStream*/ { ! /* static public String filename; *************** *** 87,90 **** return new TestSuite(TestFileDataStream.class); } ! } --- 87,90 ---- return new TestSuite(TestFileDataStream.class); } ! */ } Index: TestInputDataStreamAdapter.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestInputDataStreamAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestInputDataStreamAdapter.java 2001/10/31 00:32:38 1.1 --- TestInputDataStreamAdapter.java 2001/11/10 21:33:29 1.2 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2001 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 37,45 **** } ! public void testAvailable() throws IOException { ! InputStream is = data.getInputStream(); ! assertEquals("is.available()", ! message.length - dataOffset, is.available()); ! } public void testRead() throws IOException { --- 38,46 ---- } ! public void testAvailable() throws IOException { ! InputStream is = data.getInputStream(); ! assertEquals("is.available()", ! message.length - dataOffset, is.available()); ! } public void testRead() throws IOException { *************** *** 49,53 **** assertEquals("is.available()", is.available(), message.length - dataOffset - i); ! assertEquals(//"Byte number: " + i + " did not match", ((byte) is.read()), message[dataOffset + i]); } --- 50,54 ---- assertEquals("is.available()", is.available(), message.length - dataOffset - i); ! assertEquals(//"Byte number: " + i, ((byte) is.read()), message[dataOffset + i]); } *************** *** 75,79 **** message.length - dataOffset, count); for (int i=0; i < message.length - dataOffset; ++i) { ! assertEquals(//"Byte number: " + i + " did not match", message[dataOffset + i], b[i+5]); } --- 76,80 ---- message.length - dataOffset, count); for (int i=0; i < message.length - dataOffset; ++i) { ! assertEquals(//"Byte number: " + i, message[dataOffset + i], b[i+5]); } *************** *** 90,94 **** } for (int i=0; i < count; ++i) { ! assertEquals(//"Byte number: " + i + " did not match", message[dataOffset + i], b[i]); } --- 91,95 ---- } for (int i=0; i < count; ++i) { ! assertEquals(//"Byte number: " + i, message[dataOffset + i], b[i]); } *************** *** 108,112 **** } for (int i=0; i < b.length - dataOffset; ++i) { ! assertEquals("Byte number: " + i + " did not match", message[dataOffset + i], b[i]); } --- 109,113 ---- } for (int i=0; i < b.length - dataOffset; ++i) { ! assertEquals("Byte number: " + i, message[dataOffset + i], b[i]); } *************** *** 124,128 **** } for (int i=0; i < count - 5; ++i) { ! assertEquals(//"Byte number: " + i + " did not match", message[dataOffset + i], b[i+5]); } --- 125,129 ---- } for (int i=0; i < count - 5; ++i) { ! assertEquals(//"Byte number: " + i, message[dataOffset + i], b[i+5]); } *************** *** 143,152 **** for (int i=0; i<count; ++i) { ! assertEquals("Byte number: " + i + " did not match", (byte) is.read(), b[i]); } for (int i=0; is.available() != 0; ++i) { ! assertEquals("Byte number: " + i + " did not match", message[dataOffset + b.length + i], (byte) is.read()); --- 144,153 ---- for (int i=0; i<count; ++i) { ! assertEquals("Byte number: " + i, (byte) is.read(), b[i]); } for (int i=0; is.available() != 0; ++i) { ! assertEquals("Byte number: " + i, message[dataOffset + b.length + i], (byte) is.read()); *************** *** 162,166 **** int count = is.read(b); for (int i=0; i < count; ++i) { ! assertEquals("Byte number: " + i + " did not match", message[dataOffset + SKIP_AMOUNT + i], b[i]); } --- 163,167 ---- int count = is.read(b); for (int i=0; i < count; ++i) { ! assertEquals("Byte number: " + i, message[dataOffset + SKIP_AMOUNT + i], b[i]); } *************** *** 173,178 **** String header = data.getInputStream().getHeaderValue(name); String origHeader = (String)headers.get(name); ! assertEquals("Header: " + name + " values do not match (" + ! header + "!=" + origHeader + ")", origHeader, header); } --- 174,178 ---- String header = data.getInputStream().getHeaderValue(name); String origHeader = (String)headers.get(name); ! assertEquals("Header: " + name, origHeader, header); } --- TestByteDataStream.java DELETED --- --- TestDataStream.java DELETED --- --- TestFrameDataStream.java DELETED --- --- TestInputStreamDataStream.java DELETED --- --- TestStringDataStream.java DELETED --- |
From: Huston F. <hu...@us...> - 2001-11-10 21:33:32
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp In directory usw-pr-cvs1:/tmp/cvs-serv17519/src/org/beepcore/beep/profile/sasl/otp Modified Files: OTPAuthenticator.java Log Message: Rename Byte/StringDataStream to Byte/StringOutputDataStream Index: OTPAuthenticator.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/OTPAuthenticator.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** OTPAuthenticator.java 2001/11/08 05:51:34 1.10 --- OTPAuthenticator.java 2001/11/10 21:33:29 1.11 *************** *** 518,522 **** "AuthOTP Using=>" + blob.toString() + "<="); try { ! channel.sendMSG(new StringDataStream(blob.toString()), (ReplyListener) this); } catch (BEEPException x) { abort(x.getMessage()); --- 518,523 ---- "AuthOTP Using=>" + blob.toString() + "<="); try { ! channel.sendMSG(new StringOutputDataStream(blob.toString()), ! (ReplyListener) this); } catch (BEEPException x) { abort(x.getMessage()); *************** *** 609,613 **** { blob = new Blob(Blob.STATUS_CONTINUE, phrase); ! channel.sendMSG(new StringDataStream(blob.toString()), this); } catch(BEEPException x) --- 610,614 ---- { blob = new Blob(Blob.STATUS_CONTINUE, phrase); ! channel.sendMSG(new StringOutputDataStream(blob.toString()), this); } catch(BEEPException x) *************** *** 716,720 **** Blob reply = receiveIDs(data); try { ! message.sendRPY(new StringDataStream(reply.toString())); } catch (BEEPException x) { throw new SASLException(x.getMessage()); --- 717,721 ---- Blob reply = receiveIDs(data); try { ! message.sendRPY(new StringOutputDataStream(reply.toString())); } catch (BEEPException x) { throw new SASLException(x.getMessage()); *************** *** 737,741 **** try { ! message.sendRPY(new StringDataStream(new Blob(Blob.STATUS_COMPLETE).toString())); channel.setMessageListener(null); } --- 738,742 ---- try { ! message.sendRPY(new StringOutputDataStream(new Blob(Blob.STATUS_COMPLETE).toString())); channel.setMessageListener(null); } *************** *** 759,763 **** authenticated); Blob reply = new Blob(Blob.STATUS_ABORT, s.getMessage()); ! message.sendRPY(new StringDataStream(reply.toString())); // channel.setDataListener(null); } --- 760,764 ---- authenticated); Blob reply = new Blob(Blob.STATUS_ABORT, s.getMessage()); ! message.sendRPY(new StringOutputDataStream(reply.toString())); // channel.setDataListener(null); } *************** *** 860,864 **** { Blob a = new Blob(Blob.STATUS_ABORT, x.getMessage()); ! channel.sendMSG(new StringDataStream(a.toString()), this); } --- 861,865 ---- { Blob a = new Blob(Blob.STATUS_ABORT, x.getMessage()); ! channel.sendMSG(new StringOutputDataStream(a.toString()), this); } |
From: Huston F. <hu...@us...> - 2001-11-10 21:33:31
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv17519/src/org/beepcore/beep/core Modified Files: MessageMSG.java Session.java Added Files: ByteOutputDataStream.java StringOutputDataStream.java Removed Files: ByteDataStream.java StringDataStream.java Log Message: Rename Byte/StringDataStream to Byte/StringOutputDataStream --- NEW FILE: ByteOutputDataStream.java --- /* * ByteOutputDataStream.java $Revision: 1.1 $ $Date: 2001/11/10 21:33:29 $ * * Copyright (c) 2001 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. * */ package org.beepcore.beep.core; import java.util.Enumeration; import org.beepcore.beep.util.BufferSegment; /** * <code>ByteOutputDataStream</code> represents a BEEP message's * payload. Allows the implementor to treat a <code>byte[]</code> as * a <code>DataStream</code>. <p> <b>Note that this implementation is * not synchronized.</b> If multiple threads access a * <code>ByteOutputDataStream</code> concurrently, data may be * inconsistent or lost. * * @see org.beepcore.beep.core.DataStream * * @author Huston Franklin * @version $Revision: 1.1 $, $Date: 2001/11/10 21:33:29 $ */ public class ByteOutputDataStream extends OutputDataStream { /** * Creates a <code>ByteOutputDataStream</code> from a * <code>byte[]</code> with a content type of * <code>DEFAULT_CONTENT_TYPE</code> and a transfer encoding of * <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param data A <code>byte[]</code> representing a message's payload. */ public ByteOutputDataStream(byte[] data) { this(data, 0, data.length); } /** * Creates a <code>ByteOutputDataStream</code> from a <code>byte[]</code> * with a specified content type and a transfer encoding * of <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param contentType Content type of <code>data</code>. * @param data A <code>byte[]</code> representing a message's payload. */ public ByteOutputDataStream(String contentType, byte[] data) { this(contentType, data, 0, data.length); } /** * Creates a <code>ByteOutputDataStream</code> from a <code>byte[]</code> * with a specified content type and a specified transfer encoding. * * @param contentType Content type of <code>data</code>. * @param transferEncoding Encoding Transfer encoding type of * <code>data</code>. * @param data A <code>byte[]</code> representing a message's payload. */ public ByteOutputDataStream(String contentType, String transferEncoding, byte[] data) { this(contentType, transferEncoding, data, 0, data.length); } /** * Creates a <code>ByteOutputDataStream</code> from a * <code>byte[]</code> using the specified length and offset with * a content type of <code>DEFAULT_CONTENT_TYPE</code> and a * transfer encoding of * <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param data A <code>byte[]</code> representing a message's payload. * @param offset The start offset in array <code>data</code> at which the * data is written. * @param length The maximum number of bytes to read. */ public ByteOutputDataStream(byte[] data, int offset, int length) { super(new MimeHeaders(), new BufferSegment(data, offset, length)); } /** * Creates a <code>ByteOutputDataStream</code> from a * <code>byte[]</code> using the specified length and offset and * with a specified content type and a transfer encoding of * <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param contentType Content type of <code>byte[]</code>. * @param data A <code>byte[]</code> representing a message's payload. * @param offset The start offset in array <code>data</code> at which the * data is written. * @param length The maximum number of bytes to read. */ public ByteOutputDataStream(String contentType, byte[] data, int offset, int length) { super(new MimeHeaders(contentType), new BufferSegment(data, offset, length)); } /** * Creates a <code>ByteOutputDataStream</code> from a * <code>byte[]</code> using the specified length and offset and * with a specified content type and a specified transfer * encoding. * * @param contentType Content type of <code>byte[]</code>. * @param transferEncoding Encoding Transfer encoding type of * <code>data</code>. * @param data A <code>byte[]</code> representing a message's payload. * @param offset The start offset in array <code>data</code> at which the * data is written. * @param length The maximum number of bytes to read. */ public ByteOutputDataStream(String contentType, String transferEncoding, byte[] data, int offset, int length) { super(new MimeHeaders(contentType, transferEncoding), new BufferSegment(data, offset, length)); } /** * Returns <code>true</code> if no more bytes will be added to those * currently available, if any, on this stream. Returns * <code>false</code> if more bytes are expected. */ public boolean isComplete() { return true; } /** * Returns the value of the MIME entity header <code>Content-Type</code>. */ public String getContentType() throws BEEPException { return this.mimeHeaders.getContentType(); } /** * Sets the content type of a <code>DataStream</code>. * * @param contentType */ public void setContentType(String contentType) { this.mimeHeaders.setContentType(contentType); } /** * Returns the value of the MIME entity header * <code>Content-Transfer-Encoding</code>. */ public String getTransferEncoding() throws BEEPException { return this.mimeHeaders.getTransferEncoding(); } /** * Sets the content transfer encoding of a <code>DataStream</code> * * @param transferEncoding */ public void setTransferEncoding(String transferEncoding) { this.mimeHeaders.setTransferEncoding(transferEncoding); } /** * Returns an <code>Enumeration</code> of all the names of the MIME entity * headers in this data stream. * Use this call in conjunction with <code>getHeaderValue</code> to iterate * through all the corresponding MIME entity header <code>value</code>(s) * in this data stream. * * @return An <code>Enumeration</code> of all the MIME entity header * names. * * @throws BEEPException */ public Enumeration getHeaderNames() throws BEEPException { return this.mimeHeaders.getHeaderNames(); } /** * Retrieves the correspoding <code>value</code> to a given a MIME entity * header <code>name</code>. * * @param name Name of the MIME entity header. * @return The <code>value</code> of the MIME entity header. * * @throws BEEPException */ public String getHeaderValue(String name) throws BEEPException { return this.mimeHeaders.getHeaderValue(name); } /** * Adds a MIME entity header to this data stream. * * @param name Name of the MIME enitity header. * @param value Value of the MIME entity header. */ public void setHeaderValue(String name, String value) { this.mimeHeaders.setHeader(name, value); } /** * Removes the <code>name</code> and <code>value</code> of a MIME entity * header from the data stream. Returns <code>true</code> if the * <code>name</code> was successfully removed. * * @param name Name of the header to be removed from the data stream. * * @return Returns </code>true<code> if header was removed. Otherwise, * returns <code>false</code>. */ public boolean removeHeader(String name) { return this.mimeHeaders.removeHeader(name); } } --- NEW FILE: StringOutputDataStream.java --- /* * StringOutputDataStream.java $Revision: 1.1 $ $Date: 2001/11/10 21:33:29 $ * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. * Copyright (c) 2001 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. * */ package org.beepcore.beep.core; import java.util.Enumeration; import java.util.MissingResourceException; import java.io.UnsupportedEncodingException; import java.io.IOException; import org.beepcore.beep.util.BufferSegment; /** * <code>StringOutputDataStream</code> represents a BEEP message's * payload. Allows implementors to treat a <code>String</code> as a * <code>DataSream</code>. The <code>String</code> is stored as a * <code>byte[]</code> using UTF-8 encoding. <p> <b>Note that this * implementation is not synchronized.</b> If multiple threads access * a <code>StringOutputDataStream</code> concurrently, data may be * inconsistent or lost. * * @see org.beepcore.beep.core.DataStream * * @author Eric Dixon * @author Huston Franklin * @author Jay Kint * @author Scott Pead * @version $Revision: 1.1 $, $Date: 2001/11/10 21:33:29 $ */ public class StringOutputDataStream extends OutputDataStream { /** * The default <code>StringOutputDataStream</code> String encoding * ("UTF-8"). */ private static final String DEFAULT_STRING_ENCODING = "UTF-8"; private String enc; /** * Creates a <code>StringOutputDataStream</code> with a * <code>String</code> and a <code>BEEP_XML_CONTENT_TYPE</code> * content type and a transfer encoding of * <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param data A <code>String</code> representing a message's payload. */ public StringOutputDataStream(String data) { super(new MimeHeaders()); try { add(new BufferSegment(data.getBytes(DEFAULT_STRING_ENCODING))); this.enc = DEFAULT_STRING_ENCODING; } catch (UnsupportedEncodingException e) { throw new MissingResourceException("Encoding " + DEFAULT_STRING_ENCODING + " not supported", "StringOutputDataStream", DEFAULT_STRING_ENCODING); } } /** * Creates a <code>StringOutputDataStream</code> with a * <code>String</code> and a specified content type and a transfer * encoding of <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param contentType Content type of <code>data</code> * @param data A <code>String</code> representing a message's payload. */ public StringOutputDataStream(String contentType, String data) { super(new MimeHeaders(contentType)); try { add(new BufferSegment(data.getBytes(DEFAULT_STRING_ENCODING))); this.enc = DEFAULT_STRING_ENCODING; } catch (UnsupportedEncodingException e) { throw new MissingResourceException("Encoding " + DEFAULT_STRING_ENCODING + " not supported", "StringOutputDataStream", DEFAULT_STRING_ENCODING); } } /** * Creates a <code>StringOutputDataStream</code> with a * <code>String</code> and a specified content type and a transfer * encoding of <code>DEFAULT_CONTENT_TRANSFER_ENCODING</code>. * * @param contentType Content type of <code>data</code> * @param transferEncoding Encoding Transfer encoding type of * <code>data</code>. * @param data A <code>String</code> representing a message's payload. */ public StringOutputDataStream(String contentType, String transferEncoding, String data) { super(new MimeHeaders(contentType, transferEncoding)); try { add(new BufferSegment(data.getBytes(DEFAULT_STRING_ENCODING))); this.enc = DEFAULT_STRING_ENCODING; } catch (UnsupportedEncodingException e) { throw new MissingResourceException("Encoding " + DEFAULT_STRING_ENCODING + " not supported", "StringOutputDataStream", DEFAULT_STRING_ENCODING); } } /** * Creates a <code>StringOutputDataStream</code> with a * <code>String</code> and a specified content type and encoding. * * @param contentType Content type of <code>data</code> * @param transferEncoding Encoding Transfer encoding type of * <code>data</code>. * @param data A <code>String</code> representing a message's payload. * @param enc The encoding used when converting <code>data</code> to a * <code>bytes[]</code>. */ public StringOutputDataStream(String contentType, String transferEncoding, String data, String enc) throws UnsupportedEncodingException { super(new MimeHeaders(contentType, transferEncoding)); add(new BufferSegment(data.getBytes(DEFAULT_STRING_ENCODING))); this.enc = DEFAULT_STRING_ENCODING; } /** * Returns the encoding used to convert the <code>String</code> to a * <code>bytes[]</code>. */ public String getEncoding() { return this.enc; } /** * Returns <code>true</code> if no more bytes will be added to those * currently available, if any, on this stream. Returns * <code>false</code> if more bytes are expected. */ public boolean isComplete() { return true; } /** * Returns the value of the MIME entity header <code>Content-Type</code>. */ public String getContentType() throws BEEPException { return this.mimeHeaders.getContentType(); } /** * Sets the content type of a <code>DataStream</code>. * * @param contentType */ public void setContentType(String contentType) { this.mimeHeaders.setContentType(contentType); } /** * Returns an <code>Enumeration</code> of all the names of the MIME entity * headers in this data stream. * Use this call in conjunction with <code>getHeaderValue</code> to iterate * through all the corresponding MIME entity header <code>value</code>(s) * in this data stream. * * @return An <code>Enumeration</code> of all the MIME entity header * names. * * @throws BEEPException */ public Enumeration getHeaderNames() throws BEEPException { return this.mimeHeaders.getHeaderNames(); } /** * Retrieves the correspoding <code>value</code> to a given a MIME entity * header <code>name</code>. * * @param name Name of the MIME entity header. * @return The <code>value</code> of the MIME entity header. * * @throws BEEPException */ public String getHeaderValue(String name) throws BEEPException { return this.mimeHeaders.getHeaderValue(name); } /** * Adds a MIME entity header to this data stream. * * @param name Name of the MIME enitity header. * @param value Value of the MIME entity header. */ public void setHeaderValue(String name, String value) { this.mimeHeaders.setHeader(name, value); } /** * Returns the value of the MIME entity header * <code>Content-Transfer-Encoding</code>. */ public String getTransferEncoding() throws BEEPException { return this.mimeHeaders.getTransferEncoding(); } /** * Sets the content transfer encoding of a <code>DataStream</code> * * @param transferEncoding */ public void setTransferEncoding(String transferEncoding) { this.mimeHeaders.setTransferEncoding(transferEncoding); } /** * Removes the <code>name</code> and <code>value</code> of a MIME entity * header from the data stream. Returns <code>true</code> if the * <code>name</code> was successfully removed. * * @param name Name of the header to be removed from the data stream. * * @return Returns </code>true<code> if header was removed. Otherwise, * returns <code>false</code>. */ public boolean removeHeader(String name) { return this.mimeHeaders.removeHeader(name); } } Index: MessageMSG.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/MessageMSG.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** MessageMSG.java 2001/11/08 05:51:34 1.5 --- MessageMSG.java 2001/11/10 21:33:29 1.6 *************** *** 79,83 **** { OutputDataStream stream = ! new StringDataStream(error.createErrorMessage()); MessageStatus m = new MessageStatus(this.channel, MESSAGE_TYPE_ERR, this.msgno, stream); --- 79,83 ---- { OutputDataStream stream = ! new StringOutputDataStream(error.createErrorMessage()); MessageStatus m = new MessageStatus(this.channel, MESSAGE_TYPE_ERR, this.msgno, stream); *************** *** 104,108 **** MessageStatus m = new MessageStatus(this.channel, MESSAGE_TYPE_ERR, this.msgno, ! new StringDataStream(error)); this.channel.sendMessage(m); return m; --- 104,108 ---- MessageStatus m = new MessageStatus(this.channel, MESSAGE_TYPE_ERR, this.msgno, ! new StringOutputDataStream(error)); this.channel.sendMessage(m); return m; *************** *** 129,133 **** MessageStatus m = new MessageStatus(this.channel, MESSAGE_TYPE_ERR, this.msgno, ! new StringDataStream(error)); this.channel.sendMessage(m); return m; --- 129,133 ---- MessageStatus m = new MessageStatus(this.channel, MESSAGE_TYPE_ERR, this.msgno, ! new StringOutputDataStream(error)); this.channel.sendMessage(m); return m; Index: Session.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Session.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** Session.java 2001/11/10 03:58:45 1.18 --- Session.java 2001/11/10 21:33:29 1.19 *************** *** 564,569 **** // Make a message OutputDataStream ds = ! new StringDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! startBuffer.toString()); // Tell Channel Zero to start us up --- 564,569 ---- // Make a message OutputDataStream ds = ! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! startBuffer.toString()); // Tell Channel Zero to start us up *************** *** 985,990 **** synchronized (reply) { OutputDataStream ds = ! new StringDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! closeBuffer.toString()); this.zero.sendMSG(ds, --- 985,990 ---- synchronized (reply) { OutputDataStream ds = ! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! closeBuffer.toString()); this.zero.sendMSG(ds, *************** *** 1045,1051 **** } ! StringDataStream sds = ! new StringDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! sb.toString()); // Store the Channel --- 1045,1051 ---- } ! StringOutputDataStream sds = ! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! sb.toString()); // Store the Channel *************** *** 1099,1105 **** // Send an ok ! StringDataStream sds = ! new StringDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! FRAGMENT_OK); try { --- 1099,1105 ---- // Send an ok ! StringOutputDataStream sds = ! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! FRAGMENT_OK); try { *************** *** 1177,1183 **** } ! StringDataStream sds = ! new StringDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! FRAGMENT_OK); try { --- 1177,1183 ---- } ! StringOutputDataStream sds = ! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! FRAGMENT_OK); try { *************** *** 1350,1355 **** // get the greeting from the session byte[] greeting = Session.this.getProfileRegistry().getGreeting(this); ! ByteDataStream f = ! new ByteDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, greeting); Message m = new MessageMSG(this.zero, 0, null); --- 1350,1356 ---- // get the greeting from the session byte[] greeting = Session.this.getProfileRegistry().getGreeting(this); ! ByteOutputDataStream f = ! new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE, ! greeting); Message m = new MessageMSG(this.zero, 0, null); --- ByteDataStream.java DELETED --- --- StringDataStream.java DELETED --- |
From: Huston F. <hu...@us...> - 2001-11-10 21:33:31
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/anonymous In directory usw-pr-cvs1:/tmp/cvs-serv17519/src/org/beepcore/beep/profile/sasl/anonymous Modified Files: AnonymousAuthenticator.java Log Message: Rename Byte/StringDataStream to Byte/StringOutputDataStream Index: AnonymousAuthenticator.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/anonymous/AnonymousAuthenticator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** AnonymousAuthenticator.java 2001/11/08 05:51:34 1.11 --- AnonymousAuthenticator.java 2001/11/10 21:33:29 1.12 *************** *** 211,215 **** try { credential.put(SessionCredential.AUTHENTICATOR, authenticateId); ! channel.sendMSG(new StringDataStream(blob.toString()), this); } catch (Exception x) { abort(x.getMessage()); --- 211,215 ---- try { credential.put(SessionCredential.AUTHENTICATOR, authenticateId); ! channel.sendMSG(new StringOutputDataStream(blob.toString()), this); } catch (Exception x) { abort(x.getMessage()); *************** *** 315,319 **** try { Blob reply = receiveID(data); ! message.sendRPY(new StringDataStream(reply.toString())); } catch (BEEPException x) { abort(x.getMessage()); --- 315,319 ---- try { Blob reply = receiveID(data); ! message.sendRPY(new StringOutputDataStream(reply.toString())); } catch (BEEPException x) { abort(x.getMessage()); *************** *** 331,335 **** { Blob reply = new Blob(Blob.STATUS_ABORT, s.getMessage()); ! message.sendRPY(new StringDataStream(reply.toString())); } catch(BEEPException t) --- 331,335 ---- { Blob reply = new Blob(Blob.STATUS_ABORT, s.getMessage()); ! message.sendRPY(new StringOutputDataStream(reply.toString())); } catch(BEEPException t) *************** *** 414,418 **** if(sendAbort) { Blob reply = new Blob(Blob.STATUS_ABORT, x.getMessage()); ! channel.sendMSG(new StringDataStream(blob.toString()), this); } --- 414,418 ---- if(sendAbort) { Blob reply = new Blob(Blob.STATUS_ABORT, x.getMessage()); ! channel.sendMSG(new StringOutputDataStream(blob.toString()), this); } |
From: Huston F. <hu...@us...> - 2001-11-10 21:33:31
|
Update of /cvsroot/beepcore-java/beepcore-java/example/org/beepcore/beep/example In directory usw-pr-cvs1:/tmp/cvs-serv17519/example/org/beepcore/beep/example Modified Files: Bing.java Log Message: Rename Byte/StringDataStream to Byte/StringOutputDataStream Index: Bing.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/example/org/beepcore/beep/example/Bing.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** Bing.java 2001/11/08 05:51:33 1.8 --- Bing.java 2001/11/10 21:33:28 1.9 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2001 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 27,31 **** import org.beepcore.beep.core.ProfileRegistry; import org.beepcore.beep.core.Session; ! import org.beepcore.beep.core.StringDataStream; import org.beepcore.beep.lib.Reply; import org.beepcore.beep.profile.echo.EchoProfile; --- 28,32 ---- import org.beepcore.beep.core.ProfileRegistry; import org.beepcore.beep.core.Session; ! import org.beepcore.beep.core.StringOutputDataStream; import org.beepcore.beep.lib.Reply; import org.beepcore.beep.profile.echo.EchoProfile; *************** *** 114,118 **** try { // Send the request ! channel.sendMSG(new StringDataStream(request), reply); } catch (BEEPException e) { System.err.println("bing: Error sending request (" + --- 115,120 ---- try { // Send the request ! channel.sendMSG(new StringOutputDataStream(request), ! reply); } catch (BEEPException e) { System.err.println("bing: Error sending request (" + |
From: Huston F. <hu...@us...> - 2001-11-10 03:58:48
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv23193/src/org/beepcore/beep/core Modified Files: Session.java Log Message: Changed getPeerSupportedProfiles to return a collection of URIs intead of Elements Index: Session.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Session.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** Session.java 2001/11/08 05:51:34 1.17 --- Session.java 2001/11/10 03:58:45 1.18 *************** *** 24,27 **** --- 24,28 ---- import java.util.Iterator; import java.util.Collection; + import java.util.Collections; import java.util.LinkedList; *************** *** 146,150 **** private SessionCredential localCredential, peerCredential; private SessionTuningProperties tuningProperties = null; ! private Collection peerSupportedProfiles; private boolean overflow; private boolean allowChannelWindowUpdates; --- 147,151 ---- private SessionCredential localCredential, peerCredential; private SessionTuningProperties tuningProperties = null; ! private Collection peerSupportedProfiles = null; private boolean overflow; private boolean allowChannelWindowUpdates; *************** *** 1542,1549 **** } ! profileList.add(i, profile); } ! Session.this.peerSupportedProfiles = profileList; } --- 1543,1551 ---- } ! profileList.add(i, uri); } ! Session.this.peerSupportedProfiles = ! Collections.unmodifiableCollection(profileList); } |
From: Huston F. <hu...@us...> - 2001-11-09 19:12:28
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv10880 Modified Files: ProfileRegistry.java Log Message: Removed getSessionProperties Index: ProfileRegistry.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/ProfileRegistry.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** ProfileRegistry.java 2001/11/08 05:51:34 1.8 --- ProfileRegistry.java 2001/11/09 19:12:25 1.9 *************** *** 163,171 **** } - SessionTuningProperties getSessionProperties(String uri) - { - return ((InternalProfile) profileListeners.get(uri)).tuning; - } - /** * Add the <code>StartChannelListener</code> for the specified URI. --- 163,166 ---- |
From: Huston F. <hu...@us...> - 2001-11-09 19:11:00
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib In directory usw-pr-cvs1:/tmp/cvs-serv9630/lib Modified Files: SharedChannel.java Log Message: Removed NotifyMessageListenerOnFirstFrame Index: SharedChannel.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/SharedChannel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SharedChannel.java 2001/10/31 00:32:37 1.4 --- SharedChannel.java 2001/11/09 19:10:58 1.5 *************** *** 143,151 **** } - public boolean getNotifyMessageListenerOnFirstFrame() - { - return channel.getNotifyMessageListenerOnFirstFrame(); - } - public int getNumber() { --- 143,146 ---- *************** *** 156,164 **** { return channel.getSession(); - } - - public void setNotifyMessageListenerOnFirstFrame(boolean b) - { - channel.setNotifyMessageListenerOnFirstFrame(b); } --- 151,154 ---- |
From: Huston F. <hu...@us...> - 2001-11-09 19:11:00
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv9630/core Modified Files: Channel.java Log Message: Removed NotifyMessageListenerOnFirstFrame Index: Channel.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Channel.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** Channel.java 2001/11/08 05:51:34 1.17 --- Channel.java 2001/11/09 19:10:58 1.18 *************** *** 181,185 **** peerWindowSize = DEFAULT_WINDOW_SIZE; waitTimeForPeer = 0; ! this.notifyOnFirstFrame = false; } --- 181,185 ---- peerWindowSize = DEFAULT_WINDOW_SIZE; waitTimeForPeer = 0; ! this.notifyOnFirstFrame = true; } *************** *** 333,337 **** * @see MessageListener */ ! public void setNotifyMessageListenerOnFirstFrame(boolean n) { this.notifyOnFirstFrame = n; --- 333,337 ---- * @see MessageListener */ ! void setNotifyMessageListenerOnFirstFrame(boolean n) { this.notifyOnFirstFrame = n; *************** *** 344,348 **** * @see #setNotifyMessageListenerOnFirstFrame */ ! public boolean getNotifyMessageListenerOnFirstFrame() { return this.notifyOnFirstFrame; --- 344,348 ---- * @see #setNotifyMessageListenerOnFirstFrame */ ! boolean getNotifyMessageListenerOnFirstFrame() { return this.notifyOnFirstFrame; |
From: Huston F. <hu...@us...> - 2001-11-09 18:41:26
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile In directory usw-pr-cvs1:/tmp/cvs-serv32503/src/org/beepcore/beep/profile Modified Files: ProfileConfiguration.java Log Message: Changed ProfileConfiguration to not inherit from Properties Index: ProfileConfiguration.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/ProfileConfiguration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ProfileConfiguration.java 2001/11/08 05:51:34 1.2 --- ProfileConfiguration.java 2001/11/09 18:41:23 1.3 *************** *** 19,23 **** ! import java.util.*; --- 19,24 ---- ! import java.util.Enumeration; ! import java.util.Properties; *************** *** 30,33 **** * at will. */ ! public class ProfileConfiguration extends Properties { } --- 31,83 ---- * at will. */ ! public class ProfileConfiguration { ! private Properties props = new Properties(); ! ! public ProfileConfiguration() { ! } ! ! /** ! * Searches for the property with the specified key in this ! * ProfileConfiguration. ! * ! * @param key the property key. ! * @return the value in this configuration list with the ! * specified key value or null if it is not found. ! */ ! public String getProperty(String key) { ! return props.getProperty(key); ! } ! ! /** ! * Searches for the property with the specified key in this ! * ProfileConfiguration. If the key is not found in this ! * ProfileConfiguration <code>defaultValue</code> is returned. ! * ! * @param key the property key. ! * @param defaultValue a default value. ! * @return the value in this configuration list with the ! * specified key value or <code>defaultValue</code> ! * if it is not found. ! */ ! public String getProperty(String key, String defaultValue) { ! return props.getProperty(key); ! } ! ! /** ! * Returns an enumeration of all the keys in this ProfileConfiguration. ! */ ! public Enumeration propertyNames() { ! return props.propertyNames(); ! } ! ! /** ! * Stores the value with the associated key in this ProfileConfiguration. ! * ! * @return the previous value of the specified key in this ! * ProfileConfiguration, or <code>null</code> if it did not have ! * one. ! */ ! public String setProperty(String key, String value) { ! return (String)props.setProperty(key, value); ! } } |
From: Huston F. <hu...@us...> - 2001-11-09 18:41:26
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls In directory usw-pr-cvs1:/tmp/cvs-serv32503/tls/org/beepcore/beep/profile/tls/ptls Modified Files: TLSProfilePureTLS.java TLSProfilePureTLSPemInit.java Log Message: Changed ProfileConfiguration to not inherit from Properties Index: TLSProfilePureTLS.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLS.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** TLSProfilePureTLS.java 2001/11/08 05:51:35 1.4 --- TLSProfilePureTLS.java 2001/11/09 18:41:23 1.5 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2001 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 61,66 **** * @see java.util.List */ ! public class TLSProfilePureTLS extends TLSProfile ! implements StartChannelListener { // Constants --- 62,68 ---- * @see java.util.List */ ! public class TLSProfilePureTLS extends TuningProfile ! implements StartChannelListener ! { // Constants *************** *** 71,75 **** /** ! * use this as the uri for the channel to open to encrypt a session using TLS. */ public static final String URI = "http://iana.org/beep/TLS"; --- 73,78 ---- /** ! * use this as the uri for the channel to open to encrypt a ! * session using TLS. */ public static final String URI = "http://iana.org/beep/TLS"; *************** *** 95,99 **** // property names ! // public static final String PROPERTY_PEER_AUTHENTICATION_REQUIRED = "Peer Authentication Required"; public static final String PROPERTY_CLIENT_AUTH_REQUIRED = "Client Authenticaton Required"; --- 98,103 ---- // property names ! // public static final String PROPERTY_PEER_AUTHENTICATION_REQUIRED = ! // "Peer Authentication Required"; public static final String PROPERTY_CLIENT_AUTH_REQUIRED = "Client Authenticaton Required"; *************** *** 183,187 **** } ! public boolean advertiseProfile(Session session, SessionTuningProperties tuning) throws BEEPException { --- 187,192 ---- } ! public boolean advertiseProfile(Session session, ! SessionTuningProperties tuning) throws BEEPException { *************** *** 198,212 **** * * @param uri used to start a channel with TLS protection ! * @param config used to specify the parameters for sessions protected ! * by this profile's version of TLS. In other words, if you want another ! * set of paramters, you must either recall this method or create another ! * <code>TLSProfilePureTLS</code> and call this method with a new configuration. * The meaningful properties that can be set are: * <table> * <tr> ! * <td><i>Cipher Suite</i></td><td><code>short []</code> corresponding to the ! * <a href="http://www.ietf.org/rfc/rfc2246.txt">TLS spec</a> ciphers (Appendix A). ! * By default all the ciphers (except anonymous for now) are available. Use this ! * to restrict to a certain strength of cipher if you desire to do so.</td> * </tr> * <tr> --- 203,221 ---- * * @param uri used to start a channel with TLS protection ! * @param config used to specify the parameters for sessions ! * protected by this profile's version of TLS. In other words, if ! * you want another set of paramters, you must either recall this ! * method or create another <code>TLSProfilePureTLS</code> and ! * call this method with a new configuration. ! * * The meaningful properties that can be set are: * <table> * <tr> ! * <td><i>Cipher Suite</i></td><td><code>short []</code> ! * corresponding to the <a ! * href="http://www.ietf.org/rfc/rfc2246.txt">TLS spec</a> ciphers ! * (Appendix A). By default all the ciphers (except anonymous for ! * now) are available. Use this to restrict to a certain strength ! * of cipher if you desire to do so.</td> * </tr> * <tr> *************** *** 226,234 **** * <tr> * <td><i>Trusted Certificates</i></td><td>{@link List} that holds ! * all trusted (or root) certificates that we can verify a peer against.</td> * </tr> * </table> */ ! public StartChannelListener init(String uri, ProfileConfiguration config) throws BEEPException { --- 235,244 ---- * <tr> * <td><i>Trusted Certificates</i></td><td>{@link List} that holds ! * all trusted (or root) certificates that we can verify a peer ! * against.</td> * </tr> * </table> */ ! public StartChannelListener init(String uri, Hashtable config) throws BEEPException { *************** *** 281,285 **** || (config.get(PROPERTY_CERTIFICATES) == null) || (config.get(PROPERTY_TRUSTED_CERTS) == null)) { ! throw new BEEPException("Must have a private key and certificates with root certificates that match the key's algorithm"); } --- 291,297 ---- || (config.get(PROPERTY_CERTIFICATES) == null) || (config.get(PROPERTY_TRUSTED_CERTS) == null)) { ! throw new BEEPException("Must have a private key and " + ! "certificates with root certificates " + ! "that match the key's algorithm"); } *************** *** 291,295 **** // store the certificates if (!(config.get(PROPERTY_CERTIFICATES) instanceof List)) { ! throw new BEEPException("X.509 Certificates should be in a List or subclass"); } --- 303,308 ---- // store the certificates if (!(config.get(PROPERTY_CERTIFICATES) instanceof List)) { ! throw new BEEPException("X.509 Certificates should be in a List " + ! "or subclass"); } *************** *** 332,336 **** } } catch (Exception e) { ! throw new BEEPException("Trusted (root) certificates must be in DRE format contained in byte[]"); } --- 345,350 ---- } } catch (Exception e) { ! throw new BEEPException("Trusted (root) certificates must be in " + ! "DRE format contained in byte[]"); } *************** *** 488,496 **** * Called when the underlying BEEP framework receives * a "close" element.<p> ! * As of now, it is not possible to close a TLS channel. To cease using ! * TLS, the entire session must be closed. This is done since opening ! * a TLS channel resets the entire session, effectively closing all the ! * previously open channels, including channel 0 (hence the greetings are ! * exchanged again). * * @param channel <code>Channel</code> which received the close request. --- 502,511 ---- * Called when the underlying BEEP framework receives * a "close" element.<p> ! * ! * As of now, it is not possible to close a TLS channel. To cease ! * using TLS, the entire session must be closed. This is done ! * since opening a TLS channel resets the entire session, ! * effectively closing all the previously open channels, including ! * channel 0 (hence the greetings are exchanged again). * * @param channel <code>Channel</code> which received the close request. *************** *** 732,740 **** /** ! * allows an initializer class to set the trusted certificates for the profile. ! * The initializers are profile classes with a custom {@link init} method ! * that takes the certificates (a {@link List} of byte[], each being ! * the DER format for an X.509 certificate) from a given source, such as a ! * file or database and calls this method. * @param certs */ --- 747,757 ---- /** ! * allows an initializer class to set the trusted certificates for ! * the profile. The initializers are profile classes with a ! * custom {@link init} method that takes the certificates (a ! * {@link List} of byte[], each being the DER format for an X.509 ! * certificate) from a given source, such as a file or database ! * and calls this method. ! * * @param certs */ Index: TLSProfilePureTLSPemInit.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLSPemInit.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TLSProfilePureTLSPemInit.java 2001/11/08 05:51:35 1.3 --- TLSProfilePureTLSPemInit.java 2001/11/09 18:41:23 1.4 *************** *** 3,6 **** --- 3,7 ---- * * Copyright (c) 2001 Invisible Worlds, Inc. All rights reserved. + * Copyright (c) 2001 Huston Franklin. All rights reserved. * * The contents of this file are subject to the Blocks Public License (the *************** *** 21,24 **** --- 22,26 ---- import org.beepcore.beep.profile.*; import org.beepcore.beep.profile.tls.TLSProfile; + import org.beepcore.beep.transport.tcp.TCPSession; import java.security.PrivateKey; *************** *** 46,50 **** * specific configuration to encrypt a session with TLS. */ ! public class TLSProfilePureTLSPemInit implements Profile { // property names --- 48,52 ---- * specific configuration to encrypt a session with TLS. */ ! public class TLSProfilePureTLSPemInit extends TLSProfile { // property names *************** *** 65,68 **** --- 67,72 ---- "Trusted Certificates"; + private TLSProfilePureTLS tlsp = new TLSProfilePureTLS(); + /** * init sets the criteria for which an TLS connection is made when *************** *** 74,109 **** * * @param uri used to start a channel with TLS protection ! * @param config used to specify the parameters for sessions protected ! * by this profile's version of TLS. In other words, if you want another ! * set of paramters, you must either recall this method or create another ! * <code>TLSProfilePureTLSPemInit</code> and call this method with a new ! * configuration. Note: All different parameters may be in the same PEM file. * The meaningful properties that can be set are: * <table> * <tr> ! * <td><i>Cipher Suite</i></td><td>List of cipher names (comma separated) ! * to accept. Cipher names are formatted as per Appendix A in the TLS spec. ! * By default all the ciphers (except anonymous for now) are available. Use this ! * to restrict to a certain strength of cipher if you desire to do so.</td> * </tr> * <tr> ! * <td><i>Certificates</i></td><td>Name of the PEM file that contains the ! * certificates to present. These are in order from the user's certificate ! * to the root certificate.</td> * </tr> * <tr> * <td><i>Private Key</i></td><td>Name of the PEM file that contains the * encrypted private key to use.</td> * </tr> * <tr> ! * <td><i>Private Key Passphrase</i></td><td>{@link String} passphrase used to ! * encrypt the private key in its file.</td> * </tr> * <tr> ! * <td><i>Private Key Type</i></td><td>"RSA" or "DSA" are the two accepted private key formats.</td> * </tr> * <tr> ! * <td><i>Trusted Certificates</i></td><td>Name of the PEM file that contains ! * the root certificates used to verify a peer's identity.</td> * </tr> * </table> --- 78,124 ---- * * @param uri used to start a channel with TLS protection ! * @param config used to specify the parameters for sessions ! * protected by this profile's version of TLS. In other words, if ! * you want another set of paramters, you must either recall this ! * method or create another <code>TLSProfilePureTLSPemInit</code> ! * and call this method with a new configuration. Note: All ! * different parameters may be in the same PEM file. ! * * The meaningful properties that can be set are: + * * <table> * <tr> ! * <td><i>Cipher Suite</i></td><td>List of cipher names (comma ! * separated) to accept. Cipher names are formatted as per ! * Appendix A in the TLS spec. By default all the ciphers (except ! * anonymous for now) are available. Use this to restrict to a ! * certain strength of cipher if you desire to do so.</td> * </tr> + * * <tr> ! * <td><i>Certificates</i></td><td>Name of the PEM file that ! * contains the certificates to present. These are in order from ! * the user's certificate to the root certificate.</td> * </tr> + * * <tr> * <td><i>Private Key</i></td><td>Name of the PEM file that contains the * encrypted private key to use.</td> * </tr> + * * <tr> ! * <td><i>Private Key Passphrase</i></td><td>{@link String} ! * passphrase used to encrypt the private key in its file.</td> * </tr> + * * <tr> ! * <td><i>Private Key Type</i></td><td>"RSA" or "DSA" are the two ! * accepted private key formats.</td> * </tr> + * * <tr> ! * <td><i>Trusted Certificates</i></td><td>Name of the PEM file ! * that contains the root certificates used to verify a peer's ! * identity.</td> * </tr> * </table> *************** *** 112,120 **** throws BEEPException { - TLSProfilePureTLS tlsp = new TLSProfilePureTLS(); - // set whether or not peer must send a certificate ! if (config.get(PROPERTY_CLIENT_AUTH_REQUIRED) != null) { ! if (new Boolean((String) config.get(PROPERTY_CLIENT_AUTH_REQUIRED)).booleanValue() == true) { tlsp.setNeedPeerAuthentication(true); } else { --- 127,133 ---- throws BEEPException { // set whether or not peer must send a certificate ! if (config.getProperty(PROPERTY_CLIENT_AUTH_REQUIRED) != null) { ! if (new Boolean(config.getProperty(PROPERTY_CLIENT_AUTH_REQUIRED)).booleanValue() == true) { tlsp.setNeedPeerAuthentication(true); } else { *************** *** 123,131 **** } // set the cipher suites ! if (config.get(PROPERTY_CIPHER_SUITE) != null) { // parse the cipher names int fromIndex = 0; ! String cipherNames = (String) config.get(PROPERTY_CIPHER_SUITE); short cipherTemp[] = new short[TLSProfilePureTLS.MAX_CIPHERS]; int cipherCount = 0; --- 136,144 ---- } // set the cipher suites ! if (config.getProperty(PROPERTY_CIPHER_SUITE) != null) { // parse the cipher names int fromIndex = 0; ! String cipherNames = config.getProperty(PROPERTY_CIPHER_SUITE); short cipherTemp[] = new short[TLSProfilePureTLS.MAX_CIPHERS]; int cipherCount = 0; *************** *** 172,180 **** // the user must supply a private key, certificate(s), and trusted // certificate. ! if ((config.get(PROPERTY_PRIVATE_KEY) == null) ! || (config.get(PROPERTY_PRIVATE_KEY_TYPE) == null) ! || (config.get(PROPERTY_CERTIFICATES) == null) ! || (config.get(PROPERTY_TRUSTED_CERTS) == null)) { ! throw new BEEPException("Must have a private key and certificates with root certificates that match the key's algorithm"); } --- 185,196 ---- // the user must supply a private key, certificate(s), and trusted // certificate. ! if ((config.getProperty(PROPERTY_PRIVATE_KEY) == null) ! || (config.getProperty(PROPERTY_PRIVATE_KEY_TYPE) == null) ! || (config.getProperty(PROPERTY_CERTIFICATES) == null) ! || (config.getProperty(PROPERTY_TRUSTED_CERTS) == null)) ! { ! throw new BEEPException("Must have a private key and certificates " ! + "with root certificates that match the " ! + "key's algorithm"); } *************** *** 188,192 **** // to the negotiated cipher suite. We assume that the // peer has a root that is in common with us. ! String certFile = (String) config.get(PROPERTY_CERTIFICATES); BufferedReader certbr = new BufferedReader(new FileReader(certFile)); --- 204,208 ---- // to the negotiated cipher suite. We assume that the // peer has a root that is in common with us. ! String certFile = config.getProperty(PROPERTY_CERTIFICATES); BufferedReader certbr = new BufferedReader(new FileReader(certFile)); *************** *** 207,216 **** tlsp.setCertChain(certs); ! String keyFile = (String) config.get(PROPERTY_PRIVATE_KEY); BufferedReader keybr = new BufferedReader(new FileReader(keyFile)); ! String keyType = (String) config.get(PROPERTY_PRIVATE_KEY_TYPE); String passphrase = ! (String) config.get(PROPERTY_PRIVATE_KEY_PASSPHRASE); StringBuffer actualKeyType = new StringBuffer(); --- 223,232 ---- tlsp.setCertChain(certs); ! String keyFile = config.getProperty(PROPERTY_PRIVATE_KEY); BufferedReader keybr = new BufferedReader(new FileReader(keyFile)); ! String keyType = config.getProperty(PROPERTY_PRIVATE_KEY_TYPE); String passphrase = ! config.getProperty(PROPERTY_PRIVATE_KEY_PASSPHRASE); StringBuffer actualKeyType = new StringBuffer(); *************** *** 222,228 **** if (!actualKeyType.toString().equals(keyType)) { ! throw new BEEPException("Private key types differ. Looking for " ! + keyType + " and found " ! + actualKeyType.toString()); } --- 238,245 ---- if (!actualKeyType.toString().equals(keyType)) { ! throw new BEEPException("Private key types differ. " + ! "Looking for " + keyType + ! " and found " + ! actualKeyType.toString()); } *************** *** 234,238 **** // verify that the object passed in is either a list or a String ! certFile = (String) config.get(PROPERTY_TRUSTED_CERTS); certbr = new BufferedReader(new FileReader(certFile)); certType = new StringBuffer(); --- 251,255 ---- // verify that the object passed in is either a list or a String ! certFile = config.getProperty(PROPERTY_TRUSTED_CERTS); certbr = new BufferedReader(new FileReader(certFile)); certType = new StringBuffer(); *************** *** 258,261 **** --- 275,282 ---- // return the TLSProfilePureTLS as the start channel listener return tlsp; + } + + public TCPSession startTLS(TCPSession session) throws BEEPException { + return tlsp.startTLS(session); } } |
From: Huston F. <hu...@us...> - 2001-11-09 18:41:26
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse In directory usw-pr-cvs1:/tmp/cvs-serv32503/tls/org/beepcore/beep/profile/tls/jsse Modified Files: TLSProfileJSSE.java Log Message: Changed ProfileConfiguration to not inherit from Properties Index: TLSProfileJSSE.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSE.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** TLSProfileJSSE.java 2001/11/08 05:51:35 1.4 --- TLSProfileJSSE.java 2001/11/09 18:41:23 1.5 *************** *** 323,352 **** // initialize the key managers, trust managers, and ! keyAlgorithm = config.getProperty(PROPERTY_KEY_MANAGER_ALGORITHM, ! null); ! keyProvider = config.getProperty(PROPERTY_KEY_MANAGER_PROVIDER, ! null); trustAlgorithm = ! config.getProperty(PROPERTY_TRUST_MANAGER_ALGORITHM, null); trustProvider = ! config.getProperty(PROPERTY_TRUST_MANAGER_PROVIDER, null); ! keyPassphrase = config.getProperty(PROPERTY_KEYSTORE_PASSPHRASE, ! null); ! keyStoreType = config.getProperty(PROPERTY_KEYSTORE_TYPE, null); ! keyStoreName = config.getProperty(PROPERTY_KEYSTORE_NAME, null); keyStoreFormat = config.getProperty(PROPERTY_KEYSTORE_FORMAT, "JKS"); ! keyStoreProvider = config.getProperty(PROPERTY_KEYSTORE_PROVIDER, ! null); trustPassphrase = ! config.getProperty(PROPERTY_TRUSTSTORE_PASSPHRASE, null); ! trustStoreType = config.getProperty(PROPERTY_TRUSTSTORE_TYPE, ! null); ! trustStoreName = config.getProperty(PROPERTY_TRUSTSTORE_NAME, ! null); trustStoreFormat = config.getProperty(PROPERTY_TRUSTSTORE_FORMAT, "JKS"); trustStoreProvider = ! config.getProperty(PROPERTY_TRUSTSTORE_PROVIDER, null); // determine if the client must authenticate or if the server can --- 323,346 ---- // initialize the key managers, trust managers, and ! keyAlgorithm = config.getProperty(PROPERTY_KEY_MANAGER_ALGORITHM); ! keyProvider = config.getProperty(PROPERTY_KEY_MANAGER_PROVIDER); trustAlgorithm = ! config.getProperty(PROPERTY_TRUST_MANAGER_ALGORITHM); trustProvider = ! config.getProperty(PROPERTY_TRUST_MANAGER_PROVIDER); ! keyPassphrase = config.getProperty(PROPERTY_KEYSTORE_PASSPHRASE); ! keyStoreType = config.getProperty(PROPERTY_KEYSTORE_TYPE); ! keyStoreName = config.getProperty(PROPERTY_KEYSTORE_NAME); keyStoreFormat = config.getProperty(PROPERTY_KEYSTORE_FORMAT, "JKS"); ! keyStoreProvider = config.getProperty(PROPERTY_KEYSTORE_PROVIDER); trustPassphrase = ! config.getProperty(PROPERTY_TRUSTSTORE_PASSPHRASE); ! trustStoreType = config.getProperty(PROPERTY_TRUSTSTORE_TYPE); ! trustStoreName = config.getProperty(PROPERTY_TRUSTSTORE_NAME); trustStoreFormat = config.getProperty(PROPERTY_TRUSTSTORE_FORMAT, "JKS"); trustStoreProvider = ! config.getProperty(PROPERTY_TRUSTSTORE_PROVIDER); // determine if the client must authenticate or if the server can |
From: Huston F. <hu...@us...> - 2001-11-09 16:44:46
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/tls In directory usw-pr-cvs1:/tmp/cvs-serv24003/src/org/beepcore/beep/profile/tls Modified Files: TLSProfile.java Log Message: Changed JSSE to be the default provider Index: TLSProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/tls/TLSProfile.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** TLSProfile.java 2001/11/08 05:51:35 1.13 --- TLSProfile.java 2001/11/09 16:44:43 1.14 *************** *** 1,3 **** - /* * TLSProfile.java $Revision$ $Date$ --- 1,2 ---- *************** *** 43,52 **** /** - * list of known providers - */ - public static final String[] providers = { "TLSProfilePureTLS", - "TLSProfileJSSE" }; - - /** * init sets the criteria for which an TLS connection is made when * a TLS channel is started for a profile. It should only be --- 42,45 ---- *************** *** 65,69 **** * instance of a <code>TLSProfile</code>. */ ! abstract public StartChannelListener init(String uri, ProfileConfiguration config) throws BEEPException; --- 58,63 ---- * instance of a <code>TLSProfile</code>. */ ! abstract public StartChannelListener init(String uri, ! ProfileConfiguration config) throws BEEPException; *************** *** 97,101 **** try { return ! getInstance("org.beepcore.beep.profile.tls.ptls.TLSProfilePureTLS"); } catch (NoClassDefFoundError e) { } --- 91,95 ---- try { return ! getInstance("org.beepcore.beep.profile.tls.jsse.TLSProfileJSSE"); } catch (NoClassDefFoundError e) { } *************** *** 103,107 **** try { return ! getInstance("org.beepcore.beep.profile.tls.jsse.TLSProfileJSSE"); } catch (NoClassDefFoundError e) { throw new BEEPException("TLS not installed"); --- 97,101 ---- try { return ! getInstance("org.beepcore.beep.profile.tls.ptls.TLSProfilePureTLSPemInit"); } catch (NoClassDefFoundError e) { throw new BEEPException("TLS not installed"); |
From: Huston F. <hu...@us...> - 2001-11-09 15:49:31
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp In directory usw-pr-cvs1:/tmp/cvs-serv5063/src/org/beepcore/beep/transport/tcp Modified Files: TCPSession.java Log Message: TLS fix Index: TCPSession.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/transport/tcp/TCPSession.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** TCPSession.java 2001/11/08 05:26:29 1.15 --- TCPSession.java 2001/11/09 15:49:28 1.16 *************** *** 360,363 **** --- 360,366 ---- } + // If IO is disabled don't send SEQ + if (running == false) + return false; // @todo update the java-doc to correctly identify the params /* |
From: Huston F. <hu...@us...> - 2001-11-08 05:51:39
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls In directory usw-pr-cvs1:/tmp/cvs-serv13730/tls/org/beepcore/beep/profile/tls/ptls Modified Files: TLSProfilePureTLS.java TLSProfilePureTLSHandshakeCompletedListener.java TLSProfilePureTLSPemInit.java Log Message: changed URL for BPL Index: TLSProfilePureTLS.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLS.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TLSProfilePureTLS.java 2001/08/14 14:41:27 1.3 --- TLSProfilePureTLS.java 2001/11/08 05:51:35 1.4 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TLSProfilePureTLSHandshakeCompletedListener.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLSHandshakeCompletedListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TLSProfilePureTLSHandshakeCompletedListener.java 2001/07/09 05:57:05 1.1 --- TLSProfilePureTLSHandshakeCompletedListener.java 2001/11/08 05:51:35 1.2 *************** *** 8,12 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 8,12 ---- * "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, Index: TLSProfilePureTLSPemInit.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/ptls/TLSProfilePureTLSPemInit.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TLSProfilePureTLSPemInit.java 2001/08/14 14:41:27 1.2 --- TLSProfilePureTLSPemInit.java 2001/11/08 05:51:35 1.3 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, |
From: Huston F. <hu...@us...> - 2001-11-08 05:51:39
|
Update of /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core In directory usw-pr-cvs1:/tmp/cvs-serv13730/test/org/beepcore/beep/core Modified Files: TestByteDataStream.java TestDataStream.java TestFileDataStream.java TestFrameDataStream.java TestInputStreamDataStream.java TestStringDataStream.java Log Message: changed URL for BPL Index: TestByteDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestByteDataStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestByteDataStream.java 2001/05/16 19:42:41 1.1 --- TestByteDataStream.java 2001/11/08 05:51:35 1.2 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TestDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestDataStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestDataStream.java 2001/05/16 19:42:41 1.1 --- TestDataStream.java 2001/11/08 05:51:35 1.2 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TestFileDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestFileDataStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestFileDataStream.java 2001/05/16 19:42:41 1.1 --- TestFileDataStream.java 2001/11/08 05:51:35 1.2 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TestFrameDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestFrameDataStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestFrameDataStream.java 2001/05/16 19:42:41 1.1 --- TestFrameDataStream.java 2001/11/08 05:51:35 1.2 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TestInputStreamDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestInputStreamDataStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TestInputStreamDataStream.java 2001/05/16 19:42:41 1.1 --- TestInputStreamDataStream.java 2001/11/08 05:51:35 1.2 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TestStringDataStream.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/test/org/beepcore/beep/core/TestStringDataStream.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TestStringDataStream.java 2001/10/31 00:32:38 1.2 --- TestStringDataStream.java 2001/11/08 05:51:35 1.3 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, |
From: Huston F. <hu...@us...> - 2001-11-08 05:51:38
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse In directory usw-pr-cvs1:/tmp/cvs-serv13730/tls/org/beepcore/beep/profile/tls/jsse Modified Files: TLSProfileJSSE.java TLSProfileJSSEHandshakeCompletedListener.java Log Message: changed URL for BPL Index: TLSProfileJSSE.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSE.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TLSProfileJSSE.java 2001/07/30 13:10:47 1.3 --- TLSProfileJSSE.java 2001/11/08 05:51:35 1.4 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, Index: TLSProfileJSSEHandshakeCompletedListener.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSEHandshakeCompletedListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** TLSProfileJSSEHandshakeCompletedListener.java 2001/07/12 07:09:10 1.2 --- TLSProfileJSSEHandshakeCompletedListener.java 2001/11/08 05:51:35 1.3 *************** *** 8,12 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 8,12 ---- * "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, |
From: Huston F. <hu...@us...> - 2001-11-08 05:51:38
|
Update of /cvsroot/beepcore-java/beepcore-java/tls/com/claymoresystems/ptls In directory usw-pr-cvs1:/tmp/cvs-serv13730/tls/com/claymoresystems/ptls Modified Files: PureTLSPackageBridge.java Log Message: changed URL for BPL Index: PureTLSPackageBridge.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/tls/com/claymoresystems/ptls/PureTLSPackageBridge.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PureTLSPackageBridge.java 2001/07/09 05:57:04 1.1 --- PureTLSPackageBridge.java 2001/11/08 05:51:35 1.2 *************** *** 7,11 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "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, |