xdrs_util
Class XmlNodeUtil

java.lang.Object
  extended byxdrs_util.XmlNodeUtil

public class XmlNodeUtil
extends java.lang.Object

Utility functions to manipulate XML nodes

Version:
$Revision: 1.1 $ $Date: 2005/05/06 21:31:08 $ (GMT)
Author:
Aleksander Slominski, matt

Field Summary
static java.lang.String DIR_TYPE
           
static java.lang.String LEAF_TYPE
           
static java.lang.String NODE_TYPE
           
static java.lang.String REMOTE_DIR_TYPE
           
static java.lang.String REMOTE_LEAF_TYPE
           
static java.lang.String REQUIRED_XSOAP_VERSION
           
static java.lang.String XSD_NS_2001
           
static java.lang.String XSI_NS_2001
           
static java.lang.String XSI_NS_2001_NIL
           
 
Constructor Summary
XmlNodeUtil()
           
 
Method Summary
static boolean canReadDirNode(org.gjt.xpp.XmlNode node)
           
static boolean canSetPermissionsDirNode(org.gjt.xpp.XmlNode node)
           
static boolean canWriteDirNode(org.gjt.xpp.XmlNode node)
           
static void checkNodeType(org.gjt.xpp.XmlNode node, java.lang.String expectedTypeUri, java.lang.String[] expectedTypeNames)
           
static org.gjt.xpp.XmlNode convertStringToXmlTree(java.lang.String xmlString)
           
static java.lang.String convertXmlTreeToString(org.gjt.xpp.XmlNode xmlTree)
           
static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation)
           
static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation, org.globus.gsi.GlobusCredential cred)
           
static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation, org.globus.gsi.GlobusCredential cred, java.security.cert.X509Certificate[] trustedCerts)
           
static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation, org.globus.gsi.GlobusCredential cred, java.security.cert.X509Certificate[] trustedCerts, boolean bypassDigitalSignatures)
           
static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation, org.globus.gsi.GlobusCredential cred, java.security.cert.X509Certificate[] trustedCerts, boolean bypassDigitalSignatures, boolean useXSoap)
           
static java.lang.String getDirNodeOwner(org.gjt.xpp.XmlNode node)
           
static java.lang.String getDirNodeReadOnlyGroup(org.gjt.xpp.XmlNode node)
           
static java.lang.String getDirNodeReadWriteGroup(org.gjt.xpp.XmlNode node)
           
static java.lang.String getNodeChildStringContent(org.gjt.xpp.XmlNode node, java.lang.String childName)
           
static java.lang.Object[] getNodeChildXmlContent(org.gjt.xpp.XmlNode node, java.lang.String name)
           
static java.lang.Object[] getNodeChildXmlContent(org.gjt.xpp.XmlNode node, java.lang.String uri, java.lang.String name)
           
static org.gjt.xpp.XmlNode getNodeChildXmlTree(org.gjt.xpp.XmlNode node, java.lang.String childName)
           
static org.gjt.xpp.XmlNode getNodeChildXmlTree(org.gjt.xpp.XmlNode node, java.lang.String uri, java.lang.String name)
           
static java.lang.String getNodeHtml(org.gjt.xpp.XmlNode node)
           
static org.gjt.xpp.XmlNode getNodeMetadata(org.gjt.xpp.XmlNode node)
           
static org.gjt.xpp.XmlNode getNodeMetadataItem(org.gjt.xpp.XmlNode node, java.lang.String metadataItemNamespace, java.lang.String metadataItemLocalName)
           
static java.lang.String getNodeName(org.gjt.xpp.XmlNode node)
           
static java.lang.String getNodeReference(org.gjt.xpp.XmlNode node)
           
static java.lang.String getNodeTypeName(org.gjt.xpp.XmlNode node)
           
static java.lang.String getNodeTypeUri(org.gjt.xpp.XmlNode node)
           
static org.gjt.xpp.XmlNode[] getNodeXmlNodeChildren(org.gjt.xpp.XmlNode node)
           
static org.gjt.xpp.XmlNode[] getNodeXmlNodeChildrenNotMatching(org.gjt.xpp.XmlNode node, java.lang.String[] childrenNames)
           
static boolean isDirNode(org.gjt.xpp.XmlNode node)
           
static boolean isRemoteDirNode(org.gjt.xpp.XmlNode node)
           
static org.gjt.xpp.XmlNode newDirNode(java.lang.String dirName)
           
