Class BusinessEntityManagerImpl
- java.lang.Object
-
- org.neotropic.kuwaiba.core.persistence.reference.neo4j.BusinessEntityManagerImpl
-
- All Implemented Interfaces:
AbstractEntityManager,BusinessEntityManager
@Service public class BusinessEntityManagerImpl extends Object implements BusinessEntityManager
Business entity manager reference implementation (using Neo4J as backend).- Author:
- Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBusinessEntityManagerImpl.AttributeDefinitionSetThis class wraps a set of attribute definitions necessary to create objects with default values
-
Constructor Summary
Constructors Constructor Description BusinessEntityManagerImpl()Main constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParentToSpecialObject(String specialObjectClass, String specialObjectId, String parentClass, String parentId)Breaks the special hierarchy to enable special children to have more than one parent.longattachFileToObject(String name, String tags, byte[] file, String className, String objectId)Relates a file to an inventory objectbooleancanDeleteObject(String className, String oid)Checks recursively if it's safe to delete a single objectString[]copyObjects(String targetClassName, String targetOid, HashMap<String,List<String>> objects, boolean recursive)Copy a set of objectsStringcopyPoolItem(String poolId, String poolItemClassName, String poolItemId, boolean recursive)Copy a pool item from a pool to another poolString[]copySpecialObjects(String targetClassName, String targetOid, HashMap<String,List<String>> objects, boolean recursive)Copy a set of special objects (this is used to copy objects when they are containment are set in the special containment hierarchy) use case: to move physical links into a wire ContainerlongcountChildren(String objectClass, String objectId)Counts if an object has childrenlongcountSpecialChildren(String objectClass, String objectId)Counts if an object has special childrenString[]createBulkObjects(String className, String parentClassName, String parentOid, String namePattern, String templateId)Creates multiple objects using a given name patternString[]createBulkSpecialObjects(String className, String parentClassName, String parentId, String namePattern, String templateId)Creates multiple special objects using a given name patternlongcreateClassLevelReport(String className, String reportName, String reportDescription, String script, int outputType, boolean enabled)Creates a class level report (a report that will be available for all instances of a given class -and its subclasses-)StringcreateContact(String contactClass, String customerClassName, String customerId, String userName)Creates a contact.Contacts are always associated to a customerStringcreateHeadlessObject(String className, HashMap<String,String> attributes, String templateId)Creates an object without parent.longcreateInventoryLevelReport(String reportName, String reportDescription, String script, int outputType, boolean enabled, List<StringPair> parameters)Creates an inventory level report (a report that is not tied to a particlar instance or class.StringcreateObject(String className, String parentClassName, String parentOid, HashMap<String,String> attributes, String templateId)Creates a new inventory objectStringcreateObject(String className, String parentClassName, HashMap<String,String> attributes, String templateId, String criteria)Creates an objectorg.neo4j.graphdb.NodecreateObject(org.neo4j.graphdb.Node classNode, ClassMetadata classToMap, HashMap<String,String> attributes)StringcreatePoolItem(String poolId, String className, HashMap<String,String> attributes, String templateId)Creates an object inside a poolStringcreateSpecialObject(String className, String parentClassName, String parentOid, HashMap<String,String> attributes, String templateId)Creates a new inventory object for a domain specific model (where the standard containment rules don't apply)HashMap<String,String>createSpecialObjectUsingTemplate(String className, String parentClassName, String parentOid, HashMap<String,String> attributes, String templateId)Equal toBusinessEntityManager.createSpecialObject(java.lang.String, java.lang.String, java.lang.String, java.util.HashMap, java.lang.String)but the return is a map of ids.voidcreateSpecialRelationship(String aObjectClass, String aObjectId, String bObjectClass, String bObjectId, String name, boolean unique)Creates a relationship between two elements and labels it.voidcreateSpecialRelationship(String aObjectClass, String aObjectId, String bObjectClass, String bObjectId, String name, boolean unique, HashMap<String,Object> properties)This method creates a special relationship with a set of property valuesvoiddeleteContact(String contactClass, String contactId, String userName)Deletes a contactvoiddeleteObject(String className, String oid, boolean releaseRelationships)Deletes a single objectvoiddeleteObjects(HashMap<String,List<String>> objects, boolean releaseRelationships)Deletes a set of objectsChangeDescriptordeleteReport(long reportId)Deletes a reportvoiddetachFileFromObject(long fileObjectId, String className, String objectId)Releases (and deletes) a file associated to an inventory objectbyte[]executeClassLevelReport(String objectClassName, String objectId, long reportId)Executes a class level report and returns the result.byte[]executeInventoryLevelReport(long reportId, List<StringPair> parameters)Executes an inventory level report and returns the result.List<BusinessObjectLightList>findRoutesThroughSpecialRelationships(String objectAClassName, String objectAId, String objectBClassName, String objectBId, String relationshipName)Finds all possible routes between two given inventory objectsList<AnnotatedBusinessObjectLight>getAnnotatedSpecialAttribute(String objectClass, String objectId, String specialAttributeName)This method will extract the object at the other side of the special relationship and all the properties of the relationship itselfStringgetAttributeValueAsString(String objectClass, String objectId, String attributeName)Utility method that returns the value of an attribute of a given object as a string.HashMap<String,String>getAttributeValuesAsString(String objectClass, String objectId)Fetches the attributes of an inventory object (and their values) and returns them as strings.List<BusinessObject>getChildrenOfClass(String parentOid, String parentClass, String classToFilter, int page, int maxResults)Gets the direct children of a given object of a given class.List<BusinessObjectLight>getChildrenOfClassLight(String parentOid, String parentClass, String classToFilter, int maxResults)Same as getChildrenOfClass, but returns only the light version of the objectsList<BusinessObjectLight>getChildrenOfClassLightRecursive(String parentOid, String parentClass, String classToFilter, HashMap<String,String> attributesToFilter, int page, int limit)Gets all class and abstract class children of a given class to filter in a hierarchy with root in the given parent.List<ReportMetadataLight>getClassLevelReports(String className, boolean recursive, boolean includeDisabled)Gets the class level reports associated to the given class (or its superclasses)BusinessObjectLightgetCommonParent(String aObjectClass, String aOid, String bObjectClass, String bOid)Finds the common parent between two objects.ContactgetContact(String contactClass, String contactId)Gets the entire information of a given contactList<BusinessObjectLight>getContactResources(String contactClass, String contactId)Retrieves the list of resources (inventory objects) related to a contact.List<Contact>getContacts(int page, int limit, HashMap<String,Object> filters)Retrieves the list of contacts that matches the search criteriaList<Contact>getContactsForCustomer(String customerClass, String customerId)Retrieves the list of contacts associated to a customerFileObjectgetFile(long fileObjectId, String className, String objectId)Retrieves a particular file associated to an inventory object.List<FileObjectLight>getFilesForObject(String className, String objectId)Fetches the files associated to an inventory object.Map<BusinessObjectLight,List<FileObjectLight>>getFilesFromRelatedListTypeItems(String uuid)Retrieves a map with the files related to the list type item attributes of the given objectBusinessObjectgetFirstParentOfClass(String objectClassName, String oid, String objectToMatchClassName)Gets the first occurrence of a parent with a given class (according to the special and standard containment hierarchy) (for example "give me the parent of this port until you find the nearest rack")org.neo4j.graphdb.NodegetInstanceOfClass(long classId, String oid)Boiler-plate code.org.neo4j.graphdb.NodegetInstanceOfClass(String className, String oid)Boiler-plate code.org.neo4j.graphdb.NodegetInstanceOfClass(org.neo4j.graphdb.Node classNode, String oid)List<ReportMetadataLight>getInventoryLevelReports(boolean includeDisabled)Gets the inventory class reports.List<BusinessObjectLight>getMultipleParents(String objectId)Gets the parents of an object that breaks the containment rule of having only one parent.BusinessObjectgetObject(String className, String oid)Gets the detailed information about an objectList<BusinessObjectLight>getObjectChildren(long classId, String oid, int maxResults)Gets the children of a given object, providing the class and object id.List<BusinessObjectLight>getObjectChildren(String className, String oid, int maxResults)Gets the children of a given objectList<BusinessObjectLight>getObjectChildren(String className, String oid, HashMap<String,String> filters, long skip, long limit)Get a set of children to the given the parent class name and id.longgetObjectChildrenCount(String className, String oid, HashMap<String,String> filters)Get the child count given the parent class name and id.BusinessObjectLightgetObjectLight(String className, String oid)Gets the simplified information about an objectList<BusinessObjectLight>getObjectsByNameAndClassName(List<String> names, int skip, int limit, String... clasessToFilter)Gets a set of objects by its exact names and class names, used to know if an object with the same its already created in the inventory e.g.List<BusinessObjectLight>getObjectsLight(HashMap<String,String> ids)Retrieves a list of objects based on the provided UUIDs.List<BusinessObject>getObjectsOfClass(String className, int maxResults)Recursively gets all the instances of given classList<BusinessObjectLight>getObjectsOfClassLight(String className, long skip, long limit)Recursively gets all the light instances of given class, without filters.List<BusinessObjectLight>getObjectsOfClassLight(String className, HashMap<String,String> filters, long skip, long limit)Recursively gets all the light instances of given classList<BusinessObjectLight>getObjectSpecialChildren(String objectClass, String objectId)Gets the special children of a given objectlonggetObjectSpecialChildrenCount(String objectClass, String objectId, String... childrenClassNamesToFilter)Gets the special children of a given objectList<BusinessObjectLight>getObjectSpecialChildrenWithFilters(String objectClass, String objectId, List<String> childrenClassNamesToFilter, int page, int limit)Gets the special children of a given objectList<BusinessObject>getObjectsWithFilter(String className, String filterName, String filterValue)Same asBusinessEntityManager.getObjectsWithFilterLight(java.lang.String, java.lang.String, java.lang.String), but returns the full information about the objects involvedList<BusinessObjectLight>getObjectsWithFilterLight(String className, String filterName, String filterValue)Retrieves a list of light instances of a given class given a simple filter.BusinessObjectLightgetParent(String objectClass, String oid)Gets the parent of a given object in the containment hierarchyList<BusinessObjectLight>getParents(String objectClassName, String oid)Retrieves recursively the list of parents of an object in the containment hierarchyList<BusinessObjectLight>getParentsUntilFirstOfClass(String objectClass, String oid, String... objectToMatchClassNames)Gets the list of parents (according to the special and standard containment hierarchy) until it finds an instance of class objectToMatchClassName (for example "give me the parents of this port until you find the nearest rack")BusinessObjectLightgetPhysicalNodeToObjectInWarehouse(String objectClassName, String objectId)Gets the physical node of a warehouse itemInventoryObjectPoolgetPool(String poolId)Gets a pool by its idList<BusinessObjectLight>getPoolItems(String poolId, int limit)Retrieves the list of objects from a poolList<BusinessObjectLight>getPoolItemsByClassName(String poolId, String className, int page, int limit)Retrieves the list of objects from a poollonggetPoolItemsCount(String poolId, String className)Count the total of objects in a poolList<InventoryObjectPool>getPoolsInObject(String objectClassName, String objectId, String poolClass)Retrieves the pools associated to a particular objectList<InventoryObjectPool>getPoolsInPool(String parentPoolId, String poolClassName)Retrieves the pools associated to a particular poollonggetPoolsInPoolCount(String parentPoolId, String poolClassName)Retrieves the total count of pools associated to a particular poolReportMetadatagetReport(long reportId)Gets the information related to a class level report.List<InventoryObjectPool>getRootPools(String className, int type, boolean includeSubclasses)Retrieves the pools that don't have any parent and are normally intended to be managed by the Pool ManagerList<BusinessObjectLight>getSiblings(String className, String oid, int maxResults)Gets the siblings of a given object in the containment hierarchyList<BusinessObjectLight>getSpecialAttribute(String objectClass, String objectId, String specialAttributeName)Gets the value of a special attribute.HashMap<String,List<BusinessObjectLight>>getSpecialAttributes(String className, String objectId, String... attributeNames)Returns the specified special relationships of a given object as a hashmap whose keys are the names of the relationships and the values the list of related objects.List<BusinessObjectLight>getSpecialChildrenOfClassLight(String parentOid, String parentClass, String classToFilter, int maxResults)Returns the special children of a given object as RemoteBusinessObjectLight instances.This method is not recursive.List<BusinessObjectLight>getSpecialChildrenOfClassLightRecursive(String parentOid, String parentClass, String classToFilter, int maxResults)Gets all class and abstract class special children of a given class to filter in a hierarchy with root in the given parent.List<BusinessObjectLight>getSuggestedChildrenWithFilter(String parentClass, String parentId, String filter, boolean ignoreSpecialChildren, int skip, int limit, String... clasessToFilter)Gets a set of suggested children with filter (no recursive).List<BusinessObjectLight>getSuggestedObjectsWithFilter(String filter, int limit)Suggests a number of objects based on a search string.List<BusinessObjectLight>getSuggestedObjectsWithFilter(String filter, int skip, int limit, String... clasessToFilter)Gets a set of suggested objects with filter.List<BusinessObjectLight>getSuggestedObjectsWithFilter(String filter, String superClass, int limit)Same asBusinessEntityManager.getSuggestedObjectsWithFilter(java.lang.String, int), but the results will be instances of the super class provided or one of its subclasses.HashMap<String,List<BusinessObjectLight>>getSuggestedObjectsWithFilterGroupedByClassName(List<String> classesNamesToFilter, String filter, long classesSkip, long classesLimit, long objectSkip, long objectLimit)Suggests a number of objects based on a search string.HashMap<String,List<InventoryObjectPool>>getSuggestedPoolsByName(List<String> classesNamesToFilter, String nameTofilter, long poolSkip, long poolLimit, long objectSkip, long objectLimit)Suggests a number of pools based on a search string (the pool name).List<BusinessObjectLight>getWarehousesInObject(String objectClassName, String objectId)Gets the warehouses in a objectBusinessObjectLightgetWarehouseToObject(String objectClassName, String objectId)Gets warehouse related to objectbooleanhasRelationship(String objectClass, String objectId, String relationshipName, int numberOfRelationships)Checks if an object has a given number of standard relationships with another objectbooleanhasSpecialAttribute(String objectClass, String objectId, String attributeName)Check if an object has a given special attribute.booleanhasSpecialRelationship(String objectClass, String objectId, String relationshipName, int numberOfRelationships)Checks if an object has a given number of special relationships with another objectvoidinitCache()This optional method clears and builds the cache components needed in the current entity manager.booleanisParent(String parentClass, String parentId, String childClass, String childId)Checks if a given object is parent to another, according to the standard or special containment hierarchy.voidmoveObjects(String targetClassName, String targetOid, HashMap<String,String[]> objects)Move a list of objects to a new parent: this methods ignores those who can't be moved and raises an OperationNotPermittedException, however, it will move those which can be movedvoidmoveObjectsToPool(String targetClassName, String targetOid, HashMap<String,String[]> objects)Move a list of objects to a new parent: this methods ignores those who can't be moved and raises an OperationNotPermittedException, however, it will move those which can be movedvoidmovePoolItem(String poolId, String poolItemClassName, String poolItemId)Move a pool item from a pool to another poolvoidmoveSpecialObjects(String targetClassName, String targetOid, HashMap<String,String[]> objects)Move a list of objects to a new parent(taking into account the special hierarchy containment): this methods ignores those who can't be moved and raises an OperationNotPermittedException, however, it will move those which can be movedvoidrelateObjectToContact(String objectClass, String objectId, String contactClass, String contactId, String userName)Relates an inventory object to a contact.voidreleaseObjectFromContact(String objectClass, String objectId, String contactClass, String contactId, String userName)Releases an inventory object from a contact.voidreleaseRelationships(String objectClass, String objectId, List<String> relationshipsToRelease)Releases all the relationships with the given names associated to the object provided.voidreleaseSpecialRelationship(String objectClass, String objectId, String otherObjectId, String name)Release all special relationships with a given namevoidreleaseSpecialRelationshipInTargetObject(String objectClass, String objectId, String relationshipName, String targetId)Release all special relationships with a given name whose target object id matches with the one providedList<Contact>searchForContacts(String searchString, int maxResults)Searches in all the properties of a contact for a given stringvoidsetConfiguration(Properties configuration)Configuration variables (usually, yet not necessarily read from a config file) that will be used to process some calls (for example file paths or constants).voidupdateContact(String contactClass, String contactId, List<StringPair> properties, String userName)Updates a contact's informationvoidupdateFileProperties(long fileObjectId, List<StringPair> properties, String className, String objectId)Updates the properties of a file object (name or tags)ChangeDescriptorupdateObject(String className, String oid, HashMap<String,String> attributes)Updates an object attributes.ChangeDescriptorupdateReport(long reportId, String reportName, String reportDescription, Boolean enabled, Integer type, String script)Updates the properties of an existing class level report.ChangeDescriptorupdateReportParameters(long reportId, List<StringPair> parameters)Updates the parameters of a report
-
-
-
Method Detail
-
initCache
public void initCache()
Description copied from interface:AbstractEntityManagerThis optional method clears and builds the cache components needed in the current entity manager.- Specified by:
initCachein interfaceAbstractEntityManager
-
setConfiguration
public void setConfiguration(Properties configuration)
Description copied from interface:AbstractEntityManagerConfiguration variables (usually, yet not necessarily read from a config file) that will be used to process some calls (for example file paths or constants).- Specified by:
setConfigurationin interfaceAbstractEntityManager- Parameters:
configuration- The set of properties. Each EM should document its variables and what are their default values.
-
createObject
public String createObject(String className, String parentClassName, String parentOid, HashMap<String,String> attributes, String templateId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates a new inventory object- Specified by:
createObjectin interfaceBusinessEntityManager- Parameters:
className- Name of the class which this object will be instantiated fromparentClassName- Parent object class name. If null, the parent will be the DummyRoot nodeparentOid- Parent's oid. If -1, the parent will be the DummyRoot nodeattributes- Attributes to be set by default in the new object. It's a HashMap where the keys are the attribute names and the values, the values for such attributes. Note that binary type attributes can't be set here.templateId- Template id to be used to create the current object. Template values can be overridden if "attributeValues" is not empty. Use an empty string or null to not use a Template.- Returns:
- The object's id
- Throws:
BusinessObjectNotFoundException- Thrown if the parent id is not foundOperationNotPermittedException- If there's a business constraint that doesn't allow to create the object.MetadataObjectNotFoundException- Thrown if the object's class can't be foundInvalidArgumentException- If any of the attribute values has an invalid value or format.ApplicationObjectNotFoundException- If the specified template could not be found
-
createObject
public String createObject(String className, String parentClassName, HashMap<String,String> attributes, String templateId, String criteria) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException, OperationNotPermittedException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates an object- Specified by:
createObjectin interfaceBusinessEntityManager- Parameters:
className- Class the object will be instance ofparentClassName- Class of the parent the object will be instance of. Use root for the navigation treeattributes- Dictionary with the names and the values of the attributes to be set.templateId- The id of the template to be used to create this object. This id was probably retrieved by {@link ApplicationEntityManager.getTemplatesForClass(String)} before. Use a null or empty string to not use a template.criteria- Criteria to search for the parent. This is a string with two parts: One is the name of the attribute and the other its value, both separated by a fixed colon :. Example: name:Colombia- Returns:
- The id of the new object.
- Throws:
MetadataObjectNotFoundException- Thrown if the object's class can't be foundBusinessObjectNotFoundException- Thrown if the parent id is not foundInvalidArgumentException- If any of the attribute values has an invalid value or format.OperationNotPermittedException- If there's a business constraint that doesn't allow to create the object.ApplicationObjectNotFoundException- If the specified template could not be found.
-
createSpecialObject
public String createSpecialObject(String className, String parentClassName, String parentOid, HashMap<String,String> attributes, String templateId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates a new inventory object for a domain specific model (where the standard containment rules don't apply)- Specified by:
createSpecialObjectin interfaceBusinessEntityManager- Parameters:
className- Name of the class which this object will be instantiated fromparentClassName- Parent object class nameparentOid- Parent's oidattributes- Attributes to be set by default in the new object. It's a HashMap where the keys are the attribute names and the values, the values for such attributes. Note that binary type attributes can't be set here.templateId- The id of the template to be used to create this object. This id was probably retrieved by {@link ApplicationEntityManager.getTemplatesForClass(String)} before. Use a null or empty string to not use a template.- Returns:
- The id of the new object.
- Throws:
BusinessObjectNotFoundException- Thrown if the parent id is not foundMetadataObjectNotFoundException- Thrown if the object's class can't be foundInvalidArgumentException- If any of the attribute values has an invalid value or format.ApplicationObjectNotFoundException- If the specified template could not be found.
-
createSpecialObjectUsingTemplate
public HashMap<String,String> createSpecialObjectUsingTemplate(String className, String parentClassName, String parentOid, HashMap<String,String> attributes, String templateId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerEqual toBusinessEntityManager.createSpecialObject(java.lang.String, java.lang.String, java.lang.String, java.util.HashMap, java.lang.String)but the return is a map of ids. Creates a new inventory object for a domain specific model (where the standard containment rules don't apply)- Specified by:
createSpecialObjectUsingTemplatein interfaceBusinessEntityManager- Parameters:
className- Name of the class which this object will be instantiated fromparentClassName- Parent object class nameparentOid- Parent's oidattributes- Attributes to be set by default in the new object. It's a HashMap where the keys are the attribute names and the values, the values for such attributes. Note that binary type attributes can't be set here.templateId- The id of the template to be used to create this object. This id was probably retrieved by {@link ApplicationEntityManager.getTemplatesForClass(String)} before. Use a null or empty string to not use a template.- Returns:
- The id of the new object.
- Throws:
BusinessObjectNotFoundException- Thrown if the parent id is not foundOperationNotPermittedException- If the update can't be performed due to a format issueMetadataObjectNotFoundException- Thrown if the object's class can't be foundInvalidArgumentException- If any of the attribute values has an invalid value or format.ApplicationObjectNotFoundException- If the specified template could not be found.
-
addParentToSpecialObject
public void addParentToSpecialObject(String specialObjectClass, String specialObjectId, String parentClass, String parentId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerBreaks the special hierarchy to enable special children to have more than one parent.- Specified by:
addParentToSpecialObjectin interfaceBusinessEntityManager- Parameters:
specialObjectClass- Special object class namespecialObjectId- Special Object IdparentClass- Parent Object classparentId- Parent Object id- Throws:
BusinessObjectNotFoundExceptionOperationNotPermittedExceptionMetadataObjectNotFoundExceptionInvalidArgumentException
-
createHeadlessObject
public String createHeadlessObject(String className, HashMap<String,String> attributes, String templateId) throws OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates an object without parent. This might be particularly useful for complex models. Use it carefully to avoid leaving orphan objects. Always provide custom methods to delete- Specified by:
createHeadlessObjectin interfaceBusinessEntityManager- Parameters:
className- The class name of the object to be created.attributes- The initial set of attributes (as pairs attribute name - value) to be set. These values will override those in the template used (if any).templateId- The id of the template to be used to create the object. Use null or an empty string to not use any template.- Returns:
- The id of the newly created object.
- Throws:
OperationNotPermittedException- If the class provided is marked as in design or it is abstract.MetadataObjectNotFoundException- If the class provided does not exist.InvalidArgumentException- If the format of any of the default attributes provided is incorrect.ApplicationObjectNotFoundException- If the template provided does not exist.
-
createPoolItem
public String createPoolItem(String poolId, String className, HashMap<String,String> attributes, String templateId) throws ApplicationObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates an object inside a pool- Specified by:
createPoolItemin interfaceBusinessEntityManager- Parameters:
poolId- Parent pool idclassName- Class this object is going to be instance ofattributes- The list of attributes to be set initially. The values are serialized objects.templateId- The id of the template to be used to create this object. This id was probably retrieved by {@link ApplicationEntityManager.getTemplatesForClass(String)} before. Use a null or empty string to not use a template.- Returns:
- the id of the newly created object
- Throws:
ApplicationObjectNotFoundException- If the parent pool can't be foundInvalidArgumentException- If any of the attributes or its type is invalidMetadataObjectNotFoundException- If the class name could not be found
-
createBulkObjects
public String[] createBulkObjects(String className, String parentClassName, String parentOid, String namePattern, String templateId) throws MetadataObjectNotFoundException, OperationNotPermittedException, BusinessObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates multiple objects using a given name pattern- Specified by:
createBulkObjectsin interfaceBusinessEntityManager- Parameters:
className- The class name for the new objectsparentClassName- The parent class name for the new objectsparentOid- The object id of the parentnamePattern- A pattern to create the names for the new objectstemplateId- a template id for the objects creation, it could be null if no template is required- Returns:
- An arrays of ids for the new objects
- Throws:
MetadataObjectNotFoundException- If the className or the parentClassName can not be found.OperationNotPermittedException- If the className is not a possible children of parentClassName. If the className is not in design or are abstract. If the className is not an InventoryObject.BusinessObjectNotFoundException- If the parent node can not be found.InvalidArgumentException- If the given name pattern not match with the regular expression to build the new object name.ApplicationObjectNotFoundException- if the given template id does not exist.
-
createBulkSpecialObjects
public String[] createBulkSpecialObjects(String className, String parentClassName, String parentId, String namePattern, String templateId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates multiple special objects using a given name pattern- Specified by:
createBulkSpecialObjectsin interfaceBusinessEntityManager- Parameters:
className- The class name for the new special objectsparentClassName- The parent class name for the new special objectsparentId- The object id of the parentnamePattern- A pattern to create the names for the new special objectstemplateId- The id of the template to be used for the set of objects to be created. Used null for none.- Returns:
- An array of ids for the new special objects
- Throws:
MetadataObjectNotFoundException- If the className or the parentClassName can not be found.BusinessObjectNotFoundException- If the parent node can not be found.OperationNotPermittedException- If the className is not a possible special children of parentClassName. If the className is not in design or are abstract. If the className is not an InventoryObject.InvalidArgumentException- If the given name pattern not match with the regular expression to build the new object name.ApplicationObjectNotFoundException- If the provided template could not be found.
-
getObject
public BusinessObject getObject(String className, String oid) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the detailed information about an object- Specified by:
getObjectin interfaceBusinessEntityManager- Parameters:
className- Object class nameoid- Object's oid- Returns:
- A detailed representation of the requested object
- Throws:
BusinessObjectNotFoundException- If the requested object can't be foundMetadataObjectNotFoundException- If the className class can't be foundInvalidArgumentException- If the object id can not be found.
-
getObjectLight
public BusinessObjectLight getObjectLight(String className, String oid) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the simplified information about an object- Specified by:
getObjectLightin interfaceBusinessEntityManager- Parameters:
className- Object class nameoid- Object's oid- Returns:
- A detailed representation of the requested object
- Throws:
BusinessObjectNotFoundException- If the requested object can't be foundMetadataObjectNotFoundException- If the className class can't be foundInvalidArgumentException- If the oid is null
-
getObjectsLight
public List<BusinessObjectLight> getObjectsLight(HashMap<String,String> ids) throws BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves a list of objects based on the provided UUIDs.- Specified by:
getObjectsLightin interfaceBusinessEntityManager- Parameters:
ids- A HashMap containing UUIDs as keys and their corresponding className as values. These UUIDs are used to match against the inventory objects in the database.- Returns:
- A list of BusinessObjectLightinstances representing the found objects.
- Throws:
BusinessObjectNotFoundException- If no objects corresponding to the provided UUIDs are found.InvalidArgumentException- If the provided UUIDs are null or empty.
-
getObjectsWithFilterLight
public List<BusinessObjectLight> getObjectsWithFilterLight(String className, String filterName, String filterValue) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves a list of light instances of a given class given a simple filter. This method will search for all objects with a string-based attribute (filterName) whose value matches a value provided (filterValue)- Specified by:
getObjectsWithFilterLightin interfaceBusinessEntityManager- Parameters:
className- The class of the objects to be searched. This method support abstract superclasses as wellfilterName- The attribute to be used as filter. This will work only with String-type attributes. Example: serialNumber. To list type attributes the filter must be applied to the name. Example: filterName: model, filterValue: XYZfilterValue- The value to be use to match the instances. Example "Serial-12345"- Returns:
- The list of instances that matches the filterName/filterValue criteria
- Throws:
InvalidArgumentException- If the uuid attribute could not be found in the result nodes
-
getObjectsWithFilter
public List<BusinessObject> getObjectsWithFilter(String className, String filterName, String filterValue) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerSame asBusinessEntityManager.getObjectsWithFilterLight(java.lang.String, java.lang.String, java.lang.String), but returns the full information about the objects involved- Specified by:
getObjectsWithFilterin interfaceBusinessEntityManager- Parameters:
className- The class of the objects to be searched. This method support abstract superclasses as wellfilterName- The attribute to be used as filter. This will work only with String-type attributes. Example: serialNumber. To list type attributes the filter must be applied to the name. Example: filterName: model, filterValue: XYZfilterValue- The value to be use to match the instances. Example "Serial-12345"- Returns:
- The list of instances that matches the filterName/filterValue criteria
- Throws:
InvalidArgumentException- If it's not possible to construct the RemoteBusinessObjects from the information in the database
-
getSuggestedObjectsWithFilter
public List<BusinessObjectLight> getSuggestedObjectsWithFilter(String filter, int limit)
Description copied from interface:BusinessEntityManagerSuggests a number of objects based on a search string. The search string is matched against the name of the object, its class name or its class display name.- Specified by:
getSuggestedObjectsWithFilterin interfaceBusinessEntityManager- Parameters:
filter- The string to use as search filter.limit- The limit of results. Use -1 to retrieve all.- Returns:
- A list of up to #
limitsuggested objects matching the criteria, alphabetically sorted.
-
getSuggestedObjectsWithFilter
public List<BusinessObjectLight> getSuggestedObjectsWithFilter(String filter, String superClass, int limit)
Description copied from interface:BusinessEntityManagerSame asBusinessEntityManager.getSuggestedObjectsWithFilter(java.lang.String, int), but the results will be instances of the super class provided or one of its subclasses. In reality, this method could do the same asBusinessEntityManager.getSuggestedObjectsWithFilter(java.lang.String, int)withsuperClassset toInventoryObject, but the implementation of both methods may differ significantly in terms of performance and complexity.- Specified by:
getSuggestedObjectsWithFilterin interfaceBusinessEntityManager- Parameters:
filter- The search stringsuperClass- The results will be instances of this class or one of its subclasseslimit- The limit of results. Use -1 to retrieve all- Returns:
- A list of up to #
limitsuggested objects matching the criteria, alphabetically sorted
-
getSuggestedObjectsWithFilter
public List<BusinessObjectLight> getSuggestedObjectsWithFilter(String filter, int skip, int limit, String... clasessToFilter)
Description copied from interface:BusinessEntityManagerGets a set of suggested objects with filter.- Specified by:
getSuggestedObjectsWithFilterin interfaceBusinessEntityManager- Parameters:
filter- a possible part of the name of an object(s) or class(es).skip- The number of leading suggested objects to skip.limit- The number of suggested objects the result should be limited to.clasessToFilter- The suggested objects will be instance of this classes or subclasses.- Returns:
- List of suggested objects.
-
getObjectsByNameAndClassName
public List<BusinessObjectLight> getObjectsByNameAndClassName(List<String> names, int skip, int limit, String... clasessToFilter) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets a set of objects by its exact names and class names, used to know if an object with the same its already created in the inventory e.g. an IP address or a subnet in the ipam module can not be repeated- Specified by:
getObjectsByNameAndClassNamein interfaceBusinessEntityManager- Parameters:
names- the exact names of the objectsskip- the pagelimit- the limit per pageclasessToFilter- class names of the objects- Returns:
- a list of objects
- Throws:
InvalidArgumentException
-
getSuggestedChildrenWithFilter
public List<BusinessObjectLight> getSuggestedChildrenWithFilter(String parentClass, String parentId, String filter, boolean ignoreSpecialChildren, int skip, int limit, String... clasessToFilter)
Description copied from interface:BusinessEntityManagerGets a set of suggested children with filter (no recursive).- Specified by:
getSuggestedChildrenWithFilterin interfaceBusinessEntityManager- Parameters:
parentClass- The parent class name.parentId- The parent id.filter- Filter children (no recursive) by name or class.ignoreSpecialChildren- True to ignore special children in the suggested children (no recursive).skip- The number of leading children to skip.limit- The number of children the result should be limited to.clasessToFilter- The suggested children will be instance of this classes or subclasses.- Returns:
- List of suggested children (no recursive).
-
getAttributeValueAsString
public String getAttributeValueAsString(String objectClass, String objectId, String attributeName) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerUtility method that returns the value of an attribute of a given object as a string. In date-type attributes, it will return the formatted dated, while in list types, it will return the name of the linked element- Specified by:
getAttributeValueAsStringin interfaceBusinessEntityManager- Parameters:
objectClass- The class of the objectobjectId- The id of the objectattributeName- The attribute whose value will be retrieved- Returns:
- The value of the requested attribute. Null values are possible
- Throws:
MetadataObjectNotFoundException- If the class of the object could not be foundBusinessObjectNotFoundException- If the object itself could not be foundInvalidArgumentException- Check with the data model integrity, because this would mean that a the type of the attribute should be a list type, but it's notApplicationObjectNotFoundException- Check with the data model integrity, because this would mean that a list type item related to the object is not an instance of the right list type class
-
getAttributeValuesAsString
public HashMap<String,String> getAttributeValuesAsString(String objectClass, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerFetches the attributes of an inventory object (and their values) and returns them as strings. This is useful mainly to display property sheets and reports, so it's not necessary to always check if an attribute is a list type and retrieve its string representation- Specified by:
getAttributeValuesAsStringin interfaceBusinessEntityManager- Parameters:
objectClass- The class of the objectobjectId- The id of the object- Returns:
- A dictionary with the name of the attributes and their values represented as strings
- Throws:
MetadataObjectNotFoundException- If the class of the object could not be foundBusinessObjectNotFoundException- If the object itself could not be foundInvalidArgumentException- Check with the data model integrity, because this would mean that a the type of the attribute should be a list type, but it's notApplicationObjectNotFoundException- Check with the data model integrity, because this would mean that a list type item related to the object is not an instance of the right list type class
-
getCommonParent
public BusinessObjectLight getCommonParent(String aObjectClass, String aOid, String bObjectClass, String bOid) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerFinds the common parent between two objects.- Specified by:
getCommonParentin interfaceBusinessEntityManager- Parameters:
aObjectClass- Object A class name.aOid- Object A id.bObjectClass- Object B class name.bOid- Object B id.- Returns:
- The common parent or null if none.
- Throws:
BusinessObjectNotFoundException- If any of the objects could not be found.MetadataObjectNotFoundException- If any of the classes provided could not be found.InvalidArgumentException- If the database object could not be properly mapped into a serializable Java object.
-
getParent
public BusinessObjectLight getParent(String objectClass, String oid) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the parent of a given object in the containment hierarchy- Specified by:
getParentin interfaceBusinessEntityManager- Parameters:
objectClass- Object classoid- Object id- Returns:
- The immediate parent. Null if the parent is null. A dummy object with id -1 if the parent is DummyRoot
- Throws:
BusinessObjectNotFoundException- If the requested object can't be foundMetadataObjectNotFoundException- If any of the class nodes involved is malformedInvalidArgumentException- If the database object could not be properly mapped into a serializable java object.
-
getParents
public List<BusinessObjectLight> getParents(String objectClassName, String oid) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves recursively the list of parents of an object in the containment hierarchy- Specified by:
getParentsin interfaceBusinessEntityManager- Parameters:
objectClassName- Object classoid- Object id- Returns:
- The list of parents
- Throws:
BusinessObjectNotFoundException- If the object does not existMetadataObjectNotFoundException- If the class can not be foundInvalidArgumentException- If the oid is null
-
getParentsUntilFirstOfClass
public List<BusinessObjectLight> getParentsUntilFirstOfClass(String objectClass, String oid, String... objectToMatchClassNames) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the list of parents (according to the special and standard containment hierarchy) until it finds an instance of class objectToMatchClassName (for example "give me the parents of this port until you find the nearest rack")- Specified by:
getParentsUntilFirstOfClassin interfaceBusinessEntityManager- Parameters:
objectClass- Class of the object to get the parents fromoid- Id of the object to get the parents fromobjectToMatchClassNames- Classes of the objects that will limit the search. It can be a superclass, if you want to match many classes at once- Returns:
- The list of parents until an instance of objectToMatchClassName is found. If no instance of that class is found, all parents until the Dummy Root will be returned
- Throws:
BusinessObjectNotFoundException- If the object to evaluate can not be foundMetadataObjectNotFoundException- If any of the classes provided could not be foundApplicationObjectNotFoundException- If the object provided is not in the standard containment hierarchyInvalidArgumentException- If the oid is null
-
getFirstParentOfClass
public BusinessObject getFirstParentOfClass(String objectClassName, String oid, String objectToMatchClassName) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the first occurrence of a parent with a given class (according to the special and standard containment hierarchy) (for example "give me the parent of this port until you find the nearest rack")- Specified by:
getFirstParentOfClassin interfaceBusinessEntityManager- Parameters:
objectClassName- Class of the object to get the parent fromoid- Id of the object to get the parent fromobjectToMatchClassName- Class of the object that will limit the search. It can be a superclass, if you want to match many classes at once- Returns:
- The the first occurrence of a parent with a given class. If no instance of that class is found, the child of Dummy Root related in this hierarchy will be returned
- Throws:
BusinessObjectNotFoundException- If the object to evaluate can not be foundMetadataObjectNotFoundException- If any of the classes provided could not be foundApplicationObjectNotFoundException- If the object provided is not in the standard containment hierarchyInvalidArgumentException- If the oid is null
-
getMultipleParents
public List<BusinessObjectLight> getMultipleParents(String objectId) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the parents of an object that breaks the containment rule of having only one parent. For example the links and containers in the Outside Plant Module.- Specified by:
getMultipleParentsin interfaceBusinessEntityManager- Parameters:
objectId- Object Id.- Returns:
- The set of parents.
- Throws:
InvalidArgumentException- If the object id is null.
-
isParent
public boolean isParent(String parentClass, String parentId, String childClass, String childId) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerChecks if a given object is parent to another, according to the standard or special containment hierarchy.- Specified by:
isParentin interfaceBusinessEntityManager- Parameters:
parentClass- Alleged parent Class Name.parentId- Alleged parent id.childClass- Child Class Name.childId- Child Id.- Returns:
- True if the given parent has the given child (according to the special and standard containment hierarchy)
- Throws:
InvalidArgumentException
-
deleteObjects
public void deleteObjects(HashMap<String,List<String>> objects, boolean releaseRelationships) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerDeletes a set of objects- Specified by:
deleteObjectsin interfaceBusinessEntityManager- Parameters:
objects- a hashmap where the class name is the key and the value is a list of long containing the ids of the objects to be deleted that are instance of the key classreleaseRelationships- If all the relationships should be release upon deleting the objects. If false, an OperationNotPermittedException will be raised if the object has incoming relationships.- Throws:
BusinessObjectNotFoundException- If the requested object can't be foundMetadataObjectNotFoundException- If the requested object class can't be foundOperationNotPermittedException- If the update can't be performed due a business rule or because the object is blocked or it has relationships and releaseRelationships is falseInvalidArgumentException- If the uuid can not be found
-
deleteObject
public void deleteObject(String className, String oid, boolean releaseRelationships) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerDeletes a single object- Specified by:
deleteObjectin interfaceBusinessEntityManager- Parameters:
className- Object's class nameoid- Objects oidreleaseRelationships- Release relationships automatically. If set to false, it will fail if the object already has incoming relationships- Throws:
BusinessObjectNotFoundException- If the object couldn't be foundMetadataObjectNotFoundException- If the class could not be foundOperationNotPermittedException- If the object could not be deleted because there's some business rules that avoids it or it has incoming relationships.InvalidArgumentException- If the oid is null
-
updateObject
public ChangeDescriptor updateObject(String className, String oid, HashMap<String,String> attributes) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerUpdates an object attributes. Note that you can't set binary attributes through this method. Use setBinaryAttributes instead.- Specified by:
updateObjectin interfaceBusinessEntityManager- Parameters:
className- Object class nameoid- Object's oidattributes- The attributes to be updated (the key is the attribute name, the value is and array with the value -or values in case of MANY TO MANY list type attributes-)- Returns:
- The summary of the changes that were made
- Throws:
MetadataObjectNotFoundException- If the object class can't be foundBusinessObjectNotFoundException- If the object can't be foundOperationNotPermittedException- If the update can't be performed due a business rule or because the object is blockedInvalidArgumentException- If any of the names provided does not exist or can't be set using this method or of the value of any of the attributes can not be mapped correctly or if the class provided is not a subclass ofInventoryObject.
-
createSpecialRelationship
public void createSpecialRelationship(String aObjectClass, String aObjectId, String bObjectClass, String bObjectId, String name, boolean unique) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCreates a relationship between two elements and labels it. Use with extreme care, since it can create arbitrary relationships- Specified by:
createSpecialRelationshipin interfaceBusinessEntityManager- Parameters:
aObjectClass- a side object classaObjectId- a side object idbObjectClass- b side object classbObjectId- b side object idname- Name to label the new relationshipunique- If there could be only one relationship between both elements with that name- Throws:
BusinessObjectNotFoundException- If any of the objects can't be foundOperationNotPermittedException- if any of the objects involved can't be connected (i.e. if it's not an inventory object)MetadataObjectNotFoundException- if any of the classes provided can not be foundInvalidArgumentException- If the a/bObjectId are null
-
createSpecialRelationship
public void createSpecialRelationship(String aObjectClass, String aObjectId, String bObjectClass, String bObjectId, String name, boolean unique, HashMap<String,Object> properties) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerThis method creates a special relationship with a set of property values- Specified by:
createSpecialRelationshipin interfaceBusinessEntityManager- Parameters:
aObjectClass- The class of the first object to relatedaObjectId- The id of the first object to relatedbObjectClass- The class of the second object to relatedbObjectId- The id of the first object to relatedname- The name of the relationshipunique- If there could be only one relationship between both elements with that nameproperties- A hash with the set of properties and their respective values- Throws:
BusinessObjectNotFoundException- If any of the objects can not be foundOperationNotPermittedException- If, due to a business rule, the objects can not be relatedMetadataObjectNotFoundException- If any of the classes specified does not existInvalidArgumentException- If the a/bObjectId are null
-
releaseSpecialRelationship
public void releaseSpecialRelationship(String objectClass, String objectId, String otherObjectId, String name) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRelease all special relationships with a given name- Specified by:
releaseSpecialRelationshipin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- Object idotherObjectId- The object we want to be released from. -1 To all objects related with relationships with that namename- Relationship name- Throws:
BusinessObjectNotFoundException- If the object can not be foundMetadataObjectNotFoundException- If the class can not be foundInvalidArgumentException- If objectId or otherObjectId are null
-
releaseSpecialRelationshipInTargetObject
public void releaseSpecialRelationshipInTargetObject(String objectClass, String objectId, String relationshipName, String targetId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRelease all special relationships with a given name whose target object id matches with the one provided- Specified by:
releaseSpecialRelationshipInTargetObjectin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- Object idrelationshipName- Relationship nametargetId- Id of the object at the end of the relationship- Throws:
BusinessObjectNotFoundException- If the object can not be foundMetadataObjectNotFoundException- If the class can not be foundInvalidArgumentException- If the object/targetId are null
-
moveObjectsToPool
public void moveObjectsToPool(String targetClassName, String targetOid, HashMap<String,String[]> objects) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerMove a list of objects to a new parent: this methods ignores those who can't be moved and raises an OperationNotPermittedException, however, it will move those which can be moved- Specified by:
moveObjectsToPoolin interfaceBusinessEntityManager- Parameters:
targetClassName- Parent's class nametargetOid- Parent's oidobjects- Map using the object class name as keys and the respective objects oids as values- Throws:
BusinessObjectNotFoundException- If the object or its new parent can't be foundOperationNotPermittedException- If the update can't be performed due to a business ruleMetadataObjectNotFoundException- If the object's or new parent's class can't be foundInvalidArgumentException- If inventory object/pool does no have uuid
-
moveObjects
public void moveObjects(String targetClassName, String targetOid, HashMap<String,String[]> objects) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerMove a list of objects to a new parent: this methods ignores those who can't be moved and raises an OperationNotPermittedException, however, it will move those which can be moved- Specified by:
moveObjectsin interfaceBusinessEntityManager- Parameters:
targetClassName- Parent's class nametargetOid- Parent's oidobjects- Map using the object class name as keys and the respective objects oids as values- Throws:
BusinessObjectNotFoundException- If the object or its new parent can't be foundOperationNotPermittedException- If the update can't be performed due to a business ruleMetadataObjectNotFoundException- If the object's or new parent's class can't be foundInvalidArgumentException- If inventory object/pool does not have uuid
-
moveSpecialObjects
public void moveSpecialObjects(String targetClassName, String targetOid, HashMap<String,String[]> objects) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerMove a list of objects to a new parent(taking into account the special hierarchy containment): this methods ignores those who can't be moved and raises an OperationNotPermittedException, however, it will move those which can be moved- Specified by:
moveSpecialObjectsin interfaceBusinessEntityManager- Parameters:
targetClassName- Parent's class nametargetOid- Parent's oidobjects- Map using the object class name as keys and the respective objects oids as values- Throws:
BusinessObjectNotFoundException- If the object or its new parent can't be foundOperationNotPermittedException- If the update can't be performed due to a business ruleMetadataObjectNotFoundException- If the object's or new parent's class can't be foundInvalidArgumentException- If an inventory object/pool does not have uuid
-
movePoolItem
public void movePoolItem(String poolId, String poolItemClassName, String poolItemId) throws ApplicationObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerMove a pool item from a pool to another pool- Specified by:
movePoolItemin interfaceBusinessEntityManager- Parameters:
poolId- The id of the pool nodepoolItemClassName- The class name for the pool itempoolItemId- The id for the pool item- Throws:
ApplicationObjectNotFoundException- If the pool node can not be foundInvalidArgumentException- If the pool item can not be move to the selected poolBusinessObjectNotFoundException- If the pool item can not be foundMetadataObjectNotFoundException- If the pool item class name can no be found
-
copyObjects
public String[] copyObjects(String targetClassName, String targetOid, HashMap<String,List<String>> objects, boolean recursive) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCopy a set of objects- Specified by:
copyObjectsin interfaceBusinessEntityManager- Parameters:
targetClassName- Target parent's class nametargetOid- Target parent's oidobjects- Hashmap with the objects class names as keys and their oids as valuesrecursive- If this operation should also copy the children objects recursively- Returns:
- A list containing the newly created object ids
- Throws:
BusinessObjectNotFoundException- If any of the template objects couldn't be foundOperationNotPermittedException- If the target parent can't contain any of the new instancesMetadataObjectNotFoundException- If any of the provided classes couldn't be foundInvalidArgumentException- If an inventory object id is null
-
copySpecialObjects
public String[] copySpecialObjects(String targetClassName, String targetOid, HashMap<String,List<String>> objects, boolean recursive) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCopy a set of special objects (this is used to copy objects when they are containment are set in the special containment hierarchy) use case: to move physical links into a wire Container- Specified by:
copySpecialObjectsin interfaceBusinessEntityManager- Parameters:
targetClassName- Target parent's class nametargetOid- Target parent's oidobjects- Hashmap with the objects class names as keys and their oids as valuesrecursive- If this operation should also copy the children objects recursively- Returns:
- A list containing the newly created object ids
- Throws:
BusinessObjectNotFoundException- If any of the template objects couldn't be foundMetadataObjectNotFoundException- If any of the provided classes couldn't be foundInvalidArgumentException- If the objects can not be copied to the specified parent (most likely due to containment restrictions).
-
copyPoolItem
public String copyPoolItem(String poolId, String poolItemClassName, String poolItemId, boolean recursive) throws ApplicationObjectNotFoundException, InvalidArgumentException, BusinessObjectNotFoundException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerCopy a pool item from a pool to another pool- Specified by:
copyPoolItemin interfaceBusinessEntityManager- Parameters:
poolId- The id of the pool nodepoolItemClassName- The class name for the pool itempoolItemId- The id for the pool itemrecursive- If this operation should also copy the children objects recursively- Returns:
- The newly created object id
- Throws:
ApplicationObjectNotFoundException- If the pool node can not be foundInvalidArgumentException- If the pool item can not be move to the selected poolBusinessObjectNotFoundException- If the pool item can not be foundMetadataObjectNotFoundException- If the pool item class name can no be found
-
getObjectChildren
public List<BusinessObjectLight> getObjectChildren(String className, String oid, int maxResults) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the children of a given object- Specified by:
getObjectChildrenin interfaceBusinessEntityManager- Parameters:
className- Object's class nameoid- Object's oidmaxResults- max number of children to be returned, -1 to return all- Returns:
- The list of children
- Throws:
BusinessObjectNotFoundException- If the object or its new parent can't be foundMetadataObjectNotFoundException- If the object's can't be foundInvalidArgumentException- If oid is null
-
getObjectChildren
public List<BusinessObjectLight> getObjectChildren(long classId, String oid, int maxResults) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the children of a given object, providing the class and object id.- Specified by:
getObjectChildrenin interfaceBusinessEntityManager- Parameters:
classId- The id of the class the object is instance ofoid- The oid of the objectmaxResults- The max number of results to be retrieved. Use 0 to retrieve all- Returns:
- The list of children.
- Throws:
BusinessObjectNotFoundException- If the object could not be found.MetadataObjectNotFoundException- If the class could not be found.InvalidArgumentException- If the oid is null
-
getSiblings
public List<BusinessObjectLight> getSiblings(String className, String oid, int maxResults) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the siblings of a given object in the containment hierarchy- Specified by:
getSiblingsin interfaceBusinessEntityManager- Parameters:
className- Object classoid- Object oidmaxResults- Max number of results to be returned- Returns:
- List of siblings
- Throws:
MetadataObjectNotFoundException- If the class does not existBusinessObjectNotFoundException- If the object does not existInvalidArgumentException- If the oid is null
-
getObjectsOfClassLight
public List<BusinessObjectLight> getObjectsOfClassLight(String className, HashMap<String,String> filters, long skip, long limit) throws InvalidArgumentException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerRecursively gets all the light instances of given class- Specified by:
getObjectsOfClassLightin interfaceBusinessEntityManager- Parameters:
className- Class name. It must be a subclass of InventoryObjectfilters- map of filters key: attribute name, value: attribute valueskip- page or number of elements to skiplimit- max count of child per page- Returns:
- a set of instances of the class
- Throws:
InvalidArgumentException- If the class name is nullMetadataObjectNotFoundException- If the provided class name doesn't exists
-
getObjectsOfClassLight
public List<BusinessObjectLight> getObjectsOfClassLight(String className, long skip, long limit) throws InvalidArgumentException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerRecursively gets all the light instances of given class, without filters.- Specified by:
getObjectsOfClassLightin interfaceBusinessEntityManager- Parameters:
className- Class name. It must be a subclass of InventoryObjectskip- page or number of elements to skiplimit- max count of child per page- Returns:
- a set of instances of the class
- Throws:
InvalidArgumentException- If the class name is nullMetadataObjectNotFoundException- If the provided class name doesn't exists
-
getObjectsOfClass
public List<BusinessObject> getObjectsOfClass(String className, int maxResults) throws MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRecursively gets all the instances of given class- Specified by:
getObjectsOfClassin interfaceBusinessEntityManager- Parameters:
className- Class name. It mist be a subclass of InventoryObjectmaxResults- Max number of results. 0 to get all- Returns:
- a list of instances
- Throws:
MetadataObjectNotFoundException- if the class can not be foundInvalidArgumentException- If the class is not subclass of InventoryObject
-
getChildrenOfClass
public List<BusinessObject> getChildrenOfClass(String parentOid, String parentClass, String classToFilter, int page, int maxResults) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the direct children of a given object of a given class.- Specified by:
getChildrenOfClassin interfaceBusinessEntityManager- Parameters:
parentOid- parent idparentClass- Parent classclassToFilter- Class to be match againstpage- the number of page of the number of elements to skipmaxResults- max number of results. 0 to get all- Returns:
- A list of children of parentid/parentClass instance that are instances of classToFilter.
- Throws:
MetadataObjectNotFoundException- If any of the classes can not be foundBusinessObjectNotFoundException- If parent object can not be foundInvalidArgumentException- If the database objects can not be correctly mapped into serializable Java objects.
-
getSpecialChildrenOfClassLight
public List<BusinessObjectLight> getSpecialChildrenOfClassLight(String parentOid, String parentClass, String classToFilter, int maxResults) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerReturns the special children of a given object as RemoteBusinessObjectLight instances.This method is not recursive.- Specified by:
getSpecialChildrenOfClassLightin interfaceBusinessEntityManager- Parameters:
parentOid- The id of the parent objectparentClass- The class name of the parent objectclassToFilter- The superclass/class to be used to filter the results. You can also use abstract superclasses.maxResults- The max number of results to fetch. Use -1 to retrieve all- Returns:
- The list of special children of the given object, filtered using classToFilter
- Throws:
MetadataObjectNotFoundException- If the parent class name provided could not be foundBusinessObjectNotFoundException- If the parent object could not be foundInvalidArgumentException- If the filter class is invalid.
-
getChildrenOfClassLightRecursive
public List<BusinessObjectLight> getChildrenOfClassLightRecursive(String parentOid, String parentClass, String classToFilter, HashMap<String,String> attributesToFilter, int page, int limit) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets all class and abstract class children of a given class to filter in a hierarchy with root in the given parent. i.e.: all the ports in Router, all the Routers in a City- Specified by:
getChildrenOfClassLightRecursivein interfaceBusinessEntityManager- Parameters:
parentOid- Object id of the root parent of the hierarchyparentClass- Class name of the root parent of the hierarchyclassToFilter- Class name of the expected childrenattributesToFilter- if filtering by the attributes of the retrieved objectspage- The page or the number of elements to skip, no pagination -1limit- Maximum number of results, -1 no limit- Returns:
- The list of object instance of the given class to filter
- Throws:
MetadataObjectNotFoundException- If the parent class is not foundBusinessObjectNotFoundException- If the parent is not foundInvalidArgumentException- If the parent Id is null
-
getSpecialChildrenOfClassLightRecursive
public List<BusinessObjectLight> getSpecialChildrenOfClassLightRecursive(String parentOid, String parentClass, String classToFilter, int maxResults) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets all class and abstract class special children of a given class to filter in a hierarchy with root in the given parent. Use case: used in some class level and inventory level reports script- Specified by:
getSpecialChildrenOfClassLightRecursivein interfaceBusinessEntityManager- Parameters:
parentOid- Object id of the root parent of the hierarchyparentClass- Class name of the root parent of the hierarchyclassToFilter- Class name of the expected childrenmaxResults- Maximum number of results, -1 no limit- Returns:
- The list of object instance of the given class to filter
- Throws:
MetadataObjectNotFoundException- If the parent class is not foundBusinessObjectNotFoundException- If the parent is not foundInvalidArgumentException- If the parent Id is null
-
getChildrenOfClassLight
public List<BusinessObjectLight> getChildrenOfClassLight(String parentOid, String parentClass, String classToFilter, int maxResults) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerSame as getChildrenOfClass, but returns only the light version of the objects- Specified by:
getChildrenOfClassLightin interfaceBusinessEntityManager- Parameters:
parentOid- parent idparentClass- Parent classclassToFilter- Class to be match againstmaxResults- max number of results. 0 to get all- Returns:
- A list of children of parentid/parentClass instance, instances of classToFilter
- Throws:
MetadataObjectNotFoundException- If any of the classes can not be foundBusinessObjectNotFoundException- If parent object can not be foundInvalidArgumentException- If the parent object id is null
-
getSpecialAttribute
public List<BusinessObjectLight> getSpecialAttribute(String objectClass, String objectId, String specialAttributeName) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the value of a special attribute. A special attribute is one belonging to a business domain specific attribute (usually a model. Domain specific attribute information is not filed under the standard metadata but a special one. Implementations may vary)- Specified by:
getSpecialAttributein interfaceBusinessEntityManager- Parameters:
objectClass- object's classobjectId- object's idspecialAttributeName- Special attribute name- Returns:
- A list of objects related to the object through a special relationship. An empty array if the object provided is not related to others using that relationship.
- Throws:
BusinessObjectNotFoundException- if the object can not be foundMetadataObjectNotFoundException- if either the object class or the attribute can not be foundInvalidArgumentException- If the object id is null
-
getAnnotatedSpecialAttribute
public List<AnnotatedBusinessObjectLight> getAnnotatedSpecialAttribute(String objectClass, String objectId, String specialAttributeName) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerThis method will extract the object at the other side of the special relationship and all the properties of the relationship itself- Specified by:
getAnnotatedSpecialAttributein interfaceBusinessEntityManager- Parameters:
objectClass- The class of the object whose special attribute will be retrieved fromobjectId- The object's idspecialAttributeName- The name of the special attribute- Returns:
- The list of elements related with such relationship plus the properties of theirs relationships
- Throws:
BusinessObjectNotFoundException- If the object could not be foundMetadataObjectNotFoundException- If the object class could not be foundInvalidArgumentException- If the object id is null
-
getSpecialAttributes
public HashMap<String,List<BusinessObjectLight>> getSpecialAttributes(String className, String objectId, String... attributeNames) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerReturns the specified special relationships of a given object as a hashmap whose keys are the names of the relationships and the values the list of related objects. If no filter (attributeNames) is provided, all special attributes (relationships) will be returned- Specified by:
getSpecialAttributesin interfaceBusinessEntityManager- Parameters:
className- Object classobjectId- Object IdattributeNames- The list of special attributes (relationships) to be fetched. if none provided, the method will return all of them.- Returns:
- The hash map with the existing special relationships and the associated objects
- Throws:
MetadataObjectNotFoundException- If the class provided does not existBusinessObjectNotFoundException- if the object does not existInvalidArgumentException- If the object id is null
-
getObjectSpecialChildren
public List<BusinessObjectLight> getObjectSpecialChildren(String objectClass, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the special children of a given object- Specified by:
getObjectSpecialChildrenin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- object id- Returns:
- The list of special children.
- Throws:
MetadataObjectNotFoundException- If the class could not be foundBusinessObjectNotFoundException- If the object could not be found.InvalidArgumentException- If the object id is null
-
getObjectSpecialChildrenWithFilters
public List<BusinessObjectLight> getObjectSpecialChildrenWithFilters(String objectClass, String objectId, List<String> childrenClassNamesToFilter, int page, int limit) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the special children of a given object- Specified by:
getObjectSpecialChildrenWithFiltersin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- object idpage- the number of results to skip or the page- Returns:
- The list of special children.
- Throws:
MetadataObjectNotFoundException- If the class could not be foundBusinessObjectNotFoundException- If the object could not be found.InvalidArgumentException- If the object id is null
-
getObjectSpecialChildrenCount
public long getObjectSpecialChildrenCount(String objectClass, String objectId, String... childrenClassNamesToFilter) throws BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the special children of a given object- Specified by:
getObjectSpecialChildrenCountin interfaceBusinessEntityManagerobjectId- object id- Returns:
- The list of special children.
- Throws:
BusinessObjectNotFoundException- If the object could not be found.InvalidArgumentException- If the object id is null
-
hasRelationship
public boolean hasRelationship(String objectClass, String objectId, String relationshipName, int numberOfRelationships) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerChecks if an object has a given number of standard relationships with another object- Specified by:
hasRelationshipin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- Object idrelationshipName- Relationship namenumberOfRelationships- Number of relationships- Returns:
- True if the object has numberOfRelationships relationships with another object
- Throws:
BusinessObjectNotFoundException- If the object can not be foundMetadataObjectNotFoundException- If objectClass does not existInvalidArgumentException- If the object id is null
-
hasSpecialAttribute
public boolean hasSpecialAttribute(String objectClass, String objectId, String attributeName) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCheck if an object has a given special attribute.- Specified by:
hasSpecialAttributein interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- Object idattributeName- Attribute name- Returns:
- True if the object has special attributes
- Throws:
MetadataObjectNotFoundExceptionBusinessObjectNotFoundExceptionInvalidArgumentException
-
countChildren
public long countChildren(String objectClass, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCounts if an object has children- Specified by:
countChildrenin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- Object id- Returns:
- Number of children
- Throws:
MetadataObjectNotFoundExceptionBusinessObjectNotFoundExceptionInvalidArgumentException
-
countSpecialChildren
public long countSpecialChildren(String objectClass, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCounts if an object has special children- Specified by:
countSpecialChildrenin interfaceBusinessEntityManager- Returns:
- Number of special children
- Throws:
MetadataObjectNotFoundExceptionBusinessObjectNotFoundExceptionInvalidArgumentException
-
releaseRelationships
public void releaseRelationships(String objectClass, String objectId, List<String> relationshipsToRelease) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerReleases all the relationships with the given names associated to the object provided. If no relationships with such names exist, the method will do nothing. Use this method with extreme care, you can seriously affect the relational integrity of the system- Specified by:
releaseRelationshipsin interfaceBusinessEntityManager- Parameters:
objectClass- The class of the target objectobjectId- The id of the target objectrelationshipsToRelease- An array with the relationships to be released- Throws:
MetadataObjectNotFoundException- If the class provided does not existBusinessObjectNotFoundException- If the object could not be foundInvalidArgumentException- If any of the relationships is now allowed according to the defined data model
-
hasSpecialRelationship
public boolean hasSpecialRelationship(String objectClass, String objectId, String relationshipName, int numberOfRelationships) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerChecks if an object has a given number of special relationships with another object- Specified by:
hasSpecialRelationshipin interfaceBusinessEntityManager- Parameters:
objectClass- Object classobjectId- Object idrelationshipName- Relationship namenumberOfRelationships- Number of relationships- Returns:
- True if the object has numberOfRelationships relationships with another object
- Throws:
BusinessObjectNotFoundException- If the object can not be foundMetadataObjectNotFoundException- if objectClass does not existInvalidArgumentException- If the object id is null
-
createContact
public String createContact(String contactClass, String customerClassName, String customerId, String userName) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates a contact.Contacts are always associated to a customer- Specified by:
createContactin interfaceBusinessEntityManager- Parameters:
contactClass- Class of the contact. This class should always be a subclass of GenericContactcustomerClassName- The class of the customer this contact will be associated tocustomerId- The id of the customer this contact will be associated touserName- The user name of the session- Returns:
- The id of the newly created contact
- Throws:
BusinessObjectNotFoundException- If the customer could not be foundInvalidArgumentException- If any of the properties or its value is invalidMetadataObjectNotFoundException- If the customer class could not be foundApplicationObjectNotFoundException- If the object activity log could no be found
-
updateContact
public void updateContact(String contactClass, String contactId, List<StringPair> properties, String userName) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerUpdates a contact's information- Specified by:
updateContactin interfaceBusinessEntityManager- Parameters:
contactClass- The class of the contactcontactId- The id of the contactproperties- The attributes to be updated. The list types require only the id of the linked list type as a stringuserName- The user name of the session- Throws:
BusinessObjectNotFoundException- If the contact could not be foundInvalidArgumentException- If any of the properties or its value is invalidMetadataObjectNotFoundException- If the contact class could not be foundApplicationObjectNotFoundException- If the object activity log could no be found
-
deleteContact
public void deleteContact(String contactClass, String contactId, String userName) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerDeletes a contact- Specified by:
deleteContactin interfaceBusinessEntityManager- Parameters:
contactClass- The class of the contactcontactId- The id of the contactuserName- The user name of the session- Throws:
BusinessObjectNotFoundException- If the contact could not be foundInvalidArgumentException- If the name is empty or there's an attempt to change the creationDateMetadataObjectNotFoundException- If the class could not be foundApplicationObjectNotFoundException- If the object activity log could no be found
-
getContact
public Contact getContact(String contactClass, String contactId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the entire information of a given contact- Specified by:
getContactin interfaceBusinessEntityManager- Parameters:
contactClass- The class of the contactcontactId- The id of the contact- Returns:
- the contact
- Throws:
BusinessObjectNotFoundException- If the contact could not be foundMetadataObjectNotFoundException- If the contact class could not be foundInvalidArgumentException- If the contact is malformed and the customer it should be related to does not exist
-
getContactsForCustomer
public List<Contact> getContactsForCustomer(String customerClass, String customerId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the list of contacts associated to a customer- Specified by:
getContactsForCustomerin interfaceBusinessEntityManager- Parameters:
customerClass- The class of the customer the contacts belong tocustomerId- The id of the customer the contacts belong to- Returns:
- The list of contacts
- Throws:
BusinessObjectNotFoundException- If the customer could not be foundMetadataObjectNotFoundException- If the customer class could not be foundInvalidArgumentException- If an error occurs while building the contact objects
-
searchForContacts
public List<Contact> searchForContacts(String searchString, int maxResults) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerSearches in all the properties of a contact for a given string- Specified by:
searchForContactsin interfaceBusinessEntityManager- Parameters:
searchString- The string to be matchedmaxResults- The max number of results. Use -1 to retrieve al results- Returns:
- The list of contacts that matches the search criteria
- Throws:
InvalidArgumentException- If an error occurs while building the contact objects
-
getContacts
public List<Contact> getContacts(int page, int limit, HashMap<String,Object> filters) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the list of contacts that matches the search criteria- Specified by:
getContactsin interfaceBusinessEntityManager- Parameters:
page- current pagelimit- limit of results per page. -1 to retrieve them allfilters- The response may be filtered by customer (use keycustomer, value the customer name, a String) by type (use keytype, value the type name, a String) by contact name (use keycontact_name, value the contact name, a String) by contact email1 (use keycontact_email1, value the contact email1, a String) by contact email2 (use keycontact_email2, value the contact email2, a String)- Returns:
- The list of contacts that matches the search criteria
- Throws:
InvalidArgumentException- If an error occurs while building the contact objects
-
relateObjectToContact
public void relateObjectToContact(String objectClass, String objectId, String contactClass, String contactId, String userName) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerRelates an inventory object to a contact.- Specified by:
relateObjectToContactin interfaceBusinessEntityManager- Parameters:
objectClass- The class of the object.objectId- The id of the object.contactClass- The class of the contact.contactId- The id of the contact.userName- The user name of the session.- Throws:
BusinessObjectNotFoundException- If any of the objects can't be found.OperationNotPermittedException- If any of the objects involved can't be connected (i.e. if it's not an inventory object).MetadataObjectNotFoundException- If any of the classes provided can not be found.InvalidArgumentException- If the a/b ObjectId are null.ApplicationObjectNotFoundException- If the object activity log could not be found.
-
releaseObjectFromContact
public void releaseObjectFromContact(String objectClass, String objectId, String contactClass, String contactId, String userName) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException, ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerReleases an inventory object from a contact.- Specified by:
releaseObjectFromContactin interfaceBusinessEntityManager- Parameters:
objectClass- The class of the object.objectId- The id of the object.contactClass- The class of the contact.contactId- The id of the contact.userName- The user name of the session.- Throws:
BusinessObjectNotFoundException- If the object can not be found.MetadataObjectNotFoundException- If the class can not be found.InvalidArgumentException- If contactId or objectId are null.ApplicationObjectNotFoundException- If the object activity log could no be found.
-
getContactResources
public List<BusinessObjectLight> getContactResources(String contactClass, String contactId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the list of resources (inventory objects) related to a contact.- Specified by:
getContactResourcesin interfaceBusinessEntityManager- Parameters:
contactClass- The class of the contact.contactId- The id of the contact.- Returns:
- List of related resources.
- Throws:
BusinessObjectNotFoundException- If the contact can't be found.MetadataObjectNotFoundException- If the contract class provided can't be found.InvalidArgumentException- If the contact is not subclass of GenericContact.
-
attachFileToObject
public long attachFileToObject(String name, String tags, byte[] file, String className, String objectId) throws BusinessObjectNotFoundException, OperationNotPermittedException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRelates a file to an inventory object- Specified by:
attachFileToObjectin interfaceBusinessEntityManager- Parameters:
name- The name of the filetags- The tags that describe the contents of the filefile- The file itselfclassName- The class of the object the file will be attached toobjectId- The id of the object 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)
-
getFilesForObject
public List<FileObjectLight> getFilesForObject(String className, String objectId) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerFetches the files associated to an inventory object. Note that this call won't retrieve the actual files, but only references to them- Specified by:
getFilesForObjectin interfaceBusinessEntityManager- 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
public FileObject getFile(long fileObjectId, String className, String objectId) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerRetrieves a particular file associated to an inventory object. This call returns the actual file- Specified by:
getFilein interfaceBusinessEntityManager- Parameters:
fileObjectId- The id of the file objectclassName- The class of the object the file is associated toobjectId- The id of the object 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
-
detachFileFromObject
public void detachFileFromObject(long fileObjectId, String className, String objectId) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundExceptionDescription copied from interface:BusinessEntityManagerReleases (and deletes) a file associated to an inventory object- Specified by:
detachFileFromObjectin interfaceBusinessEntityManager- Parameters:
fileObjectId- The id of the file objectclassName- The class of the object the file is associated toobjectId- The id of the object 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
public void updateFileProperties(long fileObjectId, List<StringPair> properties, String className, String objectId) throws BusinessObjectNotFoundException, ApplicationObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundExceptionDescription copied from interface:BusinessEntityManagerUpdates the properties of a file object (name or tags)- Specified by:
updateFilePropertiesin interfaceBusinessEntityManager- Parameters:
fileObjectId- The id of the file objectproperties- 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 toobjectId- The id of the object the file is attached to- Throws:
BusinessObjectNotFoundException- If the object file is attached to could not be foundApplicationObjectNotFoundException- If the file object 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
-
getFilesFromRelatedListTypeItems
public Map<BusinessObjectLight,List<FileObjectLight>> getFilesFromRelatedListTypeItems(String uuid)
Description copied from interface:BusinessEntityManagerRetrieves a map with the files related to the list type item attributes of the given object- Specified by:
getFilesFromRelatedListTypeItemsin interfaceBusinessEntityManager- Parameters:
uuid- the object id- Returns:
- The map with the files. The key is the list type item and the value a list with the related files
-
findRoutesThroughSpecialRelationships
public List<BusinessObjectLightList> findRoutesThroughSpecialRelationships(String objectAClassName, String objectAId, String objectBClassName, String objectBId, String relationshipName) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerFinds all possible routes between two given inventory objects- Specified by:
findRoutesThroughSpecialRelationshipsin interfaceBusinessEntityManager- Parameters:
objectAClassName- Inventory object A class nameobjectAId- Inventory object A idobjectBClassName- Inventory object B class nameobjectBId- Inventory object B idrelationshipName- The name of the relationship used to navigate through nodes and find the route- Returns:
- A list of the routes, including only the nodes as RemoteBusinessObjectLights
- Throws:
InvalidArgumentException- If any of the inventory objects does not have uuid
-
getWarehousesInObject
public List<BusinessObjectLight> getWarehousesInObject(String objectClassName, String objectId) throws MetadataObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the warehouses in a object- Specified by:
getWarehousesInObjectin interfaceBusinessEntityManager- Parameters:
objectClassName- The class of the objectobjectId- The id of the object- Returns:
- Gets the warehouses in a object
- Throws:
MetadataObjectNotFoundException- If the specified class could not be found.InvalidArgumentException
-
getWarehouseToObject
public BusinessObjectLight getWarehouseToObject(String objectClassName, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets warehouse related to object- Specified by:
getWarehouseToObjectin interfaceBusinessEntityManager- Parameters:
objectClassName- The class of the objectobjectId- The id of the object- Returns:
- Gets warehouse related to object.
- Throws:
MetadataObjectNotFoundException- If the specified class could not be found.BusinessObjectNotFoundException- If the object provided could not be found.InvalidArgumentException
-
getPhysicalNodeToObjectInWarehouse
public BusinessObjectLight getPhysicalNodeToObjectInWarehouse(String objectClassName, String objectId) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets the physical node of a warehouse item- Specified by:
getPhysicalNodeToObjectInWarehousein interfaceBusinessEntityManager- Parameters:
objectClassName- The class of the objectobjectId- The id of the object- Returns:
- Gets the physical node of a warehouse item
- Throws:
MetadataObjectNotFoundException- If the specified class could not be found.BusinessObjectNotFoundException- If the object provided could not be found.InvalidArgumentException
-
createClassLevelReport
public long createClassLevelReport(String className, String reportName, String reportDescription, String script, int outputType, boolean enabled) throws MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerCreates a class level report (a report that will be available for all instances of a given class -and its subclasses-)- Specified by:
createClassLevelReportin interfaceBusinessEntityManager- Parameters:
className- Class this report is going to be related to. It can be ab abstract class and the report will be available for all its subclassesreportName- Name of the report.reportDescription- ReportMetadata description.script- Script text.outputType- What will be the default output of this report? See RemoteReportLight for possible valuesenabled- If enabled, a report can be executed.- Returns:
- The id of the newly created report.
- Throws:
MetadataObjectNotFoundException- If the class provided could not be found.
-
createInventoryLevelReport
public long createInventoryLevelReport(String reportName, String reportDescription, String script, int outputType, boolean enabled, List<StringPair> parameters) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCreates an inventory level report (a report that is not tied to a particlar instance or class. In most cases, they also receive parameters)- Specified by:
createInventoryLevelReportin interfaceBusinessEntityManager- Parameters:
reportName- Name of the report.reportDescription- ReportMetadata description.script- Script text.outputType- What will be the default output of this report? See InventoryLevelReportDescriptor for possible valuesenabled- If enabled, a report can be executed.parameters- Optional (it might be either null or an empty list). The list of the parameters that this report will support and optional default values. They will always be captured as strings, so it's up to the author of the report the sanitization and conversion of the inputs- Returns:
- The id of the newly created report.
- Throws:
ApplicationObjectNotFoundException- If the dummy root could not be found, which is actually a severe problem.InvalidArgumentException- If any of the parameter names is null or empty
-
deleteReport
public ChangeDescriptor deleteReport(long reportId) throws ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerDeletes a report- Specified by:
deleteReportin interfaceBusinessEntityManager- Parameters:
reportId- The id of the report.- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException- If the report could not be found.
-
updateReport
public ChangeDescriptor updateReport(long reportId, String reportName, String reportDescription, Boolean enabled, Integer type, String script) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerUpdates the properties of an existing class level report.- Specified by:
updateReportin interfaceBusinessEntityManager- Parameters:
reportId- Id of the report.reportName- The name of the report. Null to leave it unchanged.reportDescription- The description of the report. Null to leave it unchanged.enabled- Is the report enabled? . Null to leave it unchanged.type- Type of the output of the report. See LocalReportLight for possible valuesscript- Text of the script.- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException- If the report could not be found.InvalidArgumentException- If any of the report properties has a wrong or unexpected format.
-
updateReportParameters
public ChangeDescriptor updateReportParameters(long reportId, List<StringPair> parameters) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerUpdates the parameters of a report- Specified by:
updateReportParametersin interfaceBusinessEntityManager- Parameters:
reportId- The id of the reportparameters- The list of parameters and optional default values. Those with null values will be deleted and the ones that didn't exist previously will be created.- Returns:
- The summary of the changes
- Throws:
ApplicationObjectNotFoundException- If the report was not found.InvalidArgumentException- If the any of the parameters has an invalid name.
-
getClassLevelReports
public List<ReportMetadataLight> getClassLevelReports(String className, boolean recursive, boolean includeDisabled) throws MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerGets the class level reports associated to the given class (or its superclasses)- Specified by:
getClassLevelReportsin interfaceBusinessEntityManager- Parameters:
className- The class to extract the reports from.recursive- False to get only the directly associated reports. True top get also the reports associate top its superclassesincludeDisabled- True to also include the reports marked as disabled. False to return only the enabled ones.- Returns:
- The list of reports.
- Throws:
MetadataObjectNotFoundException- If the class could not be found
-
getInventoryLevelReports
public List<ReportMetadataLight> getInventoryLevelReports(boolean includeDisabled) throws ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerGets the inventory class reports.- Specified by:
getInventoryLevelReportsin interfaceBusinessEntityManager- Parameters:
includeDisabled- True to also include the reports marked as disabled. False to return only the enabled ones.- Returns:
- The list of reports.
- Throws:
ApplicationObjectNotFoundException- f the dummy root could not be found, which is actually a severe problem.
-
getReport
public ReportMetadata getReport(long reportId) throws ApplicationObjectNotFoundException
Description copied from interface:BusinessEntityManagerGets the information related to a class level report.- Specified by:
getReportin interfaceBusinessEntityManager- Parameters:
reportId- The id of the report.- Returns:
- The report.
- Throws:
ApplicationObjectNotFoundException- If the report could not be found.
-
executeClassLevelReport
public byte[] executeClassLevelReport(String objectClassName, String objectId, long reportId) throws MetadataObjectNotFoundException, ApplicationObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerExecutes a class level report and returns the result.- Specified by:
executeClassLevelReportin interfaceBusinessEntityManager- Parameters:
objectClassName- The class of the instance that will be used as input for the report.objectId- The id of the instance that will be used as input for the report.reportId- The id of the report.- Returns:
- The result of the report execution.
- Throws:
MetadataObjectNotFoundException- If the class could not be found.ApplicationObjectNotFoundException- If the report could not be found.BusinessObjectNotFoundException- If the inventory object could not be found.InvalidArgumentException- If there's an error during the execution of the report.
-
executeInventoryLevelReport
public byte[] executeInventoryLevelReport(long reportId, List<StringPair> parameters) throws ApplicationObjectNotFoundException, InvalidArgumentExceptionDescription copied from interface:BusinessEntityManagerExecutes an inventory level report and returns the result.- Specified by:
executeInventoryLevelReportin interfaceBusinessEntityManager- Parameters:
reportId- The id of the report.parameters- List of pairs param name - param value.- Returns:
- The result of the report execution.
- Throws:
ApplicationObjectNotFoundException- If the report could not be found.InvalidArgumentException- If the associated script exits with error.
-
getRootPools
public List<InventoryObjectPool> getRootPools(String className, int type, boolean includeSubclasses) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the pools that don't have any parent and are normally intended to be managed by the Pool Manager- Specified by:
getRootPoolsin interfaceBusinessEntityManager- Parameters:
className- The class name used to filter the results. Only the pools with a className attribute matching the provided value will be returned. Use null if you want to get alltype- The type of pools that should be retrieved. Root pools can be for general purpose, or as roots in modelsincludeSubclasses- Usetrueif you want to get only the pools whoseclassNameproperty matches exactly the one provided, andfalseif you want to also include the subclasses- Returns:
- A set of pools
- Throws:
InvalidArgumentException- If a root pool does not have the uuid
-
getPoolsInObject
public List<InventoryObjectPool> getPoolsInObject(String objectClassName, String objectId, String poolClass) throws BusinessObjectNotFoundException, InvalidArgumentException, MetadataObjectNotFoundException
Description copied from interface:BusinessEntityManagerRetrieves the pools associated to a particular object- Specified by:
getPoolsInObjectin interfaceBusinessEntityManager- Parameters:
objectClassName- The parent object class nameobjectId- The parent object idpoolClass- The class name used to filter the results. Only the pools with a className attribute matching the provided value will be returned. Use null if you want to get all- Returns:
- A set of pools
- Throws:
BusinessObjectNotFoundException- If the parent object can not be foundInvalidArgumentException- If a pool does not have uuidMetadataObjectNotFoundException- If the argument poolClass is not a valid class.
-
getPoolsInPool
public List<InventoryObjectPool> getPoolsInPool(String parentPoolId, String poolClassName) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the pools associated to a particular pool- Specified by:
getPoolsInPoolin interfaceBusinessEntityManager- Parameters:
parentPoolId- The parent pool idpoolClassName- The class name used to filter the results. Only the pools with a className attribute matching the provided value will be returned. Use null if you want to get all- Returns:
- A set of pools
- Throws:
ApplicationObjectNotFoundException- If the parent object can not be foundInvalidArgumentException- If any pool does no have uuid
-
getPoolsInPoolCount
public long getPoolsInPoolCount(String parentPoolId, String poolClassName) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the total count of pools associated to a particular pool- Specified by:
getPoolsInPoolCountin interfaceBusinessEntityManager- Parameters:
parentPoolId- The parent pool idpoolClassName- The class name used to filter the results. Only the pools with a className attribute matching the provided value will be returned. Use null if you want to get all- Returns:
- the total count of the pools
- Throws:
ApplicationObjectNotFoundException- If the parent object can not be foundInvalidArgumentException- If any pool does no have uuid
-
getPool
public InventoryObjectPool getPool(String poolId) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerGets a pool by its id- Specified by:
getPoolin interfaceBusinessEntityManager- Parameters:
poolId- The pool's id- Returns:
- the pool as a Pool object
- Throws:
ApplicationObjectNotFoundException- If the pool could not be foundInvalidArgumentException- If the pool id is null or the result pool does not have uuid
-
getPoolItems
public List<BusinessObjectLight> getPoolItems(String poolId, int limit) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the list of objects from a pool- Specified by:
getPoolItemsin interfaceBusinessEntityManager- Parameters:
poolId- Parent pool idlimit- the results limit. per page 0 to avoid the limit- Returns:
- The list of items inside the pool
- Throws:
ApplicationObjectNotFoundException- If the pool id provided is not validInvalidArgumentException- If the pool item is an inventory object and it does not have the uuid
-
getPoolItemsByClassName
public List<BusinessObjectLight> getPoolItemsByClassName(String poolId, String className, int page, int limit) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerRetrieves the list of objects from a pool- Specified by:
getPoolItemsByClassNamein interfaceBusinessEntityManager- Parameters:
poolId- Parent pool idclassName- a given className to retrieve a set of objects of that className form the pool used when the pool is a Generic class and could have objects of different classpage- the number of values of the result to skip or the page 0 to avoidlimit- the results limit. per page 0 to avoid the limit- Returns:
- The list of items inside the pool
- Throws:
ApplicationObjectNotFoundException- If the pool id provided is not validInvalidArgumentException- If the pool item is an inventory object and it does not have the uuid
-
getPoolItemsCount
public long getPoolItemsCount(String poolId, String className) throws ApplicationObjectNotFoundException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerCount the total of objects in a pool- Specified by:
getPoolItemsCountin interfaceBusinessEntityManager- Parameters:
poolId- Parent pool idclassName- a given className to retrieve a set of objects of that className form the pool used when the pool is a Generic class and could have objects of different class- Returns:
- The count of items inside the pool
- Throws:
ApplicationObjectNotFoundException- If the pool id provided is not validInvalidArgumentException- If the pool item is an inventory object and it does not have the uuid
-
getInstanceOfClass
public org.neo4j.graphdb.Node getInstanceOfClass(String className, String oid) throws MetadataObjectNotFoundException, BusinessObjectNotFoundException, InvalidArgumentException
Boiler-plate code. Gets a particular instance given the class name and the oid. Callers must handle associated transactions- Parameters:
className- object class nameoid- object id- Returns:
- a Node representing the entity
- Throws:
MetadataObjectNotFoundException- id the class could not be foundBusinessObjectNotFoundException- if the object could not be foundInvalidArgumentException- If the object id is null
-
getInstanceOfClass
public org.neo4j.graphdb.Node getInstanceOfClass(long classId, String oid) throws MetadataObjectNotFoundException, BusinessObjectNotFoundExceptionBoiler-plate code. Gets a particular instance given the class name and the oid- Parameters:
classId- object class idoid- object id- Returns:
- a Node representing the entity
- Throws:
MetadataObjectNotFoundException- if the class could not be foundBusinessObjectNotFoundException
-
getInstanceOfClass
public org.neo4j.graphdb.Node getInstanceOfClass(org.neo4j.graphdb.Node classNode, String oid) throws BusinessObjectNotFoundException- Throws:
BusinessObjectNotFoundException
-
createObject
public org.neo4j.graphdb.Node createObject(org.neo4j.graphdb.Node classNode, ClassMetadata classToMap, HashMap<String,String> attributes) throws InvalidArgumentException, MetadataObjectNotFoundException
-
canDeleteObject
public boolean canDeleteObject(String className, String oid) throws BusinessObjectNotFoundException, MetadataObjectNotFoundException, OperationNotPermittedException, InvalidArgumentException
Description copied from interface:BusinessEntityManagerChecks recursively if it's safe to delete a single object- Specified by:
canDeleteObjectin interfaceBusinessEntityManager- Parameters:
className- Object's class nameoid- Objects oid- Returns:
- True if the object does not have relationships that keep it from being deleted. False otherwise.
- Throws:
BusinessObjectNotFoundException- If the object couldn't be foundMetadataObjectNotFoundException- If the requested object class can't be foundOperationNotPermittedException- If the object could not be deleted because there's some business rules that avoids it or it has incoming relationships.InvalidArgumentException
-
getObjectChildrenCount
public long getObjectChildrenCount(String className, String oid, HashMap<String,String> filters) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerGet the child count given the parent class name and id.- Specified by:
getObjectChildrenCountin interfaceBusinessEntityManager- Parameters:
className- Parent class nameoid- Parent idfilters- map of filters key: attribute name, value: attribute value- Returns:
- The count of child
- Throws:
InvalidArgumentException- If the class name is null
-
getObjectChildren
public List<BusinessObjectLight> getObjectChildren(String className, String oid, HashMap<String,String> filters, long skip, long limit) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerGet a set of children to the given the parent class name and id.- Specified by:
getObjectChildrenin interfaceBusinessEntityManager- Parameters:
className- Parent class nameoid- Parent idfilters- null for no filter, map of filters key: attribute name, value: attribute valueskip- Skip indexlimit- Max count of child- Returns:
- Set of children
- Throws:
InvalidArgumentException- If the class name is null
-
getSuggestedObjectsWithFilterGroupedByClassName
public HashMap<String,List<BusinessObjectLight>> getSuggestedObjectsWithFilterGroupedByClassName(List<String> classesNamesToFilter, String filter, long classesSkip, long classesLimit, long objectSkip, long objectLimit) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerSuggests a number of objects based on a search string. This search string will be case-insensitive-matched against the name of the objects and classes in the inventory attributes to filter.- Specified by:
getSuggestedObjectsWithFilterGroupedByClassNamein interfaceBusinessEntityManagerfilter- value to filter in the attribute name of every business object name or class name o class display name- Returns:
- Set of children
- Throws:
InvalidArgumentException- If the class name, skip or limit are null
-
getSuggestedPoolsByName
public HashMap<String,List<InventoryObjectPool>> getSuggestedPoolsByName(List<String> classesNamesToFilter, String nameTofilter, long poolSkip, long poolLimit, long objectSkip, long objectLimit) throws InvalidArgumentException
Description copied from interface:BusinessEntityManagerSuggests a number of pools based on a search string (the pool name). This search string will be case-insensitive-matched against the name of the objects and classes in the inventory attributes to filter.- Specified by:
getSuggestedPoolsByNamein interfaceBusinessEntityManager- Returns:
- Set of pools
- Throws:
InvalidArgumentException- If the class name, skip or limit are null
-
-