|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.wli.config.Ref
public final class Ref
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.
Field Summary | |
---|---|
static Ref |
DEFAULT_PROJECT_REF
Default project reference |
static Ref |
DOMAIN
Reference to the domain |
static String |
DOMAIN_REF
|
static String |
FOLDER_DATA_LOCAL_NAME
Local name for folderdata |
static String |
FOLDER_REF
|
static String |
LOCATION_DATA_TYPE
Type Id for location metadata |
static int |
MAX_FOLDER_OR_PROJECT_PART_LENGTH
|
static String |
PROJECT_DATA_LOCAL_NAME
Local name for project data |
static String |
PROJECT_REF
|
static char |
SEPARATOR_CHAR
Character that separates hierarchical names |
static 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(String typeId,
Ref parent,
String name)
Constructor for creating a reference to an object under a particular parent |
|
Ref(String typeId,
String[] names)
Constructor for creating an arbitrary reference. |
Method Summary | |
---|---|
static void |
_assertValidLocalNamePart(String name)
|
static void |
_assertValidProjectOrFolderPart(String name)
|
int |
compareTo(Object o)
|
boolean |
equals(Object o)
|
static Ref |
getDomainRef()
Returns the (only) reference to the config fwk domain |
String |
getFullName()
Returns the full name of the object. |
String |
getGlobalName()
|
String |
getLocalName()
Returns the local name (last name) for the given ref |
static String |
getLocalNamePart(String fullName)
Returns the local name part of the full name. |
String[] |
getNames()
Returns the hierarchical name for the object referenced. |
static String[] |
getNames(String fullName)
converts a fullname into its components by splitting it at the separator character SEPARATOR_CHAR |
static String |
getParentNamePart(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. |
String |
getProjectName()
Returns the project name If this is a resource reference, project reference of a folder reference. |
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,
String ruleId)
make an AlertRuleRef using the serviceRef and the ruleId. |
static Ref |
makeFolderRef(Ref parent,
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(String location)
Deprecated. since 2.6 |
static Ref |
makeProjectRef(String projectName)
Constructs a reference to project |
static Ref |
makeRef(String typeId,
Ref parent,
String localname)
Constructs a reference to an arbitrary object other than the domain and that is hierarchical. |
static Ref |
makeRef(String typeId,
String[] names)
Constructs a reference to an arbitrary object other than the domain. |
static Ref |
makeResourceRef(String resourceType,
Ref projectOrFolderRef,
String resourceName)
Convenience constructor for creating an arbitrary resource reference |
static Ref |
makeSimpleTypeRef(String typeId,
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 Set<Ref> |
narrowRefs(Set<Ref> initialSet,
Set<Ref> filter)
Narrows the initial set so that only those that are specified in the filter remain. |
static Ref |
parseGlobalName(String globalName)
|
Object |
readResolve()
|
static void |
sort(List<Ref> refList)
This method returns sorted Ref list |
String |
toString()
|
static boolean |
validateProjectOrFolderPart(StringBuilder resultMsg,
String name,
Locale locale)
Utility method for validating a folder or project name. |
static boolean |
validateResourceLocalNamePart(StringBuilder resultMsg,
String name,
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 |
---|
public static final long serialVersionUID
public static final String DOMAIN_REF
public static final String PROJECT_REF
public static final String FOLDER_REF
public static final int MAX_FOLDER_OR_PROJECT_PART_LENGTH
public static final Ref DOMAIN
public static final Ref DEFAULT_PROJECT_REF
public static final Ref STATIC_PROJECT_REF
public static final String PROJECT_DATA_LOCAL_NAME
public static final String FOLDER_DATA_LOCAL_NAME
public static final char SEPARATOR_CHAR
public static final String SEPARATOR_CHAR_PATTERN
public static final String LOCATION_DATA_TYPE
public static final Ref SYSTEM_PROJECT_REF
Refs.SYSTEM_PROJECT_REF
.
Deprecated API is removed in the subsequent major release.public static final Ref SYSTEM_UDDI_FOLDER
Refs.SYSTEM_UDDI_FOLDER
.
Deprecated API is removed in the subsequent major release.public static final Ref SYSTEM_SMTP_FOLDER
Refs.SYSTEM_SMTP_FOLDER
.
Deprecated API is removed in the subsequent major release.public static final Ref SYSTEM_JNDI_PROVIDER_FOLDER
Refs.SYSTEM_JNDI_PROVIDER_FOLDER
.
Deprecated API is removed in the subsequent major release.Constructor Detail |
---|
public Ref(String typeId, Ref parent, String name)
typeId
- The type of the reference that will be created - expected to be canonicalparent
- 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.public Ref(String typeId, String[] names)
typeId
- - expected to be canonicalnames
- Method Detail |
---|
public String getTypeId()
public boolean isDomainRef()
public boolean isProjectRef()
public boolean isFolderRef()
public boolean isResourceRef()
public boolean isLocationDataRef()
public String[] getNames()
public String getFullName()
public String getLocalName()
public Ref getProject() throws IllegalStateException
IllegalStateException
IllegalStateException
- if this is not a project, folder or resource referencepublic String getProjectName() throws IllegalStateException
IllegalStateException
IllegalStateException
- if this is not a project, folder or resource referencepublic Ref getParentRef()
public boolean isDescendantOf(Ref ancestor)
ancestor
-
public String getGlobalName()
public static Ref parseGlobalName(String globalName)
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
public Object readResolve()
public Ref map(Ref sourceLocation, Ref targetLocation) throws IllegalArgumentException
sourceLocation
- the prefix location to be changed.targetLocation
- the new value for the prefix location.
IllegalArgumentException
- if this reference is not under the source location.public static Ref makeLocationRef(String location)
Factory method to create parent ref for the given location. For Eg: if location is project1/folder1/folder2 it creates Ref object for folder2.
location
-
public static Ref makeLocationDataRef(Ref location)
location
- the folder/project for which the location data reference will be computed
public static Ref makeProjectRef(String projectName)
projectName
- name of the project
public static Ref makeFolderRef(Ref parent, String folderName)
parent
- the parent. This can be a folder or a project.folderName
- name of the folder
public static Ref makeRef(String typeId, Ref parent, String localname)
typeId
- Type of the reference to constructparent
- the parent. This can be a folder or a project.localname
- local name for the referencepublic static Ref makeRef(String typeId, String[] names)
typeId
- Type of the reference to constructnames
- array of names that describe the path to the object being referenced.public static Ref makeSimpleTypeRef(String typeId, String name)
public static Ref makeResourceRef(String resourceType, Ref projectOrFolderRef, String resourceName)
resourceType
- type of the resourceprojectOrFolderRef
- parent folder or projectresourceName
- name of the resource
public static Ref getDomainRef()
public static Ref makeAlertRuleRef(Ref parentRef, String ruleId)
parentRef
- ruleId
-
public static String[] getNames(String fullName)
SEPARATOR_CHAR
fullName
- the full (hierarchical) name to the instancepublic static boolean validateProjectOrFolderPart(StringBuilder resultMsg, String name, Locale locale)
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
public static boolean validateResourceLocalNamePart(StringBuilder resultMsg, String name, Locale locale)
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
public static void _assertValidProjectOrFolderPart(String name) throws IllegalArgumentException
IllegalArgumentException
public static void _assertValidLocalNamePart(String name) throws IllegalArgumentException
IllegalArgumentException
public static String getLocalNamePart(String fullName)
fullName
-
public static String getParentNamePart(String fullName)
fullName
-
public static void sort(List<Ref> refList)
public static Set<Ref> narrowRefs(Set<Ref> initialSet, Set<Ref> filter)
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.
initialSet
- filter
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |