bwLehrpool Masterserver
Manages authentication and sharing of virtual machines between participating institutions
Public Member Functions | Static Public Member Functions | Static Package Functions | Private Attributes | Static Private Attributes | List of all members
org.openslx.imagemaster.serverconnection.ConnectionHandler Class Reference

Class to handle all incoming and outgoing connections. More...

+ Inheritance diagram for org.openslx.imagemaster.serverconnection.ConnectionHandler:
+ Collaboration diagram for org.openslx.imagemaster.serverconnection.ConnectionHandler:

Public Member Functions

void incomingDownloadRequest (final Uploader uploader)
 Server is uploading - client is downloading! More...
 
void incomingUploadRequest (final Downloader downloader) throws IOException
 Server is downloading - client is uploading! More...
 

Static Public Member Functions

static int getSslPort ()
 
static int getPlainPort ()
 
static IncomingTransfer registerUpload (ImagePublishData img, List< ByteBuffer > blockHashes, ImagePublishDataEx existing) throws TTransferRejectedException, TInvocationException
 Register new incoming transfer from a satellite server. More...
 
static IncomingTransfer getExistingUpload (ImagePublishData imageData, List< ByteBuffer > crcSums) throws TTransferRejectedException
 
static IncomingTransfer getUploadByToken (String uploadToken)
 
static int getUploadConnectionCount ()
 
static int getDownloadConnectionCount ()
 
static void removeUpload (IncomingTransfer transfer)
 
static TransferInformation registerDownload (ImagePublishDataEx img) throws TTransferRejectedException, TInvocationException
 

Static Package Functions

 [static initializer]
 

Private Attributes

final ExecutorService transferPool
 

Static Private Attributes

static final Logger LOGGER = LogManager.getLogger( ConnectionHandler.class )
 
static final int MAX_TRANSFERS = 12
 
static Map< String,
IncomingTransfer
incomingTransfersByTransferId = new ConcurrentHashMap<>()
 
static final Map< String,
IncomingTransfer
incomingTransfersByVersionId = new ConcurrentHashMap<>()
 
static Map< String,
OutgoingTransfer
outgoingTransfers = new ConcurrentHashMap<>()
 
static IncomingEvent eventHandler = new ConnectionHandler()
 
static final Listener plainListener
 
static final Listener sslListener
 

Detailed Description

Class to handle all incoming and outgoing connections.

Also handles the authentication and the saving/delivering of images.

Definition at line 44 of file ConnectionHandler.java.

Member Function Documentation

org.openslx.imagemaster.serverconnection.ConnectionHandler.[static initializer] ( )
staticpackage
static int org.openslx.imagemaster.serverconnection.ConnectionHandler.getDownloadConnectionCount ( )
static

Definition at line 245 of file ConnectionHandler.java.

+ Here is the caller graph for this function:

static IncomingTransfer org.openslx.imagemaster.serverconnection.ConnectionHandler.getExistingUpload ( ImagePublishData  imageData,
List< ByteBuffer >  crcSums 
) throws TTransferRejectedException
static

Definition at line 171 of file ConnectionHandler.java.

+ Here is the caller graph for this function:

static int org.openslx.imagemaster.serverconnection.ConnectionHandler.getPlainPort ( )
static

Definition at line 122 of file ConnectionHandler.java.

+ Here is the caller graph for this function:

static int org.openslx.imagemaster.serverconnection.ConnectionHandler.getSslPort ( )
static

Definition at line 115 of file ConnectionHandler.java.

+ Here is the caller graph for this function:

static IncomingTransfer org.openslx.imagemaster.serverconnection.ConnectionHandler.getUploadByToken ( String  uploadToken)
static

Definition at line 184 of file ConnectionHandler.java.

+ Here is the caller graph for this function:

static int org.openslx.imagemaster.serverconnection.ConnectionHandler.getUploadConnectionCount ( )
static

Definition at line 233 of file ConnectionHandler.java.

+ Here is the caller graph for this function:

void org.openslx.imagemaster.serverconnection.ConnectionHandler.incomingDownloadRequest ( final Uploader  uploader)

Server is uploading - client is downloading!

Definition at line 193 of file ConnectionHandler.java.

+ Here is the call graph for this function:

void org.openslx.imagemaster.serverconnection.ConnectionHandler.incomingUploadRequest ( final Downloader  downloader) throws IOException

Server is downloading - client is uploading!

Definition at line 215 of file ConnectionHandler.java.

+ Here is the call graph for this function:

static TransferInformation org.openslx.imagemaster.serverconnection.ConnectionHandler.registerDownload ( ImagePublishDataEx  img) throws TTransferRejectedException, TInvocationException
static

Definition at line 263 of file ConnectionHandler.java.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static IncomingTransfer org.openslx.imagemaster.serverconnection.ConnectionHandler.registerUpload ( ImagePublishData  img,
List< ByteBuffer >  blockHashes,
ImagePublishDataEx  existing 
) throws TTransferRejectedException, TInvocationException
static

Register new incoming transfer from a satellite server.

Parameters
imgthe desired meta data for the new image/version, as supplied by the satellite
blockHasheslist of block hashes for the image
existingOPTIONAL if the image version already exists on the server, this is given so we can repair/complete the local file, if necessary
Returns
The assigned transfer object

Definition at line 138 of file ConnectionHandler.java.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void org.openslx.imagemaster.serverconnection.ConnectionHandler.removeUpload ( IncomingTransfer  transfer)
static

Definition at line 257 of file ConnectionHandler.java.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

IncomingEvent org.openslx.imagemaster.serverconnection.ConnectionHandler.eventHandler = new ConnectionHandler()
staticprivate

Definition at line 55 of file ConnectionHandler.java.

Map<String, IncomingTransfer> org.openslx.imagemaster.serverconnection.ConnectionHandler.incomingTransfersByTransferId = new ConcurrentHashMap<>()
staticprivate

Definition at line 51 of file ConnectionHandler.java.

final Map<String, IncomingTransfer> org.openslx.imagemaster.serverconnection.ConnectionHandler.incomingTransfersByVersionId = new ConcurrentHashMap<>()
staticprivate

Definition at line 52 of file ConnectionHandler.java.

final Logger org.openslx.imagemaster.serverconnection.ConnectionHandler.LOGGER = LogManager.getLogger( ConnectionHandler.class )
staticprivate

Definition at line 47 of file ConnectionHandler.java.

final int org.openslx.imagemaster.serverconnection.ConnectionHandler.MAX_TRANSFERS = 12
staticprivate

Definition at line 49 of file ConnectionHandler.java.

Map<String, OutgoingTransfer> org.openslx.imagemaster.serverconnection.ConnectionHandler.outgoingTransfers = new ConcurrentHashMap<>()
staticprivate

Definition at line 54 of file ConnectionHandler.java.

final Listener org.openslx.imagemaster.serverconnection.ConnectionHandler.plainListener
staticprivate

Definition at line 60 of file ConnectionHandler.java.

final Listener org.openslx.imagemaster.serverconnection.ConnectionHandler.sslListener
staticprivate

Definition at line 61 of file ConnectionHandler.java.

final ExecutorService org.openslx.imagemaster.serverconnection.ConnectionHandler.transferPool
private
Initial value:
= new CascadedThreadPoolExecutor( 1, MAX_TRANSFERS * 2, 1, TimeUnit.MINUTES,
new SynchronousQueue<Runnable>(),
new PrioThreadFactory( "TransferPool", Thread.NORM_PRIORITY - 2 ), null )

Definition at line 56 of file ConnectionHandler.java.


The documentation for this class was generated from the following file: