"defaultMatchingMode"); if (item != null) { getInternalRouter().setDefaultMatchingMode( getInt(item, getInternalRouter().getDefaultMatchingMode())); getInternalRouter() .setDefaultMatchQuery( getBoolean(item, getInternalRouter() .getDefaultMatchQuery())); getInternalRouter().setMaxAttempts( getInt(item, getInternalRouter().getMaxAttempts())); getInternalRouter().setRoutingMode( getInt(item, getInternalRouter().getRoutingMode())); getInternalRouter().setRequiredScore( getFloat(item, getInternalRouter().getRequiredScore())); getInternalRouter().setRetryDelay( getLong(item, getInternalRouter().getRetryDelay())); setAttach(getInternalRouter(), routerNode);
Component component = new Component(); component.getServers().add(Protocol.HTTP, 8182); MyApplication app = new MyApplication(); component.getDefaultHost().attachDefault(app); component.getInternalRouter().attachDefault(app);
if (item != null) { router.setDefaultMatchingMode(getInt(item, getComponent() .getInternalRouter().getDefaultMatchingMode())); if (item != null) { router.setDefaultMatchingQuery(getBoolean(item, getComponent() .getInternalRouter().getDefaultMatchingQuery())); if (item != null) { router.setMaxAttempts(getInt(item, getComponent() .getInternalRouter().getMaxAttempts())); if (item != null) { router.setRoutingMode(getInt(item, getComponent() .getInternalRouter().getRoutingMode())); if (item != null) { router.setRequiredScore(getFloat(item, getComponent() .getInternalRouter().getRequiredScore())); if (item != null) { router.setRetryDelay(getLong(item, getComponent() .getInternalRouter().getRetryDelay()));
parseRouter(getInternalRouter(), childNode); } else if ("logService".equals(childNode.getNodeName())) { Node item = childNode.getAttributes().getNamedItem(
getComponent().getHosts().add(host); } else if ("internalRouter".equals(childNode.getNodeName())) { parseRouter(getComponent().getInternalRouter(), childNode); } else if ("logService".equals(childNode.getNodeName())) {
component.getInternalRouter().handle(request, response); } else if (cr.getRiapAuthorityType() == LocalReference.RIAP_HOST) { VirtualHost host = null;
public static void main(String[] args) throws Exception { userManager = new SampleUserManager(); userManager.addUser("alice").setPassword("abcdef".toCharArray()); userManager.addUser("bob").setPassword("123456".toCharArray()); clientManager = new MemoryClientManager(); Client client = clientManager.createClient(ClientType.CONFIDENTIAL, null, null); System.out.println("SampleClient: client_id=" + client.getClientId() + ", client_secret=" + String.copyValueOf(client.getClientSecret())); tokenManager = new MemoryTokenManager(); // Setup Restlet Component component = new Component(); component.getClients().add(Protocol.HTTP); component.getClients().add(Protocol.HTTPS); component.getClients().add(Protocol.RIAP); component.getClients().add(Protocol.CLAP); component.getServers().add(Protocol.HTTP, 8080); component.getDefaultHost().attach("/sample", new SampleApplication()); OAuth2ServerApplication app = new OAuth2ServerApplication(); component.getDefaultHost().attach("/oauth", app); component.getInternalRouter().attach("/oauth", app); component.start(); } }