[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/core Frame.java,1.15,1.16 ProfileRe
Status: Beta
Brought to you by:
huston
|
From: Huston F. <hu...@us...> - 2001-11-27 17:37:25
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core
In directory usw-pr-cvs1:/tmp/cvs-serv6472/src/org/beepcore/beep/core
Modified Files:
Frame.java ProfileRegistry.java Session.java
Log Message:
Added utility methods for String to ASCII
Index: Frame.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Frame.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** Frame.java 2001/11/27 16:04:58 1.15
--- Frame.java 2001/11/27 17:37:22 1.16
***************
*** 19,24 ****
- import java.io.UnsupportedEncodingException;
-
import java.util.Iterator;
import java.util.LinkedList;
--- 19,22 ----
***************
*** 28,31 ****
--- 26,30 ----
import org.beepcore.beep.util.HeaderParser;
import org.beepcore.beep.util.Log;
+ import org.beepcore.beep.util.StringUtil;
/**
***************
*** 281,291 ****
header.append(this.CRLF);
! Log.logEntry(Log.SEV_DEBUG, header.toString());
! try {
! return header.toString().getBytes("UTF-8");
! } catch (UnsupportedEncodingException e) {
! throw new RuntimeException("UnsupportedEncodingException" +
! e.getMessage());
}
}
--- 280,287 ----
header.append(this.CRLF);
! if (Log.isLogged(Log.SEV_DEBUG)) {
! Log.logEntry(Log.SEV_DEBUG, header.toString());
}
+ return StringUtil.stringBufferToAscii(header);
}
***************
*** 360,365 ****
}
! Log.logEntry(Log.SEV_DEBUG_VERBOSE,
! "getMessageType=" + types[ret] + " (" + ret + ")");
return ret;
--- 356,363 ----
}
! if (Log.isLogged(Log.SEV_DEBUG_VERBOSE)) {
! Log.logEntry(Log.SEV_DEBUG_VERBOSE, "getMessageType=" +
! types[ret] + " (" + ret + ")");
! }
return ret;
Index: ProfileRegistry.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/ProfileRegistry.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** ProfileRegistry.java 2001/11/09 19:12:25 1.9
--- ProfileRegistry.java 2001/11/27 17:37:22 1.10
***************
*** 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
***************
*** 20,31 ****
import java.util.Enumeration;
import java.util.Hashtable;
import org.beepcore.beep.util.Log;
/**
! * This class is used to save pointers in Sessions - if the peer is using
! * the same set of profile and associated StartChannelListener for all
! * sessions then they should create one of these helpers and use them in
! * the corresponding factory methods.
*
* @author Eric Dixon
--- 21,33 ----
import java.util.Enumeration;
import java.util.Hashtable;
+
import org.beepcore.beep.util.Log;
+ import org.beepcore.beep.util.StringUtil;
/**
! * Maintains a set of associations between URIs and
! * <code>StartChannelListener</code>s. This set is used to generate
! * the <code>greeting</code> and to demux <code>start</code> requests.
*
* @author Eric Dixon
***************
*** 33,37 ****
* @author Jay Kint
* @author Scott Pead
! * @version $Revision, $Date$
*/
public class ProfileRegistry implements Cloneable {
--- 35,39 ----
* @author Jay Kint
* @author Scott Pead
! * @version $Revision$, $Date$
*/
public class ProfileRegistry implements Cloneable {
***************
*** 117,122 ****
*
*/
! public StartChannelListener getStartChannelListener(SessionTuningProperties tuning,
! String uri)
{
--- 119,125 ----
*
*/
! public StartChannelListener
! getStartChannelListener(SessionTuningProperties tuning,
! String uri)
{
***************
*** 173,178 ****
*
*/
! public synchronized StartChannelListener addStartChannelListener(String profile,
! StartChannelListener listener, SessionTuningProperties tuning)
{
--- 176,183 ----
*
*/
! public synchronized StartChannelListener
! addStartChannelListener(String profile,
! StartChannelListener listener,
! SessionTuningProperties tuning)
{
***************
*** 205,209 ****
*
*/
! public synchronized StartChannelListener removeStartChannelListener(String profile)
{
InternalProfile temp =
--- 210,215 ----
*
*/
! public synchronized StartChannelListener
! removeStartChannelListener(String profile)
{
InternalProfile temp =
***************
*** 316,323 ****
sb.append(FRAGMENT_GREETING_SUFFIX);
-
- greeting = sb.toString();
! return greeting.getBytes();
}
}
--- 322,327 ----
sb.append(FRAGMENT_GREETING_SUFFIX);
! return StringUtil.stringBufferToAscii(sb);
}
}
Index: Session.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Session.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** Session.java 2001/11/22 15:25:29 1.20
--- Session.java 2001/11/27 17:37:22 1.21
***************
*** 40,43 ****
--- 40,44 ----
import org.beepcore.beep.core.event.SessionListener;
import org.beepcore.beep.util.Log;
+ import org.beepcore.beep.util.StringUtil;
***************
*** 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;
--- 142,145 ----
***************
*** 597,602 ****
// Make a message
OutputDataStream ds =
! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! startBuffer.toString());
// Tell Channel Zero to start us up
--- 596,601 ----
// Make a message
OutputDataStream ds =
! new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! StringUtil.stringBufferToAscii(startBuffer));
// Tell Channel Zero to start us up
***************
*** 989,994 ****
synchronized (reply) {
OutputDataStream ds =
! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! closeBuffer.toString());
this.zero.sendMSG(ds,
--- 988,993 ----
synchronized (reply) {
OutputDataStream ds =
! new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! StringUtil.stringBufferToAscii(closeBuffer));
this.zero.sendMSG(ds,
***************
*** 1051,1062 ****
}
! StringOutputDataStream sds =
! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! sb.toString());
// Store the Channel
ch.setState(Channel.STATE_OK);
channels.put(ch.getNumberAsString(), ch);
! ((Message)zero.getAppData()).sendRPY(sds);
}
--- 1050,1061 ----
}
! OutputDataStream ds =
! new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! StringUtil.stringBufferToAscii(sb));
// Store the Channel
ch.setState(Channel.STATE_OK);
channels.put(ch.getNumberAsString(), ch);
! ((Message)zero.getAppData()).sendRPY(ds);
}
***************
*** 1165,1171 ****
// Send an ok
! StringOutputDataStream sds =
! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! FRAGMENT_OK);
try {
--- 1164,1170 ----
// Send an ok
! OutputDataStream sds =
! new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! StringUtil.stringToAscii(FRAGMENT_OK));
try {
***************
*** 1243,1249 ****
}
! StringOutputDataStream sds =
! new StringOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! FRAGMENT_OK);
try {
--- 1242,1248 ----
}
! OutputDataStream sds =
! new ByteOutputDataStream(MimeHeaders.BEEP_XML_CONTENT_TYPE,
! StringUtil.stringToAscii(FRAGMENT_OK));
try {
|