static org.gjt.xpp.XmlNode newLeafNode(java.lang.String name)
           
static org.gjt.xpp.XmlNode newNode(java.lang.String type, java.lang.String name)
           
static org.gjt.xpp.XmlNode newNode(java.lang.String type, java.lang.String namespace, java.lang.String name)
           
static org.gjt.xpp.XmlNode newRemoteDirNode(java.lang.String dirName, java.lang.String remoteService, java.lang.String remotePath)
           
static org.gjt.xpp.XmlNode newRemoteLeafNode(java.lang.String leafName, java.lang.String remoteService, java.lang.String remotePath)
           
static org.gjt.xpp.XmlNode setNodeChild(org.gjt.xpp.XmlNode node, java.lang.String childName, java.lang.Object childNode, java.lang.Object[] children, org.gjt.xpp.XmlNode childXmlTree)
           
static org.gjt.xpp.XmlNode setNodeChildToStringContent(org.gjt.xpp.XmlNode node, java.lang.String childName, java.lang.String childStringContent)
           
static org.gjt.xpp.XmlNode setNodeChildToXmlContent(org.gjt.xpp.XmlNode node, java.lang.String childName, java.lang.Object[] xmlContent)
          For given node set its child identified by name to have XML fragment
static org.gjt.xpp.XmlNode setNodeChildToXmlTree(org.gjt.xpp.XmlNode node, java.lang.String childName, org.gjt.xpp.XmlNode childXmlTree)
          For given node set its child identified by name to have XML fragment
static org.gjt.xpp.XmlNode setNodeHtml(org.gjt.xpp.XmlNode node, java.lang.String html)
           
static org.gjt.xpp.XmlNode setNodeMetadata(org.gjt.xpp.XmlNode node, org.gjt.xpp.XmlNode metadata)
           
static org.gjt.xpp.XmlNode setNodeMetadataItem(org.gjt.xpp.XmlNode node, org.gjt.xpp.XmlNode metadataItem)
           
static org.gjt.xpp.XmlNode setNodeMetadataItem(org.gjt.xpp.XmlNode node, org.gjt.xpp.XmlNode metadataItem, boolean overrideIfItemAlredyExisits)
           
static org.gjt.xpp.XmlNode setNodeMetadataItemFromXmlString(org.gjt.xpp.XmlNode node, java.lang.String metadataItemAsXmlString)
           
static org.gjt.xpp.XmlNode setNodeMetadataItemFromXmlString(org.gjt.xpp.XmlNode node, java.lang.String metadataItemAsXmlString, boolean overrideIfItemAlredyExisits)
           
static org.gjt.xpp.XmlNode setNodePermissions(org.gjt.xpp.XmlNode node, java.lang.String[] perms)
           
static org.gjt.xpp.XmlNode setNodeReference(org.gjt.xpp.XmlNode node, java.lang.String reference)
           
static org.gjt.xpp.XmlNode setPermissionsEffective(org.gjt.xpp.XmlNode node, boolean[] perms)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_TYPE

public static final java.lang.String NODE_TYPE
See Also:
Constant Field Values

DIR_TYPE

public static final java.lang.String DIR_TYPE
See Also:
Constant Field Values

LEAF_TYPE

public static final java.lang.String LEAF_TYPE
See Also:
Constant Field Values

REMOTE_LEAF_TYPE

public static final java.lang.String REMOTE_LEAF_TYPE
See Also:
Constant Field Values

REMOTE_DIR_TYPE

public static final java.lang.String REMOTE_DIR_TYPE
See Also:
Constant Field Values

XSI_NS_2001

public static final java.lang.String XSI_NS_2001
See Also:
Constant Field Values

XSD_NS_2001

public static final java.lang.String XSD_NS_2001
See Also:
Constant Field Values

XSI_NS_2001_NIL

public static final java.lang.String XSI_NS_2001_NIL
See Also:
Constant Field Values

REQUIRED_XSOAP_VERSION

public static final java.lang.String REQUIRED_XSOAP_VERSION
See Also:
Constant Field Values
Constructor Detail

XmlNodeUtil

public XmlNodeUtil()
Method Detail

getDirectoryServiceProxy

public static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation)
                                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

getDirectoryServiceProxy

public static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation,
                                                         org.globus.gsi.GlobusCredential cred)
                                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

getDirectoryServiceProxy

public static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation,
                                                         org.globus.gsi.GlobusCredential cred,
                                                         java.security.cert.X509Certificate[] trustedCerts)
                                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

