CADI.Server.LogicalTarget
Class ServerLogicalTargetManager

java.lang.Object
  extended by CADI.Server.LogicalTarget.ServerLogicalTargetManager
Direct Known Subclasses:
JP2LogicalTargetManager

public abstract class ServerLogicalTargetManager
extends java.lang.Object

This class defines an interface that must be implemented by the new compression systems supported by the CADI Server. This interface is used to manage the supported logical targets.

Usage example:
  constructor
  setParentName
  setLog
  logicalTargetIndexing
  processClientRequest
  getResponseViewWindow
  getQuality
  deliveryData
  getJPIPMessageHeaders

Version:
1.1 2009/04/13
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
protected  int EORReasonCode
          Reason code.
protected  java.lang.String EORReasonMessage
          It is and reason message associated with the EORReasonCode.
protected  java.util.ArrayList<JPIPMessageHeader> jpipMessageHeaders
          An array list to save the JPIP message heders which have been sent as a response to the client.
protected  CADILog log
          Definition in Scheduler.log
protected  java.lang.String parentName
          It is the parent name (which invokes an object of this class).
protected  int quality
          Definition in JPIPResponseFields.quality.
protected  ViewWindowField responseViewWindow
          Contains the view window for the image served, if it has been changed by the server.
 
Constructor Summary
ServerLogicalTargetManager()
           
 
Method Summary
abstract  void deliveryData(HTTPResponseSender httpResponseSender)
          This method deliveries the data which belong to the request view window.
abstract  void deliveryData(HTTPResponseSender httpResponseSender, JPIPMessageEncoder jpipMessageEncoder)
          This method deliveries the data which belong to the request view window.
 int getEORReasonCode()
          Gets the reason code value.
 java.lang.String getEORReasonMessage()
          Gets the reason message.
 java.util.ArrayList<JPIPMessageHeader> getJPIPMessageHeaders()
          Gets the jpipMessageHeaders attribute.
 int getQuality()
          Returns the quality.
 ViewWindowField getResponseViewWindow()
           
abstract  ServerLogicalTarget logicalTargetIndexing(BufferedDataInputStream in)
          Indexes a logical target file, i.e, reads the logical target structure and it is kept in memory be used later when a client request for a Window of Interest of the logical target.
abstract  void processClientRequest(ServerLogicalTarget logicalTarget, ServerCache serverCache, ViewWindowField requestViewWindow, long maxLen)
          This method processes the request WOI of the client.
 void setLog(CADILog log)
          Sets the log attribute.
 void setParentName(java.lang.String parentName)
          Sets the parent name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jpipMessageHeaders

protected java.util.ArrayList<JPIPMessageHeader> jpipMessageHeaders
An array list to save the JPIP message heders which have been sent as a response to the client. This headers will be used by the Worker object to update the server cache.


responseViewWindow

protected ViewWindowField responseViewWindow
Contains the view window for the image served, if it has been changed by the server.


quality

protected int quality
Definition in JPIPResponseFields.quality.


log

protected CADILog log
Definition in Scheduler.log


parentName

protected java.lang.String parentName
It is the parent name (which invokes an object of this class).

This attribute will be used to be passed to the log object as the thread name.


EORReasonCode

protected int EORReasonCode
Reason code. Its allowed values are defined in EORCodes


EORReasonMessage

protected java.lang.String EORReasonMessage
It is and reason message associated with the EORReasonCode.

It is an optional attribute.

Constructor Detail

ServerLogicalTargetManager

public ServerLogicalTargetManager()
Method Detail

setLog

public final void setLog(CADILog log)
Sets the log attribute.

Parameters:
log - definition in Scheduler.log.

setParentName

public final void setParentName(java.lang.String parentName)
Sets the parent name.

Parameters:
parentName - definition in parentName.

logicalTargetIndexing

public abstract ServerLogicalTarget logicalTargetIndexing(BufferedDataInputStream in)
                                                   throws WarningException,
                                                          ErrorException
Indexes a logical target file, i.e, reads the logical target structure and it is kept in memory be used later when a client request for a Window of Interest of the logical target. How the logical target structure is kept in memory, it is more easy and faster to find the precincts which belong to the requested WOI.

Parameters:
in -
Throws:
WarningException
ErrorException

processClientRequest

public abstract void processClientRequest(ServerLogicalTarget logicalTarget,
                                          ServerCache serverCache,
                                          ViewWindowField requestViewWindow,
                                          long maxLen)
                                   throws java.lang.IllegalArgumentException
This method processes the request WOI of the client. It must calculate the response View Window and the quality parameter of the response. Therefore, the Worker can delivery the HTTP response header to the client.

This function must be implemented for each logical target supported.

Parameters:
logicalTarget -
serverCache -
requestViewWindow -
maxLen -
Throws:
java.lang.IllegalArgumentException - If an illegal or inappropiate argument has been passed.

deliveryData

public abstract void deliveryData(HTTPResponseSender httpResponseSender)
                           throws java.io.IOException,
                                  ErrorException
This method deliveries the data which belong to the request view window.

Parameters:
httpResponseSender -
Throws:
java.io.IOException
ErrorException

deliveryData

public abstract void deliveryData(HTTPResponseSender httpResponseSender,
                                  JPIPMessageEncoder jpipMessageEncoder)
                           throws java.io.IOException,
                                  ErrorException
This method deliveries the data which belong to the request view window.

Parameters:
httpResponseSender -
jpipMessageEncoder -
Throws:
java.io.IOException
ErrorException

getResponseViewWindow

public final ViewWindowField getResponseViewWindow()

getQuality

public final int getQuality()
Returns the quality.

Returns:
the quality.

getJPIPMessageHeaders

public final java.util.ArrayList<JPIPMessageHeader> getJPIPMessageHeaders()
Gets the jpipMessageHeaders attribute.

Returns:
the jpipMessageHeaders.

getEORReasonCode

public final int getEORReasonCode()
Gets the reason code value.

Returns:
The reason code value
See Also:
EORReasonCode

getEORReasonMessage

public final java.lang.String getEORReasonMessage()
Gets the reason message.

Returns:
The reason message.
See Also:
EORReasonMessage


CADI - Copyright (C) 2007
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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) (contact)