org.gcube.contentmanagement.contentmanager.stubs.calls
Class Utils

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.calls.Utils

public class Utils
extends java.lang.Object

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
Utils()
           
 
Method Summary
static GCUBEFault buildFault(GCUBEFault fault)
          Creates a specific fault from a generic one.
static org.w3c.dom.Element getDocument(AnyHolder d)
          Extracts a document from its packaging for transmission.
static AnyHolder getDocumentHolder(org.w3c.dom.Element e)
          Returns a packaging of a document suitable for transmission.
static Predicate getPredicate(AnyHolder p)
          Extracts a predicate from its packaging for transmission.
static AnyHolder getPredicateHolder(Predicate p)
          Returns a packaging of a given predicate suitable for transmission.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getPredicateHolder

public static AnyHolder getPredicateHolder(Predicate p)
                                    throws java.lang.Exception
Returns a packaging of a given predicate suitable for transmission.

Parameters:
p - the predicate.
Returns:
the packaging.
Throws:
java.lang.Exception - if the predicate could not be packaged.

getPredicate

public static Predicate getPredicate(AnyHolder p)
                              throws java.lang.Exception
Extracts a predicate from its packaging for transmission.

Parameters:
p - the packaging.
Returns:
the predicate.
Throws:
java.lang.Exception - if the predicate could not be extracted.

getDocumentHolder

public static AnyHolder getDocumentHolder(org.w3c.dom.Element e)
                                   throws java.lang.Exception
Returns a packaging of a document suitable for transmission.

Parameters:
e - the DOM-representation of the document.
Returns:
the packaging.
Throws:
java.lang.Exception - if the document could not be packaged.

getDocument

public static org.w3c.dom.Element getDocument(AnyHolder d)
Extracts a document from its packaging for transmission.

Parameters:
d - the packaging.
Returns:
the DOM-representation of the document.

buildFault

public static GCUBEFault buildFault(GCUBEFault fault)
Creates a specific fault from a generic one.

Parameters:
fault - the generic fault.
Returns:
the specific fault.