org.eclipse.stardust.engine.core.spi.dms
Class RepositoryIdUtils

java.lang.Object
  extended by org.eclipse.stardust.engine.core.spi.dms.RepositoryIdUtils

public class RepositoryIdUtils
extends Object

Utility to handle the repositoryId prefix of Resource.getId() and Resource.getId().

Author:
Roland.Stamm

Field Summary
static String REPOSITORY_ID_PREFIX
          The prefix that is used to identify a repositoryId.
 
Method Summary
static Documents addRepositoryId(Documents documents, String repositoryId)
           
static
<T extends Resource>
List<T>
addRepositoryId(List<T> resources, String repositoryId)
           
static String addRepositoryId(String id, String repositoryId)
           
static
<T extends Resource>
T
addRepositoryId(T resource, String repositoryId)
           
static List<String> extractRepositoryId(List<String> prefixedIds)
           
static String extractRepositoryId(Resource resource)
           
static String extractRepositoryId(String prefixedId)
           
static String replaceRepositoryId(String prefixedId, String newRepositoryId)
           
static boolean repositoryIdEquals(String repositoryId1, String repositoryId2)
          Compares repositoryIds considering legacy id null which defaults to RepositoryManager.SYSTEM_REPOSITORY_ID.
static boolean resourceIdEquals(String id1, String id2)
          Compares Resource Ids considering legacy Ids without repositoryId prefix.
The prefix pointing to the repositoryId RepositoryManager.SYSTEM_REPOSITORY_ID is optional.
static List<String> stripRepositoryId(List<String> prefixedIds)
           
static String stripRepositoryId(String prefixedId)
           
static
<T extends Resource>
T
stripRepositoryId(T resource)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_ID_PREFIX

public static final String REPOSITORY_ID_PREFIX
The prefix that is used to identify a repositoryId.

See Also:
Constant Field Values
Method Detail

extractRepositoryId

public static String extractRepositoryId(String prefixedId)

extractRepositoryId

public static List<String> extractRepositoryId(List<String> prefixedIds)

extractRepositoryId

public static String extractRepositoryId(Resource resource)

stripRepositoryId

public static String stripRepositoryId(String prefixedId)

stripRepositoryId

public static List<String> stripRepositoryId(List<String> prefixedIds)

stripRepositoryId

public static <T extends Resource> T stripRepositoryId(T resource)

addRepositoryId

public static String addRepositoryId(String id,
                                     String repositoryId)

addRepositoryId

public static <T extends Resource> T addRepositoryId(T resource,
                                                     String repositoryId)

addRepositoryId

public static <T extends Resource> List<T> addRepositoryId(List<T> resources,
                                                           String repositoryId)

addRepositoryId

public static Documents addRepositoryId(Documents documents,
                                        String repositoryId)

replaceRepositoryId

public static String replaceRepositoryId(String prefixedId,
                                         String newRepositoryId)

resourceIdEquals

public static boolean resourceIdEquals(String id1,
                                       String id2)
Compares Resource Ids considering legacy Ids without repositoryId prefix.
The prefix pointing to the repositoryId RepositoryManager.SYSTEM_REPOSITORY_ID is optional.

Do not confuse with repositoryIdEquals(String, String)

For example:
'{urn:repository:default}{jcr-uuid}ABC' == '{jcr-uuid}ABC'.
However:
'{urn:repository:newRepository}{jcr-uuid}ABC' != '{jcr-uuid}ABC'


repositoryIdEquals

public static boolean repositoryIdEquals(String repositoryId1,
                                         String repositoryId2)
Compares repositoryIds considering legacy id null which defaults to RepositoryManager.SYSTEM_REPOSITORY_ID.

Do not confuse with resourceIdEquals(String, String).

For example:
'default == null'
However:
'newRepository != null'



Copyright © 2017 Eclipse Stardust. All Rights Reserved.