Package com.pathomation
Class CoreAdmin
java.lang.Object
com.pathomation.CoreAdmin
Intended for PMA.core interactions related to administrative operations. Does
NOT apply to PMA.start / PMA.core.lite
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addUser
(String admSessionID, String login, String firstName, String lastName, String email, String pwd) static boolean
addUser
(String admSessionID, String login, String firstName, String lastName, String email, String pwd, Boolean canAnnotate) static boolean
addUser
(String admSessionID, String login, String firstName, String lastName, String email, String pwd, Boolean canAnnotate, Boolean isAdmin) static boolean
addUser
(String admSessionID, String login, String firstName, String lastName, String email, String pwd, Boolean canAnnotate, Boolean isAdmin, Boolean isSuspended) This method is used to create a new user on PMA.corestatic String
static String
adminConnect
(String pmaCoreURL) static String
adminConnect
(String pmaCoreURL, String pmaCoreAdmUsername) static String
adminConnect
(String pmaCoreURL, String pmaCoreAdmUsername, String pmaCoreAdmPassword) This method is used to authenticate & connect as an admin to a PMA.core instance using admin credentialsstatic boolean
static boolean
adminDisconnect
(String adminSessionID) This method is used to disconnect an admin session from a PMA.core instancestatic void
static void
checkForPMAStart
(String method) static void
checkForPMAStart
(String method, String url) static void
checkForPMAStart
(String method, String url, String session) This method is under constructionstatic String
createAmazons3MountingPoint
(String accessKey, String secretKey, String path, Integer instanceId) static String
createAmazons3MountingPoint
(String accessKey, String secretKey, String path, Integer instanceId, Integer chunkSize) static String
createAmazons3MountingPoint
(String accessKey, String secretKey, String path, Integer instanceId, Integer chunkSize, String serviceUrl) This method is used to create an Amazon S3 mounting point.static boolean
createDirectory
(String sessionID, String path) This method is used to create a new directory on PMA.corestatic String
createFileSystemMountingPoint
(String username, String password, String domainName, String path, Integer instanceId) This method is used to create an FileSystem mounting point.static String
createRootDirectory
(String admSessionID, String alias) static String
createRootDirectory
(String admSessionID, String alias, List<String> amazonS3MountingPoints) static String
createRootDirectory
(String admSessionID, String alias, List<String> amazonS3MountingPoints, List<String> fileSystemMountingPoints) static String
createRootDirectory
(String admSessionID, String alias, List<String> amazonS3MountingPoints, List<String> fileSystemMountingPoints, String description) static String
createRootDirectory
(String admSessionID, String alias, List<String> amazonS3MountingPoints, List<String> fileSystemMountingPoints, String description, Boolean isPublic) static String
createRootDirectory
(String admSessionID, String alias, List<String> amazonS3MountingPoints, List<String> fileSystemMountingPoints, String description, Boolean isPublic, Boolean isOffline) static boolean
deleteDirectory
(String admSessionID, String path) This method is used to delete a directory on PMA.corestatic boolean
deleteSlide
(String admSessionID, String path) This method is used to delete a slide on PMA.corestatic String
This method is used to cache results from requested URLs (POST method)static boolean
renameDirectory
(String admSessionID, String originalPath, String newName) This method is used to rename a directory on PMA.corestatic boolean
renameSlide
(String admSessionID, String originalPath, String newName) This method is used to rename a slide on PMA.corestatic boolean
resetPassword
(String sessionID, String username, String newPassword) This method is used to reset a user's passwordstatic String
reverseRootDirectory
(String admSessionID, String alias) This method is used to lookup the reverse path of a root-directorystatic String
reverseUID
(String admSessionID, String slideRefUid) This method is used to lookup the reverse path of a UID for a specific slidestatic String
sendEmailReminder
(String admSessionID, String login) static String
sendEmailReminder
(String admSessionID, String login, String subject) This method is used to send out an email reminder to the address associated with user loginstatic void
setDebugFlag
(boolean flag) This method is used to determine whether the Java SDK runs in debugging mode or not.static boolean
userExists
(String admSessionID, String query) This method is used to check if a user exists
-
Constructor Details
-
CoreAdmin
public CoreAdmin()
-
-
Method Details
-
setDebugFlag
public static void setDebugFlag(boolean flag) This method is used to determine whether the Java SDK runs in debugging mode or not. When in debugging mode (flag = true), extra output is produced when certain conditions in the code are not met- Parameters:
flag
- Debugging mode (activated or deactivated)
-
checkForPMAStart
This method is under construction- Parameters:
method
- default value(""),url
- default value(null),session
- default value(null), Session ID- Throws:
Exception
- If something goes wrong
-
checkForPMAStart
- Throws:
Exception
-
checkForPMAStart
- Throws:
Exception
-
checkForPMAStart
- Throws:
Exception
-
httpPost
This method is used to cache results from requested URLs (POST method)- Parameters:
url
- URL to requestdata
- JSON input- Returns:
- Data returned following a request to a specific URL
-
adminConnect
public static String adminConnect(String pmaCoreURL, String pmaCoreAdmUsername, String pmaCoreAdmPassword) throws Exception This method is used to authenticate & connect as an admin to a PMA.core instance using admin credentials- Parameters:
pmaCoreURL
- url of PMA.core instancepmaCoreAdmUsername
- default value(""), username for PMA.core instancepmaCoreAdmPassword
- default value(""), password for PMA.core instance- Returns:
- session's ID if session was created successfully, otherwise null
- Throws:
Exception
- If target instance isn't a PMA.core instance
-
adminConnect
- Throws:
Exception
-
adminConnect
- Throws:
Exception
-
adminConnect
- Throws:
Exception
-
adminDisconnect
This method is used to disconnect an admin session from a PMA.core instance- Parameters:
adminSessionID
- First optional argument(String), default- Returns:
- True if successfully disconnected, false otherwise
-
adminDisconnect
public static boolean adminDisconnect() -
sendEmailReminder
This method is used to send out an email reminder to the address associated with user login- Parameters:
admSessionID
- admin session IDlogin
- user loginsubject
- First argument(String) - email subject.- Returns:
- Empty string if operation successful, an error message otherwise
-
sendEmailReminder
-
addUser
public static boolean addUser(String admSessionID, String login, String firstName, String lastName, String email, String pwd, Boolean canAnnotate, Boolean isAdmin, Boolean isSuspended) This method is used to create a new user on PMA.core- Parameters:
admSessionID
- admin session IDlogin
- user loginfirstName
- user's first namelastName
- user's last nameemail
- user's emailpwd
- user's passwordcanAnnotate
- Defines whether the user can annotate slides or notisAdmin
- Defines whether the user is an administrator or notisSuspended
- Defines whether the user is suspended or not- Returns:
- True if the creation has succeeded, false otherwise
-
addUser
-
addUser
-
addUser
-
userExists
This method is used to check if a user exists- Parameters:
admSessionID
- admin session IDquery
- keyword for the User to search for- Returns:
- True if the user exists, false otherwise
-
resetPassword
This method is used to reset a user's password- Parameters:
sessionID
- session IDusername
- username to updatenewPassword
- new password- Returns:
- True if password reset successfully, false otherwise
-
createDirectory
This method is used to create a new directory on PMA.core- Parameters:
sessionID
- an admin session IDpath
- path to create the new directory in- Returns:
- true if directory was created successfully, false otherwise
- Throws:
IOException
-
renameDirectory
This method is used to rename a directory on PMA.core- Parameters:
admSessionID
- an admin session IDoriginalPath
- Old pathnewName
- New name- Returns:
- true if directory was renamed successfully, false otherwise
-
deleteDirectory
This method is used to delete a directory on PMA.core- Parameters:
admSessionID
- an admin session IDpath
- path of the directory to delete- Returns:
- true if directory was successfully deleted, false otherwise
-
reverseUID
This method is used to lookup the reverse path of a UID for a specific slide- Parameters:
admSessionID
- an admin session IDslideRefUid
- slide UID- Returns:
- The reverse path of the slide
- Throws:
Exception
- If something goes wrong
-
reverseRootDirectory
This method is used to lookup the reverse path of a root-directory- Parameters:
admSessionID
- an admin session IDalias
- root directory alias- Returns:
- The reverse path of the root directory it's a file system one, empty string if it's a S3 one
- Throws:
Exception
- If something goes wrong
-
renameSlide
This method is used to rename a slide on PMA.core- Parameters:
admSessionID
- an admin session IDoriginalPath
- Old pathnewName
- New name- Returns:
- true if slide was renamed successfully, false otherwise
-
deleteSlide
This method is used to delete a slide on PMA.core- Parameters:
admSessionID
- an admin session IDpath
- path of the slide to delete- Returns:
- true if slide was successfully deleted, false otherwise
-
createAmazons3MountingPoint
public static String createAmazons3MountingPoint(String accessKey, String secretKey, String path, Integer instanceId, Integer chunkSize, String serviceUrl) This method is used to create an Amazon S3 mounting point. A list of these is to be used to supply method create_root_directory()- Parameters:
accessKey
- AWS Access keysecretKey
- AWS secret keypath
- pathinstanceId
- instance IDchunkSize
- default value(1048576), chunk sizeserviceUrl
- default value(null), service URL- Returns:
- Amazon S3 mounting point
-
createAmazons3MountingPoint
-
createAmazons3MountingPoint
-
createFileSystemMountingPoint
public static String createFileSystemMountingPoint(String username, String password, String domainName, String path, Integer instanceId) This method is used to create an FileSystem mounting point. A list of these is to be used to supply method create_root_directory()- Parameters:
username
- user namepassword
- passworddomainName
- domain namepath
- pathinstanceId
- instance ID- Returns:
- Filesystem mounting point
-
createRootDirectory
public static String createRootDirectory(String admSessionID, String alias, List<String> amazonS3MountingPoints, List<String> fileSystemMountingPoints, String description, Boolean isPublic, Boolean isOffline) - Parameters:
admSessionID
- Admin session IDalias
- Root directory AliasamazonS3MountingPoints
- List of amazon S3 mounting pointsfileSystemMountingPoints
- List of file system mounting pointsdescription
- (String), default value("Root dir created through pma_java"), Root directory descriptionisPublic
- (Boolean) defines whether the root directory is public or notisOffline
- (Boolean) defines whether the root directory is offline or not- Returns:
- Response code of the corresponding API call
-
createRootDirectory
-
createRootDirectory
-
createRootDirectory
-
createRootDirectory
-
createRootDirectory
-