Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.hipergate
Class Distances

    java.lang.Object
      com.knowgate.hipergate.Distances

    public class Distances

extends java.lang.Object

Wrapper around DistributedCachePeer for caching distances from k_distances_cache table

Method Summary
`void` | `expireAll()`
`static java.lang.Float` | `getDistance(java.sql.Connection oConn, java.lang.String sLocationFrom, java.lang.String sLocationTo, java.lang.String sLocale)` Get distance between two locations from volatile memory cache or the database
`static java.lang.Float` | `getDistance(JDCConnection oConn, java.lang.String sLocationFrom, java.lang.String sLocationTo, java.lang.String sLocale)`
`static java.lang.Float` | `getDistance(java.lang.String sLocationFrom, java.lang.String sLocationTo, java.lang.String sLocale)` Get distance between two locations from volatile memory cache
`static void` | `setDistance(java.sql.Connection oConn, java.lang.String sLocationFrom, java.lang.String sLocationTo, float fKm, java.lang.String sLocale)` Set distance between two locations at volatile memory cache and at k_distances_cache database table Transaction management is responsability of the calling method, no commit nor rollback is performed after writting to the database if autocommit mode is set to off
`static void` | `setDistance(JDCConnection oConn, java.lang.String sLocationFrom, java.lang.String sLocationTo, float fKm, java.lang.String sLocale)`
`static void` | `setDistance(java.lang.String sLocationFrom, java.lang.String sLocationTo, float fKm, java.lang.String sLocale)` Set distance between two locations at volatile memory cache

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### setDistance

    public static void setDistance(java.lang.String sLocationFrom,
                                   java.lang.String sLocationTo,
                                   float fKm,
                                   java.lang.String sLocale)
                            throws java.lang.InstantiationException,
                                   java.lang.NullPointerException,
                                   java.rmi.RemoteException

  Set distance between two locations at volatile memory cache

  Parameters:
    `sLocationFrom` - String up to 254 characters
    `sLocationTo` - String up to 254 characters
    `fKm` - float Distance in kilometters
    `sLocale` - String locale for locations
  Throws:
    `java.lang.InstantiationException`
    `java.lang.NullPointerException`
    `java.rmi.RemoteException`

### setDistance

    public static void setDistance(java.sql.Connection oConn,
                                   java.lang.String sLocationFrom,
                                   java.lang.String sLocationTo,
                                   float fKm,
                                   java.lang.String sLocale)
                            throws java.lang.InstantiationException,
                                   java.lang.NullPointerException,
                                   java.rmi.RemoteException,
                                   java.sql.SQLException

  Set distance between two locations at volatile memory cache and at k_distances_cache database table

  Transaction management is responsability of the calling method, no commit nor rollback is performed after writting to the database if autocommit mode is set to off

  Parameters:
    `oConn` - Connection Opened JDBC database connection
    `sLocationFrom` - String up to 254 characters
    `sLocationTo` - String up to 254 characters
    `fKm` - float Distance in kilometters
    `sLocale` - String locale for locations
  Throws:
    `java.lang.InstantiationException`
    `java.lang.NullPointerException`
    `java.rmi.RemoteException`
    `java.sql.SQLException`

### setDistance

    public static void setDistance(JDCConnection oConn,
                                   java.lang.String sLocationFrom,
                                   java.lang.String sLocationTo,
                                   float fKm,
                                   java.lang.String sLocale)
                            throws java.lang.InstantiationException,
                                   java.lang.NullPointerException,
                                   java.rmi.RemoteException,
                                   java.sql.SQLException

  Throws:
    `java.lang.InstantiationException`
    `java.lang.NullPointerException`
    `java.rmi.RemoteException`
    `java.sql.SQLException`

### getDistance

    public static java.lang.Float getDistance(java.lang.String sLocationFrom,
                                              java.lang.String sLocationTo,
                                              java.lang.String sLocale)
                                       throws java.lang.InstantiationException,
                                              java.rmi.RemoteException,
                                              java.lang.ClassCastException

  Get distance between two locations from volatile memory cache

  Returns:
    Float distance in kilometters or null if no cached distance for given locations is found
  Throws:
    `java.lang.InstantiationException`
    `java.rmi.RemoteException`
    `java.lang.ClassCastException`

### getDistance

    public static java.lang.Float getDistance(java.sql.Connection oConn,
                                              java.lang.String sLocationFrom,
                                              java.lang.String sLocationTo,
                                              java.lang.String sLocale)
                                       throws java.lang.InstantiationException,
                                              java.rmi.RemoteException,
                                              java.lang.ClassCastException,
                                              java.sql.SQLException

  Get distance between two locations from volatile memory cache or the database

  Returns:
    Float distance in kilometters or null if no distance for given locations is found neither at volatile memory cache nor at the database
  Throws:
    `java.lang.InstantiationException`
    `java.rmi.RemoteException`
    `java.lang.ClassCastException`
    `java.sql.SQLException`

### getDistance

    public static java.lang.Float getDistance(JDCConnection oConn,
                                              java.lang.String sLocationFrom,
                                              java.lang.String sLocationTo,
                                              java.lang.String sLocale)
                                       throws java.lang.InstantiationException,
                                              java.rmi.RemoteException,
                                              java.lang.ClassCastException,
                                              java.sql.SQLException

  Throws:
    `java.lang.InstantiationException`
    `java.rmi.RemoteException`
    `java.lang.ClassCastException`
    `java.sql.SQLException`

### expireAll

    public void expireAll()
                   throws java.rmi.RemoteException

  Throws:
    `java.rmi.RemoteException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD