Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public Restlet createInboundRoot(){
- Router router = new Router(getContext());
- router.attach("/", RootServerResource.class);
- router.attach("/apps", AppsServerResource.class);
- router.attach("/ifaces", IfacesServerResource.class);
- router.attach("/ifaces/{ifaceId}", IfaceServerResource.class);
- ChallengeAuthenticator authenticator = new ChallengeAuthenticator(
- getContext(), ChallengeScheme.HTTP_BASIC, "AndroPi");
- authenticator.setVerifier(verifier);
- Tracer tracer = new Tracer(getContext());
- Router router2 = new Router(getContext());
- router2.attach("/apps/{appId}/", AppServerResource.class);
- router2.attach("/apps/{appId}/rules", RulesServerResource.class);
- router2.attach("/apps/{appId}/rules/{ruleId}", RuleServerResource.class);
- authenticator.setNext(tracer);
- tracer.setNext(router2);
- router.attach("/apps/{appId}", authenticator);
- return router;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement