Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

Please also check out our UserAdmin REST API which makes these methods available in a REST interface


The UserAdmin API can be accessed on any server. It requires a standard Ceptor Agent setup to be present. The UserAdmin API is access just like the Ceptor Agent interface. 

...

Code Block
public interface IUseradminAccess extends IUserAdmin {
/**
 * This method is used to search for users from their logon ID
 * 
 * @param logonid The logon ID to search for
 * @return A list of users with that logon ID
 * @throws UserAdminException If an error occurs during search. If no rows where found, error id <code>UserAdminException.ERROR_NOROWSFOUND</code> will be set 
 */
public QuickUser[] searchUsers( String logonid ) throws UserAdminException;

/**
 * This method is used to search for users from their logon ID, but restricts results to a single organisation
 * 
 * @param logonid The logon ID to search for
 * @param organisation_id The organisation to look in
 * @return A list of users with that logon ID
 * @throws UserAdminException If an error occurs during search. If no rows where found, error id <code>UserAdminException.ERROR_NOROWSFOUND</code> will be set 
 */
public QuickUser[] searchUsers( String logonid, int organisation_id ) throws UserAdminException;

/**
 * This method is used to search for a user through the user attributes. 
 * Allowed attributes can be fetched from @see dk.itp.pp.useradmin.client.IUserAttributes
 * 
 * @param attributes The attributes to search for
 * @param sortRow The row to sort after (null in this value will mean no sorting)
 * @return A list of users matching the given attrbutes
 * @throws UserAdminException If an error occurs during search. If no rows where found, error id <code>UserAdminException.ERROR_NOROWSFOUND</code> will be set 
 */
public QuickUser[] searchUsers( Hashtable attributes, String sortRow ) throws UserAdminException;

/**
 * This method can be used to retreive all the delivery methods defined in the
 * useradministration system
 * @return A list of Delivery methods defined in the system
 * @throws UserAdminException If an error occurs fetching data
 */
public DeliveryMethod[] getAllDeliveryMethods() throws UserAdminException;

/**
 * 
 * @return The list of valid user attributes (including those defined through server plugin)
 * @throws UserAdminException If an error occurs fetching data
 */	
public String[] getAllUserAttributes() throws UserAdminException;

/**
 * This method can be used to retreive all the authentication methods defined in the
 * useradministration system
 * @return A list of the authentication methods defined in the system
 * @throws UserAdminException If an error occurs fetching data
 */
public AuthenticationMethod[] getAllAuthenticationMethods() throws UserAdminException;

/**
 * This method can be used to retreive all the status's defined in the
 * useradministration system
 * @return A list of Status messages defined in the system
 * @throws UserAdminException If an error occurs fetching data
 */
public Status[] getAllStatus() throws UserAdminException;

/**
 * This method can be used to retreive all the status info's defined in the
 * useradministration system
 * @return A list of Status info messages defined in the system
 * @throws UserAdminException If an error occurs fetching data
 */
public StatusInfo[] getAllStatusInfo() throws UserAdminException;

/**
 * Returns a specific status. 
 * @param statusid The ID of the status
 * @return The status with the id given. <code>null</code> if the status does not exist
 * @throws UserAdminException If an error occurs fetching data
 */
public Status getStatus( int statusid )  throws UserAdminException;	

/**
 * Returns a specific status info 
 * @param statusinfoid The ID of the status info
 * @return The status info with the id given. <code>null</code> if the status info does not exist
 * @throws UserAdminException If an error occurs fetching data
 */
public StatusInfo getStatusInfo( int statusinfoid ) throws UserAdminException;

/**
 * Creates a new organisation
 * 
 * @param name The name of the organisation
 * @param description Description of the organisation
 * @param parent Parent ID of the organisation (-1 if no parent) 
 * @param status Status of this organisation
 * @param statusinfo Status info message for this organisation
 * @return The ID of the newly created organisation
 * @throws UserAdminException If an error occurs during creation of the organisation
 */
public int createOrganisation( String name, String description, int parent, int status, int statusinfo)  throws UserAdminException;

/**
 * Creates a new organisation with attach of profiles
 * 
 * @param name The name of the organisation
 * @param description Description of the organisation
 * @param parent Parent ID of the organisation (-1 if no parent) 
 * @param status Status of this organisation
 * @param statusinfo Status info message for this organisation
 * @param profiles Attach the profiles 
 * @return The ID of the newly created organisation
 * @throws UserAdminException If an error occurs during creation of the organisation
 */
public int createOrganisation( String name, String description, int parent, int status, int statusinfo, int profiles[] )  throws UserAdminException;

/**
 * This method returns a list of all organisations defined in the user
 * administration system. The organisations returned will <b>not</b> contain
 * attribute data.
 *  
 * @return All organisations. An empty list if no organisations exists.
 * @throws UserAdminException If an error occurs fetching data
 */
public Organisation[] getAllOrganisations() throws UserAdminException;

/**
 * Returns a list of organisations with the given parent ID. The organisations
 * returned will <b>not</b> contain attribute data.
 * 
 * @param parentId The parent ID of the organisations to search for
 * @return The organisation list with the given parent. An empty list if no organisations exist
 */
public Organisation[] getOrganisations( int parentId ) throws UserAdminException;

/**
 * This method returns specific organisation based on the ID. This organisation
 * will include attribute data.
 * 
 * @param organisationid The ID of the organisation to retreive
 * @return The organisation with the given ID. <code>null</code> if it does not exist.
 * @throws UserAdminException If an error occurs fetching data
 */
public Organisation getOrganisation( int organisationid ) throws UserAdminException;
	
/**
 * Returns the profiles attached to an organisation
 * 
 * @param organisationid The ID of the organisation to retreive profiles from
 * @return A list of profiles attached to the given organisation
 * @throws UserAdminException If an error occurs fetching data
 */
public Profile[] getOrganisationProfiles( int organisationid ) throws UserAdminException;
	
/**
 * This method allows the update of a single organisation
 * 
 * @param organisationid The ID of the organisation to update
 * @param name The name of the organisation.
 * @param description The description of the organisation
 * @param parentid The ID of the parent organisation (-1 if no parent)
 * @param status The new status of the organisation 
 * @param statusinfo The new statusinfo of the organisation 
 * @throws UserAdminException If an error occurs updating data
 */
public void updateOrganisation( int organisationid, String name, String description, int parentid, int status, int statusinfo ) throws UserAdminException;
	
/**
 * This method updates an organisations attributes
 * 
 * @param organisationid The ID of the organisation to update
 * @param attributes A hashtable containing the attributes to create/update (if a value is empty, it will be deleted)
 * @throws UserAdminException If an error occurs updating data
 */
public void updateOrganisationAttributes(int organisationid, Hashtable attributes) throws UserAdminException;

/**
 * Used for creating a new group 
 * @param name Group name
 * @param description Group description
 * @param authlvl Authentication level for this new group
 * @return The ID of the group created   
 * @throws UserAdminException If an error occurs creating data
 */
public int createGroup( String name, String description, int authlvl ) throws UserAdminException;

/**
 * Used for creating a new profile 
 * @param name Profile name
 * @param description Profile description
 * @return The ID of the profile created   
 * @throws UserAdminException If an error occurs fetching data
 */
public int createProfile( String name, String description ) throws UserAdminException;

/**
 * Used for updating an existing group
 * @param id Group ID 
 * @param name Group name
 * @param description Group description
 * @param authlvl Authentication level for the group
 * @throws UserAdminException If an error occurs updating data
 */
public void updateGroup( int id, String name, String description, int authlvl ) throws UserAdminException;

/**
 * Used for updating a profile
 * @param id Profile ID 
 * @param name Profile name
 * @param description Profile description
 * @throws UserAdminException If an error occurs updating data
 */
public void updateProfile( int id, String name, String description ) throws UserAdminException;

/**
 * Used for attaching a group to a profile
 * @param id Profile ID 
 * @param groupid ID of the group to attach to the profile
 * @throws UserAdminException If an error occurs updating data
 */
public void attachGroupToProfile( int id, int group ) throws UserAdminException;

/**
 * Used for detaching a group from a profile
 * @param id Profile ID 
 * @param groupid ID of the group to detach from the profile
 * @throws UserAdminException If an error occurs updating data
 */
public void detachGroupFromProfile( int id, int group ) throws UserAdminException;

/**
 * Used for deleting a group
 * @param id Group ID 
 * @throws UserAdminException If an error occurs deleting data
 */
public void deleteGroup( int id ) throws UserAdminException;

/**
 * Used for deleting a profile
 * @param id Profile ID 
 * @throws UserAdminException If an error occurs deleting data
 */
public void deleteProfile( int id ) throws UserAdminException;

/**
 * Used for deleting an organisation
 * @param id Organisation ID
 * @throws UserAdminException If an error occurs deleting data
 */
public void deleteOrganisation( int id ) throws UserAdminException; 

/**
 * Used for attaching a profile to an organisation
 * @param id Organisation ID 
 * @param profileid ID of the profile
 * @throws UserAdminException If an error occurs updating data
 */
public void attachProfileToOrganisation( int id, int profile ) throws UserAdminException;

/**
 * Used for detaching a profile from an organisation
 * @param id Organisation ID 
 * @param profileid ID of the profile
 * @throws UserAdminException If an error occurs updating data
 */
public void detachProfileFromOrganisation( int id, int profile ) throws UserAdminException;

/**
 * This method can be used to create a user within the user database. 
 * The user will get a challenged attached to him. Also the parsed
 * attribute table will be added to the user database and the list of 
 * profiles that the user is to be attached to. If the attributes or 
 * profiles parsen is <code>null</code> they will be ignored.
 * 
 * @param logonid The logon id for the challenge attached to the user
 * @param methodid The authentication method for the challenge attached to the user
 * @param level Authentication level, or 0 for default for this method
 * @param credentials The credentials for the attached challenge
 * @param profiles The profiles to attach the new user to
 * @param attributes The attributes for the new user
 * @return The user id of the newly created user
 * @throws UserAdminException If an error occurs creating the user. If a challenge entry exists, the exception is thrown with errorcode ERROR_ENTRYALREADYEXIST
 */
public int createUser( String logonid, int methodid, int level, byte[] credentials, int[] profiles, Hashtable attributes ) throws UserAdminException;

/**
 * Returns a list of profiles that the user is allowed to assign to users
 * @return The list of profiles
 * @throws UserAdminException If an error occurs fetching the profiles
 */
public Profile[] getAssignableProfiles() throws UserAdminException;

/**
 * Searches for an organisation using the parameters given. The organisations
 * returned will <b>not</b> include profile and attribute information, those
 * must be retreived through the <code>getOrganisation</code> method.
 * 
 * @param attributes A list of the attributes to search for. Attributes in the main table can be searched for using the constants in the <code>Organisation</code> interface.
 * @param sortrow The row to sort by
 * @throws UserAdminException If an error occurs during search. If no rows where found, error id <code>UserAdminException.ERROR_NOROWSFOUND</code> will be set 
 */
public Organisation[] searchOrganisations( Hashtable attributes, String sortRow )  throws UserAdminException;	

/**
 * Customer specific search method for searching users in the database.
 * 
 * @param parameter The parameter object for the search
 * @param maxCount The maximum number of rows to return (if <= 0 it will be set to 100)
 * @return The result of the search. If users where searched for the result will be QuickUser[]String[] with the strings containing the challenge logon IDs. If en email or PBS sent search is done the result will be a Date[]QuickUser[]..  
 * @throws UserAdminException If an error occurs during search
 */
public Object[][] listSearchNKUser( NKUserSearchParameter parameter, int maxCount ) throws UserAdminException;	

/**
 * This method is used for a wide user list search. The search is fairly
 * slow (un-indexed on some fields) so it should be used lightly. At least one search
 * parameter in the parameter object <b>must</b> be set. If not an exception is thrown!
 * 
 * @param parameter The user search parameter object defining the search parameters
 * @param maxCount The maximum number of rows to return (if <= 0 it will be set to 100)
 * @param starttime The time to start searching for list entries. A value of -1 equals ignoring this value
 * @param endtime The time to stop searching for list entries. A value of -1 equals ignoring this value
 * @return The result of the search
 * @throws UserAdminException If an error occurs during search
 */
public QuickUser[] listSearchUser( UserSearchParameter parameter, int maxCount, long starttime, long endtime ) throws UserAdminException;

/**
 * This method can be used to list search in the transaction log. The result is
 * an array of result arrays with the following columns Time, user, business info,
 * sign info, log text, organisation ID and logonid. 7 columns total.
 * 
 * @param parameters The parameters for the search. The parameters are [User, Component, Text, organisation, logon ID]. 
 *                   At least one of the parameters must be given. If no organisation id is given, only the organisations
 *                   the user can search in will be searched! 
 * @param maxCount The maximum number of rows to return (if <= 0 it will be set to 100)
 * @param starttime The time to start searching for list entries. A value of -1 equals ignoring this value
 * @param endtime The time to stop searching for list entries. A value of -1 equals ignoring this value
 * @return The result of the search
 * @throws UserAdminException If an error occurs during search
 */	
public String[][] listSearchTransactionLog( String []parameters, int maxCount, long starttime, long endtime ) throws UserAdminException;

/**
 * Executes a search in the revision log with the given parameters.
 * 
 * @param logonid Logon ID to search for
 * @param component Component to search for
 * @param text The generated text to search for
 * @param maxCount The maximum number of rows to return (if <= 0 it will be set to 100)
 * @param starttime The time to start searching for list entries. A value of -1 equals ignoring this value
 * @param endtime The time to stop searching for list entries. A value of -1 equals ignoring this value
 * @return The result with the following columns; logtime, loguser, logcomponent, logdetails(text)
 * @throws UserAdminException If an error occurs during search
 */
public String[][] listSearchRevisionLog( String logonid, String component, String text, int maxCount, long starttime, long endtime ) throws UserAdminException;

/**
 * Executes a search in the non-rep log with the given parameters.
 * 
 * @param logonid Logon ID to search for
 * @param status Status text to search for
 * @param tag Tag to search for
 * @param message Message text to search for
 * @param ipaddress IP address to search for
 * @param maxCount The maximum number of rows to return (if <= 0 it will be set to 100)
 * @param starttime The time to start searching for list entries. A value of -1 equals ignoring this value
 * @param endtime The time to stop searching for list entries. A value of -1 equals ignoring this value
 * @return The result with the f.ollowing columns; logtime, loguser, logstatus, logtag, logmessage, clientip
 * @throws UserAdminException If an error occurs during search
 */
public String[][] listSearchNonRepLog( String logonid, String status, String tag, String message, String ipaddress, int maxCount, long starttime, long endtime ) throws UserAdminException;

/**
 * Updates the organisation ID on a user. This method simply calls the 
 * <code>updateUserAttributes</code> method since the organisation ID is
 * a user attribute. It is recommended to use that method to update several 
 * user attributes at the same time.
 * 
 * @param userid The user to update
 * @param organisationid The organisation to update with. (-1 to clear)
 * @throws UserAdminException If an error occurs during update
 */
public void updateUserOrganisation( int userid, int organisationid ) throws UserAdminException;	

/**
 * Updates all users attached to an organisation to be attached
 * to the given profile.
 * The user must be granted the <b>multiprofile.attach</b> ACL in order for
 * this method to be executed. 
 * 
 * @param organisationid The organisation to update 
 * @param profileid The profile to attach to all users in the organisation
 * @return The number of profiles actually attached to users 
 * @throws UserAdminException If some exception occurs during processing
 */
public int attachProfileToOrganisationUsers( int organisationid, int profileid ) throws UserAdminException;	
	
/**
 * Updates all users attached to an organisation to be attached
 * to the given profile.
 * The user must be granted the <b>multiprofile.attach</b> ACL in order for
 * this method to be executed. 
 * 
 * @param organisationid The organisation to update 
 * @param profileid The profile to attach to all users in the organisation
 * @param existingprofile The profile that the users must be assigned to in order to get the new profile
 * @return The number of profiles actually attached to users 
 * @throws UserAdminException If some exception occurs during processing
 */
public int attachProfileToOrganisationUsers( int organisationid, int profileid, int existingprofile ) throws UserAdminException;	
	
/**
 * Updates all users attached to an organisation to be detached
 * from the given profile if the timestamp is later than given. If the
 * timestamp is empty (null) the profil will be detached from all users.
 * The user must be granted the <b>multiprofile.detach</b> ACL in order for
 * this method to be executed. 
 * 
 * @param organisationid The organisation to update 
 * @param profileid The profile to detach from all users in the organisation
 * @param timestamp The timestamp to check for
 * @return The number of profiles actually detached from users 
 * @throws UserAdminException If some exception occurs during processing
 */
public int detachProfileFromOrganisationUsers( int organisationid, int profileid, Date timestamp ) throws UserAdminException;	

/**
 * Used for attaching an additional group to the ACL
 * @param aclname ACL name 
 * @param groups ID of the group to attach to the acl
 * @throws UserAdminException If an error occurs updating data
 */
public void attachGroupToACL( String aclname, int groupId ) throws UserAdminException;

/**
 * Used for detaching a group from an ACL
 * @param aclname ACL name 
 * @param groups ID of the group to detach from the acl
 * @throws UserAdminException If an error occurs updating data
 */
public void detachGroupFromACL( String aclname, int groupId ) throws UserAdminException;