Search in sources :

Example 1 with ErestGetBasic

use of one.kii.summer.io.sender.ErestGetBasic in project kiimate by SINeWang.

the class DefaultVisitRawAssetSpi method visit.

@Override
public <T> T visit(Class<T> klass, LatestForm latestForm) throws BadRequest, Panic, NotFound {
    String urlTemplate = url + URI;
    ErestGetBasic erestGet = new ErestGetBasic(latestForm.getOwnerId());
    return erestGet.execute(urlTemplate, klass, latestForm.getOwnerId(), latestForm.getGroup(), latestForm.getName(), latestForm.getStability(), latestForm.getVersion());
}
Also used : ErestGetBasic(one.kii.summer.io.sender.ErestGetBasic)

Example 2 with ErestGetBasic

use of one.kii.summer.io.sender.ErestGetBasic in project kiimate by SINeWang.

the class DefaultVisitExtensionSpi method visit.

@Override
public String visit(GroupForm form) throws Panic {
    String url = baseUrl + URI;
    ErestGetBasic erest = new ErestGetBasic(visitorId);
    try {
        return erest.execute(url, String.class, ownerId, form.getGroup(), NAME_ROOT, TREE);
    } catch (NotFound notFound) {
        notFound.printStackTrace();
    } catch (BadRequest badRequest) {
        badRequest.printStackTrace();
    } catch (Panic panic) {
        panic.printStackTrace();
    }
    throw new Panic();
}
Also used : ErestGetBasic(one.kii.summer.io.sender.ErestGetBasic) BadRequest(one.kii.summer.io.exception.BadRequest) Panic(one.kii.summer.io.exception.Panic) NotFound(one.kii.summer.io.exception.NotFound)

Example 3 with ErestGetBasic

use of one.kii.summer.io.sender.ErestGetBasic in project kiimate by SINeWang.

the class DefaultVisitExtensionSpi method visit.

@Override
public String visit(GroupNameForm form) throws Panic {
    String url = baseUrl + URI;
    ErestGetBasic erest = new ErestGetBasic(visitorId);
    try {
        return erest.execute(url, String.class, ownerId, form.getGroup(), form.getName(), TREE);
    } catch (NotFound notFound) {
        notFound.printStackTrace();
    } catch (BadRequest badRequest) {
        badRequest.printStackTrace();
    } catch (Panic panic) {
        panic.printStackTrace();
    }
    throw new Panic();
}
Also used : ErestGetBasic(one.kii.summer.io.sender.ErestGetBasic) BadRequest(one.kii.summer.io.exception.BadRequest) Panic(one.kii.summer.io.exception.Panic) NotFound(one.kii.summer.io.exception.NotFound)

Aggregations

ErestGetBasic (one.kii.summer.io.sender.ErestGetBasic)3 BadRequest (one.kii.summer.io.exception.BadRequest)2 NotFound (one.kii.summer.io.exception.NotFound)2 Panic (one.kii.summer.io.exception.Panic)2