Examples of SystemScope


Examples of org.apache.harmony.security.SystemScope

     * @com.intel.drl.spec_ref
     */
    public static IdentityScope getSystemScope() {

        if (systemScope == null) {
            systemScope = new SystemScope("System Scope"); //$NON-NLS-1$
        }
        return systemScope;
    }
View Full Code Here

Examples of org.apache.harmony.security.SystemScope

    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        if (mode) ss = new SystemScope("SystemScope");
        else {
            ss = IdentityScope.getSystemScope();
            Enumeration e = ss.identities();
            while (e.hasMoreElements()) ss.removeIdentity((Identity)e.nextElement());
        }
View Full Code Here

Examples of org.apache.harmony.security.SystemScope

    /*
     * Class under test for void SystemScope(String)
     */
    public void testSystemScopeString() {
        SystemScope ss = new SystemScope("SystemScope");
        assertEquals("SystemScope", ss.getName());      
    }
View Full Code Here

Examples of org.apache.harmony.security.SystemScope

    /*
     * Class under test for void SystemScope(String, IdentityScope)
     */
    public void testSystemScopeStringIdentityScope() throws Exception {
        SystemScope ss = new SystemScope("SystemScope");
        SystemScope nested = new SystemScope("NestedScope", ss);
        assertEquals("NestedScope", nested.getName());
        assertSame(ss, nested.getScope());
    }
View Full Code Here

Examples of org.apache.harmony.security.SystemScope

    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        if (mode) ss = new SystemScope("SystemScope");
        else {
            ss = IdentityScope.getSystemScope();
            Enumeration e = ss.identities();
            while (e.hasMoreElements()) ss.removeIdentity((Identity)e.nextElement());
        }
View Full Code Here

Examples of org.apache.harmony.security.SystemScope

    /*
     * Class under test for void SystemScope(String)
     */
    public void testSystemScopeString() {
        SystemScope ss = new SystemScope("SystemScope");
        assertEquals("SystemScope", ss.getName());      
    }
View Full Code Here

Examples of org.apache.harmony.security.SystemScope

    /*
     * Class under test for void SystemScope(String, IdentityScope)
     */
    public void testSystemScopeStringIdentityScope() throws Exception {
        SystemScope ss = new SystemScope("SystemScope");
        SystemScope nested = new SystemScope("NestedScope", ss);
        assertEquals("NestedScope", nested.getName());
        assertSame(ss, nested.getScope());
    }
View Full Code Here

Examples of org.mitre.oauth2.model.SystemScope

     * @throws IOException
     */
    private void readSystemScopes(JsonReader reader) throws IOException {
        reader.beginArray();
        while (reader.hasNext()) {
            SystemScope scope = new SystemScope();
            reader.beginObject();
            while (reader.hasNext()) {
                switch (reader.peek()) {
                    case END_OBJECT:
                        continue;
                    case NAME:
                        String name = reader.nextName();
                        if (reader.peek() == JsonToken.NULL) {
                            reader.skipValue();
                        } else if (name.equals("value")) {
                            scope.setValue(reader.nextString());
                        } else if (name.equals("description")) {
                            scope.setDescription(reader.nextString());
                        } else if (name.equals("allowDynReg")) {
                            scope.setAllowDynReg(reader.nextBoolean());
                        } else if (name.equals("defaultScope")) {
                            scope.setDefaultScope(reader.nextBoolean());
                        } else if (name.equals("icon")) {
                            scope.setIcon(reader.nextString());
                        } else {
                            logger.debug("found unexpected entry");
                            reader.skipValue();
                        }
                        break;
View Full Code Here

Examples of org.mitre.oauth2.model.SystemScope

  }

  @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json")
  public String getScope(@PathVariable("id") Long id, ModelMap m) {

    SystemScope scope = scopeService.getById(id);

    if (scope != null) {

      m.put("entity", scope);
View Full Code Here

Examples of org.mitre.oauth2.model.SystemScope

  @PreAuthorize("hasRole('ROLE_ADMIN')")
  @RequestMapping(value = "/{id}", method = RequestMethod.PUT, produces = "application/json", consumes = "application/json")
  public String updateScope(@PathVariable("id") Long id, @RequestBody String json, ModelMap m) {

    SystemScope existing = scopeService.getById(id);

    SystemScope scope = gson.fromJson(json, SystemScope.class);

    if (existing != null && scope != null) {

      if (existing.getId().equals(scope.getId())) {
        // sanity check

        scope = scopeService.save(scope);

        m.put("entity", scope);

        return JsonEntityView.VIEWNAME;
      } else {

        logger.error("updateScope failed; scope ids to not match: got "
            + existing.getId() + " and " + scope.getId());

        m.put("code", HttpStatus.BAD_REQUEST);
        m.put("errorMessage", "Could not update scope. Scope ids to not match: got "
            + existing.getId() + " and " + scope.getId());
        return JsonErrorView.VIEWNAME;
      }

    } else {
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.