org.hd.d.pg2k.webSvr.threeD
Class Utils

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.threeD.Utils

final class Utils
extends java.lang.Object

3D Walkthrough utilities. Shared by the JWS code and the supporting server-side code.


Field Summary
static java.lang.String HP_OPCODE
          HTTP parameter used to select the operation type; URL safe.
static java.lang.String HP_ORD
          HTTP parameter used to indicate the exhibit ordinal(s); URL safe.
private static java.lang.String MDREQ
          "File" portion of meta-data request.
static java.lang.String OP_LUS
          Operation type to request multiple exhibit name lookups by ordinal; URL safe.
static java.lang.String OP_MD
          Operation type to request basic metadata; URL safe.
(package private) static int RPC_HTTP_CONNECT_TIMEOUT_MS
          Basic connect timeout for HTTP/RPCs for reasonable interactivity, in ms; strictly positive.
(package private) static int RPC_HTTP_READ_TIMEOUT_MS
          Basic read timeout for HTTP/RPCs for reasonable interactivity, in ms; strictly positive.
static java.lang.String SERVLET_MOUNT_POINT
          Expected mount point of this servlet; starts with "/".
 
Constructor Summary
private Utils()
          Prevent construction of an instance.
 
Method Summary
private static java.net.HttpURLConnection _setUpConnection(java.net.URL hostAndPort, java.lang.String rrURL)
          Set up and open HTTP connection to server for RPC; never null.
(package private) static Name.ExhibitFull[] getExhibitNames(java.net.URL hostAndPort, int[] ordinals)
          Client-side call to get exhibit names (by index) from the server; never null.
(package private) static LightweightMetaDataFetchInterface.GalleryBasicMetaData getMetaData(java.net.URL hostAndPort)
          Client-side call to fetch metadata from the server; never null.
static boolean supportedTypeFor3DWT(ExhibitMIME.ExhibitTypeParameters exhibitType)
          Returns true for exhibit types supported in the walkthrough, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVLET_MOUNT_POINT

public static final java.lang.String SERVLET_MOUNT_POINT
Expected mount point of this servlet; starts with "/".

See Also:
Constant Field Values

HP_OPCODE

public static final java.lang.String HP_OPCODE
HTTP parameter used to select the operation type; URL safe.

See Also:
Constant Field Values

HP_ORD

public static final java.lang.String HP_ORD
HTTP parameter used to indicate the exhibit ordinal(s); URL safe.

See Also:
Constant Field Values

OP_MD

public static final java.lang.String OP_MD
Operation type to request basic metadata; URL safe.

See Also:
Constant Field Values

OP_LUS

public static final java.lang.String OP_LUS
Operation type to request multiple exhibit name lookups by ordinal; URL safe.

See Also:
Constant Field Values

MDREQ

private static final java.lang.String MDREQ
"File" portion of meta-data request.

See Also:
Constant Field Values

RPC_HTTP_CONNECT_TIMEOUT_MS

static final int RPC_HTTP_CONNECT_TIMEOUT_MS
Basic connect timeout for HTTP/RPCs for reasonable interactivity, in ms; strictly positive. Generally HTTP/TCP connects very quickly if it is going to connect at all and anything longer usually implies a lost handshake packet or a dead network connection, so waiting a longer time rarely helps.

The random factor helps to prevent different clients from colliding.


RPC_HTTP_READ_TIMEOUT_MS

static final int RPC_HTTP_READ_TIMEOUT_MS
Basic read timeout for HTTP/RPCs for reasonable interactivity, in ms; strictly positive. Once we have connected then the network is probably OK, so it is worth waiting a while in case the server needs time to compute the results; so the read timeout should usually be a little more than the connect timeout.

The random factor helps to prevent separate clients from colliding.

Constructor Detail

Utils

private Utils()
Prevent construction of an instance.

Method Detail

supportedTypeFor3DWT

public static boolean supportedTypeFor3DWT(ExhibitMIME.ExhibitTypeParameters exhibitType)
Returns true for exhibit types supported in the walkthrough, false otherwise.


getMetaData

static final LightweightMetaDataFetchInterface.GalleryBasicMetaData getMetaData(java.net.URL hostAndPort)
                                                                         throws java.io.IOException
Client-side call to fetch metadata from the server; never null.

Parameters:
hostAndPort - server host with optional port, or null to use the default/main server name
Throws:
java.io.IOException - in case of error

_setUpConnection

private static java.net.HttpURLConnection _setUpConnection(java.net.URL hostAndPort,
                                                           java.lang.String rrURL)
                                                    throws java.io.IOException
Set up and open HTTP connection to server for RPC; never null.

Throws:
java.io.IOException

getExhibitNames

static final Name.ExhibitFull[] getExhibitNames(java.net.URL hostAndPort,
                                                int[] ordinals)
                                         throws java.io.IOException
Client-side call to get exhibit names (by index) from the server; never null.

Parameters:
hostAndPort - server host with optional port, or null to use the default/main server name
Throws:
java.io.IOException - in case of error

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.