Search in sources :

Example 11 with CannotManageException

use of org.cristalise.kernel.common.CannotManageException in project kernel by cristal-ise.

the class BulkImport method importItemPath.

public ItemPath importItemPath(ItemPath item, Object locker) throws PersistencyException {
    try {
        ItemPath itemPath = (ItemPath) importCluster.get(item, PATH + "/Item");
        Gateway.getLookupManager().add(itemPath);
        return itemPath;
    } catch (ObjectCannotBeUpdated | ObjectAlreadyExistsException | CannotManageException e) {
        Logger.error(e);
        throw new PersistencyException(e.getMessage());
    }
}
Also used : CannotManageException(org.cristalise.kernel.common.CannotManageException) ObjectCannotBeUpdated(org.cristalise.kernel.common.ObjectCannotBeUpdated) PersistencyException(org.cristalise.kernel.common.PersistencyException) ObjectAlreadyExistsException(org.cristalise.kernel.common.ObjectAlreadyExistsException) ItemPath(org.cristalise.kernel.lookup.ItemPath)

Example 12 with CannotManageException

use of org.cristalise.kernel.common.CannotManageException in project kernel by cristal-ise.

the class ModuleActivity method create.

@Override
public Path create(AgentPath agentPath, boolean reset) throws ObjectNotFoundException, ObjectCannotBeUpdated, CannotManageException, ObjectAlreadyExistsException, InvalidDataException {
    try {
        domainPath = Bootstrap.verifyResource(ns, name, version, type.getTypeCode(), itemPath, getResourceLocation(), reset);
        itemPath = domainPath.getItemPath();
    } catch (Exception e) {
        Logger.error(e);
        throw new CannotManageException("Exception verifying module resource " + ns + "/" + name);
    }
    actDef = LocalObjectLoader.getActDef(name, version);
    populateActivityDef();
    CollectionArrayList colls;
    try {
        colls = actDef.makeDescCollections();
    } catch (InvalidDataException e) {
        Logger.error(e);
        throw new CannotManageException("Could not create description collections for " + getName() + ".");
    }
    for (Collection<?> coll : colls.list) {
        try {
            Gateway.getStorage().put(itemPath, coll, null);
            // create last collection
            coll.setVersion(null);
            Gateway.getStorage().put(itemPath, coll, null);
        } catch (PersistencyException e) {
            Logger.error(e);
            throw new CannotManageException("Persistency exception storing description collections for " + getName() + ".");
        }
    }
    return domainPath;
}
Also used : CannotManageException(org.cristalise.kernel.common.CannotManageException) InvalidDataException(org.cristalise.kernel.common.InvalidDataException) PersistencyException(org.cristalise.kernel.common.PersistencyException) CollectionArrayList(org.cristalise.kernel.collection.CollectionArrayList) InvalidDataException(org.cristalise.kernel.common.InvalidDataException) ObjectNotFoundException(org.cristalise.kernel.common.ObjectNotFoundException) ObjectAlreadyExistsException(org.cristalise.kernel.common.ObjectAlreadyExistsException) PersistencyException(org.cristalise.kernel.common.PersistencyException) CannotManageException(org.cristalise.kernel.common.CannotManageException)

Aggregations

CannotManageException (org.cristalise.kernel.common.CannotManageException)12 ObjectNotFoundException (org.cristalise.kernel.common.ObjectNotFoundException)8 ObjectAlreadyExistsException (org.cristalise.kernel.common.ObjectAlreadyExistsException)7 PersistencyException (org.cristalise.kernel.common.PersistencyException)6 InvalidDataException (org.cristalise.kernel.common.InvalidDataException)5 ObjectCannotBeUpdated (org.cristalise.kernel.common.ObjectCannotBeUpdated)5 AgentPath (org.cristalise.kernel.lookup.AgentPath)5 CorbaServer (org.cristalise.kernel.entity.CorbaServer)3 InvalidAgentPathException (org.cristalise.kernel.lookup.InvalidAgentPathException)3 ItemPath (org.cristalise.kernel.lookup.ItemPath)3 RolePath (org.cristalise.kernel.lookup.RolePath)3 IOException (java.io.IOException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 TraceableEntity (org.cristalise.kernel.entity.TraceableEntity)2 ActiveEntity (org.cristalise.kernel.entity.agent.ActiveEntity)2 DomainPath (org.cristalise.kernel.lookup.DomainPath)2 Viewpoint (org.cristalise.kernel.persistency.outcome.Viewpoint)2 PropertyArrayList (org.cristalise.kernel.property.PropertyArrayList)2 MappingException (org.exolab.castor.mapping.MappingException)2 MarshalException (org.exolab.castor.xml.MarshalException)2