org.LexGrid.LexBIG.cagrid
Class Utils

java.lang.Object
  extended by org.LexGrid.LexBIG.cagrid.Utils

public class Utils
extends java.lang.Object

Utilities class for the LexBIG caGrid Services.

Author:
Kevin Peterson

Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String[] associationIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.AssociationIdentification[] assocs)
          Constructs a String array containing the values of the AssociationIdentification array.
static org.LexGrid.LexBIG.DataModel.cagrid.GraphResolutionPolicy buildGraphResolutionPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveCodedEntryDepth, int resolveAssociationDepth, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList propertyNames, org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] propertyTypes, org.LexGrid.LexBIG.DataModel.Collections.SortOptionList sortOptions, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList filterOptions, int maxToReturn, boolean keepLastAssociationLevelUnresolved)
           
static org.LexGrid.LexBIG.DataModel.cagrid.HierarchyResolutionPolicy buildHierarchyResolutionPolicy(java.lang.String hierarchyID, java.lang.String conceptCode, boolean resolveConcepts, org.LexGrid.LexBIG.DataModel.Collections.NameAndValueList associationQualifiers)
           
static org.LexGrid.LexBIG.DataModel.cagrid.NodeListPolicy buildNodeListPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveAssociationDepth, int maxToReturn)
           
static org.LexGrid.LexBIG.DataModel.cagrid.RelationshipDistanceBasedPolicy buildRelationshipDistanceBasedPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference sourceConcept, org.LexGrid.LexBIG.DataModel.Core.ConceptReference targetConcept, int distance)
           
static org.LexGrid.LexBIG.DataModel.cagrid.RelationshipTypeBasedPolicy buildRelationshipTypeBasedPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference sourceConcept, org.LexGrid.LexBIG.DataModel.Core.ConceptReference targetConcept, boolean directOnly)
           
static org.LexGrid.LexBIG.DataModel.cagrid.SetResolutionPolicy buildSetResolutionPolicy(org.LexGrid.LexBIG.DataModel.Collections.SortOptionList sortOptions, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList filterOptions, org.LexGrid.LexBIG.DataModel.Collections.LocalNameList propertyNames, org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] propertyTypes, boolean resolveConcepts, int maxToReturn)
           
static org.LexGrid.LexBIG.DataModel.Core.ConceptReference checkIfConceptReferencsIsResolved(org.LexGrid.LexBIG.DataModel.Core.ConceptReference ref)
          Because caGrid services cannot pass a ResolvedConceptReference, this method builds a ConceptReference out of a ResolvedConceptReference
static java.lang.String[] conceptIdentificationArrayToString(org.LexGrid.LexBIG.DataModel.cagrid.ConceptIdentification[] codeArray)
           
static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption convertActiveOption(org.LexGrid.LexBIG.DataModel.enums.ActiveOption option)
           
static org.LexGrid.LexBIG.DataModel.enums.ActiveOption convertActiveOption(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption option)
           
static org.LexGrid.LexBIG.Extensions.Generic.LexBIGServiceConvenienceMethods.HierarchyPathResolveOption convertHierarchyPathResolveOption(org.LexGrid.LexBIG.DataModel.enums.HierarchyPathResolveOption option)
           
static org.LexGrid.LexBIG.DataModel.enums.HierarchyPathResolveOption convertHierarchyPathResolveOption(org.LexGrid.LexBIG.Extensions.Generic.LexBIGServiceConvenienceMethods.HierarchyPathResolveOption option)
           
static org.LexGrid.LexBIG.DataModel.enums.PropertyType[] convertPropertyType(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] inputArray)
          Constructs an array of PropertyType objects based on values in a String array.
static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] convertPropertyType(org.LexGrid.LexBIG.DataModel.enums.PropertyType[] inputArray)
          Constructs an array of PropertyType objects based on values in a String array.
static org.LexGrid.LexBIG.DataModel.enums.SearchDesignationOption convertSearchDesignationOption(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.SearchDesignationOption option)
           
static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.SearchDesignationOption convertSearchDesignationOption(org.LexGrid.LexBIG.DataModel.enums.SearchDesignationOption option)
           
