/*
- * todesbaum-lib -
- * Copyright (C) 2006 David Roden
+ * jSite - Command.java - Copyright © 2006–2012 David Roden
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* name of the {@link de.todesbaum.util.freenet.fcp2.Connection} connects). So
* when receiving messages from the node you should always be prepared for
* something you did not expect.
- *
+ *
* @author David Roden <droden@gmail.com>
- * @version $Id: Command.java 371 2006-03-25 10:38:13Z bombe $
+ * @version $Id$
*/
public abstract class Command {
/**
* Creates a new command with the specified name and identifier.
- *
+ *
* @param name
* The name of the command
* @param identifier
/**
* Returns the name of this command.
- *
+ *
* @return The name of this command
*/
public String getCommandName() {
/**
* Return the identifier of this command.
- *
+ *
* @return The identifier of this command
*/
public String getIdentifier() {
* <strong>NOTE:</strong> Subclasses of Command <strong>must</strong> call
* <code>super.write(writer)</code> before or after writing their own
* parameters!
- *
+ *
* @param writer
* The stream to write the parameters to
* @throws IOException
* Returns whether this command has payload to send after the message.
* Subclasses need to return <code>true</code> here if they need to send
* payload after the message.
- *
+ *
* @return <code>true</code> if this command has payload to send,
* <code>false</code> otherwise
*/
* Returns the payload of this command as an {@link InputStream}. This
* method is never called if {@link #hasPayload()} returns
* <code>false</code>.
- *
+ *
* @return The payload of this command
*/
protected InputStream getPayload() {
/**
* Returns the length of the payload. This method is never called if
* {@link #hasPayload()} returns <code>false</code>.
- *
+ *
* @return The length of the payload
*/
protected long getPayloadLength() {