Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.6.3)

E15033-08


com.bea.wli.config
Class Ref

java.lang.Object
  extended by com.bea.wli.config.Ref

All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public final class Ref
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

A Ref uniquely represents a resource, project or folder that is managed by the Configuration Framework. A Ref object has two components: A typeId that indicates whether it is a project, folder, or a resource, and an array of names of non-zero length. For a resource the array of names start with the project name, followed by folder names, and end with the resource name. For a project, the Ref object simply contains one name component, that is, the project name. A Ref object for a folder contains the project name followed by the names of the folders which it is nested under.

A special Ref DOMAIN refers to the whole domain.

Note: this class has a natural ordering that is inconsistent with equals.

See Also:
Serialized Form

Field Summary
static Ref DEFAULT_PROJECT_REF
          Default project reference
static Ref DOMAIN
          Reference to the domain
static java.lang.String DOMAIN_REF
           
static java.lang.String FOLDER_DATA_LOCAL_NAME
          Local name for folderdata
static java.lang.String FOLDER_REF
           
static java.lang.String LOCATION_DATA_TYPE
          Type Id for location metadata
static int MAX_FOLDER_OR_PROJECT_PART_LENGTH
           
static java.lang.String PROJECT_DATA_LOCAL_NAME
          Local name for project data
static java.lang.String PROJECT_REF
           
static char SEPARATOR_CHAR
          Character that separates hierarchical names
static java.lang.String SEPARATOR_CHAR_PATTERN
          REgular expression representation of the separateor char for pattern matching purposes.
static long serialVersionUID
           
static Ref STATIC_PROJECT_REF
          Internal project that always exists
static Ref SYSTEM_JNDI_PROVIDER_FOLDER
          Deprecated. in 2.6. Please use Refs.SYSTEM_JNDI_PROVIDER_FOLDER. Deprecated API is removed in the subsequent major release.
static Ref SYSTEM_PROJECT_REF
          Deprecated. in 2.6. Please use Refs.SYSTEM_PROJECT_REF. Deprecated API is removed in the subsequent major release.
static Ref SYSTEM_SMTP_FOLDER
          Deprecated. in 2.6. Please use Refs.SYSTEM_SMTP_FOLDER. Deprecated API is removed in the subsequent major release.
static Ref SYSTEM_UDDI_FOLDER
          Deprecated. in 2.6. Please use Refs.SYSTEM_UDDI_FOLDER. Deprecated API is removed in the subsequent major release.

 

Constructor Summary
Ref(java.lang.String typeId, Ref parent, java.lang.String name)
          Constructor for creating a reference to an object under a particular parent
Ref(java.lang.String typeId, java.lang.String[] names)
          Constructor for creating an arbitrary reference.

 

Method Summary
static void _assertValidLocalNamePart(java.lang.String name)
           
static void _assertValidProjectOrFolderPart(java.lang.String name)
           
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
static Ref getDomainRef()
          Returns the (only) reference to the config fwk domain
 java.lang.String getFullName()
          Returns the full name of the object.
 java.lang.String getGlobalName()
           
 java.lang.String getLocalName()
          Returns the local name (last name) for the given ref
static java.lang.String getLocalNamePart(java.lang.String fullName)
          Returns the local name part of the full name.
 java.lang.String[] getNames()
          Returns the hierarchical name for the object referenced.
static java.lang.String[] getNames(java.lang.String fullName)
          converts a fullname into its components by splitting it at the separator character SEPARATOR_CHAR
static java.lang.String getParentNamePart(java.lang.String fullName)
          Returns the parent name part of the full name.
 Ref getParentRef()
          Returns a reference to the parent.
 Ref getProject()
          Returns the project If this is a resource reference, project reference of a folder reference.
 java.lang.String getProjectName()
          Returns the project name If this is a resource reference, project reference of a folder reference.
 java.lang.String getTypeId()
          Returns the type of the reference
 int hashCode()
           
 boolean isDescendantOf(Ref ancestor)
          Returns true if this reference is a descendent (child, grandchild etc...) of the given reference
 boolean isDomainRef()
          Returns true if this is the domain reference
 boolean isFolderRef()
          Returns true if this is a folder reference
 boolean isLocationDataRef()
          Returns true if this is a reference to the locationData resource
 boolean isProjectRef()
          Returns true if this is a project reference
 boolean isResourceRef()
          REturns true if this is a resource reference
static Ref makeAlertRuleRef(Ref parentRef, java.lang.String ruleId)
          make an AlertRuleRef using the serviceRef and the ruleId.
