Examples of User


Examples of org.hsqldb.rights.User

        PersistentStore store = session.sessionData.getRowStore(t);

        // Intermediate holders
        HsqlArrayList users;
        User          user;
        Object[]      row;
        HsqlName      initialSchema;

        // Initialization
        users = database.getUserManager().listVisibleUsers(session);

        // Do it.
        for (int i = 0; i < users.size(); i++) {
            row           = t.getEmptyRowData();
            user          = (User) users.get(i);
            initialSchema = user.getInitialSchema();
            row[0]        = user.getNameString();
            row[1]        = ValuePool.getBoolean(user.isAdmin());
            row[2]        = ((initialSchema == null) ? null
                                                     : initialSchema.name);

            t.insertSys(store, row);
        }
View Full Code Here

Examples of org.hsqldb_voltpatches.rights.User

                    return Result.newErrorResult(e, sql);
                }
            }
            case StatementTypes.SET_USER_INITIAL_SCHEMA : {
                try {
                    User     user   = (User) parameters[0];
                    HsqlName schema = (HsqlName) parameters[1];

                    session.checkDDLWrite();

                    if (user == null) {
                        user = session.getUser();
                    } else {
                        session.checkAdmin();
                        session.checkDDLWrite();

                        user = session.database.userManager.get(
                            user.getNameString());
                    }

                    if (schema != null) {
                        schema =
                            session.database.schemaManager.getSchemaHsqlName(
                                schema.name);
                    }

                    //
                    user.setInitialSchema(schema);
                    session.database.setMetaDirty(false);

                    //
                    return Result.updateZeroResult;
                } catch (HsqlException e) {
                    return Result.newErrorResult(e, sql);
                }
            }
            case StatementTypes.SET_USER_PASSWORD : {
                try {
                    User   user = parameters[0] == null ? session.getUser()
                                                        : (User) parameters[0];
                    String password = (String) parameters[1];

                    session.checkDDLWrite();
                    session.setScripting(true);
                    user.setPassword(password);

                    return Result.updateZeroResult;
                } catch (HsqlException e) {
                    return Result.newErrorResult(e, sql);
                }
View Full Code Here

Examples of org.infinispan.client.hotrod.protostream.domain.User

      List<Address> addresses = reader.readCollection("address", new ArrayList<Address>(), Address.class);

      Integer age = reader.readInt("age");
      User.Gender gender = reader.readObject("gender", User.Gender.class);

      User user = new User();
      user.setId(id);
      user.setAccountIds(accountIds);
      user.setName(name);
      user.setSurname(surname);
      user.setAge(age);
      user.setGender(gender);
      user.setAddresses(addresses);
      return user;
   }
View Full Code Here

Examples of org.infinispan.loaders.jpa.entity.User

    Cache<String, Document> docCache = cacheManager
            .getCache("documentCache");
      Cache<VehicleId, Vehicle> vehicleCache = cacheManager
            .getCache("vehicleCache");
     
    User user = new User();
    user.setUsername("jdoe");
    user.setFirstName("John");
    user.setLastName("Doe");
    userCache.put(user.getUsername(), user);
   
    Document doc = new Document();
    doc.setName("hello");
    doc.setTitle("Hello World");
    doc.setArticle("hello there... this is a test");
View Full Code Here

Examples of org.infinispan.persistence.jpa.entity.User

    cacheManager.defineConfiguration("userCache", cacheConfig);

    cacheManager.start();
    Cache<String, User> userCache = cacheManager.getCache("userCache");
    User user = new User();
    user.setUsername("rtsang");
    user.setFirstName("Ray");
    user.setLastName("Tsang");
    userCache.put(user.getUsername(), user);
    userCache.stop();
    cacheManager.stop();
  }
View Full Code Here

