Interface ApplicationEntityManager
-
- All Superinterfaces:
AbstractEntityManager
- All Known Implementing Classes:
ApplicationEntityManagerImpl
public interface ApplicationEntityManager extends AbstractEntityManager
This is the entity in charge of manipulating application objects such as users, views, etc- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASS_POOL
String that identifies the class used for poolsstatic int
POOL_TYPE_GENERAL_PURPOSE
Type of pool general purpose.static int
POOL_TYPE_MODULE_COMPONENT
Type of pool module component.static int
POOL_TYPE_MODULE_ROOT
Type of pool module root.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addObjectTofavoritesFolder(String objectClass, String objectId, long favoritesFolderId, long userId)
Adds an object to the favorites foldervoid
addUserToGroup(long userId, long groupId)
Adds a user to a grouplong
attachFileToListTypeItem(String name, String tags, byte[] file, String ltClass, String listTypeItemId)
Relates a file to a list type itemvoid
checkRelationshipByAttributeValueBusinessRules(String sourceObjectClassName, String sourceObjectId, String targetObjectClassName, String targetObjectId)
check if a relationship can be established between two objects with the attribute values defined in the rulevoid
closeSession(String sessionId, String remoteAddress)
Closes a sessionvoid
commitActivity(long processInstanceId, long activityDefinitionId, Artifact artifact)
Saves the artifact generated once an activity has been completed (for example, the user filled in a form).String[]
copyTemplateElements(String[] sourceObjectsClassNames, String[] sourceObjectsIds, String newParentClassName, String newParentId)
Copy template elements within templates.String[]
copyTemplateSpecialElement(String[] sourceObjectsClassNames, String[] sourceObjectsIds, String newParentClassName, String newParentId)
Copy template special elements within templates,String[]
createBulkSpecialTemplateElement(String stElementClass, String stElementParentClassName, String stElementParentId, String stElementNamePattern)
Creates multiple special template elements using a given name patternString[]
createBulkTemplateElement(String templateElementClassName, String templateElementParentClassName, String templateElementParentId, String templateElementNamePattern)
Creates multiple template elements using a given name patternlong
createBusinessRule(String ruleName, String ruleDescription, int ruleType, int ruleScope, String appliesTo, String ruleVersion, List<String> constraints)
Creates a business rule given a set of constraintslong
createConfigurationVariable(String configVariablesPoolId, String name, String description, int type, boolean masked, String valueDefinition)
Creates a configuration variable inside a pool.String
createConfigurationVariablesPool(String name, String description)
Creates a pool of configuration variableslong
createFavoritesFolderForUser(String name, long userId)
Create a relationship between an user and a new favorites folderlong
createFilterDefinition(String name, String description, String classToBeApplied, String script, boolean enabled)
Creates a filter.void
createGeneralActivityLogEntry(String userName, int type, String notes)
Creates a general activity log entry, that is, an entry that is not associated to a particular objectvoid
createGeneralActivityLogEntry(String userName, int type, ChangeDescriptor changeDescriptor)
Creates a general activity log entry, that is, an entry that is not associated to a particular objectlong
createGeneralView(String viewClass, String name, String description, byte[] structure, byte[] background)
Creates a view not related to a particular objectlong
createGroup(String groupName, String description, List<Long> users)
Creates a grouplong
createLayout(String viewClassName, String name, String description, byte[] structure, byte[] background)
Creates a new layout view.String
createListTypeItem(String className, String name, String displayName)
Creates a list type itemlong
createListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClassName, String viewClassName, String name, String description, byte[] structure, byte[] background)
Creates a view for a given list type item.void
createObjectActivityLogEntry(String userName, String className, String oid, int type, String affectedProperties, String oldValues, String newValues, String notes)
Creates an object activity log entry, that is, an entry that is directly related to an object, such as the modification of the value of an attributevoid
createObjectActivityLogEntry(String userName, String className, String oid, int type, ChangeDescriptor changeDescriptor)
Creates an object activity log entry, that is, an entry that is directly related to an object, such as the modification of the value of an attributelong
createObjectRelatedView(String oid, String objectClass, String name, String description, String viewClassName, byte[] structure, byte[] background)
Creates a view for a given object.long
createOSPView(String name, String description, byte[] structure)
Creates an Outside Plant ViewString
createPoolInObject(String parentClassname, String parentId, String name, String description, String instancesOfClass, int type)
Creates a pool that will have as parent an inventory object.String
createPoolInPool(String parentId, String name, String description, String instancesOfClass, int type)
Creates a pool that will have as parent another pool.long
createProcessDefinition(String name, String description, String version, boolean enabled, byte[] structure)
Creates a process definition.long
createProcessInstance(long processDefinitionId, String processInstanceName, String processInstanceDescription)
Creates an instance of a process, that is, starts onelong
createQuery(String queryName, long ownerOid, byte[] queryStructure, String description)
Creates a QueryString
createRootPool(String name, String description, String instancesOfClass, int type)
Creates a pool without a parent.String
createScriptedQueriesPool(String name, String description)
Creates a scripted queries pool.String
createScriptedQuery(String scriptedQueriesPoolId, String name, String description, String script, boolean enabled)
Creates a scripted query.String
createScriptedQueryParameter(String scriptedQueryId, String name, String description, String type, boolean mandatory, Object defaultValue)
Creates a scripted query parameter.Session
createSession(String user, String password, int sessionType, String ipAddress)
Creates a session.long
createTask(String name, String description, boolean enabled, boolean commitOnExecute, String script, List<StringPair> parameters, TaskScheduleDescriptor schedule, TaskNotificationDescriptor notificationType)
Creates and schedule a task.String
createTemplate(String templateClass, String templateName)
Creates a template.String
createTemplateElement(String templateElementClass, String templateElementParentClassName, String templateElementParentId, String templateElementName)
Creates an object inside a template.String
createTemplateSpecialElement(String tsElementClass, String tsElementParentClassName, String tsElementParentId, String tsElementName)
Create an special object inside an templatelong
createUser(String userName, String password, String firstName, String lastName, boolean enabled, int type, String email, List<Privilege> privileges, long defaultGroupId)
Creates a user.long
createValidatorDefinition(String name, String description, String classToBeApplied, String script, boolean enabled)
Creates a validator definition.void
deleteBusinessRule(long businessRuleId)
Deletes a business rulevoid
deleteConfigurationVariable(String name)
Deletes a config variablevoid
deleteConfigurationVariablesPool(String poolId)
Deletes a configuration variables pool.void
deleteFavoritesFolders(long[] favoritesFolderId, long userId)
Delete a Bookmark Folder of an Uservoid
deleteFilterDefinition(long filterId, String className)
Deletes a filter definitionvoid
deleteGeneralViews(List<Long> ids)
Deletes a list of general viewsvoid
deleteGroups(List<Long> oids)
Removes a list of groupsvoid
deleteLayout(long viewId)
Deletes a layout viewvoid
deleteListTypeItem(String className, String oid, boolean realeaseRelationships)
Deletes a list type itemvoid
deleteListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId)
Deletes a list type item related viewvoid
deleteOSPView(long viewId)
Deletes an existing OSP viewvoid
deletePools(String[] ids)
Deletes a set of pools.void
deleteProcessDefinition(long processDefinitionId)
Deletes a process definitionvoid
deleteProcessInstance(long processInstanceId)
Deletes a process instancevoid
deleteQuery(long queryOid)
Deletes a Queryvoid
deleteScriptedQueriesPool(String scriptedQueriesPoolId)
Deletes a scripted queries pool.void
deleteScriptedQuery(String scriptedQueryId)
Deletes an scripted query given the id.void
deleteScriptedQueryParameter(String scriptedQueryParameterId)
Deletes a scripted query parameter.void
deleteTask(long taskId)
Deletes a task and unsubscribes all users from itChangeDescriptor
deleteTemplateElement(String templateElementClass, String templateElementId)
Deletes an element within a template or a template itself.void
deleteUsers(List<Long> oids)
Removes a list of usersvoid
deleteValidatorDefinition(long validatorDefinitionId)
Deletes a validator definitionvoid
detachFileFromListTypeItem(long fileId, String className, String objectId)
Releases (and deletes) a file associated to a list type itemHashMap<String,BusinessObjectList>
executeCustomDbCode(String dbCode, boolean needReturn)
Deprecated.Don't use it, instead, create a method in the corresponding entity manager instead of running code directly on the databaseList<Properties>
executeCustomScriptedQuery(String queryName, Properties parameters)
This method is the evolution of the deprecatedexecuteCustomDbCode(java.lang.String, boolean)
.List<ResultRecord>
executeQuery(ExtendedQuery query)
Used to perform complex queries.ScriptedQueryResult
executeScriptedQuery(String scriptedQueryId, ScriptedQueryParameter... parameters)
Executes the scripted query.TaskResult
executeTask(long taskId)
Executes a task on demand.ActivityDefinition
getActivityDefinition(long processDefinitionId, long activityDefinitionId)
Retrieves a process definitionList<ConfigurationVariable>
getAllConfigurationVariables()
Gets all the configuration variables in the database, no matter what pool they belong to.List<FilterDefinition>
getAllFilterDefinitions(HashMap<String,Object> attributesToFilter, int page, int limit)
Retrieves all the filters created in the inventory.long
getAllFilterDefinitionsCount(HashMap<String,Object> attributesToFilter)
Counts all the Filters definition createdList<ValidatorDefinition>
getAllValidatorDefinitions()
Gets all validator definitions, no matter what class they are related to.ArtifactDefinition
getArtifactDefinitionForActivity(long processDefinitionId, long activityDefinitionId)
Given an activity definition, returns the artifact definition associated to itArtifact
getArtifactForActivity(long processInstanceId, long activityId)
Gets the artifact associated to an activity (for example, a form that was already filled in by a user in a previous, already committed activity)List<ActivityLogEntry>
getBusinessObjectAuditTrail(String objectClass, String objectId, int limit)
Gets a business object audit trailList<BusinessRule>
getBusinessRules(int type)
Retrieves the business rules of a particular type.byte[]
getClassHierachy(boolean showAll)
Get the data model class hierarchy as an XML documentProperties
getConfiguration()
Gets the configuration variables of this managerConfigurationVariable
getConfigurationVariable(String name)
Retrieves a configuration variableList<ConfigurationVariable>
getConfigurationVariablesInPool(String poolId)
Gets the configuration variables in a configuration variable poolList<InventoryObjectPool>
getConfigurationVariablesPools()
Retrieves the list of pools of config variablesList<ConfigurationVariable>
getConfigurationVariablesWithPrefix(String prefix)
Gets the configuration variables with a given prefixObject
getConfigurationVariableValue(String name)
Retrieves only the value of a configuration variable.List<BusinessObjectLight>
getDeviceLayouts()
Gets the list of template elements with a device layoutbyte[]
getDeviceLayoutStructure(String oid, String className)
Gets the device layout structure.FavoritesFolder
getFavoritesFolder(long favoritesFolderId, long userId)
Gets a favorites folderList<FavoritesFolder>
getFavoritesFoldersForObject(long userId, String objectClass, String objectId)
Get the bookmarks where an object is associatedList<FavoritesFolder>
getFavoritesFoldersForUser(long userId)
Get the favorites folders create by an user.FileObject
getFile(long fileId, String className, String objectId)
Retrieves a particular file associated to an inventory list type item.List<FileObjectLight>
getFilesForListTypeItem(String className, String objectId)
Fetches the files associated to an inventory object.List<FilterDefinition>
getFilterDefinitionsForClass(String className, boolean includeParentClassesFilters, boolean ignoreCache, HashMap<String,Object> attributesToFilter, int page, int limit)
For a given class retrieves all its filters definitions (also the filters of its parent classes could be included).long
getFilterDefinitionsForClassCount(String className, boolean includeParentClassesFilters, boolean ignoreCache, HashMap<String,Object> attributesToFilter, int page, int limit)
For a given class name returns the count of the filters definitionsList<ActivityLogEntry>
getGeneralActivityAuditTrail(int page, int limit, HashMap<String,Object> filters)
Retrieves the list of general activity log entriesViewObject
getGeneralView(long viewId)
Returns a view of those that are not related to a particular object (i.e.: GIS views)List<ViewObjectLight>
getGeneralViews(String viewClassName, int limit)
Allows to retrieve a list of views of a certain type, specifying their classList<GroupProfile>
getGroups()
Retrieves the list of all groupsList<GroupProfileLight>
getGroupsForUser(long userId)
Retrieves the list of groups a user belongs toList<ClassMetadataLight>
getInstanceableListTypes()
Get the possible list typesViewObject
getLayout(long viewId)
Returns a layout view with the given idList<ViewObjectLight>
getLayouts(int limit)
Allows to retrieve a list of all existent layout views.BusinessObject
getListTypeItem(String listTypeClassName, String listTypeItemId)
Retrieves list type item given its idBusinessObjectLight
getListTypeItemForLayout(long layoutViewId)
Returns the list type item related with the given viewList<ViewObjectLight>
getListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, int limit)
Gets the views related to a list type item, such as the default, rack or equipment viewsViewObject
getListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId)
Gets a view related to a list type item, such as the default, rack or equipment viewsList<BusinessObjectLight>
getListTypeItems(String className)
Retrieves all the items related to a given list typeList<BusinessObjectLight>
getListTypeItemUses(String listTypeItemClass, String listTypeItemId, int limit)
Retrieves the objects that make reference to a given list type itemBusinessObjectLight
getListTypeItemWithName(String listTypeClassName, String listTypeItemName)
Retrieves a list type item given its nameActivityDefinition
getNextActivityForProcessInstance(long processInstanceId)
Requests for the next activity to be executed in a process instance.ViewObject
getObjectRelatedView(String oid, String objectClass, long viewId)
Get a view related to an object, such as the default rack or object viewsList<ViewObjectLight>
getObjectRelatedViews(String oid, String objectClass, int limit)
Get a view related to an object, such as the default, rack or equipment viewsList<BusinessObjectLight>
getObjectsInFavoritesFolder(long favoritesFolderId, long userId, int limit)
Get the object assigned to the bookmarkViewObject
getOSPView(long viewId)
Retrieves the specific information about an existing OSP viewList<ViewObjectLight>
getOSPViews()
Retrieves the existing OSP viewsProcessDefinition
getProcessDefinition(long processDefinitionId)
Retrieves a process definitionList<ProcessDefinition>
getProcessDefinitions()
Deprecated.ProcessInstance
getProcessInstance(long processInstanceId)
Gets a process instanceList<ActivityDefinition>
getProcessInstanceActivitiesPath(long processInstanceId)
Gets Process Instance Activities PathList<ProcessInstance>
getProcessInstances(long processDefinitionId)
Gets a process instances of a process definitionList<CompactQuery>
getQueries(boolean showPublic)
Gets all queriesCompactQuery
getQuery(long queryOid)
Gets a single queryList<ScriptedQuery>
getScriptedQueries(String filterName, boolean ignoreDisabled, int skip, int limit)
Gets a set of scripted queries.List<ScriptedQuery>
getScriptedQueriesByPoolId(String scriptedQueriesPoolId, String filterName, boolean ignoreDisabled, int skip, int limit)
Gets a set of scripted queries in a scripted queries pool the its id.List<ScriptedQuery>
getScriptedQueriesByPoolName(String scriptedQueriesPoolName, String filterName, boolean ignoreDisabled, int skip, int limit)
Gets a set of scripted queries in a scripted queries pool the its name.ScriptedQueriesPool
getScriptedQueriesPool(String scriptedQueriesPoolId)
Gets a scripted queries pool.ScriptedQueriesPool
getScriptedQueriesPoolByName(String scriptedQueriesPoolName)
Gets a scripted queries pool given the name.int
getScriptedQueriesPoolCount(String filterName)
Counts the scripted queries pools.List<ScriptedQueriesPool>
getScriptedQueriesPools(String filterName, int skip, int limit)
Gets a set of scripted queries pools.ScriptedQuery
getScriptedQuery(String scriptedQueryId)
Gets a scripted query given its idint
getScriptedQueryCount(String filterName)
Counts the scripted queries.int
getScriptedQueryCountByPoolId(String scriptedQueriesPoolId, String filterName, boolean ignoreDisabled)
Counts the scripted queries filter by name in a scripted queries pool.int
getScriptedQueryCountByPoolName(String scriptedQueriesPoolName, String filterName)
Counts the scripted queries filter by name in a scripted queries pool.ScriptedQueryParameter
getScriptedQueryParameter(String scriptedQueryParameterId)
Gets an scripted query paramter.List<ScriptedQueryParameter>
getScriptedQueryParameters(String scriptedQueryId)
Gets the scripted query parameters.ConcurrentHashMap<String,Session>
getSessions()
Gets current sessionsList<UserProfileLight>
getSubscribersForTask(long taskId)
Gets the subscribers of a particular taskTask
getTask(long taskId)
Retrieves the information about a particular taskList<Task>
getTasks()
Gets all registered tasksList<Task>
getTasksForUser(long userId)
Gets the tasks associated to a particular userTemplateObject
getTemplateElement(String templateElementClass, String templateElementId)
Retrives all the information of a given template element.List<TemplateObjectLight>
getTemplateElementChildren(String templateElementClass, String templateElementId)
Retrieves the children of a given template element.List<TemplateObjectLight>
getTemplatesForClass(String className)
Gets the templates available for a given classList<TemplateObjectLight>
getTemplateSpecialElementChildren(String tsElementClass, String tsElementId)
Retrieves the children of a given template special element.UserProfile
getUserInSession(String sessionId)
Retrieves a user from the session ring given a session idList<UserProfile>
getUsers()
Retrieves the list of all usersList<UserProfile>
getUsersInGroup(long groupId)
Gets all the users in a groupList<ValidatorDefinition>
getValidatorDefinitionsForClass(String className)
Retrieves all the validator definitions in the systemboolean
isSessionValid(String username, String token)
Tells if a given pair user-session token is valid.void
releaseListTypeItem(String listTypeItemId)
Release a list type item relationshipsvoid
releaseListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId)
Release a list type item with a view.void
reloadProcessDefinitions()
Updates the process definitionsvoid
removeObjectFromfavoritesFolder(String objectClass, String objectId, long favoritesFolderId, long userId)
Removes an object associated to a favorites foldervoid
removePrivilegeFromGroup(long groupId, String featureToken)
Removes a privilege from a uservoid
removePrivilegeFromUser(long userId, String featureToken)
Removes a privilege from a uservoid
removeUserFromGroup(long userId, long groupId)
Removes a user from a groupList<Validator>
runValidationsForObject(String objectClass, long objectId)
Runs the existing validations for the class associated to the given object.ChangeDescriptor
saveQuery(long queryOid, String queryName, long ownerOid, byte[] queryStructure, String description)
Updates an existing queryvoid
setGroupProperties(long oid, String groupName, String description)
Set the attributes of a groupvoid
setListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId)
Relate a list type item with a view.ChangeDescriptor
setPoolProperties(String poolId, String name, String description)
Updates a pool.void
setPrivilegeToGroup(long groupId, String featureToken, int accessLevel)
Sets a privilege to a group.void
setPrivilegeToUser(long userId, String featureToken, int accessLevel)
Sets a privilege to a user.void
setUserProperties(long oid, String userName, String password, String firstName, String lastName, int enabled, int type, String email)
Set the properties of a given user using the id to search for itvoid
setUserProperties(String formerUsername, String newUserName, String password, String firstName, String lastName, int enabled, int type, String email)
Updates the attributes of a user, using its username as key to find itChangeDescriptor
subscribeUserToTask(long userId, long taskId)
Subscribes a user to a task, so it will be notified of the result of its executionChangeDescriptor
unsubscribeUserFromTask(long userId, long taskId)
Unsubscribes a user from a task, so it will no longer be notified about the result of its executionvoid
updateActivity(long processInstanceId, long activityDefinitionId, Artifact artifact)
Updates the artifact generated once an activity has been completed (for example, the user filled in a form).void
updateConfigurationVariable(String name, String propertyToUpdate, String newValue)
Updates the value of a configuration variable.void
updateConfigurationVariablesPool(String poolId, String propertyToUpdate, String value)
Updates an attribute of a given config variables poolvoid
updateFavoritesFolder(long favoritesFolderId, long userId, String favoritesFolderName)
Updates a favorites foldervoid
updateFileProperties(long fileId, List<StringPair> properties, String className, String listTypeItemId)
Updates the properties of a file list type item (name or tags)void
updateFilterDefinition(long filterId, String name, String description, String classToBeApplied, String script, Boolean enabled)
Updates the properties of a filter, null values will be ignored; when the script of the filter definition its been updated it will tries to compile the script to create a Filter instance, if the compilation fails the filter attribute in the filter definition will remains nullChangeDescriptor
updateGeneralView(long oid, String name, String description, byte[] structure, byte[] background)
Saves a view not related to a particular object.ChangeDescriptor
updateLayout(long viewId, String name, String description, byte[] structure, byte[] background)
Updates a layout view.ChangeDescriptor
updateListTypeItem(String className, String oid, HashMap<String,String> attributes)
Updates a list type item.Formerly this functionality was provided byBusinessEntityManager
updateObject
, but the implementation was split in two methods.ChangeDescriptor
updateListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId, String name, String description, byte[] structure, byte[] background)
Updates a view for a given list type item.ChangeDescriptor
updateObjectRelatedView(String oid, String objectClass, long viewId, String name, String description, byte[] structure, byte[] background)
Updates a view for a given object.void
updateOSPView(long viewId, String name, String description, byte[] structure)
Updates an existing OSP viewvoid
updateProcessDefinition(long processDefinitionId, List<StringPair> properties, byte[] structure)
Updates a process definition, either its standard properties or its structurevoid
updateScriptedQueriesPool(String scriptedQueriesPoolId, String name, String description)
Updates a scripted queries pool.void
updateScriptedQuery(String scriptedQueryId, String name, String description, String script, boolean enabled)
Updates a scripted query given its idvoid
updateScriptedQueryParameter(String scriptedQueryParameterId, String name, String description, String type, boolean mandatory, Object defaultValue)
Updates a scripted query parameter.ChangeDescriptor
updateTaskNotificationType(long taskId, TaskNotificationDescriptor notificationType)
Updates a task notification typeChangeDescriptor
updateTaskParameters(long taskId, List<StringPair> parameters)
Updates the parameters of a task.ChangeDescriptor
updateTaskProperties(long taskId, String propertyName, String propertyValue)
Updates any of these properties from a task: name, description, enabled and scriptChangeDescriptor
updateTaskSchedule(long taskId, TaskScheduleDescriptor schedule)
Updates a task scheduleChangeDescriptor
updateTemplateElement(String templateElementClass, String templateElementId, String[] attributeNames, String[] attributeValues)
Updates the value of an attribute of a template element.void
updateValidatorDefinition(long validatorDefinitionId, String name, String description, String classToBeApplied, String script, Boolean enabled)
Updates the properties of a validator.void
validateCall(String methodName, String sessionId)
Checks if a call to a single method can be made by a particular user.void
validateCall(String methodName, String ipAddress, String sessionId)
Validates if a user is allowed to call a given a northbound interface method-
Methods inherited from interface org.neotropic.kuwaiba.core.apis.persistence.AbstractEntityManager
initCache, setConfiguration
-
-
-
-
Field Detail
-
POOL_TYPE_GENERAL_PURPOSE
static final int POOL_TYPE_GENERAL_PURPOSE
Type of pool general purpose. These pools are not linked to any particular model- See Also:
- Constant Field Values
-
POOL_TYPE_MODULE_ROOT
static final int POOL_TYPE_MODULE_ROOT
Type of pool module root. These pools are used in models and are the root of such model- See Also:
- Constant Field Values
-
POOL_TYPE_MODULE_COMPONENT
static final int POOL_TYPE_MODULE_COMPONENT
Type of pool module component. These pools are used in models and are in the lower levels of the pool containment hierarchy.- See Also:
- Constant Field Values
-
CLASS_POOL
static final String CLASS_POOL
String that identifies the class used for pools- See Also:
- Constant Field Values
-
-
Method Detail
-
getSessions
ConcurrentHashMap<String,Session> getSessions()
Gets current sessions- Returns:
- A dictionary whose keys are the session tokens and the values are the session related objects
-
isSessionValid
boolean isSessionValid(String username, String token)
Tells if a given pair user-session token is valid.- Parameters:
username
- The user name.token
- The session token.- Returns:
- True if the token exists and corresponds to the given user.
-
validateCall
void validateCall(String methodName, String sessionId) throws NotAuthorizedException
Checks if a call to a single method can be made by a particular user. This is temporary an applicable only to web service calls.- Parameters:
methodName
- The name of the method to be matched.sessionId
- The session attempting to make the call.- Throws:
NotAuthorizedException
- If such user is not allowed to call that method.
-
createUser
long createUser(String userName, String password, String firstName, String lastName, boolean enabled, int type, String email, List<Privilege> privileges, long defaultGroupId) throws InvalidArgumentException
Creates a user. System users ("hard-coded" kind of users used for internal tasks that can not be deleted nor modified byu the end users) can only be manipulated (that is, anything but created) by accessing directly to the database- Parameters:
userName
- New user's name. Mandatory.password
- New user's passwordfirstName
- New user's first namelastName
- New user's last nameenabled
- Shall the new user be enabled by defaulttype
- User type. See UserProfileLight.USER_TYPE_* for possible valuesemail
- New user's emailprivileges
- New user's privileges. Use null for nonedefaultGroupId
- Default group this user will be associated to- Returns:
- The id of the newly created user
- Throws:
InvalidArgumentException
- If the username is null or empty or the username already exists, if the user type is invalid or if the password is an empty string.
-
setUserProperties
void setUserProperties(long oid, String userName, String password, String firstName, String lastName, int enabled, int type, String email) throws InvalidArgumentException, ApplicationObjectNotFoundException
Set the properties of a given user using the id to search for it- Parameters:
oid
- User iduserName
- New user's name. Use null to leave it unchangedpassword
- New user's password. Use null to leave it unchangedfirstName
- New user's first name. Use null to leave it unchangedlastName
- New user's last name. Use null to leave it unchangedenabled
- 0 for false, 1 for true, -1 to leave it unchangedtype
- User type. See UserProfile.USER_TYPE* for possible values. Use -1 to leave it unchangedemail
- New user's email. Use null to leave it unchanged- Throws:
InvalidArgumentException
- If the username is null or empty or the username already exists, if the user type is invalid or if the password is an empty string, or if it is attempted to change the user name of the admin user name, or if this operation is attempted on a system user. Also, if the new user type is invalid.ApplicationObjectNotFoundException
- If the user could not be found
-
setUserProperties
void setUserProperties(String formerUsername, String newUserName, String password, String firstName, String lastName, int enabled, int type, String email) throws InvalidArgumentException, ApplicationObjectNotFoundException
Updates the attributes of a user, using its username as key to find it- Parameters:
formerUsername
- Current user namenewUserName
- New name. Null if unchangedpassword
- Password. Null if unchangedfirstName
- User's first name. Null if unchangedlastName
- User's last name. Null if unchangedenabled
- 0 for false, 1 for true, -1 to leave it unchangedtype
- User type. See UserProfile.USER_TYPE* for possible values. -1 to leave it unchangedemail
- User's email. Null if unchanged- Throws:
InvalidArgumentException
- If the username is null or empty or the username already exists, if the user type is invalid or if the password is an empty string, or if it is attempted to change the user name of the admin user name, or if this operation is attempted on a system user. Also, if the new user type is invalid.ApplicationObjectNotFoundException
- If the user could not be found
-
addUserToGroup
void addUserToGroup(long userId, long groupId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Adds a user to a group- Parameters:
userId
- The id of the user to be added to the groupgroupId
- Id of the group which the user will be added to- Throws:
InvalidArgumentException
- If the user is already related to that group.ApplicationObjectNotFoundException
- If the user or group can not be found
-
removeUserFromGroup
void removeUserFromGroup(long userId, long groupId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Removes a user from a group- Parameters:
userId
- The id of the user to be added to the groupgroupId
- Id of the group which the user will be added to- Throws:
InvalidArgumentException
- If the user is not related to that groupApplicationObjectNotFoundException
- If the user or the group could not be found
-
setPrivilegeToUser
void setPrivilegeToUser(long userId, String featureToken, int accessLevel) throws InvalidArgumentException, ApplicationObjectNotFoundException
Sets a privilege to a user. If the feature token provided already has been assigned to the user, the access level will be changed, otherwise, a privilege will be created- Parameters:
userId
- The user IdfeatureToken
- The feature token. See class Privilege for details. Note that this token must match to the one expected by the client application. That's the only way the correct features will be enabled.accessLevel
- The feature token. See class Privilege.ACCESS_LEVEL* for details.- Throws:
InvalidArgumentException
- If the access level is invalid or if the featureToken has a wrong formatApplicationObjectNotFoundException
- If the user could not be found.
-
setPrivilegeToGroup
void setPrivilegeToGroup(long groupId, String featureToken, int accessLevel) throws InvalidArgumentException, ApplicationObjectNotFoundException
Sets a privilege to a group. If the feature token provided already has been assigned to the group, the access level will be changed, otherwise, a privilege will be created- Parameters:
groupId
- The group IdfeatureToken
- The feature token. See class Privilege for details. Note that this token must match to the one expected by the client application. That's the only way the correct features will be enabled.accessLevel
- The feature token. See class Privilege.ACCESS_LEVEL* for details.- Throws:
InvalidArgumentException
- If the access level is invalid or if the featureToken has a wrong formatApplicationObjectNotFoundException
- If the group could not be found
-
removePrivilegeFromUser
void removePrivilegeFromUser(long userId, String featureToken) throws InvalidArgumentException, ApplicationObjectNotFoundException
Removes a privilege from a user- Parameters:
userId
- Id of the userfeatureToken
- The feature token. See class Privilege for details.- Throws:
InvalidArgumentException
- If the feature token is not related to the userApplicationObjectNotFoundException
- If the user could not be found
-
removePrivilegeFromGroup
void removePrivilegeFromGroup(long groupId, String featureToken) throws InvalidArgumentException, ApplicationObjectNotFoundException
Removes a privilege from a user- Parameters:
groupId
- Id of the groupfeatureToken
- The feature token. See class Privilege for details.- Throws:
InvalidArgumentException
- If the feature token is not related to the groupApplicationObjectNotFoundException
- If the group could not be found
-
createGroup
long createGroup(String groupName, String description, List<Long> users) throws InvalidArgumentException, ApplicationObjectNotFoundException
Creates a group- Parameters:
groupName
- The group namedescription
- The group descriptionusers
- users who belong the group- Returns:
- The new group id.
- Throws:
InvalidArgumentException
- if there's already a group with that nameApplicationObjectNotFoundException
- If any of the provided users could not be found
-
getUsers
List<UserProfile> getUsers()
Retrieves the list of all users- Returns:
- The list of users
-
getGroups
List<GroupProfile> getGroups()
Retrieves the list of all groups- Returns:
- An array of GroupProfile
-
setGroupProperties
void setGroupProperties(long oid, String groupName, String description) throws InvalidArgumentException, ApplicationObjectNotFoundException
Set the attributes of a group- Parameters:
oid
- The oid of the group.groupName
- The name of the group. Use null to leave the old value.description
- The description of the group. Use null to leave the old value.- Throws:
InvalidArgumentException
- If any of the privileges ids is invalid.ApplicationObjectNotFoundException
- If the group could not be found.
-
deleteUsers
void deleteUsers(List<Long> oids) throws ApplicationObjectNotFoundException, InvalidArgumentException
Removes a list of users- Parameters:
oids
- The ids of the users to be deleted.- Throws:
ApplicationObjectNotFoundException
- If any of the users could not be found.InvalidArgumentException
- If any of the users is the default administrator, which can't be deleted
-
deleteGroups
void deleteGroups(List<Long> oids) throws ApplicationObjectNotFoundException, InvalidArgumentException
Removes a list of groups- Parameters:
oids
- The oid of the groups to delete.- Throws:
ApplicationObjectNotFoundException
- If any of the groups could not be found.InvalidArgumentException
- If the group you are trying to delete contains the default administrator
-
createListTypeItem
String createListTypeItem(String className, String name, String displayName) throws MetadataObjectNotFoundException, InvalidArgumentException, OperationNotPermittedException
Creates a list type item- Parameters:
className
- List typename
- new item's namedisplayName
- new item's display name- Returns:
- new item's id
- Throws:
MetadataObjectNotFoundException
- if className is not an existing classInvalidArgumentException
- if the class provided is not a list typeOperationNotPermittedException
- If the class is abstract or marked as in design.
-
updateListTypeItem
ChangeDescriptor updateListTypeItem(String className, String oid, HashMap<String,String> attributes) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Updates a list type item.Formerly this functionality was provided byBusinessEntityManager
updateObject
, but the implementation was split in two methods.- Parameters:
className
- The class of the LTI to be updated. it must be a subclass of GenericObjectListoid
- The id of the LTI to be updated.attributes
- The attributes to be changed.- Returns:
- The summary of the changes made.
- Throws:
MetadataObjectNotFoundException
- If the list type does not exist.ApplicationObjectNotFoundException
- If the LTI does not exist.InvalidArgumentException
- If the class provided is not a subclass of GenericObjectList.
-
getListTypeItems
List<BusinessObjectLight> getListTypeItems(String className) throws MetadataObjectNotFoundException, InvalidArgumentException
Retrieves all the items related to a given list type- Parameters:
className
- list type- Returns:
- A list of RemoteBusinessObjectLight instances representing the items
- Throws:
MetadataObjectNotFoundException
- if className is not an existing classInvalidArgumentException
- if the class provided is not a list type
-
getListTypeItem
BusinessObject getListTypeItem(String listTypeClassName, String listTypeItemId) throws MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Retrieves list type item given its id- Parameters:
listTypeClassName
- The class name of list type itemlistTypeItemId
- The id of list type item- Returns:
- A RemoteBusinessObjectLight instance representing the item
- Throws:
MetadataObjectNotFoundException
- If the list type class Name is not an existing classInvalidArgumentException
- if the list type class name provided is not a list typeApplicationObjectNotFoundException
- If the the item id can not be found
-
getListTypeItemWithName
BusinessObjectLight getListTypeItemWithName(String listTypeClassName, String listTypeItemName) throws MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Retrieves a list type item given its name- Parameters:
listTypeClassName
- The class name of list type itemlistTypeItemName
- The name of list type item- Returns:
- A RemoteBusinessObjectLight instance representing the item
- Throws:
MetadataObjectNotFoundException
- If the list type class Name is not an existing classInvalidArgumentException
- if the list type class name provided is not a list typeApplicationObjectNotFoundException
- If the the item id can not be found
-
deleteListTypeItem
void deleteListTypeItem(String className, String oid, boolean realeaseRelationships) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException, NotAuthorizedException
Deletes a list type item- Parameters:
className
- List type item classoid
- list type item oidrealeaseRelationships
- Should the relationships be released- Throws:
MetadataObjectNotFoundException
- if the class name is not validBusinessObjectNotFoundException
- if the list type item can't be foundOperationNotPermittedException
- if the object has relationshipsInvalidArgumentException
- If the class provided is not a list typeNotAuthorizedException
- If the user can't delete a list type item
-
releaseListTypeItem
void releaseListTypeItem(String listTypeItemId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException, NotAuthorizedException
Release a list type item relationships- Parameters:
listTypeItemId
- list type item oid- Throws:
MetadataObjectNotFoundException
- if the class name is not validBusinessObjectNotFoundException
- if the list type item can't be foundOperationNotPermittedException
- if the object has relationshipsInvalidArgumentException
- If the class provided is not a list typeNotAuthorizedException
- If the user can't delete a list type item
-
getInstanceableListTypes
List<ClassMetadataLight> getInstanceableListTypes() throws ApplicationObjectNotFoundException
Get the possible list types- Returns:
- A list of ClassMetadataLight instances representing the possible list types
- Throws:
ApplicationObjectNotFoundException
- if the GenericObjectList class does not exist
-
createListTypeItemRelatedLayout
long createListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClassName, String viewClassName, String name, String description, byte[] structure, byte[] background) throws MetadataObjectNotFoundException, InvalidArgumentException
Creates a view for a given list type item. If there's already a view of the provided view type, it will be overwritten- Parameters:
listTypeItemId
- list type item idlistTypeItemClassName
- list type item class namename
- view namedescription
- view descriptionviewClassName
- view class namestructure
- XML document with the view structurebackground
- background image- Returns:
- The id of the new view.
- Throws:
MetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the view type is not supported
-
getLayouts
List<ViewObjectLight> getLayouts(int limit) throws InvalidArgumentException, NotAuthorizedException
Allows to retrieve a list of all existent layout views.- Parameters:
limit
- The limit of results. -1 for all- Returns:
- The list of views
- Throws:
InvalidArgumentException
- If the view class does not existNotAuthorizedException
- If the user is not allowed to query for general views
-
getLayout
ViewObject getLayout(long viewId) throws ApplicationObjectNotFoundException
Returns a layout view with the given id- Parameters:
viewId
- view id- Returns:
- An object representing the view
- Throws:
ApplicationObjectNotFoundException
- If the requested view is not found
-
getListTypeItemForLayout
BusinessObjectLight getListTypeItemForLayout(long layoutViewId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Returns the list type item related with the given view- Parameters:
layoutViewId
- view id- Returns:
- An object representing the list type item
- Throws:
ApplicationObjectNotFoundException
- If the given view is not foundInvalidArgumentException
- if the object cannot be created from the list type item node
-
createLayout
long createLayout(String viewClassName, String name, String description, byte[] structure, byte[] background) throws InvalidArgumentException
Creates a new layout view. Creates a new Layout view with the given data- Parameters:
name
- view namedescription
- view descriptionviewClassName
- view class namestructure
- XML document with the view structurebackground
- background image- Returns:
- The id of the new view.
- Throws:
InvalidArgumentException
- if the view type is not supported
-
setListTypeItemRelatedLayout
void setListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId) throws InvalidArgumentException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Relate a list type item with a view. Creates a relationship between the given list type and layout view.- Parameters:
listTypeItemId
- list type item idlistTypeItemClass
- list type item class nameviewId
- the view id- Throws:
MetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the view type is not supportedApplicationObjectNotFoundException
- if the view does not exist
-
releaseListTypeItemRelatedLayout
void releaseListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId) throws InvalidArgumentException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Release a list type item with a view. Deletes a relationship between the given list type and layout view.- Parameters:
listTypeItemId
- list type item idlistTypeItemClass
- list type item class nameviewId
- the view id- Throws:
MetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the view type is not supportedApplicationObjectNotFoundException
- if the view does not exist
-
getListTypeItemRelatedLayout
ViewObject getListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId) throws MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Gets a view related to a list type item, such as the default, rack or equipment views- Parameters:
listTypeItemId
- list type item idlistTypeItemClass
- list type item classviewId
- view id- Returns:
- The associated view (there should be only one of each type). Null if there's none yet
- Throws:
ApplicationObjectNotFoundException
- if the list type item or the view can not be foundMetadataObjectNotFoundException
- if the corresponding class metadata can not be foundInvalidArgumentException
- if the provided view type is not supported
-
updateListTypeItemRelatedLayout
ChangeDescriptor updateListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId, String name, String description, byte[] structure, byte[] background) throws MetadataObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException, ApplicationObjectNotFoundException
Updates a view for a given list type item. If there's already a view of the provided view type, it will be overwritten- Parameters:
listTypeItemId
- list type item idlistTypeItemClass
- list type item classviewId
- viewIdname
- view namedescription
- view descriptionstructure
- XML document with the view structurebackground
- Background image. If null, the previous will be removed, if 0-sized array, it will remain unchanged- Returns:
- The summary of the changes
- Throws:
BusinessObjectNotFoundException
- if the list type item can not be foundMetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the view type is not supportedApplicationObjectNotFoundException
- If the view can not be found
-
updateLayout
ChangeDescriptor updateLayout(long viewId, String name, String description, byte[] structure, byte[] background) throws MetadataObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException, ApplicationObjectNotFoundException
Updates a layout view. Updates the given layout view with the parameters provided.- Parameters:
viewId
- viewIdname
- view namedescription
- view descriptionstructure
- XML document with the view structurebackground
- Background image. If null, the previous will be removed, if 0-sized array, it will remain unchanged- Returns:
- The summary of the changes
- Throws:
BusinessObjectNotFoundException
- if the list type item can not be foundMetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the view type is not supportedApplicationObjectNotFoundException
- If the view can not be found
-
getListTypeItemRelatedLayout
List<ViewObjectLight> getListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, int limit) throws MetadataObjectNotFoundException, InvalidArgumentException
Gets the views related to a list type item, such as the default, rack or equipment views- Parameters:
listTypeItemId
- list type item idlistTypeItemClass
- list type class namelimit
- max number of results- Returns:
- The associated views
- Throws:
MetadataObjectNotFoundException
- if the corresponding class metadata can not be foundInvalidArgumentException
- if the provided view type is not supported
-
deleteListTypeItemRelatedLayout
void deleteListTypeItemRelatedLayout(String listTypeItemId, String listTypeItemClass, long viewId) throws MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Deletes a list type item related view- Parameters:
listTypeItemId
- list type item idlistTypeItemClass
- list type class nameviewId
- related view id- Throws:
MetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the list type item can no be found using the idApplicationObjectNotFoundException
- if the view can not be found
-
deleteLayout
void deleteLayout(long viewId) throws MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Deletes a layout view- Parameters:
viewId
- related view id- Throws:
MetadataObjectNotFoundException
- if the list type item class can not be foundInvalidArgumentException
- if the list type item can no be found using the idApplicationObjectNotFoundException
- if the view can not be found
-
getListTypeItemUses
List<BusinessObjectLight> getListTypeItemUses(String listTypeItemClass, String listTypeItemId, int limit) throws ApplicationObjectNotFoundException, InvalidArgumentException
Retrieves the objects that make reference to a given list type item- Parameters:
listTypeItemClass
- The list type classlistTypeItemId
- The list type item idlimit
- The limit of results. Use -1 to retrieve all.- Returns:
- The list of business objects related to the list type item
- Throws:
ApplicationObjectNotFoundException
InvalidArgumentException
-
getDeviceLayouts
List<BusinessObjectLight> getDeviceLayouts() throws InvalidArgumentException
Gets the list of template elements with a device layout- Returns:
- the list of template elements with a device layout
- Throws:
InvalidArgumentException
- If any template does not have uuid
-
getDeviceLayoutStructure
byte[] getDeviceLayoutStructure(String oid, String className) throws ApplicationObjectNotFoundException, InvalidArgumentException
Gets the device layout structure.<deviceLayoutStructure> <device id="" className="" name=""/> ... . . <device id="" className="" name="" parentId=""> <model id="" className="" name=""> <view id="" className=""> <structure> Base64 </structure> </view> </model> </device> ... . . <device id="" className="" name="" parentId=""/> ... . . <device id="" className="" name="" parentId=""> <model id="" className="" name=""> <view id="" className=""> <structure> Base64 </structure> </view> </model> </device> </deviceLayoutStructure>
- Parameters:
oid
- object idclassName
- object class- Returns:
- The structure of the device layout
- Throws:
ApplicationObjectNotFoundException
- In case that any of the devices contained within the main one has a malformed model attribute.InvalidArgumentException
- If the structure is somehow malformed.
-
getObjectRelatedView
ViewObject getObjectRelatedView(String oid, String objectClass, long viewId) throws ApplicationObjectNotFoundException, BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Get a view related to an object, such as the default rack or object views- Parameters:
oid
- object's idobjectClass
- object's classviewId
- view id- Returns:
- The associated view (there should be only one of each type). Null if there's none yet
- Throws:
ApplicationObjectNotFoundException
- if the object or the view can not be foundMetadataObjectNotFoundException
- if the corresponding class metadata can not be foundInvalidArgumentException
- if the provided view type is not supportedBusinessObjectNotFoundException
- If the object can not be found
-
getObjectRelatedViews
List<ViewObjectLight> getObjectRelatedViews(String oid, String objectClass, int limit) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Get a view related to an object, such as the default, rack or equipment views- Parameters:
oid
- object's idobjectClass
- object's classlimit
- max number of results- Returns:
- The associated views
- Throws:
BusinessObjectNotFoundException
- if the object can not be foundMetadataObjectNotFoundException
- if the corresponding class metadata can not be foundInvalidArgumentException
- if the provided view type is not supported
-
getGeneralViews
List<ViewObjectLight> getGeneralViews(String viewClassName, int limit) throws InvalidArgumentException, NotAuthorizedException
Allows to retrieve a list of views of a certain type, specifying their class- Parameters:
viewClassName
- The class namelimit
- The limit of results. -1 for all- Returns:
- The list of views
- Throws:
InvalidArgumentException
- If the view class does not existNotAuthorizedException
- If the user is not allowed to query for general views
-
getGeneralView
ViewObject getGeneralView(long viewId) throws ApplicationObjectNotFoundException
Returns a view of those that are not related to a particular object (i.e.: GIS views)- Parameters:
viewId
- view id- Returns:
- An object representing the view
- Throws:
ApplicationObjectNotFoundException
- If the requested view is not found
-
createObjectRelatedView
long createObjectRelatedView(String oid, String objectClass, String name, String description, String viewClassName, byte[] structure, byte[] background) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Creates a view for a given object. If there's already a view of the provided view type, it will be overwritten- Parameters:
oid
- object's oidobjectClass
- object classname
- view namedescription
- view descriptionviewClassName
- view class name (See class ViewObject for details about the supported types)structure
- XML document with the view structure (see http://sourceforge.net/apps/mediawiki/kuwaiba/index.php?title=XML_Documents#To_Save_Object_Views for details about the supported format)background
- background image- Returns:
- The id of the new view.
- Throws:
BusinessObjectNotFoundException
- if the object can not be foundMetadataObjectNotFoundException
- if the object class can not be foundInvalidArgumentException
- if the view type is not supported
-
createGeneralView
long createGeneralView(String viewClass, String name, String description, byte[] structure, byte[] background) throws InvalidArgumentException
Creates a view not related to a particular object- Parameters:
viewClass
- View classname
- view namedescription
- view descriptionstructure
- XML document specifying the view structure (nodes, edges, control points)background
- Background image- Returns:
- The id of the newly created view
- Throws:
InvalidArgumentException
- if the view type is invalid
-
updateObjectRelatedView
ChangeDescriptor updateObjectRelatedView(String oid, String objectClass, long viewId, String name, String description, byte[] structure, byte[] background) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Updates a view for a given object. If there's already a view of the provided view type, it will be overwritten- Parameters:
oid
- object's oidobjectClass
- object classviewId
- viewIdname
- view namedescription
- view descriptionstructure
- XML document with the view structure (see http://neotropic.co/kuwaiba/wiki/index.php?title=XML_Documents#To_Save_Object_Views for details about the supported format)background
- Background image. If null, the previous will be removed, if 0-sized array, it will remain unchanged- Returns:
- The summary of the changes
- Throws:
BusinessObjectNotFoundException
- if the object can not be foundMetadataObjectNotFoundException
- if the object class can not be foundInvalidArgumentException
- if the view type is not supportedApplicationObjectNotFoundException
- If the view can not be found
-
updateGeneralView
ChangeDescriptor updateGeneralView(long oid, String name, String description, byte[] structure, byte[] background) throws InvalidArgumentException, ApplicationObjectNotFoundException
Saves a view not related to a particular object. The view type can not be changed- Parameters:
oid
- View idname
- view name. Null to leave unchangeddescription
- view description. Null to leave unchangedstructure
- XML document specifying the view structure (nodes, edges, control points). Null to leave unchangedbackground
- Background image. If null, the previous will be removed, if 0-sized array, it will remain unchanged- Returns:
- The summary of the changes.
- Throws:
InvalidArgumentException
- if the view type is invalid or if the background could not be saved.ApplicationObjectNotFoundException
- if the view couldn't be found
-
deleteGeneralViews
void deleteGeneralViews(List<Long> ids) throws ApplicationObjectNotFoundException
Deletes a list of general views- Parameters:
ids
- The ids of the views to be deleted.- Throws:
ApplicationObjectNotFoundException
- if the view can't be found
-
createQuery
long createQuery(String queryName, long ownerOid, byte[] queryStructure, String description) throws ApplicationObjectNotFoundException
Creates a Query- Parameters:
queryName
- The name of the query.ownerOid
- The if of the user that will own the query. Use -1 to make it public.queryStructure
- The structure of the query as an XML document.description
- The description of the query.- Returns:
- The id of the newly created query.
- Throws:
ApplicationObjectNotFoundException
- If the owner could not be found.
-
saveQuery
ChangeDescriptor saveQuery(long queryOid, String queryName, long ownerOid, byte[] queryStructure, String description) throws ApplicationObjectNotFoundException
Updates an existing query- Parameters:
queryOid
- The id of the queryqueryName
- The name of the query. Leave null to keep the old value.ownerOid
- The id of the user that owns this query. Use -1 to keep the old value.queryStructure
- The structure of the query as an XML document. Leave null to keep the old value.description
- The description of the query. Leave null to keep the old value.- Returns:
- The summary of the changes.
- Throws:
ApplicationObjectNotFoundException
- If the query can not be found.
-
deleteQuery
void deleteQuery(long queryOid) throws ApplicationObjectNotFoundException
Deletes a Query- Parameters:
queryOid
- The id of the query.- Throws:
ApplicationObjectNotFoundException
- If the query could not be found
-
getQueries
List<CompactQuery> getQueries(boolean showPublic)
Gets all queries- Parameters:
showPublic
- Include public queries or show only the private ones.- Returns:
- The list of queries.
-
getQuery
CompactQuery getQuery(long queryOid) throws ApplicationObjectNotFoundException
Gets a single query- Parameters:
queryOid
- The id of the query.- Returns:
- The query as an object.
- Throws:
ApplicationObjectNotFoundException
- If the query could not be found.
-
executeQuery
List<ResultRecord> executeQuery(ExtendedQuery query) throws MetadataObjectNotFoundException, InvalidArgumentException
Used to perform complex queries. Please note that the first record is reserved for the column headers, so and empty result set will have at least one record.- Parameters:
query
- The code-friendly representation of the query made using the graphical query builder- Returns:
- a set of objects matching the specified criteria as ResultRecord array
- Throws:
MetadataObjectNotFoundException
- If the class to be search is cannot be foundInvalidArgumentException
- If any instance does not have a uuid
-
getClassHierachy
byte[] getClassHierachy(boolean showAll) throws MetadataObjectNotFoundException
Get the data model class hierarchy as an XML document- Parameters:
showAll
-- Returns:
- The class hierarchy as an XML document
- Throws:
MetadataObjectNotFoundException
- If one of the core classes could not be found
-
createRootPool
String createRootPool(String name, String description, String instancesOfClass, int type) throws MetadataObjectNotFoundException
Creates a pool without a parent. They're used as general purpose place to put inventory objects, or as root for particular models- Parameters:
name
- Pool namedescription
- Pool descriptioninstancesOfClass
- What kind of objects can this pool contain?type
- Type of pool. For possible values see ApplicationManager.POOL_TYPE_XXX- Returns:
- The id of the new pool
- Throws:
MetadataObjectNotFoundException
- If instancesOfClass is not a valid subclass of InventoryObject
-
createPoolInObject
String createPoolInObject(String parentClassname, String parentId, String name, String description, String instancesOfClass, int type) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException
Creates a pool that will have as parent an inventory object. This special containment structure can be used to provide support for new models- Parameters:
parentClassname
- Class name of the parent objectparentId
- Id of the parent objectname
- Pool namedescription
- Pool descriptioninstancesOfClass
- What kind of objects can this pool contain?type
- Type of pool. For possible values see ApplicationManager.POOL_TYPE_XXX- Returns:
- The id of the new pool
- Throws:
MetadataObjectNotFoundException
- If instancesOfClass is not a valid subclass of InventoryObjectBusinessObjectNotFoundException
- If the parent object can not be found
-
createPoolInPool
String createPoolInPool(String parentId, String name, String description, String instancesOfClass, int type) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Creates a pool that will have as parent another pool. This special containment structure can be used to provide support for new models- Parameters:
parentId
- Id of the parent poolname
- Pool namedescription
- Pool descriptioninstancesOfClass
- What kind of objects can this pool contain?type
- Type of pool. Not used so far, but it will be in the future. It will probably be used to help organize the existing pools- Returns:
- The id of the new pool
- Throws:
MetadataObjectNotFoundException
- If instancesOfClass is not a valid subclass of InventoryObjectApplicationObjectNotFoundException
- If the parent object can not be found
-
deletePools
void deletePools(String[] ids) throws ApplicationObjectNotFoundException, OperationNotPermittedException
Deletes a set of pools. Note that this method will delete and commit the changes until it finds an error, so if deleting any of the pools fails, don't try to delete those that were already processed- Parameters:
ids
- the list of ids from the objects to be deleted- Throws:
ApplicationObjectNotFoundException
- If any of the pools to be deleted couldn't be foundOperationNotPermittedException
- If any of the objects in the pool can not be deleted because it's not a business related instance (it's more a security restriction)
-
setPoolProperties
ChangeDescriptor setPoolProperties(String poolId, String name, String description)
Updates a pool. The class name field is read only to preserve the integrity of the pool. Same happens to the field type- Parameters:
poolId
- Pool Idname
- Pool name. If null, this field will remain unchangeddescription
- Pool description. If null, this field will remain unchanged- Returns:
- The summary of the changes.
-
getBusinessObjectAuditTrail
List<ActivityLogEntry> getBusinessObjectAuditTrail(String objectClass, String objectId, int limit) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Gets a business object audit trail- Parameters:
objectClass
- Object classobjectId
- Object idlimit
- Max number of results to be shown- Returns:
- The list of activity entries
- Throws:
BusinessObjectNotFoundException
- If the object can not be foundMetadataObjectNotFoundException
- If the provided class couldn't be foundInvalidArgumentException
- If the class provided is not subclass of InventoryObject
-
getGeneralActivityAuditTrail
List<ActivityLogEntry> getGeneralActivityAuditTrail(int page, int limit, HashMap<String,Object> filters)
Retrieves the list of general activity log entries- Parameters:
page
- current pagelimit
- limit of results per page. 0 to retrieve them allfilters
- The response may be filtered by user (use keyuser
, value the user name, a String) or event type (use keytype
, value any from ActivityLogEntry.ACTIVITY_TYPE_XXXX, an integer). If this parameter is null, no filters will be applied. If a key is not present, it won't be used as filter. If both are present, a logical AND will be applied.- Returns:
- The list of activity log entries. The entries are sorted by creation date in descending order.
-
validateCall
void validateCall(String methodName, String ipAddress, String sessionId) throws NotAuthorizedException
Validates if a user is allowed to call a given a northbound interface method- Parameters:
methodName
- The method to check if the user is allowed to call it.ipAddress
- The IP address the method is being invoked fromsessionId
- The session token- Throws:
NotAuthorizedException
- If the user is not allowed to invoke the method
-
createSession
Session createSession(String user, String password, int sessionType, String ipAddress) throws ApplicationObjectNotFoundException, NotAuthorizedException
Creates a session. System users can not create sessions.- Parameters:
user
- User namepassword
- PasswordsessionType
- The type of session to be created. This type depends on what kind of client is trying to access (a desktop client, a web client, a web service user, etc. See Session.TYPE_XXX for possible session typesipAddress
- IP address the session is created from- Returns:
- A session object with information about the session itself plus information about the user
- Throws:
ApplicationObjectNotFoundException
- If the user does not existNotAuthorizedException
- If the password is incorrect or if the user is not enabled, or if a system user is used to create the session.
-
getUserInSession
UserProfile getUserInSession(String sessionId) throws ApplicationObjectNotFoundException
Retrieves a user from the session ring given a session id- Parameters:
sessionId
- The session token- Returns:
- The user associated to a given session
- Throws:
ApplicationObjectNotFoundException
- If the user could not be found
-
getUsersInGroup
List<UserProfile> getUsersInGroup(long groupId) throws ApplicationObjectNotFoundException
Gets all the users in a group- Parameters:
groupId
- The id of the group- Returns:
- The list of users in that group
- Throws:
ApplicationObjectNotFoundException
- If the group could not be found.
-
getGroupsForUser
List<GroupProfileLight> getGroupsForUser(long userId) throws ApplicationObjectNotFoundException
Retrieves the list of groups a user belongs to- Parameters:
userId
- The id of the user- Returns:
- The list of groups for this user
- Throws:
ApplicationObjectNotFoundException
- If the user could not be found
-
closeSession
void closeSession(String sessionId, String remoteAddress) throws NotAuthorizedException
Closes a session- Parameters:
sessionId
- The session idremoteAddress
- remote IP Address- Throws:
NotAuthorizedException
- If the session ID is Invalid or the IP does not match with the one registered for this session
-
getConfiguration
Properties getConfiguration()
Gets the configuration variables of this manager- Returns:
- A Properties object with the configuration variables
-
createGeneralActivityLogEntry
void createGeneralActivityLogEntry(String userName, int type, String notes) throws ApplicationObjectNotFoundException
Creates a general activity log entry, that is, an entry that is not associated to a particular object- Parameters:
userName
- User that performed the actiontype
- Type of action. See class ActivityLogEntry for possible valuesnotes
- Optional additional notes related to the action. The Id of the element, if it was created/deleted. Null if no notes should be added- Throws:
ApplicationObjectNotFoundException
- If the log root node could not be found
-
createGeneralActivityLogEntry
void createGeneralActivityLogEntry(String userName, int type, ChangeDescriptor changeDescriptor) throws ApplicationObjectNotFoundException
Creates a general activity log entry, that is, an entry that is not associated to a particular object- Parameters:
userName
- User that performed the actiontype
- Type of action. See class ActivityLogEntry for possible valueschangeDescriptor
- The descriptor with all the changes performed by the method- Throws:
ApplicationObjectNotFoundException
- If the log root node could not be found
-
createObjectActivityLogEntry
void createObjectActivityLogEntry(String userName, String className, String oid, int type, String affectedProperties, String oldValues, String newValues, String notes) throws ApplicationObjectNotFoundException, BusinessObjectNotFoundException
Creates an object activity log entry, that is, an entry that is directly related to an object, such as the modification of the value of an attribute- Parameters:
userName
- User that performs the operationclassName
- The class of the object being modifiedoid
- The oid of the object being modifiedtype
- The type of action. See ActivityLogEntry class for possible valuesaffectedProperties
- Properties that were affected. Normally, they're separated by spaces, but it's not requiredoldValues
- Old values. Normally, they're separated by spaces, but it's not requirednewValues
- New values. Normally, they're separated by spaces, but it's not requirednotes
- Additional notes associated with the change- Throws:
ApplicationObjectNotFoundException
- If the object activity log could no be foundBusinessObjectNotFoundException
- If the modified object itself could not be found
-
createObjectActivityLogEntry
void createObjectActivityLogEntry(String userName, String className, String oid, int type, ChangeDescriptor changeDescriptor) throws ApplicationObjectNotFoundException, BusinessObjectNotFoundException
Creates an object activity log entry, that is, an entry that is directly related to an object, such as the modification of the value of an attribute- Parameters:
userName
- User that performs the operationclassName
- The class of the object being modifiedoid
- The oid of the object being modifiestype
- The type of action. See ActivityLogEntry class for possible valueschangeDescriptor
- The summary of the changes that were done- Throws:
ApplicationObjectNotFoundException
- If the object activity log could no be foundBusinessObjectNotFoundException
- If the modified object itself could not be found
-
executeCustomDbCode
HashMap<String,BusinessObjectList> executeCustomDbCode(String dbCode, boolean needReturn) throws NotAuthorizedException
Deprecated.Don't use it, instead, create a method in the corresponding entity manager instead of running code directly on the databaseAllows to execute custom database queries. This method should not be used as it's only a temporary solution- Parameters:
dbCode
- A string with the queryneedReturn
-- Returns:
- A table with results, that could also be interpreted as a multidimensional array with numerous paths
- Throws:
NotAuthorizedException
- If the user is not allowed to run arbitrary code on the database
-
executeCustomScriptedQuery
List<Properties> executeCustomScriptedQuery(String queryName, Properties parameters) throws ApplicationObjectNotFoundException, InvalidArgumentException
This method is the evolution of the deprecatedexecuteCustomDbCode(java.lang.String, boolean)
. It allows the user to execute scripts that usually perform queries to the data base using the native query language and then pre-process the result before returning anything.- Parameters:
queryName
- The (unique) name of the query.parameters
- The parameters as entries in a Properties object. The consumer of the script must be aware of the format of the parameters. They could be provided as simple strings, or in their former types.- Returns:
- A list of results as
Properties
instances instances. As a way of speaking, every Properties instances is like a row in a table of results. - Throws:
ApplicationObjectNotFoundException
- If the scripted query with the name provided could not be found.InvalidArgumentException
- If any of the parameters is invalid or if an unexpected error occurred during the execution of the script.
-
createTask
long createTask(String name, String description, boolean enabled, boolean commitOnExecute, String script, List<StringPair> parameters, TaskScheduleDescriptor schedule, TaskNotificationDescriptor notificationType)
Creates and schedule a task. A task is an application entity that allows to run jobs that will be executed depending on certain schedule- Parameters:
name
- Task namedescription
- Task descriptionenabled
- Is the task enabled?commitOnExecute
- Should this task commit the changes made (if any) after executing it?script
- The script to be executedparameters
- The parameters for the scriptschedule
- When the task should be executednotificationType
- How the result of the task should be notified to the associated users- Returns:
- The id of the newly created task
-
updateTaskProperties
ChangeDescriptor updateTaskProperties(long taskId, String propertyName, String propertyValue) throws ApplicationObjectNotFoundException, InvalidArgumentException
Updates any of these properties from a task: name, description, enabled and script- Parameters:
taskId
- Task idpropertyName
- Property name. Possible values: "name", "description", "enabled" and "script"propertyValue
- The value of the property. For the property "enabled", the allowed values are "true" and "false"- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException
- If the task could not be foundInvalidArgumentException
- If the property name has an invalid value
-
updateTaskParameters
ChangeDescriptor updateTaskParameters(long taskId, List<StringPair> parameters) throws ApplicationObjectNotFoundException
Updates the parameters of a task. If any of the values is null, that parameter will be deleted, if the parameter does not exist, it will be created- Parameters:
taskId
- Task idparameters
- The parameters to be modified as pairs paramName/paramValue- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException
- If the task could not be found
-
updateTaskSchedule
ChangeDescriptor updateTaskSchedule(long taskId, TaskScheduleDescriptor schedule) throws ApplicationObjectNotFoundException
Updates a task schedule- Parameters:
taskId
- Task idschedule
- New schedule- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException
- If the task could not be found
-
updateTaskNotificationType
ChangeDescriptor updateTaskNotificationType(long taskId, TaskNotificationDescriptor notificationType) throws ApplicationObjectNotFoundException
Updates a task notification type- Parameters:
taskId
- Task idnotificationType
- New notification type- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException
- If the task could not be found
-
deleteTask
void deleteTask(long taskId) throws ApplicationObjectNotFoundException
Deletes a task and unsubscribes all users from it- Parameters:
taskId
- Task id- Throws:
ApplicationObjectNotFoundException
- If the task could not be found
-
subscribeUserToTask
ChangeDescriptor subscribeUserToTask(long userId, long taskId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Subscribes a user to a task, so it will be notified of the result of its execution- Parameters:
taskId
- Id of the taskuserId
- Id of the user- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException
- If the task or the user could not be foundInvalidArgumentException
- If the user is already subscribed to the task
-
unsubscribeUserFromTask
ChangeDescriptor unsubscribeUserFromTask(long userId, long taskId) throws ApplicationObjectNotFoundException
Unsubscribes a user from a task, so it will no longer be notified about the result of its execution- Parameters:
taskId
- Id of the taskuserId
- Id of the user- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException
- If the task or the user could not be found
-
getTask
Task getTask(long taskId) throws ApplicationObjectNotFoundException
Retrieves the information about a particular task- Parameters:
taskId
- Id of the task- Returns:
- A remote task object representing the task
- Throws:
ApplicationObjectNotFoundException
- If the task could not be found
-
getSubscribersForTask
List<UserProfileLight> getSubscribersForTask(long taskId) throws ApplicationObjectNotFoundException
Gets the subscribers of a particular task- Parameters:
taskId
- task id- Returns:
- The list of users subscribers to the task identified with the id taskId
- Throws:
ApplicationObjectNotFoundException
- Id the task could not be found
-
getTasksForUser
List<Task> getTasksForUser(long userId) throws ApplicationObjectNotFoundException
Gets the tasks associated to a particular user- Parameters:
userId
- Id if the user- Returns:
- A list with the task objects
- Throws:
ApplicationObjectNotFoundException
- If the user can not be found
-
executeTask
TaskResult executeTask(long taskId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Executes a task on demand. The task may have user-defined parameters that must be set usingupdateTaskParameters(long, java.util.List)
before running the task.- Parameters:
taskId
- Id of the task. Could be known by callinggetTasks()
first.- Returns:
- An
TaskResult
instance representing the task result. - Throws:
ApplicationObjectNotFoundException
- If the task could not be found.InvalidArgumentException
- If the task doesn't have a script.
-
createTemplate
String createTemplate(String templateClass, String templateName) throws MetadataObjectNotFoundException, OperationNotPermittedException
Creates a template.- Parameters:
templateClass
- The class you want to create a template for.templateName
- The name of the template. It can not be null.- Returns:
- The id of the newly created template.
- Throws:
MetadataObjectNotFoundException
- If the provided class does not existOperationNotPermittedException
- If the template class is abstract.
-
createTemplateElement
String createTemplateElement(String templateElementClass, String templateElementParentClassName, String templateElementParentId, String templateElementName) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException, OperationNotPermittedException
Creates an object inside a template.- Parameters:
templateElementClass
- Class of the object you want to create.templateElementParentClassName
- Class of the parent to the object you want to create.templateElementParentId
- Id of the parent to the object you want to create.templateElementName
- Name of the element.- Returns:
- The id of the new object.
- Throws:
MetadataObjectNotFoundException
- If the object (or its parent) class could not be foundApplicationObjectNotFoundException
- If the parent object could not be foundOperationNotPermittedException
- If the class provided to create the new element from is abstract.
-
createTemplateSpecialElement
String createTemplateSpecialElement(String tsElementClass, String tsElementParentClassName, String tsElementParentId, String tsElementName) throws OperationNotPermittedException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Create an special object inside an template- Parameters:
tsElementClass
- Template special element classtsElementParentClassName
- Template special element parent class nametsElementParentId
- Template special element parent IdtsElementName
- Template special element name- Returns:
- The id of the new object
- Throws:
OperationNotPermittedException
- If the element class are not a possible special child of the element parent class Or if the element class given are abstractMetadataObjectNotFoundException
- If the element class or element parent class can not be foundApplicationObjectNotFoundException
- If the element parent can no be found
-
createBulkTemplateElement
String[] createBulkTemplateElement(String templateElementClassName, String templateElementParentClassName, String templateElementParentId, String templateElementNamePattern) throws MetadataObjectNotFoundException, OperationNotPermittedException, ApplicationObjectNotFoundException, InvalidArgumentException
Creates multiple template elements using a given name pattern- Parameters:
templateElementClassName
- The class name of the new set of template elementstemplateElementParentClassName
- The parent class name of the new set of template elementstemplateElementParentId
- The parent id of the new set of template elementstemplateElementNamePattern
- Name pattern of the new set of template elements- Returns:
- An array of ids for the new template elements
- Throws:
MetadataObjectNotFoundException
- If the parent class name or the template element class name cannot be foundOperationNotPermittedException
- If the given template element class cannot be a child of the given parentApplicationObjectNotFoundException
- If the parent class name cannot be foundInvalidArgumentException
- If the given pattern to generate the name has less possibilities that the number of template elements to be created
-
createBulkSpecialTemplateElement
String[] createBulkSpecialTemplateElement(String stElementClass, String stElementParentClassName, String stElementParentId, String stElementNamePattern) throws OperationNotPermittedException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Creates multiple special template elements using a given name pattern- Parameters:
stElementClass
- The class name of the new set of special template elementsstElementParentClassName
- The parent class name of the new set of special template elementsstElementParentId
- The parent id of the new set of special template elementsstElementNamePattern
- Name pattern of the new set of special template elements- Returns:
- An array if ids for the new special template elements
- Throws:
OperationNotPermittedException
- If the parent class name or the special template element class name cannot be foundMetadataObjectNotFoundException
- If the given special template element class cannot be a child of the given parentApplicationObjectNotFoundException
- If the parent class name cannot be foundInvalidArgumentException
- If the given pattern to generate the name has less possibilities that the number of special template elements to be created
-
updateTemplateElement
ChangeDescriptor updateTemplateElement(String templateElementClass, String templateElementId, String[] attributeNames, String[] attributeValues) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Updates the value of an attribute of a template element.- Parameters:
templateElementClass
- Class of the element you want to update.templateElementId
- Id of the element you want to update.attributeNames
- Names of the attributes that you want to be updated as an array of strings.attributeValues
- The values of the attributes you want to upfate. For list types, it's the id of the related type- Returns:
- The summary of the changes
- Throws:
MetadataObjectNotFoundException
- If any of the classes provided as arguments do not existApplicationObjectNotFoundException
- If the template element could not be foundInvalidArgumentException
- If the arrays attributeNames and attributeValues have different sizes
-
deleteTemplateElement
ChangeDescriptor deleteTemplateElement(String templateElementClass, String templateElementId) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Deletes an element within a template or a template itself.- Parameters:
templateElementClass
- The template element class.templateElementId
- The template element id.- Returns:
- The summary of the changes
- Throws:
MetadataObjectNotFoundException
- If the element's class could not be found.ApplicationObjectNotFoundException
- If the element could not be found.
-
getTemplatesForClass
List<TemplateObjectLight> getTemplatesForClass(String className) throws MetadataObjectNotFoundException
Gets the templates available for a given class- Parameters:
className
- Class whose templates we need- Returns:
- A list of templates (actually, the top element) as a list of RemoteOObjects
- Throws:
MetadataObjectNotFoundException
- If the class provided could not be found.
-
getTemplateElementChildren
List<TemplateObjectLight> getTemplateElementChildren(String templateElementClass, String templateElementId)
Retrieves the children of a given template element.- Parameters:
templateElementClass
- Template element class.templateElementId
- Template element id.- Returns:
- The template element's children as a list of RemoteBusinessObjectLight instances.
-
getTemplateSpecialElementChildren
List<TemplateObjectLight> getTemplateSpecialElementChildren(String tsElementClass, String tsElementId)
Retrieves the children of a given template special element.- Parameters:
tsElementClass
- Template special element class.tsElementId
- Template special element id.- Returns:
- The template element's children as a list of RemoteBusinessObjectLight instances.
-
getTemplateElement
TemplateObject getTemplateElement(String templateElementClass, String templateElementId) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Retrives all the information of a given template element.- Parameters:
templateElementClass
- Template element class.templateElementId
- Template element id.- Returns:
- The template element information
- Throws:
MetadataObjectNotFoundException
- If the template class does not existApplicationObjectNotFoundException
- If the template element could not be found.InvalidArgumentException
- If an attribute value can't be mapped into value.
-
copyTemplateElements
String[] copyTemplateElements(String[] sourceObjectsClassNames, String[] sourceObjectsIds, String newParentClassName, String newParentId) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException, ArraySizeMismatchException
Copy template elements within templates. Should not be used to copy entire templates.- Parameters:
sourceObjectsClassNames
- Array with the class names of the elements to be copied.sourceObjectsIds
- Array with the ids of the elements to be copied.newParentClassName
- Class of the parent of the copied objects.newParentId
- Id of the parent of the copied objects.- Returns:
- An array with the ids of the newly created elements in the same order they were provided.
- Throws:
MetadataObjectNotFoundException
- If any of the classes could not be found.ApplicationObjectNotFoundException
- If any of the source template elements could not be found.ArraySizeMismatchException
- If the arrays provided as arguments have different sizes.
-
copyTemplateSpecialElement
String[] copyTemplateSpecialElement(String[] sourceObjectsClassNames, String[] sourceObjectsIds, String newParentClassName, String newParentId) throws ArraySizeMismatchException, ApplicationObjectNotFoundException, MetadataObjectNotFoundException
Copy template special elements within templates,- Parameters:
sourceObjectsClassNames
- Array with the class names of the special elements to be copied.sourceObjectsIds
- Array with the ids of the special elements to be copied.newParentClassName
- Class of the parent of the copied objects.newParentId
- Id of the parent of the copied objects.- Returns:
- An array with the ids of the newly created special elements in the same order they were provided.
- Throws:
ArraySizeMismatchException
- If the arrays provided as arguments have different sizes.MetadataObjectNotFoundException
- If any of the classes could not be found.ApplicationObjectNotFoundException
- If any of the source template elements could not be found.
-
addObjectTofavoritesFolder
void addObjectTofavoritesFolder(String objectClass, String objectId, long favoritesFolderId, long userId) throws ApplicationObjectNotFoundException, MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Adds an object to the favorites folder- Parameters:
objectClass
- Object classobjectId
- Object idfavoritesFolderId
- favorites folder iduserId
- User Id- Throws:
ApplicationObjectNotFoundException
- If the favorites folder can not be foundMetadataObjectNotFoundException
- If the object can not be foundBusinessObjectNotFoundException
- If the object can not be foundOperationNotPermittedException
- If the object have a relationship with the favorite folderInvalidArgumentException
- If a node does not have uuid
-
removeObjectFromfavoritesFolder
void removeObjectFromfavoritesFolder(String objectClass, String objectId, long favoritesFolderId, long userId) throws ApplicationObjectNotFoundException, MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Removes an object associated to a favorites folder- Parameters:
objectClass
- Object classobjectId
- Object idfavoritesFolderId
- favorites folder iduserId
- User Id- Throws:
ApplicationObjectNotFoundException
- If the favorites folder can not be foundMetadataObjectNotFoundException
- If the object can not be foundBusinessObjectNotFoundException
- If the object can not be foundInvalidArgumentException
- If a node does not have uuid
-
createFavoritesFolderForUser
long createFavoritesFolderForUser(String name, long userId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Create a relationship between an user and a new favorites folder- Parameters:
name
- favorites folder nameuserId
- User id- Returns:
- The new favorites folder Id
- Throws:
ApplicationObjectNotFoundException
- If the user can not be foundInvalidArgumentException
- If the name is null or empty
-
deleteFavoritesFolders
void deleteFavoritesFolders(long[] favoritesFolderId, long userId) throws ApplicationObjectNotFoundException
Delete a Bookmark Folder of an User- Parameters:
favoritesFolderId
- favorites folder iduserId
- User Id- Throws:
ApplicationObjectNotFoundException
- If any favorites folder in the array can not be found
-
getFavoritesFoldersForUser
List<FavoritesFolder> getFavoritesFoldersForUser(long userId) throws ApplicationObjectNotFoundException
Get the favorites folders create by an user.- Parameters:
userId
- user id- Returns:
- List of Bookmarks folders for an User
- Throws:
ApplicationObjectNotFoundException
- If the user can not be found
-
getObjectsInFavoritesFolder
List<BusinessObjectLight> getObjectsInFavoritesFolder(long favoritesFolderId, long userId, int limit) throws ApplicationObjectNotFoundException, InvalidArgumentException
Get the object assigned to the bookmark- Parameters:
favoritesFolderId
- favorites folder idlimit
- Max number of resultsuserId
- User Id- Returns:
- List of objects related to bookmark
- Throws:
ApplicationObjectNotFoundException
- If the favorites folder can not be foundInvalidArgumentException
- If any of the object does not have uuid
-
getFavoritesFoldersForObject
List<FavoritesFolder> getFavoritesFoldersForObject(long userId, String objectClass, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Get the bookmarks where an object is associated- Parameters:
userId
- User idobjectClass
- Object classobjectId
- Object id- Returns:
- list of favorites folders where an object are an item
- Throws:
MetadataObjectNotFoundException
- If the object can not be foundBusinessObjectNotFoundException
- If the object can not be foundApplicationObjectNotFoundException
- If the object is associated to a bookmark folder but The favorites folder is not associated to the current userInvalidArgumentException
- If nodes do not have uuid
-
getFavoritesFolder
FavoritesFolder getFavoritesFolder(long favoritesFolderId, long userId) throws ApplicationObjectNotFoundException
Gets a favorites folder- Parameters:
favoritesFolderId
- favorites folder iduserId
- User id- Returns:
- The favorite folder with id
- Throws:
ApplicationObjectNotFoundException
- If the favorites folder can not be found
-
updateFavoritesFolder
void updateFavoritesFolder(long favoritesFolderId, long userId, String favoritesFolderName) throws ApplicationObjectNotFoundException, InvalidArgumentException
Updates a favorites folder- Parameters:
favoritesFolderId
- favorites folder iduserId
- User IdfavoritesFolderName
- favorites folder name- Throws:
ApplicationObjectNotFoundException
- If the favorites folder can not be foundInvalidArgumentException
- If the name of the favorites folder is null or empty
-
createBusinessRule
long createBusinessRule(String ruleName, String ruleDescription, int ruleType, int ruleScope, String appliesTo, String ruleVersion, List<String> constraints) throws InvalidArgumentException
Creates a business rule given a set of constraints- Parameters:
ruleName
- Rule nameruleDescription
- Rule descriptionruleType
- Rule type. See BusinesRule.TYPE* for possible values.ruleScope
- The scope of the rule. See BusinesRule.SCOPE* for possible values.appliesTo
- The class this rule applies to. Can not be null.ruleVersion
- The version of the rule. Useful to migrate it if necessary in further versions of the platformconstraints
- An array with the definition of the logic to be matched with the rule. Can not be empty or null- Returns:
- The id of the newly created business rule
- Throws:
InvalidArgumentException
- If any of the parameters is null (strings) or leer than 1 or if the constraints array is null or empty
-
deleteBusinessRule
void deleteBusinessRule(long businessRuleId) throws ApplicationObjectNotFoundException
Deletes a business rule- Parameters:
businessRuleId
- Rule id- Throws:
ApplicationObjectNotFoundException
- If the given rule does not exist
-
getBusinessRules
List<BusinessRule> getBusinessRules(int type)
Retrieves the business rules of a particular type.- Parameters:
type
- Rule type. See BusinesRule.TYPE* for possible values. Use -1 to retrieve all- Returns:
- The list of business rules with the matching type.
-
checkRelationshipByAttributeValueBusinessRules
void checkRelationshipByAttributeValueBusinessRules(String sourceObjectClassName, String sourceObjectId, String targetObjectClassName, String targetObjectId) throws BusinessRuleException, InvalidArgumentException
check if a relationship can be established between two objects with the attribute values defined in the rule- Parameters:
sourceObjectClassName
- The class of the element that's the subject of the rulesourceObjectId
- The id of the subject of the ruletargetObjectClassName
- The class of the element that's the object of the ruletargetObjectId
- The id of the object of the rule- Throws:
BusinessRuleException
- If the rule matches, and the involved objects don't comply with the conditions stated by the ruleInvalidArgumentException
- If the rule is malformed or can not be read.
-
getArtifactForActivity
Artifact getArtifactForActivity(long processInstanceId, long activityId) throws ApplicationObjectNotFoundException
Gets the artifact associated to an activity (for example, a form that was already filled in by a user in a previous, already committed activity)- Parameters:
processInstanceId
- The id of the process instance. This process may have been ended already.activityId
- The id of the activity the artifact belongs to- Returns:
- The artifact corresponding to the given activity
- Throws:
ApplicationObjectNotFoundException
- If the process instance or activity couldn't be found.
-
getArtifactDefinitionForActivity
ArtifactDefinition getArtifactDefinitionForActivity(long processDefinitionId, long activityDefinitionId) throws ApplicationObjectNotFoundException
Given an activity definition, returns the artifact definition associated to it- Parameters:
processDefinitionId
- The id of the process the activity is related toactivityDefinitionId
- The id of the activity- Returns:
- An object containing the artifact definition
- Throws:
ApplicationObjectNotFoundException
- If the process or the activity could not be found
-
commitActivity
void commitActivity(long processInstanceId, long activityDefinitionId, Artifact artifact) throws ApplicationObjectNotFoundException, InvalidArgumentException
Saves the artifact generated once an activity has been completed (for example, the user filled in a form).- Parameters:
processInstanceId
- The process instance the activity belongs toactivityDefinitionId
- The activity idartifact
- The artifact to be saved- Throws:
ApplicationObjectNotFoundException
- If the process could not be found or if the activity definition could not be foundInvalidArgumentException
- If the activity had been already executed, of there's a mismatch in the artifact versions or if the user is not an authorized actor to carry on with the activity
-
updateActivity
void updateActivity(long processInstanceId, long activityDefinitionId, Artifact artifact) throws ApplicationObjectNotFoundException, InvalidArgumentException
Updates the artifact generated once an activity has been completed (for example, the user filled in a form).- Parameters:
processInstanceId
- The process instance the activity belongs toactivityDefinitionId
- The activity idartifact
- The artifact to be saved- Throws:
ApplicationObjectNotFoundException
- If the process could not be found or if the activity definition could not be foundInvalidArgumentException
- If the activity had been already executed, of there's a mismatch in the artifact versions or if the user is not an authorized actor to carry on with the activity
-
getProcessInstanceActivitiesPath
List<ActivityDefinition> getProcessInstanceActivitiesPath(long processInstanceId) throws InventoryException
Gets Process Instance Activities Path- Parameters:
processInstanceId
- Process Instance Id to get path- Returns:
- The activity definition
- Throws:
InventoryException
- If the process instance cannot be found.
-
getNextActivityForProcessInstance
ActivityDefinition getNextActivityForProcessInstance(long processInstanceId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Requests for the next activity to be executed in a process instance.- Parameters:
processInstanceId
- The running process to get the next activity from- Returns:
- The activity definition
- Throws:
ApplicationObjectNotFoundException
- If the process instance could not be foundInvalidArgumentException
- If the process already ended
-
getProcessDefinition
ProcessDefinition getProcessDefinition(long processDefinitionId) throws ApplicationObjectNotFoundException
Retrieves a process definition- Parameters:
processDefinitionId
- The id of the process- Returns:
- The process definition. It contains an XML document to be parsed by the consumer
- Throws:
ApplicationObjectNotFoundException
- If the process could not be found or if it's malformed
-
getActivityDefinition
ActivityDefinition getActivityDefinition(long processDefinitionId, long activityDefinitionId)
Retrieves a process definition- Parameters:
processDefinitionId
- The id of the process definitionactivityDefinitionId
- The id of the Activity definition- Returns:
- The activity definition
-
deleteProcessDefinition
void deleteProcessDefinition(long processDefinitionId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Deletes a process definition- Parameters:
processDefinitionId
- The process definition to be deleted- Throws:
ApplicationObjectNotFoundException
- If the process definition could not be foundInvalidArgumentException
- if there are process instances related to the process definition
-
updateProcessDefinition
void updateProcessDefinition(long processDefinitionId, List<StringPair> properties, byte[] structure) throws ApplicationObjectNotFoundException, InvalidArgumentException
Updates a process definition, either its standard properties or its structure- Parameters:
processDefinitionId
- The process definition idproperties
- A key value dictionary with the standard properties to be updated. These properties are: name, description, version and enabled (use 'true' or 'false' for the latter)structure
- A byte array withe XML process definition body- Throws:
ApplicationObjectNotFoundException
- If the process definition could not be foundInvalidArgumentException
- If the structure is invalid or If one of the properties is malformed or has an unexpected name
-
createProcessDefinition
long createProcessDefinition(String name, String description, String version, boolean enabled, byte[] structure) throws InvalidArgumentException
Creates a process definition. A process definition is the metadata that defines the steps and constraints of a given project- Parameters:
name
- The name of the new process definitiondescription
- The description of the new process definitionversion
- The version of the new process definition. This is a three numbers, dot separated string (e.g. 2.4.1)enabled
- If the project is enabled to create instances from itstructure
- The structure of the process definition. It's an XML document that represents a BPMN process definition- Returns:
- The id of the newly created process definition
- Throws:
InvalidArgumentException
- If the process structure defines a malformed process or if the version is invalid
-
getProcessInstances
List<ProcessInstance> getProcessInstances(long processDefinitionId) throws ApplicationObjectNotFoundException
Gets a process instances of a process definition- Parameters:
processDefinitionId
- The process definition id- Returns:
- The process instances
- Throws:
ApplicationObjectNotFoundException
- If the process definition could not be found
-
getProcessDefinitions
@Deprecated List<ProcessDefinition> getProcessDefinitions()
Deprecated.Gets a process definition instances- Returns:
- The process instances
-
getProcessInstance
ProcessInstance getProcessInstance(long processInstanceId) throws ApplicationObjectNotFoundException
Gets a process instance- Parameters:
processInstanceId
- Process Instance Id- Returns:
- a Process Instance for the given id
- Throws:
ApplicationObjectNotFoundException
- If the process instance could not be found
-
reloadProcessDefinitions
void reloadProcessDefinitions() throws InvalidArgumentException
Updates the process definitions- Throws:
InvalidArgumentException
-
createProcessInstance
long createProcessInstance(long processDefinitionId, String processInstanceName, String processInstanceDescription) throws ApplicationObjectNotFoundException, InvalidArgumentException
Creates an instance of a process, that is, starts one- Parameters:
processDefinitionId
- The id of the process to be startedprocessInstanceName
- The name of the new processprocessInstanceDescription
- The description of the new process- Returns:
- The id of the newly created process instance
- Throws:
ApplicationObjectNotFoundException
- If the process definition could not be foundInvalidArgumentException
- If the process definition is disabled
-
deleteProcessInstance
void deleteProcessInstance(long processInstanceId) throws OperationNotPermittedException
Deletes a process instance- Parameters:
processInstanceId
- Process Instance Id- Throws:
OperationNotPermittedException
- If the process can no be deleted
-
createConfigurationVariable
long createConfigurationVariable(String configVariablesPoolId, String name, String description, int type, boolean masked, String valueDefinition) throws ApplicationObjectNotFoundException, InvalidArgumentException
Creates a configuration variable inside a pool. A configuration variable is a place where a value will be stored so it can retrieved by whomever need it. These variables are typically used to store values that help other modules to work, such as URLs, user names, dimensions, etc- Parameters:
configVariablesPoolId
- The id of the pool where the config variable will be putname
- The name of the pool. This value can not be null or empty. Duplicate variable names are not alloweddescription
- The description of the what the variable doestype
- The type of the variable. Use 1 for number, 2 for strings, 3 for booleans, 4 for unidimensional arrays and 5 for matrixes.masked
- If the value should be masked when rendered (for security reasons, for example)valueDefinition
- In most cases (primitive types like numbers, strings or booleans) will be the actual value of the variable as a string (for example "5" or "admin" or "true"). For arrays and matrixes use the following notation:
Arrays: (value1,value2,value3,valueN), matrixes: [(row1col1, row1col2,... row1colN), (row2col1, row2col2,... row2colN), (rowNcol1, rowNcol2,... rowNcolN)]. The values will be interpreted as strings- Returns:
- The id of the newly created variable
- Throws:
ApplicationObjectNotFoundException
- If the parent pool could not be foundInvalidArgumentException
- If the name is empty, the type is invalid, the value definition is empty
-
updateConfigurationVariable
void updateConfigurationVariable(String name, String propertyToUpdate, String newValue) throws InvalidArgumentException, ApplicationObjectNotFoundException
Updates the value of a configuration variable. See ##createConfigurationVariable(long, java.lang.String, java.lang.String, int, boolean, java.lang.String)
for value definition syntax- Parameters:
name
- The current name of the variable that will be modifiedpropertyToUpdate
- The name of the property to be updated. Possible values are: "name", "description", "type", "masked" and "value"newValue
- The new value as string- Throws:
InvalidArgumentException
- If the property to be updated can not be recognizedApplicationObjectNotFoundException
- If the config variable can not be found
-
deleteConfigurationVariable
void deleteConfigurationVariable(String name) throws ApplicationObjectNotFoundException
Deletes a config variable- Parameters:
name
- The name of the variable to be deleted- Throws:
ApplicationObjectNotFoundException
- If the config variable could not be found
-
getConfigurationVariable
ConfigurationVariable getConfigurationVariable(String name) throws ApplicationObjectNotFoundException
Retrieves a configuration variable- Parameters:
name
- The name of the variable to be retrieved- Returns:
- The variable
- Throws:
ApplicationObjectNotFoundException
- If the variable could not be found
-
getConfigurationVariableValue
Object getConfigurationVariableValue(String name) throws InvalidArgumentException, ApplicationObjectNotFoundException
Retrieves only the value of a configuration variable. Masked values are returned as null.- Parameters:
name
- The name of the variable. Masked values are returned as null.- Returns:
- The value of the variable as a java object/data type. The numbers are returned as floats. The arrays and matrixes are returned as
ArrayList<String>
andArrayList
instances respectively - Throws:
InvalidArgumentException
- If the value of the variable could not be successfully translated into a java type variableApplicationObjectNotFoundException
- If no configuration variable with that name could be found.
-
getConfigurationVariablesInPool
List<ConfigurationVariable> getConfigurationVariablesInPool(String poolId) throws ApplicationObjectNotFoundException
Gets the configuration variables in a configuration variable pool- Parameters:
poolId
- The id pool to retrieve the variables from- Returns:
- The list of config variables in the given pool
- Throws:
ApplicationObjectNotFoundException
- If the pool could not be found
-
getConfigurationVariablesWithPrefix
List<ConfigurationVariable> getConfigurationVariablesWithPrefix(String prefix)
Gets the configuration variables with a given prefix- Parameters:
prefix
- The prefix of the variables name- Returns:
- The list of config variables with the given prefix
-
getAllConfigurationVariables
List<ConfigurationVariable> getAllConfigurationVariables()
Gets all the configuration variables in the database, no matter what pool they belong to.- Returns:
- The list of existing configuration variables.
-
getConfigurationVariablesPools
List<InventoryObjectPool> getConfigurationVariablesPools()
Retrieves the list of pools of config variables- Returns:
- The available pools of configuration variables
-
createConfigurationVariablesPool
String createConfigurationVariablesPool(String name, String description) throws InvalidArgumentException
Creates a pool of configuration variables- Parameters:
name
- The name of the pool. Empty or null values are not alloweddescription
- The description of the pool- Returns:
- The id of the newly created pool
- Throws:
InvalidArgumentException
- If the name provided is null or empty
-
updateConfigurationVariablesPool
void updateConfigurationVariablesPool(String poolId, String propertyToUpdate, String value) throws InvalidArgumentException, ApplicationObjectNotFoundException
Updates an attribute of a given config variables pool- Parameters:
poolId
- The id of the pool to updatepropertyToUpdate
- The property to update. The valid values are "name" and "description"value
- The value of the property to be updated- Throws:
InvalidArgumentException
- If the property provided is not validApplicationObjectNotFoundException
- If the pool could not be found
-
deleteConfigurationVariablesPool
void deleteConfigurationVariablesPool(String poolId) throws ApplicationObjectNotFoundException
Deletes a configuration variables pool. Deleting a pool also deletes the config variables contained within- Parameters:
poolId
- The id of the pool to be deleted- Throws:
ApplicationObjectNotFoundException
- If the pool could not be found
-
attachFileToListTypeItem
long attachFileToListTypeItem(String name, String tags, byte[] file, String ltClass, String listTypeItemId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Relates a file to a list type item- Parameters:
name
- The name of the filetags
- The tags that describe the contents of the filefile
- The file itselfltClass
- the list type classlistTypeItemId
- The id of the list type item the file will be attached to- Returns:
- The id of the resulting file object
- Throws:
BusinessObjectNotFoundException
- If the inventory object could not be foundOperationNotPermittedException
- If there's some sort of system restriction that prevented the file to be createdMetadataObjectNotFoundException
- If the class provided does not existInvalidArgumentException
- If the file size exceeds the max permitted (default value is 10MB)
-
getFilesForListTypeItem
List<FileObjectLight> getFilesForListTypeItem(String className, String objectId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Fetches the files associated to an inventory object. Note that this call won't retrieve the actual files, but only references to them- Parameters:
className
- The class of the object whose files will be fetched fromobjectId
- The id of the object whose files will be fetched from- Returns:
- The list of files
- Throws:
BusinessObjectNotFoundException
- If the object could not be foundMetadataObjectNotFoundException
- If the class provided does not existInvalidArgumentException
- If the object id is null
-
getFile
FileObject getFile(long fileId, String className, String objectId) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Retrieves a particular file associated to an inventory list type item. This call returns the actual file- Parameters:
fileId
- The id of the file objectclassName
- The class of the object the file is associated toobjectId
- The id of the list type item the file is associated to- Returns:
- The file
- Throws:
BusinessObjectNotFoundException
- If the object could not be foundInvalidArgumentException
- If for some low level reason, the file could not be read from its original locationMetadataObjectNotFoundException
- If the class provided does not exist
-
detachFileFromListTypeItem
void detachFileFromListTypeItem(long fileId, String className, String objectId) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Releases (and deletes) a file associated to a list type item- Parameters:
fileId
- The id of the fileclassName
- The class of the list type item the file is associated toobjectId
- The id of the list type item the file is associated to- Throws:
BusinessObjectNotFoundException
- If the object could not be foundInvalidArgumentException
- If for some low level reason, the file could not be deleted from diskMetadataObjectNotFoundException
- If the class provided does not exist
-
updateFileProperties
void updateFileProperties(long fileId, List<StringPair> properties, String className, String listTypeItemId) throws BusinessObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Updates the properties of a file list type item (name or tags)- Parameters:
fileId
- The id of the fileproperties
- The set of properties as a dictionary key-value. Valid keys are "name" and "tags"className
- The class of the object the file is attached tolistTypeItemId
- The id of the list type item the file is attached to- Throws:
BusinessObjectNotFoundException
- If the list type item file is attached to could not be foundApplicationObjectNotFoundException
- If the file could not be foundInvalidArgumentException
- if any of the properties has an invalid name or if the file name is emptyMetadataObjectNotFoundException
- If the class of the object file is attached to could not be found
-
createValidatorDefinition
long createValidatorDefinition(String name, String description, String classToBeApplied, String script, boolean enabled) throws InvalidArgumentException, MetadataObjectNotFoundException
Creates a validator definition.- Parameters:
name
- The name of the validator. It's recommended to use camel case notation (for example thisIsAName). This field is mandatorydescription
- The optional description of the validatorclassToBeApplied
- The class or super class of the classes whose instances will be checked against this validatorscript
- The groovy script containing the logic of the validator , that is, theenabled
- If this validador should be applied or not- Returns:
- The id of the newly created validator definition
- Throws:
InvalidArgumentException
- If the name is null or emptyMetadataObjectNotFoundException
- If the classToBeApplied argument could not be found
-
updateValidatorDefinition
void updateValidatorDefinition(long validatorDefinitionId, String name, String description, String classToBeApplied, String script, Boolean enabled) throws ApplicationObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Updates the properties of a validator. The null values will be ignored- Parameters:
validatorDefinitionId
- The id of teh validator definition to be updatedname
- The new name, if any, null otherwisedescription
- The new description, if any, null otherwiseclassToBeApplied
- The new class to be associated to this validator, if any, null otherwisescript
- The new script, if any, null otherwiseenabled
- If the validator should be enabled or not, if any, null otherwise- Throws:
ApplicationObjectNotFoundException
- If the validator definition could not be foundMetadataObjectNotFoundException
- If the classToBeApplied parameter is not validInvalidArgumentException
- If the name is not null, but it is empty
-
getValidatorDefinitionsForClass
List<ValidatorDefinition> getValidatorDefinitionsForClass(String className)
Retrieves all the validator definitions in the system- Parameters:
className
- The class to retrieve the validator definitions from.- Returns:
- The list of validator definitions
-
getAllValidatorDefinitions
List<ValidatorDefinition> getAllValidatorDefinitions()
Gets all validator definitions, no matter what class they are related to.- Returns:
- The list of validators.
-
runValidationsForObject
List<Validator> runValidationsForObject(String objectClass, long objectId) throws BusinessObjectNotFoundException
Runs the existing validations for the class associated to the given object. Validators set to enabled = false will be ignored- Parameters:
objectClass
- The class of the objectobjectId
- The id of the object- Returns:
- The list of validators associated to the object and its class
- Throws:
BusinessObjectNotFoundException
- If the object can not be found
-
deleteValidatorDefinition
void deleteValidatorDefinition(long validatorDefinitionId) throws ApplicationObjectNotFoundException
Deletes a validator definition- Parameters:
validatorDefinitionId
- the id of the validator to be deleted- Throws:
ApplicationObjectNotFoundException
- If the validator definition could not be found
-
createOSPView
long createOSPView(String name, String description, byte[] structure) throws InvalidArgumentException
Creates an Outside Plant View- Parameters:
name
- The name of the new viewdescription
- The description of the new viewstructure
- The XML document with the contents of the view. The format of the XML document is consistent with the other views- Returns:
- The id of the newly created view
- Throws:
InvalidArgumentException
- If the name is empty.
-
getOSPView
ViewObject getOSPView(long viewId) throws ApplicationObjectNotFoundException
Retrieves the specific information about an existing OSP view- Parameters:
viewId
- The id of the view- Returns:
- An object containing the view details and structure
- Throws:
ApplicationObjectNotFoundException
- If the view could not be found
-
getOSPViews
List<ViewObjectLight> getOSPViews() throws InvalidArgumentException
Retrieves the existing OSP views- Returns:
- The list of existing OSP views
- Throws:
InvalidArgumentException
- If one of the views is malformed
-
updateOSPView
void updateOSPView(long viewId, String name, String description, byte[] structure) throws ApplicationObjectNotFoundException, InvalidArgumentException
Updates an existing OSP view- Parameters:
viewId
- The id of the viewname
- The new name of the view. Null if to remain unchangeddescription
- The new description of the view. Null if to remain unchangedstructure
- The new content of the view. Null if to remain unchanged- Throws:
ApplicationObjectNotFoundException
- If the view could not be foundInvalidArgumentException
- If the new name (if applicable) is empty
-
deleteOSPView
void deleteOSPView(long viewId) throws ApplicationObjectNotFoundException
Deletes an existing OSP view- Parameters:
viewId
- The id of the view to be deleted- Throws:
ApplicationObjectNotFoundException
- If the view could not be found
-
createFilterDefinition
long createFilterDefinition(String name, String description, String classToBeApplied, String script, boolean enabled) throws InvalidArgumentException, MetadataObjectNotFoundException
Creates a filter.- Parameters:
name
- The name of the filter. It's recommended to use camel case notation (for example thisIsAName). This field is mandatorydescription
- The optional description of the filterclassToBeApplied
- The class or super class of the classes whose instances will be checked against this filterscript
- The groovy script containing the logic of the filter , that is, theenabled
- If this filter should be applied or not- Returns:
- The id of the newly created filter definition
- Throws:
InvalidArgumentException
- If the name is null or emptyMetadataObjectNotFoundException
- If the classToBeApplied argument could not be found
-
updateFilterDefinition
void updateFilterDefinition(long filterId, String name, String description, String classToBeApplied, String script, Boolean enabled) throws ApplicationObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException, ScriptNotCompiledException
Updates the properties of a filter, null values will be ignored; when the script of the filter definition its been updated it will tries to compile the script to create a Filter instance, if the compilation fails the filter attribute in the filter definition will remains null- Parameters:
filterId
- The id of the filter definition to be updatedname
- The new name, not nulldescription
- The new description, if any, null otherwiseclassToBeApplied
- The new class to be associated to this filer, if any, null otherwisescript
- The new script, if any, null otherwiseenabled
- If the filer should be enabled or not, false by default- Throws:
ApplicationObjectNotFoundException
- If the filter definition could not be foundMetadataObjectNotFoundException
- If the classToBeApplied parameter is not validInvalidArgumentException
- If the name is not null, but it is emptyScriptNotCompiledException
- if the filter script could no be compiled due to syntax errors
-
getFilterDefinitionsForClass
List<FilterDefinition> getFilterDefinitionsForClass(String className, boolean includeParentClassesFilters, boolean ignoreCache, HashMap<String,Object> attributesToFilter, int page, int limit) throws InvalidArgumentException
For a given class retrieves all its filters definitions (also the filters of its parent classes could be included).- Parameters:
className
- The class to retrieve the filter definitions from.includeParentClassesFilters
- if the return must include the filters of the parent classignoreCache
- to avoid filters from the cache useful in filters module edition, or to get cached filters useful when retrieve filters to executeattributesToFilter
- attributes to filter the FiltersDefinition null to not filterpage
- page the number of page of number of elements to skip, -1 to not skip any resultlimit
- limit of results per page, -1 to retrieve all elements- Returns:
- The list of filter definitions
- Throws:
InvalidArgumentException
- if class name is null
-
getFilterDefinitionsForClassCount
long getFilterDefinitionsForClassCount(String className, boolean includeParentClassesFilters, boolean ignoreCache, HashMap<String,Object> attributesToFilter, int page, int limit) throws InvalidArgumentException
For a given class name returns the count of the filters definitions- Parameters:
className
- The class to retrieve the filter definitions from.includeParentClassesFilters
- if the return must include the filters of the parent classignoreCache
- to avoid filters from the cache useful in filters module edition, or to get cached filters useful when retrieve filters to executeattributesToFilter
- attributes to filter the FiltersDefinition null to not filter, attributes to filter: onlyEnabled, filter's name onlyEnabled return only the enabled filters definitions e.g for the router class, include filters created in class GenericNetworkElementpage
- page the number of page of number of elements to skip, -1 to not skip any resultlimit
- limit of results per page, -1 to retrieve all elements- Returns:
- the count of filters definitions
- Throws:
InvalidArgumentException
- if class name is null
-
getAllFilterDefinitions
List<FilterDefinition> getAllFilterDefinitions(HashMap<String,Object> attributesToFilter, int page, int limit)
Retrieves all the filters created in the inventory.- Parameters:
attributesToFilter
- attributes to filter the FiltersDefinition null to not filterpage
- page the number of page of number of elements to skip, -1 to not skip any resultlimit
- limit of results per page, -1 to retrieve all elements- Returns:
- The list of filter definitions
-
getAllFilterDefinitionsCount
long getAllFilterDefinitionsCount(HashMap<String,Object> attributesToFilter)
Counts all the Filters definition created- Parameters:
attributesToFilter
- attributes to filter the count of FiltersDefinition, null to not filter- Returns:
- the count of FiltersDefinitions
-
deleteFilterDefinition
void deleteFilterDefinition(long filterId, String className) throws InvalidArgumentException
Deletes a filter definition- Parameters:
filterId
- the id of the filter to be deletedclassName
- the class name of the filter to be deleted, used to remove the filter from the cache- Throws:
InvalidArgumentException
- If the class name parameter was send in null
-
createScriptedQueriesPool
String createScriptedQueriesPool(String name, String description) throws InvalidArgumentException, ExecutionException
Creates a scripted queries pool.- Parameters:
name
- Scripted queries pool name.description
- Scripted queries pool description.- Returns:
- The scripted queries pool id.
- Throws:
InvalidArgumentException
- If the name or description are null or empty.ExecutionException
- If the scripted queries was not created.
-
updateScriptedQueriesPool
void updateScriptedQueriesPool(String scriptedQueriesPoolId, String name, String description) throws InvalidArgumentException, ApplicationObjectNotFoundException
Updates a scripted queries pool.- Parameters:
scriptedQueriesPoolId
- Scripted queries pool id.name
- Scripted queries pool name.description
- Scripted queries pool description.- Throws:
ApplicationObjectNotFoundException
- If the scripted queries pool cannot be found.InvalidArgumentException
- If the scripted queries pool id or name is null or empty.
-
deleteScriptedQueriesPool
void deleteScriptedQueriesPool(String scriptedQueriesPoolId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Deletes a scripted queries pool.- Parameters:
scriptedQueriesPoolId
- Scripted queries pool id.- Throws:
ApplicationObjectNotFoundException
- If the scripted queries pool cannot be found.InvalidArgumentException
- If the scripted queries pool id is null or empty.
-
getScriptedQueriesPoolByName
ScriptedQueriesPool getScriptedQueriesPoolByName(String scriptedQueriesPoolName) throws InvalidArgumentException, ApplicationObjectNotFoundException
Gets a scripted queries pool given the name.- Parameters:
scriptedQueriesPoolName
- Scripted queries pool name.- Returns:
- A scripted queries pool.
- Throws:
ApplicationObjectNotFoundException
- If the scripted queries pool cannot be found.InvalidArgumentException
- If the scripted queries pool name is null or empty.
-
getScriptedQueriesPool
ScriptedQueriesPool getScriptedQueriesPool(String scriptedQueriesPoolId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Gets a scripted queries pool.- Parameters:
scriptedQueriesPoolId
- Scripted queries pool id.- Returns:
- A scripted queries pool.
- Throws:
ApplicationObjectNotFoundException
- If the scripted queries pool id.InvalidArgumentException
- If the scripted queries pool id is null or empty.
-
getScriptedQueriesPoolCount
int getScriptedQueriesPoolCount(String filterName)
Counts the scripted queries pools.- Parameters:
filterName
- Scripted queries pool name to filter.- Returns:
- The size of scripted queries pools.
-
getScriptedQueriesPools
List<ScriptedQueriesPool> getScriptedQueriesPools(String filterName, int skip, int limit)
Gets a set of scripted queries pools.- Parameters:
filterName
- Filter by scripted queries pool name.skip
- Result skiplimit
- Result limit- Returns:
- A set of scripted queries pools.
-
getScriptedQueryCountByPoolId
int getScriptedQueryCountByPoolId(String scriptedQueriesPoolId, String filterName, boolean ignoreDisabled)
Counts the scripted queries filter by name in a scripted queries pool.- Parameters:
scriptedQueriesPoolId
- Scripted queries pool id.filterName
- Filter by scripted query name.ignoreDisabled
- True to ignore disabled scripted queries.- Returns:
- The size of scripted queries.
-
getScriptedQueriesByPoolId
List<ScriptedQuery> getScriptedQueriesByPoolId(String scriptedQueriesPoolId, String filterName, boolean ignoreDisabled, int skip, int limit)
Gets a set of scripted queries in a scripted queries pool the its id.- Parameters:
scriptedQueriesPoolId
- Scripted queries pool id.filterName
- Scripted query name filter.ignoreDisabled
- True to return all scripted queries. False to return the enabled only.skip
- Result skip.limit
- Result limit.- Returns:
- A set of scripted queries in a scripted queries pool.
-
getScriptedQueryCountByPoolName
int getScriptedQueryCountByPoolName(String scriptedQueriesPoolName, String filterName) throws InvalidArgumentException, ExecutionException
Counts the scripted queries filter by name in a scripted queries pool.- Parameters:
scriptedQueriesPoolName
- Scripted queries pool name.filterName
- Scripted query name to filter.- Returns:
- The size of scripted queries
- Throws:
InvalidArgumentException
- If the scripted queries pool name is null or empty. If the filter name is null.ExecutionException
- It the scripted query count by pool name ended with errors.
-
getScriptedQueriesByPoolName
List<ScriptedQuery> getScriptedQueriesByPoolName(String scriptedQueriesPoolName, String filterName, boolean ignoreDisabled, int skip, int limit)
Gets a set of scripted queries in a scripted queries pool the its name.- Parameters:
scriptedQueriesPoolName
- Scripted queries pool name.filterName
- Scripted query name filter.ignoreDisabled
- True to return all scripted queries. False to return the enabled only.skip
- Result skip.limit
- Result limit.- Returns:
- A set of scripted queries in a scripted queries pool.
-
createScriptedQuery
String createScriptedQuery(String scriptedQueriesPoolId, String name, String description, String script, boolean enabled) throws InvalidArgumentException, ExecutionException
Creates a scripted query.- Parameters:
scriptedQueriesPoolId
- Scripted queries pool id.name
- Scripted query name.description
- Scripted query description.script
- Scripted query script.enabled
- True to enable the Scripted query.- Returns:
- The scripted query id.
- Throws:
ExecutionException
- If the scripted query was not created.InvalidArgumentException
- If the scripted queries pool id or the name are null or empty.
-
updateScriptedQuery
void updateScriptedQuery(String scriptedQueryId, String name, String description, String script, boolean enabled) throws InvalidArgumentException, ApplicationObjectNotFoundException
Updates a scripted query given its id- Parameters:
scriptedQueryId
- The scripted query idname
- New scripting query namedescription
- New scripting query descriptionscript
- New query scriptenabled
- New value, True to enable the scripting query- Throws:
ApplicationObjectNotFoundException
- If the scripted query cannot be found.InvalidArgumentException
- If the scripted query id or name are null or empty.
-
deleteScriptedQuery
void deleteScriptedQuery(String scriptedQueryId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Deletes an scripted query given the id.- Parameters:
scriptedQueryId
- The scripting query id- Throws:
ApplicationObjectNotFoundException
- If the scripted query cannot be found.InvalidArgumentException
- If the scripted query id is null or empty.
-
getScriptedQuery
ScriptedQuery getScriptedQuery(String scriptedQueryId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Gets a scripted query given its id- Parameters:
scriptedQueryId
- The scripted query id- Returns:
- A scripted query.
- Throws:
ApplicationObjectNotFoundException
- If the scripted query cannot be found.InvalidArgumentException
- If the scripted query id is null or empty.
-
getScriptedQueryCount
int getScriptedQueryCount(String filterName)
Counts the scripted queries.- Parameters:
filterName
- Scripted query name to filter.- Returns:
- The size of scripted queries
-
getScriptedQueries
List<ScriptedQuery> getScriptedQueries(String filterName, boolean ignoreDisabled, int skip, int limit)
Gets a set of scripted queries.- Parameters:
filterName
- Scripted query name to filter.ignoreDisabled
- True to return all scripted queries. False to return the enabled only.skip
- Result skiplimit
- Result limit- Returns:
- A set of scripted queries.
-
executeScriptedQuery
ScriptedQueryResult executeScriptedQuery(String scriptedQueryId, ScriptedQueryParameter... parameters) throws InvalidArgumentException, ApplicationObjectNotFoundException, ExecutionException
Executes the scripted query.- Parameters:
scriptedQueryId
- The scripted query classparameters
- The scripted query parameters- Returns:
- The result of execute the scripted query.
- Throws:
ApplicationObjectNotFoundException
- If the scripted query cannot be found.ExecutionException
- If the scripted query script cannot be execute.InvalidArgumentException
- If the scripted query id is null or empty.
-
createScriptedQueryParameter
String createScriptedQueryParameter(String scriptedQueryId, String name, String description, String type, boolean mandatory, Object defaultValue) throws InvalidArgumentException, ExecutionException
Creates a scripted query parameter.- Parameters:
scriptedQueryId
- The scripted query id.name
- The scripted query parameter namedescription
- The scripted query parameter description.type
- The scripted query parameter type.mandatory
- True scripted query parameter is mandatory.defaultValue
- The scripted query parameter default value.- Returns:
- The scripted query parameter id.
- Throws:
InvalidArgumentException
- If the scripted query id or name are null.ExecutionException
- If the scripted query parameter was not created.
-
updateScriptedQueryParameter
void updateScriptedQueryParameter(String scriptedQueryParameterId, String name, String description, String type, boolean mandatory, Object defaultValue) throws InvalidArgumentException, ApplicationObjectNotFoundException
Updates a scripted query parameter.- Parameters:
scriptedQueryParameterId
- The scripted query parameter name.name
- The scripted query parameter name.description
- The scripted query parameter description.type
- The scripted query parameter type.mandatory
- True if the scripted query parameter is mandatory.defaultValue
- The scripted query parameter default value.- Throws:
InvalidArgumentException
- If the scripted query parameter id or name are null.ApplicationObjectNotFoundException
- If the scripted query parameter cannot be found.
-
deleteScriptedQueryParameter
void deleteScriptedQueryParameter(String scriptedQueryParameterId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Deletes a scripted query parameter.- Parameters:
scriptedQueryParameterId
- The id of the scripted query parameter to delete.- Throws:
InvalidArgumentException
- If the scripted query parameter id is null.ApplicationObjectNotFoundException
- If the scripted query parameter cannot be found.
-
getScriptedQueryParameter
ScriptedQueryParameter getScriptedQueryParameter(String scriptedQueryParameterId) throws InvalidArgumentException, ApplicationObjectNotFoundException
Gets an scripted query paramter.- Parameters:
scriptedQueryParameterId
- The scripted query parameter id.- Returns:
- The scripted query parameter.
- Throws:
InvalidArgumentException
- If the scripted query parameter id is null.ApplicationObjectNotFoundException
- If the scripted query parameter cannot be found.
-
getScriptedQueryParameters
List<ScriptedQueryParameter> getScriptedQueryParameters(String scriptedQueryId) throws InvalidArgumentException
Gets the scripted query parameters.- Parameters:
scriptedQueryId
- The scripted query id.- Returns:
- The scripted query parameters.
- Throws:
InvalidArgumentException
- If the scripted query id is null.
-
-