Search in sources :

Example 1 with Actions

use of org.ovirt.engine.api.model.Actions in project ovirt-engine by oVirt.

the class ActionsBuilder method build.

public Actions build() {
    Actions actions = null;
    for (Method method : ArrayUtils.concat(service.getMethods(), getInterfaceSignatures(collection))) {
        Path path = method.getAnnotation(Path.class);
        Actionable actionable = method.getAnnotation(Actionable.class);
        if (actionable != null && path != null) {
            Link link = new Link();
            link.setRel(path.value());
            link.setHref(base + URL_SEPARATOR + link.getRel());
            if (actions == null) {
                actions = new Actions();
            }
            actions.getLinks().add(link);
        }
    }
    return actions;
}
Also used : Path(javax.ws.rs.Path) Actions(org.ovirt.engine.api.model.Actions) Actionable(org.ovirt.engine.api.model.Actionable) Method(java.lang.reflect.Method) Link(org.ovirt.engine.api.model.Link)

Aggregations

Method (java.lang.reflect.Method)1 Path (javax.ws.rs.Path)1 Actionable (org.ovirt.engine.api.model.Actionable)1 Actions (org.ovirt.engine.api.model.Actions)1 Link (org.ovirt.engine.api.model.Link)1