static java.lang.String[] directionalAssociationIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.DirectionalAssociationIdentification[] assocs)
          Constructs a String array containing the values of the DirectionalAssociationIdentification array.
static java.lang.String[] enumArrayToStringArray(java.lang.Enum[] enumerator)
          Constructs a String array containing the values of the Enumerator array.
static java.lang.String[] hierarchyIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.HierarchyIdentification[] ids)
          Constructs a String array containing the values of the HierarchyIdentification array.
static void processException(java.lang.Exception e)
          LexEVS Grid Service is a layer over Distributed LexBIG, which itself is a layer over LexBIG.
static java.lang.String[] propertyIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.PropertyIdentification[] ids)
           
static java.lang.String[] statusArrayToString(org.LexGrid.LexBIG.DataModel.cagrid.Status[] statusArray)
           
static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption[] stringArrayToActiveOption(java.lang.String[] stringArray)
          Constructs an array of ActiveOption objects based on values in a String array.
static org.LexGrid.LexBIG.DataModel.cagrid.AssociationIdentification[] stringArrayToAssociationIdentification(java.lang.String[] stringArray)
           
static org.LexGrid.LexBIG.DataModel.cagrid.ConceptIdentification[] stringArrayToConceptIdentification(java.lang.String[] codes)
          Constructs a String array containing the values of the ConceptIdentification array.
static org.LexGrid.LexBIG.DataModel.cagrid.DirectionalAssociationIdentification[] stringArrayToDirectionalAssociationIdentification(java.lang.String[] stringArray, boolean isForward)
           
static org.LexGrid.LexBIG.DataModel.cagrid.HierarchyIdentification[] stringArrayToHierarchyIdentification(java.lang.String[] ids)
           
static org.LexGrid.LexBIG.DataModel.cagrid.PropertyIdentification[] stringArrayToPropertyIdentification(java.lang.String[] stringArray)
          Constructs an array of PropertyIdentification objects based on values in a String array.
static org.LexGrid.LexBIG.DataModel.cagrid.Status[] stringArrayToStatus(java.lang.String[] stringArray)
          Constructs an array of Status objects based on values in a String array.
static org.apache.axis.types.URI URIConverter(java.net.URI uri)
          Transfroms a java.net.URI to an org.apache.axis.types.URI
static java.net.URI URIConverter(org.apache.axis.types.URI uri)
          Transfroms a org.apache.axis.types.URI to an java.net.URI
static org.LexGrid.LexBIG.DataModel.cagrid.AssociationIdentification wrapAssociationIdentification(java.lang.String name)
           
static org.LexGrid.LexBIG.DataModel.cagrid.CodeExistence wrapCodeExistence(boolean isPresent)
           
static org.LexGrid.LexBIG.DataModel.cagrid.CodeRelationship wrapCodeRelationship(boolean areRelated)
           
static org.LexGrid.LexBIG.DataModel.cagrid.CodeState wrapCodeState(boolean isActive)
           
static org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeCopyRight wrapCodingSchemCopyRight(java.lang.String text)
           
static org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification wrapCodingSchemeIdentifier(java.lang.String codingScheme)
           
static org.LexGrid.LexBIG.DataModel.cagrid.ConceptIdentification wrapConceptIdentification(java.lang.String code)
           
static org.LexGrid.LexBIG.DataModel.cagrid.Direction wrapDirection(boolean isForward)
           
static org.LexGrid.LexBIG.DataModel.cagrid.DirectionalAssociationIdentification wrapDirectionalAssociationIdentification(java.lang.String id, boolean isForward)
           
static org.LexGrid.LexBIG.DataModel.cagrid.ExtensionIdentification wrapExtensionIdentification(java.lang.String name)
           
static org.LexGrid.LexBIG.DataModel.cagrid.HierarchyIdentification wrapHierarchyIdentificationIdentification(java.lang.String identifier)
           
static org.LexGrid.LexBIG.DataModel.cagrid.LanguageIdentification wrapLanguageIdentification(java.lang.String name)
           
static org.LexGrid.LexBIG.DataModel.cagrid.MatchCriteria wrapMatchCritia(java.lang.String text)
           