static Ref makeFolderRef(Ref parent, java.lang.String folderName)
          Constructs a reference to a folder
static Ref makeLocationDataRef(Ref location)
          Creates a reference to the metadata that is kept for the given location (folder or project).
static Ref makeLocationRef(java.lang.String location)
          Deprecated. since 2.6
static Ref makeProjectRef(java.lang.String projectName)
          Constructs a reference to project
static Ref makeRef(java.lang.String typeId, Ref parent, java.lang.String localname)
          Constructs a reference to an arbitrary object other than the domain and that is hierarchical.
static Ref makeRef(java.lang.String typeId, java.lang.String[] names)
          Constructs a reference to an arbitrary object other than the domain.
static Ref makeResourceRef(java.lang.String resourceType, Ref projectOrFolderRef, java.lang.String resourceName)
          Convenience constructor for creating an arbitrary resource reference
static Ref makeSimpleTypeRef(java.lang.String typeId, java.lang.String name)
           
 Ref map(Ref sourceLocation, Ref targetLocation)
          Maps a reference to another reference so that a portion of its prefix location is mapped to a target location.
static java.util.Set<Ref> narrowRefs(java.util.Set<Ref> initialSet, java.util.Set<Ref> filter)
          Narrows the initial set so that only those that are specified in the filter remain.
static Ref parseGlobalName(java.lang.String globalName)
           
static Ref parseGlobalNameOld(java.lang.String globalName)
           
 java.lang.Object readResolve()
           
static void removeMoreSpecific(java.util.Set<Ref> set)
          Remove a ref R1 from set if there exists another ref R2 in the set such that R1 is under R2.
static void sort(java.util.List<Ref> refList)
           This method returns sorted Ref list
 java.lang.String toString()
           
static boolean validateProjectOrFolderPart(java.lang.StringBuilder resultMsg, java.lang.String name, java.util.Locale locale)
          Utility method for validating a folder or project name.
static boolean validateResourceLocalNamePart(java.lang.StringBuilder resultMsg, java.lang.String name, java.util.Locale locale)
          Utility method for validating the local name of a resource.

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

DOMAIN_REF

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

PROJECT_REF

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

FOLDER_REF

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

MAX_FOLDER_OR_PROJECT_PART_LENGTH

public static final int MAX_FOLDER_OR_PROJECT_PART_LENGTH
See Also:
Constant Field Values

DOMAIN

public static final Ref DOMAIN
Reference to the domain

DEFAULT_PROJECT_REF

public static final Ref DEFAULT_PROJECT_REF
Default project reference

STATIC_PROJECT_REF

public static final Ref STATIC_PROJECT_REF
Internal project that always exists

PROJECT_DATA_LOCAL_NAME

public static final java.lang.String PROJECT_DATA_LOCAL_NAME
Local name for project data
See Also:
Constant Field Values

FOLDER_DATA_LOCAL_NAME

public static final java.lang.String FOLDER_DATA_LOCAL_NAME
Local name for folderdata
See Also:
Constant Field Values

SEPARATOR_CHAR

public static final char SEPARATOR_CHAR
Character that separates hierarchical names
See Also:
Constant Field Values

SEPARATOR_CHAR_PATTERN

public static final java.lang.String SEPARATOR_CHAR_PATTERN
REgular expression representation of the separateor char for pattern matching purposes. This string is the same as SEPARATOR_CHAR except that if the sep char is a special char it contains escape prefix "\"
See Also:
Constant Field Values

LOCATION_DATA_TYPE

public static final java.lang.String LOCATION_DATA_TYPE
Type Id for location metadata
See Also:
Constant Field Values

SYSTEM_PROJECT_REF

public static final Ref SYSTEM_PROJECT_REF
Deprecated. in 2.6. Please use Refs.SYSTEM_PROJECT_REF. Deprecated API is removed in the subsequent major release.

SYSTEM_UDDI_FOLDER

public static final Ref SYSTEM_UDDI_FOLDER
Deprecated. in 2.6. Please use Refs.SYSTEM_UDDI_FOLDER. Deprecated API is removed in the subsequent major release.

SYSTEM_SMTP_FOLDER

public static final Ref SYSTEM_SMTP_FOLDER
Deprecated. in 2.6. Please use Refs.SYSTEM_SMTP_FOLDER. Deprecated API is removed in the subsequent major release.

SYSTEM_JNDI_PROVIDER_FOLDER

public static final Ref SYSTEM_JNDI_PROVIDER_FOLDER
Deprecated. in 2.6. Please use Refs.SYSTEM_JNDI_PROVIDER_FOLDER. Deprecated API is removed in the subsequent major release.

Constructor Detail

Ref

public Ref(java.lang.String typeId,
           Ref parent,
           java.lang.String name)
Constructor for creating a reference to an object under a particular parent
Parameters:
typeId - The type of the reference that will be created - expected to be canonical
parent - the parent. If the typeId is project the parent must be the domain reference. If the typeId is folder the parent must be a project or another folder. If the typeId indicates a resource the parent must be a project or a folder.
name - non-qualified name of the object that will be created. The full name of the created object will be computed by appending this name to the full name of the parent.

Ref

public Ref(java.lang.String typeId,
           java.lang.String[] names)
Constructor for creating an arbitrary reference.
Parameters:
typeId - - expected to be canonical
names -

Method Detail

getTypeId

public java.lang.String getTypeId()
Returns the type of the reference
Returns:

isDomainRef

public boolean isDomainRef()
Returns true if this is the domain reference

isProjectRef

public boolean isProjectRef()
Returns true if this is a project reference

isFolderRef

public boolean isFolderRef()
Returns true if this is a folder reference

isResourceRef

public boolean isResourceRef()
REturns true if this is a resource reference

isLocationDataRef

public boolean isLocationDataRef()
Returns true if this is a reference to the locationData resource

getNames

public java.lang.String[] getNames()
Returns the hierarchical name for the object referenced.
Returns:

getFullName

public java.lang.String getFullName()
Returns the full name of the object. This is a dot separated sequence of reference type followed by names .
Returns:

getLocalName

public java.lang.String getLocalName()
Returns the local name (last name) for the given ref

getProject

public Ref getProject()
               throws java.lang.IllegalStateException
Returns the project If this is a resource reference, project reference of a folder reference. Otherwise throws IllegalStateException
Returns:
Throws:
java.lang.IllegalStateException - if this is not a project, folder or resource reference

getProjectName

public java.lang.String getProjectName()
                                throws java.lang.IllegalStateException
Returns the project name If this is a resource reference, project reference of a folder reference. Otherwise throws IllegalStateException
Returns:
Throws:
java.lang.IllegalStateException - if this is not a project, folder or resource reference

getParentRef

public Ref getParentRef()
Returns a reference to the parent. Returns null if this is domain ref. Returns domain ref, if this is a project reference. Returns the parent (project or folder) reference if this is a folder or a resource.

isDescendantOf

public boolean isDescendantOf(Ref ancestor)
Returns true if this reference is a descendent (child, grandchild etc...) of the given reference
Parameters:
ancestor -
Returns:

getGlobalName

public java.lang.String getGlobalName()

parseGlobalNameOld

public static Ref parseGlobalNameOld(java.lang.String globalName)

parseGlobalName

public static Ref parseGlobalName(java.lang.String globalName)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

readResolve

public java.lang.Object readResolve()

map

public Ref map(Ref sourceLocation,
               Ref targetLocation)
        throws java.lang.IllegalArgumentException
Maps a reference to another reference so that a portion of its prefix location is mapped to a target location. For example, if the reference is A/B/C/D/myResource, sourceLocation = A/B, and target location = X/Y/Z then the mapping result would be X/Y/Z/C/D/myResource. If this reference is equal to the source location, the method simply returns the targetLocation.
Parameters:
sourceLocation - the prefix location to be changed.
targetLocation - the new value for the prefix location.
Returns:
Throws:
java.lang.IllegalArgumentException - if this reference is not under the source location.

makeLocationRef

public static Ref makeLocationRef(java.lang.String location)
Deprecated. since 2.6
 Factory method to create parent ref for the given location.
 For Eg: if location is project1/folder1/folder2 it creates Ref object for folder2.
 
Parameters:
location -
Returns:

makeLocationDataRef

public static Ref makeLocationDataRef(Ref location)
Creates a reference to the metadata that is kept for the given location (folder or project).
Parameters:
location - the folder/project for which the location data reference will be computed
Returns:
reference to the resource that contains metadata about the given location

makeProjectRef

public static Ref makeProjectRef(java.lang.String projectName)
Constructs a reference to project
Parameters:
projectName - name of the project
Returns:
a reference to the project whose name is given.

makeFolderRef

public static Ref makeFolderRef(Ref parent,
                                java.lang.String folderName)
Constructs a reference to a folder
Parameters:
parent - the parent. This can be a folder or a project.
folderName - name of the folder
Returns:
a reference to a folder

makeRef

public static Ref makeRef(java.lang.String typeId,
                          Ref parent,
                          java.lang.String localname)
Constructs a reference to an arbitrary object other than the domain and that is hierarchical.
Parameters:
typeId - Type of the reference to construct
parent - the parent. This can be a folder or a project.
localname - local name for the reference

makeRef

public static Ref makeRef(java.lang.String typeId,
                          java.lang.String[] names)
Constructs a reference to an arbitrary object other than the domain.
Parameters:
typeId - Type of the reference to construct
names - array of names that describe the path to the object being referenced.

makeSimpleTypeRef

public static Ref makeSimpleTypeRef(java.lang.String typeId,
                                    java.lang.String name)

makeResourceRef

public static Ref makeResourceRef(java.lang.String resourceType,
                                  Ref projectOrFolderRef,
                                  java.lang.String resourceName)
Convenience constructor for creating an arbitrary resource reference
Parameters:
resourceType - type of the resource
projectOrFolderRef - parent folder or project
resourceName - name of the resource
Returns:

getDomainRef

public static Ref getDomainRef()
Returns the (only) reference to the config fwk domain

makeAlertRuleRef

public static Ref makeAlertRuleRef(Ref parentRef,
                                   java.lang.String ruleId)
make an AlertRuleRef using the serviceRef and the ruleId.
Parameters:
parentRef -
ruleId -
Returns:

getNames

public static java.lang.String[] getNames(java.lang.String fullName)
converts a fullname into its components by splitting it at the separator character SEPARATOR_CHAR
Parameters:
fullName - the full (hierarchical) name to the instance

validateProjectOrFolderPart

public static boolean validateProjectOrFolderPart(java.lang.StringBuilder resultMsg,
                                                  java.lang.String name,
                                                  java.util.Locale locale)
Utility method for validating a folder or project name. If the name argument is valid a true value is returned and resultMsg is not affected. If the name argument is not valid, an error msg is appended to the resultMsg argument, and a false value is returned.
Parameters:
resultMsg - Error message is appended to this builder if the name is invalid.
name - the local name of the project or folder (relative to the project), e.g., myProject, or folderA
Returns:

validateResourceLocalNamePart

public static boolean validateResourceLocalNamePart(java.lang.StringBuilder resultMsg,
                                                    java.lang.String name,
                                                    java.util.Locale locale)
Utility method for validating the local name of a resource. If the name argument is valid a true value is returned and resultMsg is not affected. If the name argument is not valid, an error msg is appended to the resultMsg argument, and a false value is returned.
Parameters:
resultMsg - Error message is appended to this builder if the name is invalid.
name - the local name of the resource (relative to its location), e.g., myResource, myWSDL
Returns:

_assertValidProjectOrFolderPart

public static void _assertValidProjectOrFolderPart(java.lang.String name)
                                            throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

_assertValidLocalNamePart

public static void _assertValidLocalNamePart(java.lang.String name)
                                      throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getLocalNamePart

public static java.lang.String getLocalNamePart(java.lang.String fullName)
Returns the local name part of the full name. Local name is the last component in a full path.
Parameters:
fullName -
Returns:

getParentNamePart

public static java.lang.String getParentNamePart(java.lang.String fullName)
Returns the parent name part of the full name. The parent name is the project or containing folder in the full path.
Parameters:
fullName -
Returns:

sort

public static void sort(java.util.List<Ref> refList)
 This method returns sorted Ref list
 
Parameters:
refList - List<Ref>

narrowRefs

public static java.util.Set<Ref> narrowRefs(java.util.Set<Ref> initialSet,
                                            java.util.Set<Ref> filter)
Narrows the initial set so that only those that are specified in the filter remain. This operation is different than the behavior implemented by the Set.retainAll(java.util.Collection ), and is not equal to initialSet.retainAll(filter). A reference in the initial set is retained if it exists in the filter set, or if any of its parent locations (folders, and project that it belongs to) exists in the filter.
Parameters:
initialSet -
filter -
Returns:

removeMoreSpecific

public static void removeMoreSpecific(java.util.Set<Ref> set)
Remove a ref R1 from set if there exists another ref R2 in the set such that R1 is under R2.
Parameters:
set -

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.6.3)

E15033-08


Copyright © 2008, 2012, Oracle. All rights reserved.