e912b18e27
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@77 542714f4-19e9-0310-aa3c-eee0fc999fb1
63 lines
1.2 KiB
Java
63 lines
1.2 KiB
Java
//
|
|
// $Id: FailureResponse.java,v 1.6 2001/07/19 19:30:14 mdb Exp $
|
|
|
|
package com.threerings.cocktail.cher.net;
|
|
|
|
import java.io.IOException;
|
|
import java.io.DataInputStream;
|
|
import java.io.DataOutputStream;
|
|
|
|
public class FailureResponse extends DownstreamMessage
|
|
{
|
|
/** The code for a failure notification. */
|
|
public static final short TYPE = TYPE_BASE + 4;
|
|
|
|
/**
|
|
* Zero argument constructor used when unserializing an instance.
|
|
*/
|
|
public FailureResponse ()
|
|
{
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructs a failure response in response to a request for the
|
|
* specified oid.
|
|
*/
|
|
public FailureResponse (int oid)
|
|
{
|
|
_oid = oid;
|
|
}
|
|
|
|
public short getType ()
|
|
{
|
|
return TYPE;
|
|
}
|
|
|
|
public int getOid ()
|
|
{
|
|
return _oid;
|
|
}
|
|
|
|
public void writeTo (DataOutputStream out)
|
|
throws IOException
|
|
{
|
|
super.writeTo(out);
|
|
out.writeInt(_oid);
|
|
}
|
|
|
|
public void readFrom (DataInputStream in)
|
|
throws IOException
|
|
{
|
|
super.readFrom(in);
|
|
_oid = in.readInt();
|
|
}
|
|
|
|
public String toString ()
|
|
{
|
|
return "[type=FAIL, msgid=" + messageId + ", oid=" + _oid + "]";
|
|
}
|
|
|
|
protected int _oid;
|
|
}
|