use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class AbstractDiscoveredSystemController method queueTask.
protected void queueTask(DbClient dbClient, Class<? extends DiscoveredSystemObject> systemClazz, Dispatcher dispatcher, String methodName, Object... args) {
final URI systemURI = (URI) args[0];
_log.info("System {} received RMI request {}.", systemURI, methodName);
try {
// 1. select target device
final DiscoveredSystemObject device = dbClient.queryObject(systemClazz, systemURI);
final Controller controller = lookupDeviceController(device);
// 2. queue request
dispatcher.queue(device.getId(), device.getSystemType(), controller, methodName, args);
} catch (RetryableDatabaseException e) {
if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
// netflix curator ConnectionException is not serializable
// and thus should not be sent back to rmi client.
_log.error("Failed to queue task due to dbsvc disconnected. Error: ", e);
throw DatabaseException.retryables.connectionFailed();
}
throw e;
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class DiscoveryStatusUtils method markAsFailed.
/**
* Marks the target as failed.
*
* @param target
* the target object.
* @param message
* the error message
* @param e
* the error that caused the failure.
*/
public static void markAsFailed(ModelClient modelClient, DataObject target, String message, Exception e) {
if (target instanceof DiscoveredSystemObject) {
DiscoveredSystemObject obj = (DiscoveredSystemObject) target;
obj.setDiscoveryStatus(DataCollectionJobStatus.ERROR.name());
obj.setLastDiscoveryStatusMessage(message);
obj.setLastDiscoveryRunTime(System.currentTimeMillis());
modelClient.save(obj);
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class DiscoveryStatusUtils method markAsIgnored.
/**
* Marks the target as ignored.
*
* @param target
* the target object.
*/
public static void markAsIgnored(ModelClient modelClient, DataObject target) {
if (target instanceof DiscoveredSystemObject) {
DiscoveredSystemObject obj = (DiscoveredSystemObject) target;
obj.setCompatibilityStatus(CompatibilityStatus.UNKNOWN.name());
obj.setDiscoveryStatus(DataCollectionJobStatus.COMPLETE.name());
obj.setLastDiscoveryStatusMessage("");
obj.setLastDiscoveryRunTime(System.currentTimeMillis());
modelClient.save(obj);
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class DiscoveryStatusUtils method markAsIncompatible.
/**
* Marks the target as incompatible.
*
* @param target
* the target object.
*/
public static void markAsIncompatible(ModelClient modelClient, DataObject target, String message) {
if (target instanceof DiscoveredSystemObject) {
DiscoveredSystemObject obj = (DiscoveredSystemObject) target;
obj.setDiscoveryStatus(DataCollectionJobStatus.COMPLETE.name());
obj.setCompatibilityStatus(CompatibilityStatus.INCOMPATIBLE.name());
obj.setLastDiscoveryStatusMessage(message);
obj.setLastDiscoveryRunTime(System.currentTimeMillis());
modelClient.save(obj);
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class DiscoveryStatusUtils method markAsProcessing.
/**
* Marks the target as processing.
*
* @param target
* the target object.
*/
public static void markAsProcessing(ModelClient modelClient, DataObject target) {
if (target instanceof DiscoveredSystemObject) {
DiscoveredSystemObject obj = (DiscoveredSystemObject) target;
obj.setDiscoveryStatus(DataCollectionJobStatus.IN_PROGRESS.name());
modelClient.save(obj);
}
}
Aggregations