/** * Adds a new client connector in the map supporting the given protocol. * * @param protocol * The connector protocol. * @return The added client. */ public Client add(Protocol protocol) { final Client result = new Client(protocol); // result.setContext(getContext().createChildContext()); add(result); return result; }
public static void main(String... args) throws Exception { // Create a component with an HTTP server connector final Component component = new Component(); component.getServers().add(Protocol.HTTP, 8585); component.getClients().add(Protocol.FILE); component.getClients().add(Protocol.CLAP); component.getClients().add(Protocol.HTTP); // Attach the application to the default host and start it component.getDefaultHost().attach("/foaf", new Application()); component.start(); }
public void start() throws Exception { Injector injector = RestletGuice.createInjector(modules); Application instance = injector.getInstance(application); Component component = new Component(); component.getServers().add(Protocol.HTTP, port); component.getClients().add(Protocol.FILE); component.getClients().add(Protocol.CLAP); component.getDefaultHost().attach(instance); component.start(); }
/** * Adds a new client connector in the map supporting the given protocol. * * @param protocol * The connector protocol. * @return The added client. */ public Client add(Protocol protocol) { final Client result = new Client(protocol); result.setContext(getContext().createChildContext()); add(result); return result; }
/** * Adds a new client connector in the map supporting the given protocol. * * @param protocol * The connector protocol. * @return The added client. */ public Client add(Protocol protocol) { final Client result = new Client(protocol); result.setContext(getContext().createChildContext()); add(result); return result; }
public static void main(String[] args) throws Exception { // Setup Restlet Component component = new Component(); component.getClients().add(Protocol.HTTP); component.getClients().add(Protocol.HTTPS); component.getServers().add(Protocol.HTTP, 8888); component.getDefaultHost().attach("/sample", new SampleApplication()); component.start(); } }
/** * default constructor for UmlgRestletComponent */ public UmlgRestletComponent() { setName("restAndJson"); setDescription("Halo, I am your first comment."); getClients().add(Protocol.FILE); getClients().add(Protocol.CLAP); getClients().add(Protocol.RIAP); Server server = new Server(new Context(), Protocol.HTTP, 8111); server.getContext().getParameters().set("tracing", "true"); getServers().add(server); attachApplications(); }
public static void main(String[] args) throws Exception { Component c = new Component(); // server listening on pport 8182 c.getServers().add(Protocol.HTTP, 8182); // client connector required by the Directory. c.getClients().add(Protocol.FILE); c.getDefaultHost().attach(new HttpDigestAuthenticationApplication()); c.start(); }
public static void main(String[] args) throws Exception { Component c = new Component(); // server listening on pport 8182 c.getServers().add(Protocol.HTTP, 8182); // client connector required by the Directory. c.getClients().add(Protocol.FILE); c.getDefaultHost().attach(new AuthenticationApplication()); c.start(); }
public static void main(String[] args) throws Exception { Component component = new Component(); component.getServers().add(Protocol.HTTP, 8111); component.getClients().add(Protocol.FILE); component.getDefaultHost().attach(new MergeSitesServicesApplication()); component.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
/** * Launches the application with an HTTP server. * * @param args * The arguments. * @throws Exception */ public static void main(String[] args) throws Exception { Component mailServer = new Component(); mailServer.getClients().add(Protocol.CLAP); mailServer.getServers().add(Protocol.HTTP, 8111); mailServer.getDefaultHost().attach(new MailServerApplication()); mailServer.start(); }
@Inject public RestComponent(@Hello Application helloApp, @Car Application carApp, Verifier authTokenVerifier) { getClients().add(Protocol.HTTPS); Server secureServer = getServers().add(Protocol.HTTPS, 8043); Series<Parameter> parameters = secureServer.getContext().getParameters(); parameters.add("sslContextFactory", "org.restlet.engine.ssl.DefaultSslContextFactory"); parameters.add("keyStorePath", System.getProperty("javax.net.ssl.keyStorePath")); getDefaultHost().attach("/api/hello", secure(helloApp, authTokenVerifier, "ame")); getDefaultHost().attach("/api/cars", secure(carApp, authTokenVerifier, "ame")); replaceConverter(JacksonConverter.class, new JacksonCustomConverter()); }