com.maxleap.code.impl.MLClassManagerHookBase Maven / Gradle / Ivy
package com.maxleap.code.impl;
import com.maxleap.las.sdk.DeleteMsg;
import com.maxleap.las.sdk.SaveMsg;
import com.maxleap.las.sdk.UpdateMsg;
import com.maxleap.code.AfterResult;
import com.maxleap.code.BeforeResult;
import com.maxleap.code.MLClassManagerHook;
import com.maxleap.code.UserPrincipal;
/**
* User:poplar
* Date:14-10-28
*/
public abstract class MLClassManagerHookBase implements MLClassManagerHook {
@Override
public BeforeResult beforeCreate(T entity, UserPrincipal userPrincipal) {
return new BeforeResult(entity, true);
}
@Override
public AfterResult afterCreate(BeforeResult beforeResult, SaveMsg saveMessage, UserPrincipal userPrincipal) {
AfterResult afterResult = new AfterResult(saveMessage);
return afterResult;
}
@Override
public BeforeResult beforeDelete(String objectId, UserPrincipal userPrincipal) {
return new BeforeResult(objectId, true);
}
@Override
public AfterResult afterDelete(BeforeResult beforeResult, DeleteMsg deleteMessage, UserPrincipal userPrincipal) {
AfterResult afterResult = new AfterResult(deleteMessage);
return afterResult;
}
@Override
public AfterResult afterUpdate(String objectId, UpdateMsg updateMessage, UserPrincipal userPrincipal) {
AfterResult afterResult = new AfterResult(updateMessage);
return afterResult;
}
@Override
public BeforeResult beforeDelete(String[] objectIds, UserPrincipal userPrincipal) {
return new BeforeResult(objectIds, true);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy