Class ResourceConverter

  • public class ResourceConverter
    extends Object
    A Resource is a representation of an object bound to JNDI. This converter will take a property and convert it to a Resource and visa versa.
    • Constructor Detail

      • ResourceConverter

        public ResourceConverter()
    • Method Detail

      • fromPropertyString

        public Resource fromPropertyString​(String resourceInformation)
        Construct a Resource from a single String. Note that parameters can be nested as long as they are semicolon delimited Example: CreateDatabase=create;DatabaseName=TEST.
        resourceInformation - A string, really a list of properties, representing a Resource
        Resource representing the string.
        See Also:
      • toPropertyString

        public String toPropertyString​(Resource data)
        Get a string representation of this Resource.
        data - the Resource we are serializing
        a string representation
      • toProperties

        public Properties toProperties​(Resource data)
        Get a properties object containing all of the members of this Resource object. Note that driver properties will be nested and delimited by a semicolon.
        data - the Resource we are serializing
        a properties object corresponding to this Resource
      • getParametersAsASemicolonDelimitedString

        public String getParametersAsASemicolonDelimitedString​(Resource data)
        tests to see if the value is null before attempting to join the database properties on a semicolon.
        data - the Resource we are serializing
        property string delimited by semicolon, or null, if they cannot be parsed because the input properties weren't set or empty
      • createIdFromJndiLocation

        protected static String createIdFromJndiLocation​(String jndiLocation)
        Get a string name for the configuration of this resource. This should be XML and filesystem friendly. For example, the String returned will have no slashes or punctuation, and be as short as possible.
        jndiLocation - used to construct the id
        a string that can be used to name this configuration