public class RestHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected static Map<String,Set<String>> |
directoryEntryIdsToDelete |
protected static org.apache.commons.logging.Log |
log |
Modifier and Type | Method and Description |
---|---|
static void |
addDirectoryEntryToDelete(String directoryName,
String entryId) |
static void |
addDocumentToDelete(String idOrPath) |
static void |
addDocumentToDelete(String id,
String path) |
static void |
addGroupToDelete(String groupName) |
static void |
addPermission(String idOrPath,
String username,
String permission) |
static void |
addUserToDelete(String userName) |
static void |
cleanup() |
static void |
cleanupDirectoryEntries() |
static void |
cleanupDocuments() |
static void |
cleanupGroups() |
static void |
cleanupUsers() |
static void |
clearDirectoryEntryIdsToDelete() |
static int |
countQueryPageProvider(String providerName)
Runs a page provider on Nuxeo instance and return the total size of documents.
|
static String |
createDirectoryEntry(String directoryName,
Map<String,String> properties) |
static String |
createDocument(String idOrPath,
String type,
String title) |
static String |
createDocument(String idOrPath,
String type,
String title,
Map<String,Object> props) |
static String |
createDocument(String idOrPath,
String type,
String title,
String description) |
static void |
createGroup(String name,
String label) |
static void |
createGroup(String name,
String label,
String[] members,
String[] subGroups) |
static String |
createUser(String username,
String password) |
static String |
createUser(String username,
String password,
String firstName,
String lastName,
String company,
String email,
String group) |
static void |
deleteDirectoryEntries(String directoryName) |
static void |
deleteDirectoryEntry(String directoryName,
String entryId) |
static void |
deleteDocument(String idOrPath) |
static void |
deleteGroup(String name) |
static void |
deleteUser(String username) |
static boolean |
documentExists(String idOrPath) |
static boolean |
documentHasWorkflowStarted(String idOrPath) |
protected static boolean |
executeHTTP(Supplier<okhttp3.Response> fetcher) |
protected static <T> boolean |
exists(Supplier<T> fetcher) |
static Map<String,Object> |
fetchDirectoryEntryProperties(String directoryName,
String entryId) |
protected static org.nuxeo.client.objects.Document |
fetchDocumentByIdOrPath(String idOrPath)
Fetches a
Document instance according the input parameter which can be a document id or path. |
static void |
followLifecycleTransition(String idOrPath,
String transitionName) |
static boolean |
get(String path)
Performs a GET request and return whether or not request was successful.
|
static boolean |
groupExists(String groupName) |
static void |
logOnServer(String message)
Logs on server with
RestHelper as source and warn as level. |
static void |
logOnServer(String level,
String message)
Logs on server with
RestHelper as source. |
static void |
logOnServer(String source,
String level,
String message) |
static void |
operation(String operationId,
Map<String,Object> parameters) |
static boolean |
post(String path,
String body)
Performs a POST request and return whether or not request was successful.
|
static void |
removeDirectoryEntryToDelete(String directoryName,
String entryId) |
static void |
removeDocumentToDelete(String idOrPath) |
static void |
removePermissions(String idOrPath,
String username) |
static void |
removeUserToDelete(String userName) |
static void |
startWorkflowInstance(String idOrPath,
String workflowId) |
static void |
updateDirectoryEntry(String directoryName,
String entryId,
Map<String,String> properties) |
static boolean |
userExists(String username) |
protected static final Map<String,Set<String>> directoryEntryIdsToDelete
protected static final org.apache.commons.logging.Log log
public static void cleanup()
public static void cleanupDocuments()
public static void cleanupUsers()
public static void cleanupGroups()
public static void cleanupDirectoryEntries()
public static void addDocumentToDelete(String idOrPath)
public static void addDocumentToDelete(String id, String path)
public static void removeDocumentToDelete(String idOrPath)
public static void addUserToDelete(String userName)
public static void removeUserToDelete(String userName)
public static void addGroupToDelete(String groupName)
public static void addDirectoryEntryToDelete(String directoryName, String entryId)
public static void removeDirectoryEntryToDelete(String directoryName, String entryId)
public static void clearDirectoryEntryIdsToDelete()
public static String createUser(String username, String password)
public static String createUser(String username, String password, String firstName, String lastName, String company, String email, String group)
public static void deleteUser(String username)
public static boolean userExists(String username)
public static void createGroup(String name, String label)
public static void createGroup(String name, String label, String[] members, String[] subGroups)
public static void deleteGroup(String name)
public static boolean groupExists(String groupName)
public static String createDocument(String idOrPath, String type, String title)
public static String createDocument(String idOrPath, String type, String title, String description)
public static String createDocument(String idOrPath, String type, String title, Map<String,Object> props)
public static void deleteDocument(String idOrPath)
public static void addPermission(String idOrPath, String username, String permission)
public static void removePermissions(String idOrPath, String username)
public static void followLifecycleTransition(String idOrPath, String transitionName)
public static boolean documentExists(String idOrPath)
public static void startWorkflowInstance(String idOrPath, String workflowId)
public static boolean documentHasWorkflowStarted(String idOrPath)
protected static org.nuxeo.client.objects.Document fetchDocumentByIdOrPath(String idOrPath)
Document
instance according the input parameter which can be a document id or path.
CAUTION: Keep this method protected, we want to keep nuxeo-java-client objects here.public static int countQueryPageProvider(String providerName)
public static String createDirectoryEntry(String directoryName, Map<String,String> properties)
public static Map<String,Object> fetchDirectoryEntryProperties(String directoryName, String entryId)
public static void updateDirectoryEntry(String directoryName, String entryId, Map<String,String> properties)
public static void deleteDirectoryEntry(String directoryName, String entryId)
public static void deleteDirectoryEntries(String directoryName)
public static void operation(String operationId, Map<String,Object> parameters)
public static void logOnServer(String message)
RestHelper
as source and warn
as level.public static void logOnServer(String level, String message)
RestHelper
as source.public static void logOnServer(String source, String level, String message)
source
- the logger source, usually RestHelper or WebDriverlevel
- the log levelpublic static boolean get(String path)
public static boolean post(String path, String body)
protected static boolean executeHTTP(Supplier<okhttp3.Response> fetcher)
Copyright © 2018 Nuxeo. All rights reserved.