|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockftpserver.core.command.InvocationRecord
public class InvocationRecord
Represents information about a single FTP Command invocation. Manages and provides access to
the Command, the host address (InetAddress) of the client that submitted the
Command and the timestamp of the Command submission.
This class also supports storing zero or more arbitrary mappings of key to value, where key is
a String and value is any Object. Convenience methods are provided that enable retrieving
type-specific data by its key. The data stored in an InvocationRecord is CommandHandler-specific.
The lock() method makes an instance of this class immutable. After an instance is locked,
calling the set(String, Object) method will throw an AssertFailedException.
| Constructor Summary | |
|---|---|
InvocationRecord(Command command,
InetAddress clientHost)
Create a new instance |
|
| Method Summary | |
|---|---|
boolean |
containsKey(String key)
Returns true if this object contains a mapping for the specified key. |
InetAddress |
getClientHost()
|
Command |
getCommand()
|
Object |
getObject(String key)
Get the Object value associated with the specified key. |
String |
getString(String key)
Get the String value associated with the specified key. |
Date |
getTime()
|
boolean |
isLocked()
Return true if this object has been locked, false otherwise. |
Set |
keySet()
Returns a Set view of the keys for the data stored in this object. |
void |
lock()
Lock this instance, making it immutable. |
void |
set(String key,
Object value)
Store the value for the specified key. |
String |
toString()
Return the String representation of this object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InvocationRecord(Command command,
InetAddress clientHost)
command - - the CommandclientHost - - the client host| Method Detail |
|---|
public void lock()
set(String, Object) method will throw an
AssertFailedException.
public boolean isLocked()
lock().
public InetAddress getClientHost()
public Command getCommand()
public Date getTime()
public void set(String key,
Object value)
AssertFailedException if this object has been locked. See lock().
key - - the key; must not be nullvalue - - the value to store for the specified key
AssertFailedException - - if the key is null or this object has been locked.public boolean containsKey(String key)
true if this object contains a mapping for the specified key.
key - - the key; must not be null
true if there is a mapping for the key
AssertFailedException - - if the key is nullpublic Set keySet()
public String getString(String key)
key - - the key; must not be null
ClassCastException - - if the object for the specified key is not a String
AssertFailedException - - if the key is nullpublic Object getObject(String key)
key - - the key; must not be null
AssertFailedException - - if the key is nullpublic String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||