getDirectoryServiceProxy

public static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation,
                                                         org.globus.gsi.GlobusCredential cred,
                                                         java.security.cert.X509Certificate[] trustedCerts,
                                                         boolean bypassDigitalSignatures)
                                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

getDirectoryServiceProxy

public static XDirectoryService getDirectoryServiceProxy(java.lang.String serviceLocation,
                                                         org.globus.gsi.GlobusCredential cred,
                                                         java.security.cert.X509Certificate[] trustedCerts,
                                                         boolean bypassDigitalSignatures,
                                                         boolean useXSoap)
                                                  throws soaprmi.RemoteException
Throws:
soaprmi.RemoteException

newNode

public static org.gjt.xpp.XmlNode newNode(java.lang.String type,
                                          java.lang.String name)
                                   throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

newNode

public static org.gjt.xpp.XmlNode newNode(java.lang.String type,
                                          java.lang.String namespace,
                                          java.lang.String name)
                                   throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

newDirNode

public static org.gjt.xpp.XmlNode newDirNode(java.lang.String dirName)
                                      throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

newRemoteLeafNode

public static org.gjt.xpp.XmlNode newRemoteLeafNode(java.lang.String leafName,
                                                    java.lang.String remoteService,
                                                    java.lang.String remotePath)
                                             throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

newRemoteDirNode

public static org.gjt.xpp.XmlNode newRemoteDirNode(java.lang.String dirName,
                                                   java.lang.String remoteService,
                                                   java.lang.String remotePath)
                                            throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

newLeafNode

public static org.gjt.xpp.XmlNode newLeafNode(java.lang.String name)
                                       throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

isDirNode

public static boolean isDirNode(org.gjt.xpp.XmlNode node)
                         throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

isRemoteDirNode

public static boolean isRemoteDirNode(org.gjt.xpp.XmlNode node)
                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeChildXmlTree

public static org.gjt.xpp.XmlNode getNodeChildXmlTree(org.gjt.xpp.XmlNode node,
                                                      java.lang.String childName)
                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeChildXmlTree

public static org.gjt.xpp.XmlNode getNodeChildXmlTree(org.gjt.xpp.XmlNode node,
                                                      java.lang.String uri,
                                                      java.lang.String name)
                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeXmlNodeChildrenNotMatching

public static org.gjt.xpp.XmlNode[] getNodeXmlNodeChildrenNotMatching(org.gjt.xpp.XmlNode node,
                                                                      java.lang.String[] childrenNames)
                                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeXmlNodeChildren

public static org.gjt.xpp.XmlNode[] getNodeXmlNodeChildren(org.gjt.xpp.XmlNode node)

getNodeChildXmlContent

public static java.lang.Object[] getNodeChildXmlContent(org.gjt.xpp.XmlNode node,
                                                        java.lang.String name)
                                                 throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeChildXmlContent

public static java.lang.Object[] getNodeChildXmlContent(org.gjt.xpp.XmlNode node,
                                                        java.lang.String uri,
                                                        java.lang.String name)
                                                 throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeChildStringContent

public static java.lang.String getNodeChildStringContent(org.gjt.xpp.XmlNode node,
                                                         java.lang.String childName)
                                                  throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeName

public static java.lang.String getNodeName(org.gjt.xpp.XmlNode node)
                                    throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeHtml

public static java.lang.String getNodeHtml(org.gjt.xpp.XmlNode node)
                                    throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeMetadata

public static org.gjt.xpp.XmlNode getNodeMetadata(org.gjt.xpp.XmlNode node)
                                           throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeMetadataItem

public static org.gjt.xpp.XmlNode getNodeMetadataItem(org.gjt.xpp.XmlNode node,
                                                      java.lang.String metadataItemNamespace,
                                                      java.lang.String metadataItemLocalName)
                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeReference

public static java.lang.String getNodeReference(org.gjt.xpp.XmlNode node)
                                         throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeTypeUri

public static java.lang.String getNodeTypeUri(org.gjt.xpp.XmlNode node)
                                       throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getNodeTypeName

public static java.lang.String getNodeTypeName(org.gjt.xpp.XmlNode node)
                                        throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

checkNodeType

public static void checkNodeType(org.gjt.xpp.XmlNode node,
                                 java.lang.String expectedTypeUri,
                                 java.lang.String[] expectedTypeNames)
                          throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeChildToStringContent

