Search in sources :

Example 31 with NamedElement

use of com.emc.storageos.db.client.constraint.NamedElementQueryResultList.NamedElement in project coprhd-controller by CoprHD.

the class InMemoryDbClient method findAllOrdersByTimeRange.

@Override
public List<NamedElement> findAllOrdersByTimeRange(URI tid, String columnField, Date startTime, Date endTime, int maxCount) throws DataAccessException {
    List<NamedElement> results = Lists.newArrayList();
    for (URI modelId : findAllIds(Order.class)) {
        Order model = findById(Order.class, modelId);
        Object o = getColumnField(model, columnField);
        results.add(createNamedElement(model));
    }
    return results;
}
Also used : Order(com.emc.storageos.db.client.model.uimodels.Order) DataObject(com.emc.storageos.db.client.model.DataObject) NamedElement(com.emc.storageos.db.client.constraint.NamedElementQueryResultList.NamedElement) URI(java.net.URI)

Example 32 with NamedElement

use of com.emc.storageos.db.client.constraint.NamedElementQueryResultList.NamedElement in project coprhd-controller by CoprHD.

the class ComputeSystemHelper method upateHostTenant.

/**
 * Updates the Host's tenant.
 *
 * @param dbClient DBClient for the database operations.
 * @param dataCenterId data center URI.
 * @param tenantId tenant id to be updated.
 */
private static void upateHostTenant(DbClient dbClient, URI dataCenterId, URI tenantId) {
    List<NamedElement> hostUris = listChildren(dbClient, dataCenterId, Host.class, "label", "vcenterDataCenter");
    for (NamedElement hostUri : hostUris) {
        Host host = dbClient.queryObject(Host.class, hostUri.getId());
        if (host != null) {
            host.setTenant(tenantId);
            dbClient.persistObject(host);
        }
    }
}
Also used : Host(com.emc.storageos.db.client.model.Host) NamedElement(com.emc.storageos.db.client.constraint.NamedElementQueryResultList.NamedElement)

Aggregations

NamedElement (com.emc.storageos.db.client.constraint.NamedElementQueryResultList.NamedElement)32 URI (java.net.URI)14 DataObject (com.emc.storageos.db.client.model.DataObject)6 ArrayList (java.util.ArrayList)6 NamedURI (com.emc.storageos.db.client.model.NamedURI)4 CustomServicesWorkflow (com.emc.storageos.db.client.model.uimodels.CustomServicesWorkflow)4 Order (com.emc.storageos.db.client.model.uimodels.Order)3 NamedElementQueryResultList (com.emc.storageos.db.client.constraint.NamedElementQueryResultList)2 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)2 ActionableEvent (com.emc.storageos.db.client.model.ActionableEvent)2 Cluster (com.emc.storageos.db.client.model.Cluster)2 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)2 Host (com.emc.storageos.db.client.model.Host)2 ScheduledEvent (com.emc.storageos.db.client.model.uimodels.ScheduledEvent)2 ImmutableList (com.google.common.collect.ImmutableList)2 HashSet (java.util.HashSet)2 ServiceDescriptor (com.emc.sa.descriptor.ServiceDescriptor)1 ResourcePackage (com.emc.sa.workflow.CustomServicesWorkflowPackage.ResourcePackage)1 TimeSeriesConstraint (com.emc.storageos.db.client.constraint.TimeSeriesConstraint)1 CatalogCategory (com.emc.storageos.db.client.model.uimodels.CatalogCategory)1