static org.LexGrid.LexBIG.DataModel.cagrid.RelationContainerIdentification wrapRelationContainerIdentification(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

enumArrayToStringArray

public static java.lang.String[] enumArrayToStringArray(java.lang.Enum[] enumerator)
Constructs a String array containing the values of the Enumerator array.

Parameters:
enumerator - Enumerator to be converted to a String array.
Returns:
The String array with values corresponding to the values of the passed in enumerator

stringArrayToConceptIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.ConceptIdentification[] stringArrayToConceptIdentification(java.lang.String[] codes)
Constructs a String array containing the values of the ConceptIdentification array.

Parameters:
enumerator - Enumerator to be converted to a String array.
Returns:
The String array with values corresponding to the values of the passed in enumerator

stringArrayToHierarchyIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.HierarchyIdentification[] stringArrayToHierarchyIdentification(java.lang.String[] ids)

hierarchyIdentificationToStringArray

public static java.lang.String[] hierarchyIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.HierarchyIdentification[] ids)
Constructs a String array containing the values of the HierarchyIdentification array.

Parameters:
ids - HierarchyIdentification array to be converted to a String array.
Returns:
The String array with values corresponding to the values of the passed in array.

propertyIdentificationToStringArray

public static java.lang.String[] propertyIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.PropertyIdentification[] ids)

directionalAssociationIdentificationToStringArray

public static java.lang.String[] directionalAssociationIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.DirectionalAssociationIdentification[] assocs)
Constructs a String array containing the values of the DirectionalAssociationIdentification array.

Parameters:
ids - DirectionalAssociationIdentification array to be converted to a String array.
Returns:
The String array with values corresponding to the values of the passed in array.

associationIdentificationToStringArray

public static java.lang.String[] associationIdentificationToStringArray(org.LexGrid.LexBIG.DataModel.cagrid.AssociationIdentification[] assocs)
Constructs a String array containing the values of the AssociationIdentification array.

Parameters:
ids - DirectionalAssociationIdentification array to be converted to a String array.
Returns:
The String array with values corresponding to the values of the passed in array.

convertPropertyType

public static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] convertPropertyType(org.LexGrid.LexBIG.DataModel.enums.PropertyType[] inputArray)
Constructs an array of PropertyType objects based on values in a String array.

Parameters:
stringArray - The array containing the values of the PropertyType enum.
Returns:
The constructed PropertyType enum array.

convertPropertyType

public static org.LexGrid.LexBIG.DataModel.enums.PropertyType[] convertPropertyType(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] inputArray)
Constructs an array of PropertyType objects based on values in a String array.

Parameters:
stringArray - The array containing the values of the PropertyType enum.
Returns:
The constructed PropertyType enum array.

stringArrayToActiveOption

public static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption[] stringArrayToActiveOption(java.lang.String[] stringArray)
Constructs an array of ActiveOption objects based on values in a String array.

Parameters:
stringArray - The array containing the values of the ActiveOption enum.
Returns:
The constructed ActiveOption enum array.

stringArrayToStatus

public static org.LexGrid.LexBIG.DataModel.cagrid.Status[] stringArrayToStatus(java.lang.String[] stringArray)
Constructs an array of Status objects based on values in a String array.

Parameters:
stringArray - The array containing the values of the Status.
Returns:
The constructed Status array.

statusArrayToString

public static java.lang.String[] statusArrayToString(org.LexGrid.LexBIG.DataModel.cagrid.Status[] statusArray)

stringArrayToPropertyIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.PropertyIdentification[] stringArrayToPropertyIdentification(java.lang.String[] stringArray)
Constructs an array of PropertyIdentification objects based on values in a String array.

Parameters:
stringArray - The array containing the values of the Status.
Returns:
The constructed PropertyIdentification array.

stringArrayToDirectionalAssociationIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.DirectionalAssociationIdentification[] stringArrayToDirectionalAssociationIdentification(java.lang.String[] stringArray,
                                                                                                                                           boolean isForward)

stringArrayToAssociationIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.AssociationIdentification[] stringArrayToAssociationIdentification(java.lang.String[] stringArray)

checkIfConceptReferencsIsResolved

public static org.LexGrid.LexBIG.DataModel.Core.ConceptReference checkIfConceptReferencsIsResolved(org.LexGrid.LexBIG.DataModel.Core.ConceptReference ref)
Because caGrid services cannot pass a ResolvedConceptReference, this method builds a ConceptReference out of a ResolvedConceptReference

