// // $Id: AuthResponse.java,v 1.3 2001/05/29 03:27:59 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.dobj.DObjectFactory; /** * The auth response communicates authentication success or failure as * well as associated information via a distribted object transmitted * along with the response. The distributed object simply serves as a * container for the varied and manifold data involved in the * authentication process. */ public class AuthResponse extends DownstreamMessage { /** The code for an auth response. */ public static final short TYPE = TYPE_BASE + 0; /** * Zero argument constructor used when unserializing an instance. */ public AuthResponse () { super(); } /** * Constructs a auth response with the supplied credentials. */ public AuthResponse (AuthResponseData data) { _data = data; } public AuthResponseData getData () { return _data; } public short getType () { return TYPE; } public void writeTo (DataOutputStream out) throws IOException { super.writeTo(out); DObjectFactory.writeTo(out, _data); } public void readFrom (DataInputStream in) throws IOException { super.readFrom(in); _data = (AuthResponseData)DObjectFactory.readFrom(in); } protected AuthResponseData _data; }