Examples of org.infinispan.protostream.domain.User

   @Test
   public void testReadWrite() throws Exception {
      SerializationContext ctx = createContext();

      User user = new User();
      user.setId(1);
      user.setName("John");
      user.setSurname("Batman");
      user.setGender(User.Gender.MALE);
      user.setAccountIds(new HashSet<Integer>(Arrays.asList(1, 3)));
      user.setAddresses(Collections.singletonList(new Address("Old Street", "XYZ42")));

      byte[] bytes = ProtobufUtil.toByteArray(ctx, user);

      ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
      CodedInputStream codedInputStream = CodedInputStream.newInstance(bais);
View Full Code Here

Examples of org.infinispan.protostream.sampledomain.User

      assertTrue("The query execution total time should be > 0.", (Long) server.getAttribute(name, "SearchQueryTotalTime") > 0);
      assertEquals((long) 1, server.getAttribute(name, "SearchQueryExecutionCount"));
   }

   private User createUser(int id) {
      User user = new User();
      user.setId(id);
      user.setName("Tom" + id);
      user.setSurname("Cat" + id);
      user.setGender(User.Gender.MALE);
      user.setAccountIds(Collections.singletonList(12));
      Address address = new Address();
      address.setStreet("Dark Alley");
      address.setPostCode("123" + id);
      user.setAddresses(Collections.singletonList(address));
      return user;
   }
View Full Code Here

Examples of org.infinispan.query.dsl.embedded.sample_domain_model.User

@Test(groups = "functional", testName = "query.dsl.QueryDslIterationTest")
public class QueryDslIterationTest extends AbstractQueryDslTest {

   @BeforeMethod
   protected void populateCache() throws Exception {
      User user1 = new User();
      user1.setId(1);
      user1.setName("John");
      user1.setSurname("White");

      User user2 = new User();
      user2.setId(2);
      user2.setName("Jack");
      user2.setSurname("Black");

      User user3 = new User();
      user3.setId(3);
      user3.setName("John");
      user3.setSurname("Brown");

      User user4 = new User();
      user4.setId(4);
      user4.setName("Michael");
      user4.setSurname("Black");

      cache.put("user_" + user1.getId(), user1);
      cache.put("user_" + user2.getId(), user2);
      cache.put("user_" + user3.getId(), user3);
      cache.put("user_" + user4.getId(), user4);
   }
View Full Code Here

Examples of org.infinispan.query.dsl.embedded.testdomain.User

@Test(groups = "functional", testName = "query.dsl.QueryDslIterationTest")
public class QueryDslIterationTest extends AbstractQueryDslTest {

   @BeforeClass(alwaysRun = true)
   protected void populateCache() throws Exception {
      User user1 = getModelFactory().makeUser();
      user1.setId(1);
      user1.setName("John");
      user1.setSurname("White");

      User user2 = getModelFactory().makeUser();
      user2.setId(2);
      user2.setName("Jack");
      user2.setSurname("Black");

      User user3 = getModelFactory().makeUser();
      user3.setId(3);
      user3.setName("John");
      user3.setSurname("Brown");

      User user4 = getModelFactory().makeUser();
      user4.setId(4);
      user4.setName("Michael");
      user4.setSurname("Black");

      getCacheForWrite().put("user_" + user1.getId(), user1);
      getCacheForWrite().put("user_" + user2.getId(), user2);
      getCacheForWrite().put("user_" + user3.getId(), user3);
      getCacheForWrite().put("user_" + user4.getId(), user4);
   }
View Full Code Here

Examples of org.internna.iwebmvc.model.User

     *
     * @return the user of the active request.
     */
    public User getActiveUser() {
        HttpServletRequest request = RequestUtils.getActiveRequest();
        User user = (User) WebUtils.getSessionAttribute(request, SESSION_USER);
        if (user instanceof UserImpl) return user;
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        if (auth != null) {
            if (auth.getPrincipal() instanceof UserDetails) {
                user = securityDAO.findUser(((UserDetails) auth.getPrincipal()).getUsername());
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.