Search in sources :

Example 6 with C2KLocalObject

use of org.cristalise.kernel.entity.C2KLocalObject in project kernel by cristal-ise.

the class UserCodeProcess method getErrorJob.

/**
 * @param completeJob
 * @param errorTrans
 * @return
 */
private Job getErrorJob(Job completeJob, int errorTrans) {
    Job errorJob = null;
    synchronized (jobs) {
        for (C2KLocalObject c2kLocalObject : jobs.values()) {
            Job thisJob = (Job) c2kLocalObject;
            if (thisJob.getItemUUID().equals(completeJob.getItemUUID()) && thisJob.getTransition().getId() == errorTrans) {
                Logger.msg(5, "UserCodeProcess.getErrorJob() - job:" + thisJob);
                errorJob = thisJob;
            }
        }
    }
    return errorJob;
}
Also used : C2KLocalObject(org.cristalise.kernel.entity.C2KLocalObject) Job(org.cristalise.kernel.entity.agent.Job)

Example 7 with C2KLocalObject

use of org.cristalise.kernel.entity.C2KLocalObject in project kernel by cristal-ise.

the class BulkImport method importLifeCycle.

public void importLifeCycle(ItemPath item, Object locker) throws PersistencyException {
    String[] contents = importCluster.getClusterContents(item, LIFECYCLE);
    for (String c : contents) {
        String path = LIFECYCLE + "/" + c;
        C2KLocalObject wf = importCluster.get(item, path);
        Gateway.getStorage().put(item, wf, locker);
    // importCluster.delete(item, path);
    }
}
Also used : C2KLocalObject(org.cristalise.kernel.entity.C2KLocalObject)

Example 8 with C2KLocalObject

use of org.cristalise.kernel.entity.C2KLocalObject in project kernel by cristal-ise.

the class BulkImport method importJob.

public void importJob(ItemPath item, Object locker) throws PersistencyException {
    String[] contents = importCluster.getClusterContents(item, JOB);
    for (String c : contents) {
        String path = JOB + "/" + c;
        C2KLocalObject job = importCluster.get(item, path);
        Gateway.getStorage().put(item, job, locker);
    // importCluster.delete(item, path);
    }
}
Also used : C2KLocalObject(org.cristalise.kernel.entity.C2KLocalObject)

Example 9 with C2KLocalObject

use of org.cristalise.kernel.entity.C2KLocalObject in project kernel by cristal-ise.

the class BulkImport method importOutcome.

public void importOutcome(ItemPath item, Object locker) throws PersistencyException {
    String[] schemas = importCluster.getClusterContents(item, OUTCOME);
    for (String schema : schemas) {
        String[] versions = importCluster.getClusterContents(item, OUTCOME + "/" + schema);
        for (String version : versions) {
            String[] events = importCluster.getClusterContents(item, OUTCOME + "/" + schema + "/" + version);
            for (String event : events) {
                C2KLocalObject obj = importCluster.get(item, OUTCOME + "/" + schema + "/" + version + "/" + event);
                Gateway.getStorage().put(item, obj, locker);
            // importCluster.delete(item, path.toString());
            }
        }
    }
}
Also used : C2KLocalObject(org.cristalise.kernel.entity.C2KLocalObject)

Example 10 with C2KLocalObject

use of org.cristalise.kernel.entity.C2KLocalObject in project kernel by cristal-ise.

the class BulkImport method importViewPoint.

public void importViewPoint(ItemPath item, Object locker) throws PersistencyException {
    String[] contents = importCluster.getClusterContents(item, VIEWPOINT);
    for (String c : contents) {
        String[] subContents = importCluster.getClusterContents(item, VIEWPOINT + "/" + c);
        for (String sc : subContents) {
            String path = VIEWPOINT + "/" + c + "/" + sc;
            C2KLocalObject view = importCluster.get(item, path);
            Gateway.getStorage().put(item, view, locker);
        // importCluster.delete(item, path);
        }
    }
}
Also used : C2KLocalObject(org.cristalise.kernel.entity.C2KLocalObject)

Aggregations

C2KLocalObject (org.cristalise.kernel.entity.C2KLocalObject)20 ObjectNotFoundException (org.cristalise.kernel.common.ObjectNotFoundException)7 PersistencyException (org.cristalise.kernel.common.PersistencyException)6 InvalidDataException (org.cristalise.kernel.common.InvalidDataException)5 DomainPath (org.cristalise.kernel.lookup.DomainPath)4 InvalidItemPathException (org.cristalise.kernel.lookup.InvalidItemPathException)4 ItemPath (org.cristalise.kernel.lookup.ItemPath)4 Viewpoint (org.cristalise.kernel.persistency.outcome.Viewpoint)3 ConcurrentModificationException (java.util.ConcurrentModificationException)2 Aggregation (org.cristalise.kernel.collection.Aggregation)2 ObjectAlreadyExistsException (org.cristalise.kernel.common.ObjectAlreadyExistsException)2 Job (org.cristalise.kernel.entity.agent.Job)2 CastorHashMap (org.cristalise.kernel.utils.CastorHashMap)2 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1 AggregationMember (org.cristalise.kernel.collection.AggregationMember)1 Collection (org.cristalise.kernel.collection.Collection)1 CollectionArrayList (org.cristalise.kernel.collection.CollectionArrayList)1