* @param status Status
*/
public void sendStatus(Status status) {
final boolean andReturn = !status.getCode().equals(
StatusCodes.NS_DATA_START);
final Invoke invoke;
if (andReturn) {
final PendingCall call = new PendingCall(null, "onStatus",
new Object[] { status });
invoke = new Invoke();
invoke.setInvokeId(1);
invoke.setCall(call);
} else {
final Call call = new Call(null, "onStatus", new Object[] { status });
invoke = (Invoke) new Notify();
invoke.setInvokeId(1);
invoke.setCall(call);
}
// We send directly to the corresponding stream as for
// some status codes, no stream has been created and thus
// "getStreamByChannelId" will fail.
write(invoke, connection.getStreamIdForChannel(id));