Parameters:
ref - The ConceptReference to check
Returns:
If the passed in ConceptReference is actually a ResolvedConceptReference object, it will return a ConceptReference based on it. If the object passed in is a ConceptReference, simply return it.

URIConverter

public static org.apache.axis.types.URI URIConverter(java.net.URI uri)
                                              throws org.apache.axis.types.URI.MalformedURIException
Transfroms a java.net.URI to an org.apache.axis.types.URI

Parameters:
uri - The URI to be transformed
Returns:
The new URI.
Throws:
org.apache.axis.types.URI.MalformedURIException

URIConverter

public static java.net.URI URIConverter(org.apache.axis.types.URI uri)
                                 throws org.apache.axis.types.URI.MalformedURIException
Transfroms a org.apache.axis.types.URI to an java.net.URI

Parameters:
uri - The URI to be transformed
Returns:
The new URI.
Throws:
org.apache.axis.types.URI.MalformedURIException

buildHierarchyResolutionPolicy

public static org.LexGrid.LexBIG.DataModel.cagrid.HierarchyResolutionPolicy buildHierarchyResolutionPolicy(java.lang.String hierarchyID,
                                                                                                           java.lang.String conceptCode,
                                                                                                           boolean resolveConcepts,
                                                                                                           org.LexGrid.LexBIG.DataModel.Collections.NameAndValueList associationQualifiers)

buildRelationshipTypeBasedPolicy

public static org.LexGrid.LexBIG.DataModel.cagrid.RelationshipTypeBasedPolicy buildRelationshipTypeBasedPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference sourceConcept,
                                                                                                               org.LexGrid.LexBIG.DataModel.Core.ConceptReference targetConcept,
                                                                                                               boolean directOnly)

buildRelationshipDistanceBasedPolicy

public static org.LexGrid.LexBIG.DataModel.cagrid.RelationshipDistanceBasedPolicy buildRelationshipDistanceBasedPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference sourceConcept,
                                                                                                                       org.LexGrid.LexBIG.DataModel.Core.ConceptReference targetConcept,
                                                                                                                       int distance)

buildGraphResolutionPolicy

public static org.LexGrid.LexBIG.DataModel.cagrid.GraphResolutionPolicy buildGraphResolutionPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference graphFocus,
                                                                                                   boolean resolveForward,
                                                                                                   boolean resolveBackward,
                                                                                                   int resolveCodedEntryDepth,
                                                                                                   int resolveAssociationDepth,
                                                                                                   org.LexGrid.LexBIG.DataModel.Collections.LocalNameList propertyNames,
                                                                                                   org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] propertyTypes,
                                                                                                   org.LexGrid.LexBIG.DataModel.Collections.SortOptionList sortOptions,
                                                                                                   org.LexGrid.LexBIG.DataModel.Collections.LocalNameList filterOptions,
                                                                                                   int maxToReturn,
                                                                                                   boolean keepLastAssociationLevelUnresolved)

buildSetResolutionPolicy

public static org.LexGrid.LexBIG.DataModel.cagrid.SetResolutionPolicy buildSetResolutionPolicy(org.LexGrid.LexBIG.DataModel.Collections.SortOptionList sortOptions,
                                                                                               org.LexGrid.LexBIG.DataModel.Collections.LocalNameList filterOptions,
                                                                                               org.LexGrid.LexBIG.DataModel.Collections.LocalNameList propertyNames,
                                                                                               org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.PropertyType[] propertyTypes,
                                                                                               boolean resolveConcepts,
                                                                                               int maxToReturn)

buildNodeListPolicy

public static org.LexGrid.LexBIG.DataModel.cagrid.NodeListPolicy buildNodeListPolicy(org.LexGrid.LexBIG.DataModel.Core.ConceptReference graphFocus,
                                                                                     boolean resolveForward,
                                                                                     boolean resolveBackward,
                                                                                     int resolveAssociationDepth,
                                                                                     int maxToReturn)

wrapCodingSchemeIdentifier

public static org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeIdentification wrapCodingSchemeIdentifier(java.lang.String codingScheme)

