All Downloads are FREE. Search and download functionalities are using the official Maven repository.

base.jee.api.API Maven / Gradle / Ivy

/**
 * Creative commons Attribution-NonCommercial license.
 *
 * http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB
 *
 * NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 */
package base.jee.api;

import base.IntegerQueryResult;
import base.KeyValue;
import base.StringQueryResult;
import base.UuidQueryResult;
import base.jee.JeeBase;
import base.jee.api.model.AuditLogEntry;
import base.jee.api.model.Email;
import base.jee.api.model.Location;
import base.security.Group;
import base.security.PermissionException;
import base.security.Person;
import base.security.PersonRole;
import base.security.ResourceUid;
import base.template.Resource;
import base.security.User;
import base.template.TemplateManager;

import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.UUID;

public interface API {

	void initialSetup(String firstName, String lastName, String emailAddress, String username, String password, String smtpHostname, int smtpPort, boolean selfSignup, String ip) throws IOException;

	void registerApiCalls(JeeBase jee);

	List getPendingEmail(int count) throws IOException;

	Settings getSettingsCache();

	List getSettings(User user) throws IOException;

	List getRecentLogEntries(User user, String resourceType, String resourceUid, boolean debug, long limit) throws IOException;

	List getRecentLogEntriesByIP(User user, String ip, boolean debug, long limit) throws PermissionException, IOException;

	List getRecentLogEntriesByPerson(User user, UUID uuid, boolean debug, long limit) throws PermissionException, IOException;

	void removeSetting(User user, String name) throws IOException;

	void sendEmail(User user, String email) throws IOException;

	void upsertSetting(User user, String name, String value) throws IOException;

	void deleteSetting(User user, String name) throws IOException;

	void deleteAllSettings(User user) throws IOException;

	void createTemplate(User user, String basedOn, String name) throws IOException;

	void deleteTemplate(User user, String name) throws PermissionException;

	List getTemplateResources(String template) throws IOException;

	List getTemplates(User user) throws IOException;

	void upsertTemplateResource(User user, String template, String name, byte[] content, boolean binary) throws IOException;

	void activateAccountUsingToken(String token, String password, String password2, String ip) throws IOException;

	List authenticate(String currentToken, String username, String password, String ip) throws IOException;

	List createPerson(TemplateManager templateManager, User user, String firstName, String lastName, String email, String username, String password, String initialRoles, String expiry) throws IOException;

	void deleteGroupResourceRole(User user, String resource, String uid, UUID groupUuid, String role) throws IOException;

	void deleteGroupRole(User user, UUID groupUuid, String role) throws IOException;

	void deleteResourceRole(User user, String resource, String uid, UUID personUuid, String role) throws IOException;

	void deleteRole(User user, UUID personUuid, String role) throws IOException;

	List getBatchResults(User user, UUID batch) throws IOException;

	List getGroup(User user, UUID uuid) throws IOException;

	List getGroupMembers(User user, UUID group) throws IOException;

	List getGroupRoles(User user, UUID groupUuid) throws IOException;

	List getGroups(User user) throws IOException;

	List getPerson(User user, UUID personUuid) throws IOException;

	List getPersonByEmail(User user, String email) throws IOException;

	List getPersonGroups(User user, UUID personUuid) throws IOException;

	List getPersonRoles(User user, UUID personUuid) throws IOException;

	List getSession(String token, String ip) throws IOException;

	List hasPersonRecord() throws IOException;

	List invalidateToken(String token, String ip) throws IOException;

	void joinGroup(User user, UUID group, UUID person) throws IOException;

	void leaveGroup(User user, UUID group, UUID person) throws IOException;

	List requestPasswordResetEmail(TemplateManager templates, String email, String ip) throws IOException;

	void resetPasswordUsingToken(String token, String password, String password2, String ip) throws IOException;

	List searchPeople(User user, String keywords) throws IOException;

	List signUp(TemplateManager templateManager, User user, String firstName, String lastName, String email, String username, String password, String ip) throws IOException;

	List signUpConfirmation(String requestToken, String ip) throws IOException;

	void updatePerson(User user, UUID uuid, String firstName, String lastName, String email, String expiry) throws IOException;

	List upsertGroup(User user, String group, int type) throws IOException;

	void upsertGroupResourceRole(User user, UUID groupUuid, String role, String resource, String uid) throws IOException;

	void upsertGroupRole(User user, UUID groupUuid, String role) throws IOException;

	void upsertResourceRole(User user, UUID personUuid, String role, String resource, String uid) throws IOException;

	void upsertRole(User user, UUID personUuid, String role) throws IOException;

	void log(String level, User user, String message, ResourceUid[] resources) throws IOException;

	void expireTokens() throws IOException;

	void expireLogEntries() throws IOException;

	void setPendingEmailStatus(UUID uuid, String error) throws IOException;

	List getLocationByIP(String ip) throws IOException;

	/**
	 * Truncate all data from all tables. Made available for usage as part of test cases.
	 */
	void wipe() throws IOException;

	/**
	 * Returns roles associated with the "All users" group, and the
	 * "Authenticated users" group.
	 */
	Set getAuthenticatedRolesCache();

	/**
	 * Returns roles associated with the "All users" group.
	 */
	Set getUnauthenticatedRolesCache();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy