com.hazelcast.ascii
Class AbstractTextCommand

java.lang.Object
  extended by com.hazelcast.ascii.AbstractTextCommand
All Implemented Interfaces:
TextCommand, SocketReadable, SocketWritable
Direct Known Subclasses:
DeleteCommand, ErrorCommand, GetCommand, HttpCommand, IncrementCommand, NoOpCommand, SetCommand, SimpleCommand, StatsCommand, TouchCommand, VersionCommand

public abstract class AbstractTextCommand
extends Object
implements TextCommand


Field Summary
protected  TextCommandConstants.TextCommandType type
           
 
Constructor Summary
protected AbstractTextCommand(TextCommandConstants.TextCommandType type)
           
 
Method Summary
 long getRequestId()
           
 SocketTextReader getSocketTextReader()
           
 SocketTextWriter getSocketTextWriter()
           
 TextCommandConstants.TextCommandType getType()
           
 void init(SocketTextReader socketTextReader, long requestId)
           
 boolean isUrgent()
          Checks if this SocketWritable is urgent.
 boolean shouldReply()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.nio.SocketWritable
writeTo
 
Methods inherited from interface com.hazelcast.nio.SocketReadable
readFrom
 

Field Detail

type

protected final TextCommandConstants.TextCommandType type
Constructor Detail

AbstractTextCommand

protected AbstractTextCommand(TextCommandConstants.TextCommandType type)
Method Detail

getType

public TextCommandConstants.TextCommandType getType()
Specified by:
getType in interface TextCommand

getSocketTextReader

public SocketTextReader getSocketTextReader()
Specified by:
getSocketTextReader in interface TextCommand

getSocketTextWriter

public SocketTextWriter getSocketTextWriter()
Specified by:
getSocketTextWriter in interface TextCommand

getRequestId

public long getRequestId()
Specified by:
getRequestId in interface TextCommand

init

public void init(SocketTextReader socketTextReader,
                 long requestId)
Specified by:
init in interface TextCommand

isUrgent

public boolean isUrgent()
Description copied from interface: SocketWritable
Checks if this SocketWritable is urgent. SocketWritable that are urgent, have priority above regular SocketWritable. This is useful to implement System Operations so that they can be send faster than regular operations; especially when the system is under load you want these operations have precedence.

Specified by:
isUrgent in interface SocketWritable
Returns:
true if urgent, false otherwise.

shouldReply

public boolean shouldReply()
Specified by:
shouldReply in interface TextCommand

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.