wrapMatchCritia

public static org.LexGrid.LexBIG.DataModel.cagrid.MatchCriteria wrapMatchCritia(java.lang.String text)

wrapCodeExistence

public static org.LexGrid.LexBIG.DataModel.cagrid.CodeExistence wrapCodeExistence(boolean isPresent)

wrapExtensionIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.ExtensionIdentification wrapExtensionIdentification(java.lang.String name)

wrapHierarchyIdentificationIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.HierarchyIdentification wrapHierarchyIdentificationIdentification(java.lang.String identifier)

wrapLanguageIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.LanguageIdentification wrapLanguageIdentification(java.lang.String name)

wrapCodeRelationship

public static org.LexGrid.LexBIG.DataModel.cagrid.CodeRelationship wrapCodeRelationship(boolean areRelated)

wrapCodeState

public static org.LexGrid.LexBIG.DataModel.cagrid.CodeState wrapCodeState(boolean isActive)

wrapDirection

public static org.LexGrid.LexBIG.DataModel.cagrid.Direction wrapDirection(boolean isForward)

wrapDirectionalAssociationIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.DirectionalAssociationIdentification wrapDirectionalAssociationIdentification(java.lang.String id,
                                                                                                                                boolean isForward)

wrapConceptIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.ConceptIdentification wrapConceptIdentification(java.lang.String code)

wrapRelationContainerIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.RelationContainerIdentification wrapRelationContainerIdentification(java.lang.String name)

wrapCodingSchemCopyRight

public static org.LexGrid.LexBIG.DataModel.cagrid.CodingSchemeCopyRight wrapCodingSchemCopyRight(java.lang.String text)

wrapAssociationIdentification

public static org.LexGrid.LexBIG.DataModel.cagrid.AssociationIdentification wrapAssociationIdentification(java.lang.String name)

convertSearchDesignationOption

public static org.LexGrid.LexBIG.DataModel.enums.SearchDesignationOption convertSearchDesignationOption(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.SearchDesignationOption option)

convertSearchDesignationOption

public static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.SearchDesignationOption convertSearchDesignationOption(org.LexGrid.LexBIG.DataModel.enums.SearchDesignationOption option)

convertActiveOption

public static org.LexGrid.LexBIG.DataModel.enums.ActiveOption convertActiveOption(org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption option)

convertActiveOption

public static org.LexGrid.LexBIG.LexBIGService.CodedNodeSet.ActiveOption convertActiveOption(org.LexGrid.LexBIG.DataModel.enums.ActiveOption option)

convertHierarchyPathResolveOption

public static org.LexGrid.LexBIG.DataModel.enums.HierarchyPathResolveOption convertHierarchyPathResolveOption(org.LexGrid.LexBIG.Extensions.Generic.LexBIGServiceConvenienceMethods.HierarchyPathResolveOption option)

convertHierarchyPathResolveOption

public static org.LexGrid.LexBIG.Extensions.Generic.LexBIGServiceConvenienceMethods.HierarchyPathResolveOption convertHierarchyPathResolveOption(org.LexGrid.LexBIG.DataModel.enums.HierarchyPathResolveOption option)

conceptIdentificationArrayToString

public static java.lang.String[] conceptIdentificationArrayToString(org.LexGrid.LexBIG.DataModel.cagrid.ConceptIdentification[] codeArray)

processException

public static void processException(java.lang.Exception e)
                             throws LBParameterException,
                                    LBException,
                                    LBInvocationException,
                                    LBResourceUnavailableException,
                                    InvalidServiceContextAccess,
                                    java.rmi.RemoteException
LexEVS Grid Service is a layer over Distributed LexBIG, which itself is a layer over LexBIG. Often, Exceptions are rethrown or wrappered by the various layers, making them hard to understand by the time they reach the Grid Service layer. This method attempts to unwrap some of these Exceptions to find the real cause of the problem. After it receives an Exception, it cycles through the causes and attempts to locate the actual buried cause. It then creates a Grid Exception to correspond to that, and rethrows this new Exception.

Parameters:
e - The Exception to process
Throws:
LBParameterException
LBException
LBInvocationException
LBResourceUnavailableException
InvalidServiceContextAccess
java.rmi.RemoteException