public static org.gjt.xpp.XmlNode setNodeChildToStringContent(org.gjt.xpp.XmlNode node,
                                                              java.lang.String childName,
                                                              java.lang.String childStringContent)
                                                       throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeChildToXmlContent

public static org.gjt.xpp.XmlNode setNodeChildToXmlContent(org.gjt.xpp.XmlNode node,
                                                           java.lang.String childName,
                                                           java.lang.Object[] xmlContent)
                                                    throws org.gjt.xpp.XmlPullParserException
For given node set its child identified by name to have XML fragment

Throws:
org.gjt.xpp.XmlPullParserException

setNodeChildToXmlTree

public static org.gjt.xpp.XmlNode setNodeChildToXmlTree(org.gjt.xpp.XmlNode node,
                                                        java.lang.String childName,
                                                        org.gjt.xpp.XmlNode childXmlTree)
                                                 throws org.gjt.xpp.XmlPullParserException
For given node set its child identified by name to have XML fragment

Throws:
org.gjt.xpp.XmlPullParserException

setNodeChild

public static org.gjt.xpp.XmlNode setNodeChild(org.gjt.xpp.XmlNode node,
                                               java.lang.String childName,
                                               java.lang.Object childNode,
                                               java.lang.Object[] children,
                                               org.gjt.xpp.XmlNode childXmlTree)
                                        throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeHtml

public static org.gjt.xpp.XmlNode setNodeHtml(org.gjt.xpp.XmlNode node,
                                              java.lang.String html)
                                       throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeReference

public static org.gjt.xpp.XmlNode setNodeReference(org.gjt.xpp.XmlNode node,
                                                   java.lang.String reference)
                                            throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeMetadata

public static org.gjt.xpp.XmlNode setNodeMetadata(org.gjt.xpp.XmlNode node,
                                                  org.gjt.xpp.XmlNode metadata)
                                           throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeMetadataItem

public static org.gjt.xpp.XmlNode setNodeMetadataItem(org.gjt.xpp.XmlNode node,
                                                      org.gjt.xpp.XmlNode metadataItem)
                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeMetadataItem

public static org.gjt.xpp.XmlNode setNodeMetadataItem(org.gjt.xpp.XmlNode node,
                                                      org.gjt.xpp.XmlNode metadataItem,
                                                      boolean overrideIfItemAlredyExisits)
                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeMetadataItemFromXmlString

public static org.gjt.xpp.XmlNode setNodeMetadataItemFromXmlString(org.gjt.xpp.XmlNode node,
                                                                   java.lang.String metadataItemAsXmlString)
                                                            throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodeMetadataItemFromXmlString

public static org.gjt.xpp.XmlNode setNodeMetadataItemFromXmlString(org.gjt.xpp.XmlNode node,
                                                                   java.lang.String metadataItemAsXmlString,
                                                                   boolean overrideIfItemAlredyExisits)
                                                            throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

convertXmlTreeToString

public static java.lang.String convertXmlTreeToString(org.gjt.xpp.XmlNode xmlTree)
                                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

convertStringToXmlTree

public static org.gjt.xpp.XmlNode convertStringToXmlTree(java.lang.String xmlString)
                                                  throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getDirNodeOwner

public static java.lang.String getDirNodeOwner(org.gjt.xpp.XmlNode node)
                                        throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getDirNodeReadWriteGroup

public static java.lang.String getDirNodeReadWriteGroup(org.gjt.xpp.XmlNode node)
                                                 throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

getDirNodeReadOnlyGroup

public static java.lang.String getDirNodeReadOnlyGroup(org.gjt.xpp.XmlNode node)
                                                throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

canSetPermissionsDirNode

public static boolean canSetPermissionsDirNode(org.gjt.xpp.XmlNode node)
                                        throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

canWriteDirNode

public static boolean canWriteDirNode(org.gjt.xpp.XmlNode node)
                               throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

canReadDirNode

public static boolean canReadDirNode(org.gjt.xpp.XmlNode node)
                              throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setPermissionsEffective

public static org.gjt.xpp.XmlNode setPermissionsEffective(org.gjt.xpp.XmlNode node,
                                                          boolean[] perms)
                                                   throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException

setNodePermissions

public static org.gjt.xpp.XmlNode setNodePermissions(org.gjt.xpp.XmlNode node,
                                                     java.lang.String[] perms)
                                              throws org.gjt.xpp.XmlPullParserException
Throws:
org.gjt.xpp.XmlPullParserException