Package org.exist.config

Examples of org.exist.config.Configuration


            LOG.debug("loading configuration failed: " + e.getMessage());
        } finally {
            transaction.close(txn);
        }
     
        final Configuration _config_ = Configurator.parse(this, broker, collection, CONFIG_FILE_URI);
        configuration = Configurator.configure(this, _config_);


        for (final Realm realm : realms) {
            realm.start(broker);
View Full Code Here


   
        if(isAccount || isGroup) {
            //uri = uri.removeLastSegment();
            //String realmId = uri.lastSegment().toString();
            //AbstractRealm realm = (AbstractRealm)findRealmForRealmId(realmId);
            final Configuration conf = Configurator.parse(document);

          saving.put(document.getURI(), conf.getPropertyInteger("id"));
        }
    }
View Full Code Here

            uri = uri.removeLastSegment();

            final String realmId = uri.lastSegment().toString();
     
            final AbstractRealm realm = (AbstractRealm)findRealmForRealmId(realmId);
            final Configuration conf = Configurator.parse(document);

            Integer id = -1;
            if(isRemoved) {
                id = conf.getPropertyInteger("id");
            }

            final String name = conf.getProperty("name");

            if(isAccount) {
                if (isRemoved && id > 2 && !hasUser(id)) {
                    final AccountImpl account = new AccountImpl( realm, conf );
                    account.removed = true;
                    addUser(account.getId(), account);
                } else if(name != null) {
                  if (realm.hasAccount(name)) {
                    final Integer oldId = saving.get(document.getURI());
                   
                  final Integer newId = conf.getPropertyInteger("id");
                 
                  //XXX: resolve conflicts on ids!!!
                 
                  if (!newId.equals(oldId)) {
                        final Account current = realm.getAccount(name);
View Full Code Here

                        mockDatabase
                    }
                )
        );

        Configuration mockConfiguration = EasyMock.createMock(Configuration.class);

        AbstractRealm mockRealm = EasyMock.createMock(AbstractRealm.class,
                new ConstructorArgs(
                    AbstractRealm.class.getDeclaredConstructor(SecurityManager.class, Configuration.class),
                    new Object[] {
View Full Code Here

   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    InputStream is = new ByteArrayInputStream(config.getBytes(UTF_8));
   
    Configuration config = Configurator.parse(is);

    realm = new LDAPRealm(null, config);
  }
View Full Code Here


    @Test
    public void updateGroup_calls_assertCanModifyGroup() throws PermissionDeniedException, EXistException {
        SecurityManager mockSecurityManager = EasyMock.createMock(SecurityManager.class);
        Configuration mockConfiguration = EasyMock.createMock(Configuration.class);
        Database mockDatabase = EasyMock.createMock(Database.class);
        DBBroker mockBroker = EasyMock.createMock(DBBroker.class);
        Subject mockSubject = EasyMock.createMock(Subject.class);

        Group mockGroup = EasyMock.createMockBuilder(AbstractGroup.class)
View Full Code Here

 
  @Test
  public void simple() throws Exception {
    InputStream is = new ByteArrayInputStream(config1.getBytes(UTF_8));
       
        Configuration config = Configurator.parse(is);
       
        ConfigurableObject object = new ConfigurableObject(config);
       
        assertNotNull(object.subclasses);
       
View Full Code Here

        if(collectionGroups != null && collectionGroups.getDocumentCount(broker) > 0) {
           
            final AbstractRealm r = this;
           
            for(final Iterator<DocumentImpl> i = collectionGroups.iterator(broker); i.hasNext(); ) {
                final Configuration conf = Configurator.parse(i.next());
                final String name = conf.getProperty("name");
               
                groupsByName.modifyE(new PrincipalDbModifyE<Group, ConfigurationException>() {

                    @Override
                    public void execute(final Map<String, Group> principalDb) throws ConfigurationException {
View Full Code Here

   
    private void loadRemovedGroupsFromRealmStorage(final DBBroker broker) throws ConfigurationException, PermissionDeniedException, LockException {
        //load marked for remove groups information
        if (collectionRemovedGroups != null && collectionRemovedGroups.getDocumentCount(broker) > 0) {
            for(final Iterator<DocumentImpl> i = collectionRemovedGroups.iterator(broker); i.hasNext(); ) {
                final Configuration conf = Configurator.parse(i.next());
                final Integer id = conf.getPropertyInteger("id");
               
                if (id != null && !getSecurityManager().hasGroup(id)) {
                   
                    //G group = instantiateGroup(this, conf, true);
                    final GroupImpl group = new GroupImpl(this, conf);
View Full Code Here

           
            final AbstractRealm r = this;
           
            for(final Iterator<DocumentImpl> i = collectionAccounts.iterator(broker); i.hasNext(); ) {
                final DocumentImpl doc = i.next();
                final Configuration conf = Configurator.parse(doc);
                final String name = conf.getProperty("name");
               
                usersByName.modifyE(new PrincipalDbModifyE<Account, ConfigurationException>(){
                    @Override
                    public void execute(final Map<String, Account> principalDb) throws ConfigurationException {
                        if(name != null && !principalDb.containsKey(name)) {
View Full Code Here

TOP

Related Classes of org.exist.config.Configuration

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.