api: Rename Validator to Validate, cosmetic fixes

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-05 16:52:53 -08:00
parent b00ed17f4b
commit 6a112bd64c
3 changed files with 7 additions and 8 deletions

View File

@ -27,6 +27,6 @@ import com.cloud.utils.component.Adapter;
* APIAccessChecker checks the ownership and access control to API requests
*/
public interface APIAccessChecker extends Adapter {
// Interface for checking access to an API for a user
// Interface for checking access to an API for an user
boolean canAccessAPI(User user, String apiCommandName) throws PermissionDeniedException;
}

View File

@ -24,7 +24,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ FIELD })
public @interface Validator {
public @interface Validate {
Class<?>[] validators() default Object.class;
String description() default "";
}

View File

@ -396,20 +396,19 @@ public class ApiDispatcher {
}
for (Field field : fields) {
//plug Services
PlugService plugServiceAnnotation = field.getAnnotation(PlugService.class);
if(plugServiceAnnotation != null){
plugService(field, cmd);
}
//APITODO: change the checking here
Parameter parameterAnnotation = field.getAnnotation(Parameter.class);
if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
continue;
}
//ACL checkAccess = field.getAnnotation(ACL.class);
Validator validators = field.getAnnotation(Validator.class);
//TODO: Annotate @Validate on API Cmd classes, FIXME how to process Validate
Validate validateAnnotation = field.getAnnotation(Validate.class);
Object paramObj = unpackedParams.get(parameterAnnotation.name());
if (paramObj == null) {
if (parameterAnnotation.required()) {
@ -530,7 +529,7 @@ public class ApiDispatcher {
}
//check access on the entities.
//check access on the enstities.
}
private static Long translateUuidToInternalId(String uuid, Parameter annotation)