Search in sources :

Example 16 with ExperimentCatResource

use of org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource in project airavata by apache.

the class ExperimentResource method getExperimentStatuses.

public List<ExperimentStatusResource> getExperimentStatuses() throws RegistryException {
    List<ExperimentStatusResource> experimentStatusResources = new ArrayList();
    List<ExperimentCatResource> resources = get(ResourceType.EXPERIMENT_STATUS);
    for (ExperimentCatResource resource : resources) {
        ExperimentStatusResource statusResource = (ExperimentStatusResource) resource;
        experimentStatusResources.add(statusResource);
    }
    return experimentStatusResources;
}
Also used : ArrayList(java.util.ArrayList) ExperimentCatResource(org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource)

Example 17 with ExperimentCatResource

use of org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource in project airavata by apache.

the class ExperimentResource method getExperimentInputs.

public List<ExperimentInputResource> getExperimentInputs() throws RegistryException {
    List<ExperimentInputResource> experimentInputResources = new ArrayList();
    List<ExperimentCatResource> resources = get(ResourceType.EXPERIMENT_INPUT);
    for (ExperimentCatResource resource : resources) {
        ExperimentInputResource inputResource = (ExperimentInputResource) resource;
        experimentInputResources.add(inputResource);
    }
    return experimentInputResources;
}
Also used : ArrayList(java.util.ArrayList) ExperimentCatResource(org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource)

Example 18 with ExperimentCatResource

use of org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource in project airavata by apache.

the class ExperimentResource method getProcessList.

public List<ProcessResource> getProcessList() throws RegistryException {
    List<ProcessResource> processResources = new ArrayList();
    List<ExperimentCatResource> resources = get(ResourceType.PROCESS);
    for (ExperimentCatResource resource : resources) {
        ProcessResource processResource = (ProcessResource) resource;
        processResources.add(processResource);
    }
    return processResources;
}
Also used : ArrayList(java.util.ArrayList) ExperimentCatResource(org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource)

Example 19 with ExperimentCatResource

use of org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource in project airavata by apache.

the class ExperimentRegistry method getLatestQueueStatuses.

public List<QueueStatusModel> getLatestQueueStatuses() throws RegistryException {
    List<QueueStatusModel> queueStatusModels = new ArrayList<>();
    List<ExperimentCatResource> queueStatusResources = (new QueueStatusResource()).get(ResourceType.QUEUE_STATUS);
    for (ExperimentCatResource r : queueStatusResources) {
        QueueStatusResource qResource = (QueueStatusResource) r;
        QueueStatusModel queueStatusModel = new QueueStatusModel();
        queueStatusModel.setHostName(qResource.getHostName());
        queueStatusModel.setQueueName(qResource.getQueueName());
        queueStatusModel.setTime(qResource.getTime());
        queueStatusModel.setQueueUp(qResource.getQueueUp());
        queueStatusModel.setRunningJobs(qResource.getRunningJobs());
        queueStatusModel.setQueuedJobs(qResource.getQueuedJobs());
        queueStatusModels.add(queueStatusModel);
    }
    return queueStatusModels;
}
Also used : ExperimentCatResource(org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource)

Example 20 with ExperimentCatResource

use of org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource in project airavata by apache.

the class NotificationRegistry method getAllGatewayNotifications.

public List<Notification> getAllGatewayNotifications(String gatewayId) throws RegistryException {
    List<Notification> notifications = new ArrayList<>();
    NotificationResource notificationResource = new NotificationResource();
    List<ExperimentCatResource> resources = notificationResource.getAllNotifications(gatewayId);
    if (resources != null && !resources.isEmpty()) {
        for (ExperimentCatResource e : resources) {
            notifications.add(ThriftDataModelConversion.getNotification((NotificationResource) e));
        }
    }
    Collections.sort(notifications, (o1, o2) -> (o2.getCreationTime() - o1.getCreationTime()) > 0 ? 1 : -1);
    return notifications;
}
Also used : NotificationResource(org.apache.airavata.registry.core.experiment.catalog.resources.NotificationResource) Notification(org.apache.airavata.model.workspace.Notification) ExperimentCatResource(org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource)

Aggregations

ExperimentCatResource (org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource)36 ArrayList (java.util.ArrayList)31 RegistryException (org.apache.airavata.registry.cpi.RegistryException)12 EntityManager (javax.persistence.EntityManager)11 Query (javax.persistence.Query)11 QueryGenerator (org.apache.airavata.registry.core.experiment.catalog.utils.QueryGenerator)10 List (java.util.List)8 Notification (org.apache.airavata.model.workspace.Notification)1 Job (org.apache.airavata.registry.core.experiment.catalog.model.Job)1 JobStatus (org.apache.airavata.registry.core.experiment.catalog.model.JobStatus)1 Notification (org.apache.airavata.registry.core.experiment.catalog.model.Notification)1 Process (org.apache.airavata.registry.core.experiment.catalog.model.Process)1 QueueStatus (org.apache.airavata.registry.core.experiment.catalog.model.QueueStatus)1 TaskError (org.apache.airavata.registry.core.experiment.catalog.model.TaskError)1 TaskStatus (org.apache.airavata.registry.core.experiment.catalog.model.TaskStatus)1 NotificationResource (org.apache.airavata.registry.core.experiment.catalog.resources.NotificationResource)1 QueueStatusResource (org.apache.airavata.registry.core.experiment.catalog.resources.QueueStatusResource)1 Test (org.junit.Test)1