Search in sources :

Example 1 with SpecialObjects

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

the class BackendApiResource method getGlusterApi.

private Api getGlusterApi() {
    Api api = new Api();
    api.setTime(DateMapper.map(new Date(), null));
    for (DetailedLink detailedLink : getGlusterLinks()) {
        // add thin link
        api.getLinks().add(LinkCreator.createLink(detailedLink.getHref(), detailedLink.getRel()));
        // when required - add extra link for search
        if (detailedLink.isSetLinkCapabilities() && detailedLink.getLinkCapabilities().isSetSearchable() && detailedLink.getLinkCapabilities().isSearchable()) {
            api.getLinks().add(LinkCreator.createLink(detailedLink.getHref(), detailedLink.getRel(), detailedLink.getRequest().getUrl().getParametersSets()));
        }
        // add special links
        SpecialObjects specialObjects = new SpecialObjects();
        specialObjects.setRootTag(createRootTag());
        api.setSpecialObjects(specialObjects);
    }
    return api;
}
Also used : DetailedLink(org.ovirt.engine.api.model.DetailedLink) SpecialObjects(org.ovirt.engine.api.model.SpecialObjects) Api(org.ovirt.engine.api.model.Api) Date(java.util.Date)

Example 2 with SpecialObjects

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

the class BackendApiResource method getApi.

private Api getApi() {
    Api api = new Api();
    api.setTime(DateMapper.map(new Date(), null));
    for (DetailedLink detailedLink : getLinks()) {
        // add thin link
        api.getLinks().add(LinkCreator.createLink(detailedLink.getHref(), detailedLink.getRel()));
        // when required - add extra link for search
        if (detailedLink.isSetLinkCapabilities() && detailedLink.getLinkCapabilities().isSetSearchable() && detailedLink.getLinkCapabilities().isSearchable()) {
            api.getLinks().add(LinkCreator.createLink(detailedLink.getHref(), detailedLink.getRel(), detailedLink.getRequest().getUrl().getParametersSets()));
        }
        // add special links
        SpecialObjects specialObjects = new SpecialObjects();
        specialObjects.setBlankTemplate(createBlankTemplate());
        specialObjects.setRootTag(createRootTag());
        api.setSpecialObjects(specialObjects);
    }
    return api;
}
Also used : DetailedLink(org.ovirt.engine.api.model.DetailedLink) SpecialObjects(org.ovirt.engine.api.model.SpecialObjects) Api(org.ovirt.engine.api.model.Api) Date(java.util.Date)

Aggregations

Date (java.util.Date)2 Api (org.ovirt.engine.api.model.Api)2 DetailedLink (org.ovirt.engine.api.model.DetailedLink)2 SpecialObjects (org.ovirt.engine.api.model.SpecialObjects)2