Examples of SkeletonKeyApplication


Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

      deployment = new ResteasyDeployment();
      deployment.setSecurityEnabled(true);
      deployment.setApplicationClass(SApp.class.getName());

      EmbeddedContainer.start(deployment);
      SkeletonKeyApplication app = ((SApp)deployment.getApplication()).app;

      KeyPair keyPair = KeyPairGenerator.getInstance("RSA", "BC").generateKeyPair();
      privateKey = keyPair.getPrivate();
      certificate = KeyTools.generateTestCertificate(keyPair);
      app.getTokenService().setCertificate(certificate);
      app.getTokenService().setPrivateKey(privateKey);

      StoredUser admin = new StoredUser();
      admin.setName("Bill");
      admin.setUsername("wburke");
      HashMap<String, String> creds = new HashMap<String, String>();
      creds.put("password", "geheim");
      admin.setCredentials(creds);
      app.getUsers().create(admin);

      Project project = new Project();
      project.setName("Skeleton Key");
      project.setEnabled(true);
      app.getProjects().createProject(project);

      Role adminRole = new Role();
      adminRole.setName("admin");
      app.getRoles().create(adminRole);

      app.getProjects().addUserRole(project.getId(), admin.getId(), adminRole.getId());

      // Test export/import
      System.out.println(new Loader().export(app.getCache()));

      try
      {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         new Loader().export(app.getCache(), baos);
         ByteArrayInputStream bios = new ByteArrayInputStream(baos.toByteArray());
         app.getCache().clear();
         new Loader().importStore(bios, app.getCache());
      }
      catch (Exception e)
      {
         e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
      }
View Full Code Here

Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

   {
      SkeletonKeyApplication app;

      public SApp(@Context Configurable confgurable)
      {
         this.app = new SkeletonKeyApplication(confgurable);
      }
View Full Code Here

Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

{
   protected SkeletonKeyApplication app;

   public Server(@Context Configurable confgurable)
   {
      app = new SkeletonKeyApplication(confgurable);

      try
      {
         StoredUser admin = new StoredUser();
         admin.setName("Bill");
View Full Code Here

Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

   {
      SkeletonKeyApplication app;

      public SApp(@Context Configurable confgurable)
      {
         this.app = new SkeletonKeyApplication(confgurable);
      }
View Full Code Here

Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

   {
      SkeletonKeyApplication app;

      public SApp(@Context Configurable confgurable)
      {
         this.app = new SkeletonKeyApplication(confgurable);
      }
View Full Code Here

Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

   {
      SkeletonKeyApplication app;

      public SApp(@Context Configurable confgurable)
      {
         this.app = new SkeletonKeyApplication(confgurable);
      }
View Full Code Here

Examples of org.jboss.resteasy.keystone.server.SkeletonKeyApplication

   {
      SkeletonKeyApplication app;

      public SApp(@Context Configurable confgurable)
      {
         this.app = new SkeletonKeyApplication(confgurable);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.