Package org.atomojo.auth.service.db

Examples of org.atomojo.auth.service.db.Role


                  if (facetName==null && facetId==null) {
                     Representation entity = new DBIteratorRepresentation(MediaType.APPLICATION_XML,XML.ROLES_NAME,user.getRoles());
                     entity.setCharacterSet(CharacterSet.UTF_8);
                     return entity;
                  } else {
                     Role role = fetchRole(user);
                     if (role!=null) {
                        Representation entity = new DBObjectRepresentation(MediaType.APPLICATION_XML,role);
                        entity.setCharacterSet(CharacterSet.UTF_8);
                        return entity;
                     } else {
View Full Code Here


            Element top = doc.getDocumentElement();
            if (facet!=null && facet.equals(ROLE_FACET)) {
               if (top.getName().equals(XML.ROLE_NAME)) {
                  String sid = top.getAttributeValue("id");
                  String name = top.getAttributeValue("name");
                  Role role = null;
                  if (sid!=null) {
                     role = db.getRole(UUID.fromString(sid));
                  }
                  if (name!=null && role==null) {
                     role = db.getRole(name);
View Full Code Here

   }
  
   protected Role fetchRole(User user)
      throws SQLException,IllegalArgumentException
   {
      Role role = null;
      if (facetName!=null) {
         role = db.getRole(facetName);
      }
      if (facetId!=null) {
         UUID id = UUID.fromString(facetId);
View Full Code Here

               if (facet.equals(ROLE_FACET)) {
                  if (facetName==null && facetId==null) {
                     getResponse().setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED);
                     return null;
                  } else {
                     Role role = fetchRole(user);
                     if (role!=null) {
                        if (user.removeRole(role)) {
                           getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
                           return null;
                        } else {
View Full Code Here

   }
  
   public Representation get()
   {
      try {
         Role role = fetchRole();
         if (role==null) {
            getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND);
            return new StringRepresentation("Role not found.");
         }
         if (realmId!=null || realmName!=null) {
View Full Code Here

   }
  
   protected Role fetchRole()
      throws SQLException,IllegalArgumentException
   {
      Role role = null;
      if (roleName!=null) {
         role = db.getRole(roleName);
      }
      if (roleId!=null) {
         UUID id = UUID.fromString(roleId);
View Full Code Here

         String sid = top.getAttributeValue("id");
         UUID id = sid==null ? UUID.randomUUID() : UUID.fromString(sid);
         String name = top.getAttributeValue("name");

         try {
            Role rootRole = db.getRole(AuthDB.REALM_ROOT_ROLE);
            if (rootRole==null) {
               getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
               return new StringRepresentation("Realm root role not found.");
            }
            Role editorRole = db.getRole(AuthDB.EDITOR_ROLE);
            if (editorRole==null) {
               getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
               return new StringRepresentation("Editor role not found.");
            }
            Realm realm = db.getRealm(name);
View Full Code Here

TOP

Related Classes of org.atomojo.auth.service.db.Role

Copyright © 2018 www.massapicom. 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.