org.gcube.personalization.userprofileaccess.impl
Class SMSUtils

java.lang.Object
  extended by org.gcube.personalization.userprofileaccess.impl.SMSUtils

public class SMSUtils
extends Object


Constructor Summary
SMSUtils()
           
 
Method Summary
protected static String createDocument(String documentName, String payload)
          Creates a new document into userprofiles remote directory
protected static String createStringFromDomTree(Node tree)
          This method converts a node of a tree to a string representation.
protected static String getDocument(String documentName)
          This method retrieves the content of the document with the given ID that belongs to the given collection
protected static Document parseXMLFileToDOM(String XMLdoc)
          This method parses a string using the Document Builder parser
protected static void updateDocument(String documentName, String newContent)
          This method updates the document with the given ID that belongs to the given collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMSUtils

public SMSUtils()
Method Detail

createDocument

protected static String createDocument(String documentName,
                                       String payload)
                                throws org.gcube.common.core.faults.GCUBEFault
Creates a new document into userprofiles remote directory

Parameters:
documentName - The document's name
payload - The document'd payload
Returns:
The document's ID
Throws:
org.gcube.common.core.faults.GCUBEFault - Failed to create the document

getDocument

protected static String getDocument(String documentName)
                             throws org.gcube.common.core.faults.GCUBEFault
This method retrieves the content of the document with the given ID that belongs to the given collection

Parameters:
DocumentReader - The CM Document reader for the given document
documentID - The ID of the document to be retrieved
scope - The scope
Returns:
The payload of the document
Throws:
org.gcube.common.core.faults.GCUBEFault

updateDocument

protected static void updateDocument(String documentName,
                                     String newContent)
                              throws org.gcube.common.core.faults.GCUBEFault
This method updates the document with the given ID that belongs to the given collection

Parameters:
DocumentWriter - The CM Document writer for the given document
documentID - The ID of the document to be updated
newContent - The new payload of the document
scope - The scope
Throws:
org.gcube.common.core.faults.GCUBEFault

parseXMLFileToDOM

protected static Document parseXMLFileToDOM(String XMLdoc)
                                     throws ParserConfigurationException,
                                            SAXException,
                                            IOException
This method parses a string using the Document Builder parser

Parameters:
XMLdoc: - the string to parse
Throws:
ParserConfigurationException
SAXException
IOException

createStringFromDomTree

protected static String createStringFromDomTree(Node tree)
                                         throws TransformerException
This method converts a node of a tree to a string representation.

Parameters:
tree - The node of a document that will be transformed
Returns:
A string representation of the node
Throws:
TransformerException - failed to transform the DOMTree to String


Copyright © 2013. All Rights Reserved.