Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gov.lanl.Utility
Class ResourceNameTranslate  view ResourceNameTranslate download ResourceNameTranslate.java

java.lang.Object
  extended bygov.lanl.Utility.ResourceNameTranslate

public class ResourceNameTranslate
extends java.lang.Object

This class converts a String representation of a ResourceNameComponent into the appropriate structure and vice versa. This is particularly useful for mapping String names into the RAD space. e.g. Id.10001/field.BACTERIOLOGY maps to a ResourceNameComponent array of two elements. The element before the period is the name_string and the element after the period is the value_string This follows the specification for Stringified NameComponents as specified in the updated NamingService This seems appropriate because the ResourceNameComponent was borrowed from that specification.

Version:
$Id: ResourceNameTranslate.java,v 1.5 2002/04/25 23:09:18 dwforslund Exp $

Field Summary
private static org.apache.log4j.Logger cat
           
private static java.lang.String SEPARATOR
           
 
Constructor Summary
private ResourceNameTranslate()
          Creates a new instance of ResourceNameTranslate
 
Method Summary
static boolean isValid(java.lang.String resource)
          Check to see if Resource string is a valid ResourceName
(package private) static void main(java.lang.String[] argv)
          Static test of translation
static org.omg.DfResourceAccessDecision.ResourceNameComponent[] toName(java.lang.String resourceName)
          function to turn string into a ResourceNameComponent array The characters '.', '/' and '\' can be included in the string values if they are preceded with '\'
static org.omg.DfResourceAccessDecision.ResourceName toResource(java.lang.String resource)
          Convert resourceName string into a full resourceName
static java.lang.String toString(org.omg.DfResourceAccessDecision.ResourceName resource)
          Extend convention to handle resource name prepend the authority as though it were a protocol.
static java.lang.String toString(org.omg.DfResourceAccessDecision.ResourceNameComponent[] ResourceNameComponentList)
          Convert ResourceNameComponent[] into a String It will quote any literal '.', '/', and '\' characters by adding a preceding '\'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

private static java.lang.String SEPARATOR

cat

private static org.apache.log4j.Logger cat
Constructor Detail

ResourceNameTranslate

private ResourceNameTranslate()
Creates a new instance of ResourceNameTranslate

Method Detail

isValid

public static boolean isValid(java.lang.String resource)
Check to see if Resource string is a valid ResourceName


toString

public static java.lang.String toString(org.omg.DfResourceAccessDecision.ResourceName resource)
Extend convention to handle resource name prepend the authority as though it were a protocol.


toResource

public static org.omg.DfResourceAccessDecision.ResourceName toResource(java.lang.String resource)
                                                                throws org.omg.DfResourceAccessDecision.InvalidResourceName
Convert resourceName string into a full resourceName


toString

public static java.lang.String toString(org.omg.DfResourceAccessDecision.ResourceNameComponent[] ResourceNameComponentList)
Convert ResourceNameComponent[] into a String It will quote any literal '.', '/', and '\' characters by adding a preceding '\'


toName

public static org.omg.DfResourceAccessDecision.ResourceNameComponent[] toName(java.lang.String resourceName)
                                                                       throws org.omg.DfResourceAccessDecision.InvalidResourceName
function to turn string into a ResourceNameComponent array The characters '.', '/' and '\' can be included in the string values if they are preceded with '\'


main

static void main(java.lang.String[] argv)
Static test of translation