ome.services.blitz.gateway.services.util
Class ServiceUtilities

java.lang.Object
  extended by ome.services.blitz.gateway.services.util.ServiceUtilities

public class ServiceUtilities
extends Object

Since:
OME3.0
Version:
3.0 (Internal version: $Revision: $Date: $)
Author:
Jean-Marie Burel      j.burel@dundee.ac.uk, Donald MacDonald      donald@lifesci.dundee.ac.uk

Constructor Summary
ServiceUtilities()
           
 
Method Summary
static String cause(Throwable t)
           
static
<T extends omero.model.IObject>
List<T>
collectionCast(Class<T> klass, List<omero.model.IObject> list)
          Helper method for the conversion of base types in containers(normally of type IObject) to a concrete type.
static String convertPojos(omero.api.ContainerClass nodeType)
          Converts the specified POJO into the corresponding model.
static void handleException(Throwable t, String message)
          Helper method to handle exceptions thrown by the connection library.
static String printErrorText(Throwable e)
          Utility method to print the error message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceUtilities

public ServiceUtilities()
Method Detail

collectionCast

public static <T extends omero.model.IObject> List<T> collectionCast(Class<T> klass,
                                                                     List<omero.model.IObject> list)
Helper method for the conversion of base types in containers(normally of type IObject) to a concrete type.

Type Parameters:
T - new type.
Parameters:
klass - new type class.
list - container.
Returns:
see above.

convertPojos

public static String convertPojos(omero.api.ContainerClass nodeType)
Converts the specified POJO into the corresponding model.

Parameters:
nodeType - The POJO class.
Returns:
The corresponding class.

handleException

public static void handleException(Throwable t,
                                   String message)
                            throws omero.ServerError
Helper method to handle exceptions thrown by the connection library. Methods in this class are required to fill in a meaningful context message. This method is not supposed to be used in this class' constructor or in the login/logout methods.

Parameters:
t - The exception.
message - The context message.
Throws:
DSOutOfServiceException - A connection problem.
DSAccessException - A server-side error.
omero.ServerError

cause

public static String cause(Throwable t)

printErrorText

public static String printErrorText(Throwable e)
Utility method to print the error message

Parameters:
e - The exception to handle.
Returns:
See above.


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

Copyright © 2009 The University of Dundee. All Rights Reserved.