public class FCPConnectionHandler
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
FCPConnectionHandler.DDACheckJob |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
connectionIdentifier
Deprecated.
Use
connectionIdentifierUUID instead. |
protected java.util.UUID |
connectionIdentifierUUID
Random UUID unique for each instance of this class
|
RequestClient |
connectionRequestClientBulk |
RequestClient |
connectionRequestClientRT |
FCPConnectionOutputHandler |
outputHandler |
Constructor and Description |
---|
FCPConnectionHandler(java.net.Socket s,
FCPServer server) |
Modifier and Type | Method and Description |
---|---|
void |
addUSKSubscription(java.lang.String identifier,
SubscribeUSK subscribeUSK) |
protected boolean |
allowDDAFrom(java.io.File filename,
boolean writeRequest)
That method ought to be called before any DirectDiskAccess operation is performed by the node
|
void |
close() |
void |
closedInput() |
void |
closedOutput() |
RequestClient |
connectionRequestClient(boolean realTime) |
protected PersistentRequestClient |
createForeverClient(java.lang.String name) |
protected FCPConnectionHandler.DDACheckJob |
enqueueDDACheck(java.lang.String path,
boolean read,
boolean write)
Return a DDACheckJob : the one we created and have enqueued
|
void |
finishedClientRequest(ClientRequest get) |
protected void |
freeDDAJobs()
Delete the files we have created using DDATest
called by PersistentRequestClient.onDisconnect(handler)
|
java.lang.String |
getClientName() |
PersistentRequestClient |
getForeverClient() |
PersistentRequestClient |
getRebootClient() |
boolean |
hasFullAccess() |
boolean |
isClosed() |
boolean |
isGlobalSubscribed() |
protected FCPConnectionHandler.DDACheckJob |
popDDACheck(java.lang.String path)
Return a DDACheckJob or null if not found
|
protected void |
registerTestDDAResult(java.lang.String path,
boolean read,
boolean write)
SHOULD BE CALLED ONLY FROM TestDDAComplete!
|
ClientRequest |
removeRequestByIdentifier(java.lang.String identifier,
boolean kill) |
void |
send(FCPMessage message)
Queues the message for sending at the
FCPConnectionOutputHandler .ATTENTION: The function will return immediately before even trying to send the message, the message will be sent asynchronously. As a consequence, this function not throwing does not give any guarantee whatsoever that the message will ever be sent. |
void |
setClientName(java.lang.String name) |
void |
startClientGet(ClientGetMessage message)
Start a ClientGet.
|
void |
startClientPut(ClientPutMessage message) |
void |
startClientPutDir(ClientPutDirMessage message,
java.util.HashMap<java.lang.String,java.lang.Object> buckets,
boolean wasDiskPut) |
void |
unsubscribeUSK(java.lang.String identifier) |
public final FCPConnectionOutputHandler outputHandler
@Deprecated public final java.lang.String connectionIdentifier
connectionIdentifierUUID
instead.protected final java.util.UUID connectionIdentifierUUID
public final RequestClient connectionRequestClientBulk
public final RequestClient connectionRequestClientRT
public FCPConnectionHandler(java.net.Socket s, FCPServer server)
public final void send(FCPMessage message)
FCPConnectionOutputHandler
.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean isClosed()
public void closedInput()
public void closedOutput()
public void setClientName(java.lang.String name)
protected PersistentRequestClient createForeverClient(java.lang.String name)
public java.lang.String getClientName()
public void startClientGet(ClientGetMessage message)
public void startClientPut(ClientPutMessage message)
public void startClientPutDir(ClientPutDirMessage message, java.util.HashMap<java.lang.String,java.lang.Object> buckets, boolean wasDiskPut)
public PersistentRequestClient getRebootClient()
public PersistentRequestClient getForeverClient()
public void finishedClientRequest(ClientRequest get)
public boolean isGlobalSubscribed()
public boolean hasFullAccess()
protected boolean allowDDAFrom(java.io.File filename, boolean writeRequest)
filename
- writeRequest
- : Are willing to write or to read ?protected void registerTestDDAResult(java.lang.String path, boolean read, boolean write)
path
- read
- write
- protected FCPConnectionHandler.DDACheckJob enqueueDDACheck(java.lang.String path, boolean read, boolean write) throws java.lang.IllegalArgumentException
path
- read
- : is Read access requested ?write
- : is Write access requested ?java.lang.IllegalArgumentException
- FIXME: Maybe we need to enqueue a PS job to delete the created file after something like ... 5 mins ?protected FCPConnectionHandler.DDACheckJob popDDACheck(java.lang.String path) throws java.lang.IllegalArgumentException
path
- java.lang.IllegalArgumentException
protected void freeDDAJobs()
public ClientRequest removeRequestByIdentifier(java.lang.String identifier, boolean kill)
public void addUSKSubscription(java.lang.String identifier, SubscribeUSK subscribeUSK) throws IdentifierCollisionException
IdentifierCollisionException
public void unsubscribeUSK(java.lang.String identifier) throws MessageInvalidException
MessageInvalidException
public RequestClient connectionRequestClient(boolean realTime)