More code, more code, more kibbles and code.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-05-23 04:03:41 +00:00
parent d865c89bee
commit 6717f8d6e5
14 changed files with 402 additions and 71 deletions
@@ -1,8 +1,12 @@
//
// $Id: Credentials.java,v 1.1 2001/05/22 06:07:59 mdb Exp $
// $Id: Credentials.java,v 1.2 2001/05/23 04:03:40 mdb Exp $
package com.samskivert.cocktail.cher.net;
import java.io.IOException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import com.samskivert.cocktail.cher.io.TypedObject;
import com.samskivert.cocktail.cher.io.TypedObjectFactory;
@@ -17,7 +21,7 @@ import com.samskivert.cocktail.cher.io.TypedObjectFactory;
* that they can be instantiated prior to reconstruction from a data input
* stream.
*/
public abstract class Credentials extends TypedObject
public abstract class Credentials implements TypedObject
{
/**
* All credential derived classes should base their typed object code
@@ -25,6 +29,28 @@ public abstract class Credentials extends TypedObject
*/
public static final short TYPE_BASE = 300;
/**
* Derived classes should override this function to write their fields
* out to the supplied data output stream. They <em>must</em> be sure
* to first call <code>super.writeTo()</code>.
*/
public void writeTo (DataOutputStream out)
throws IOException
{
// we don't do anything here, but we may want to some day
}
/**
* Derived classes should override this function to read their fields
* from the supplied data input stream. They <em>must</em> be sure to
* first call <code>super.readFrom()</code>.
*/
public void readFrom (DataInputStream in)
throws IOException
{
// we don't do anything here, but we may want to some day
}
// register our credential classes
static {
TypedObjectFactory.registerClass(UsernamePasswordCreds.TYPE,