changes to get ExportAdmins working under 2.0, ExportApp is still failing.

Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/bdf518b4
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/bdf518b4
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/bdf518b4

Branch: refs/heads/master
Commit: bdf518b430f95fa10ddc7bd6456fec800e1aa1ef
Parents: 2ed5713
Author: Dave Johnson <snoopd...@apache.org>
Authored: Tue Dec 8 07:36:28 2015 -0500
Committer: Dave Johnson <snoopd...@apache.org>
Committed: Tue Dec 8 07:36:28 2015 -0500

----------------------------------------------------------------------
 stack/tools/pom.xml                             |   4 +-
 .../org/apache/usergrid/tools/ExportApp.java    |  38 +++---
 .../usergrid/tools/ExportDataCreator.java       |  22 +++-
 .../org/apache/usergrid/tools/ToolBase.java     |   8 ++
 stack/tools/src/main/resources/log4j.properties |   3 +-
 .../main/resources/toolsApplicationContext.xml  | 124 +++++++++----------
 .../apache/usergrid/tools/ExportAppTest.java    |  12 +-
 .../usergrid/tools/ExportImportAdminsTest.java  |   4 +-
 .../test/resources/usergrid-test-context.xml    |  63 ++++++++++
 9 files changed, 187 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/pom.xml
----------------------------------------------------------------------
diff --git a/stack/tools/pom.xml b/stack/tools/pom.xml
index 6b65268..01766eb 100644
--- a/stack/tools/pom.xml
+++ b/stack/tools/pom.xml
@@ -60,16 +60,16 @@
     </resources>
 
     <plugins>
+
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <!-- <groups>fast,${groups}</groups> -->
           <systemPropertyVariables>
             <storage-config>${basedir}/src/test/conf</storage-config>
           </systemPropertyVariables>
           <forkMode>always</forkMode>
-          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 
-Dsun.jnu.encoding=UTF-8 
-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec
 
-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
 ${ug.argline}</argLine>
+          <argLine>-Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 
-Dsun.jnu.encoding=UTF-8 
-javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar
 ${ug.argline}</argLine>
         </configuration>
       </plugin>
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java 
b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
index f5e5d34..9e522d2 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportApp.java
@@ -135,25 +135,20 @@ public class ExportApp extends ExportingToolBase {
 
         Observable<String> collectionsObservable = Observable.create( new 
CollectionsObservable( em ) );
 
-        collectionsObservable.flatMap( new Func1<String, 
Observable<ExportEntity>>() {
+        logger.debug( "Starting export" );
 
-            public Observable<ExportEntity> call(String collection) {
+        collectionsObservable.flatMap( collection -> {
 
-                return Observable.create( new EntityObservable( em, collection 
) )
-                        .doOnNext( new EntityWriteAction() ).subscribeOn( 
writeScheduler );
-            }
-
-        }, writeThreadCount ).flatMap( new Func1<ExportEntity, 
Observable<ExportConnection>>() {
+            return Observable.create( new EntityObservable( em, collection ) )
+                    .doOnNext( new EntityWriteAction() ).subscribeOn( 
writeScheduler );
 
-            public Observable<ExportConnection> call(ExportEntity 
exportEntity) {
+        }, writeThreadCount ).flatMap( exportEntity -> {
 
-                return Observable.create( new ConnectionsObservable( em, 
exportEntity ) )
-                        .doOnNext( new ConnectionWriteAction() ).subscribeOn( 
writeScheduler );
-            }
+            return Observable.create( new ConnectionsObservable( em, 
exportEntity ) )
+                    .doOnNext( new ConnectionWriteAction() ).subscribeOn( 
writeScheduler );
 
         }, writeThreadCount )
-            .doOnCompleted( new FileWrapUpAction() )
-            .toBlocking().last();
+            .doOnCompleted( new FileWrapUpAction() 
).toBlocking().lastOrDefault(null);
     }
 
 
@@ -176,6 +171,10 @@ public class ExportApp extends ExportingToolBase {
             int count = 0;
             try {
                 Map<String, Object> collectionMetadata = 
em.getApplicationCollectionMetadata();
+
+                logger.debug( "Emitting {} collection names for application 
{}",
+                    collectionMetadata.size(), em.getApplication().getName() );
+
                 for ( String collection : collectionMetadata.keySet() ) {
                     subscriber.onNext( collection );
                     count++;
@@ -274,8 +273,8 @@ public class ExportApp extends ExportingToolBase {
 
         public void call(Subscriber<? super ExportConnection> subscriber) {
 
-            logger.info( "Starting to read connections for entity {} type {}",
-                    exportEntity.getEntity().getName(), 
exportEntity.getEntity().getType() );
+//            logger.debug( "Starting to read connections for entity {} type 
{}",
+//                    exportEntity.getEntity().getName(), 
exportEntity.getEntity().getType() );
 
             int count = 0;
 
@@ -311,8 +310,13 @@ public class ExportApp extends ExportingToolBase {
             }
 
             subscriber.onCompleted();
-            logger.info("Completed entity {} type {} connections count {}",
-                new Object[] { exportEntity.getEntity().getName(), 
exportEntity.getEntity().getType(), count });
+
+            if ( count == 0 ) {
+                logger.debug("Completed entity {} type {} no connections",
+                    new Object[] { exportEntity.getEntity().getUuid(), 
exportEntity.getEntity().getType() });
+            }
+//            logger.debug("Completed entity {} type {} connections count {}",
+//                new Object[] { exportEntity.getEntity().getUuid(), 
exportEntity.getEntity().getType(), count });
         }
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
----------------------------------------------------------------------
diff --git 
a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java 
b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
index 4b9e5a0..5ad29d2 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ExportDataCreator.java
@@ -160,22 +160,30 @@ public class ExportDataCreator extends ToolBase {
             Entity userEntity = null;
             try {
                 final Map<String, Object> userMap = new HashMap<String, 
Object>() {{
+                    put( "name", person.username() );
                     put( "username", person.username() );
                     put( "password", person.password() );
                     put( "email", person.email() );
                     put( "companyEmail", person.companyEmail() );
-                    put( "dateOfBirth", person.dateOfBirth() );
+                    put( "dateOfBirth", 
person.dateOfBirth().toDate().toString());
                     put( "firstName", person.firstName() );
                     put( "lastName", person.lastName() );
                     put( "nationalIdentificationNumber", 
person.nationalIdentificationNumber() );
                     put( "telephoneNumber", person.telephoneNumber() );
                     put( "passportNumber", person.passportNumber() );
-                    put( "address", person.getAddress() );
+                    put( "address", new HashMap<String, Object>() {{
+                        put("streetNumber", 
person.getAddress().streetNumber());
+                        put("street", person.getAddress().street());
+                        put("city", person.getAddress().getCity());
+                        put("postalCode", person.getAddress().getPostalCode());
+                    }});
                 }};
 
                 userEntity = em.create( "user", userMap );
                 users.add( userEntity );
 
+                logger.debug("Created user {}", userEntity.getName());
+
             } catch (DuplicateUniquePropertyExistsException e) {
                 logger.error( "Dup user generated: " + person.username() );
                 continue;
@@ -204,6 +212,7 @@ public class ExportDataCreator extends ToolBase {
                 }
 
                 em.createConnection( userEntity, "employer", companyEntity );
+                logger.debug("User {} now employed by {}", 
userEntity.getName(), companyEntity.getName());
 
             } catch (DuplicateUniquePropertyExistsException e) {
                 logger.error( "Dup company generated {} property={}", 
company.name(), e.getPropertyName() );
@@ -224,12 +233,17 @@ public class ExportDataCreator extends ToolBase {
                     activity.setContent( "User " + person.username() + " 
generated a random string "
                             + RandomStringUtils.randomAlphanumeric( 5 ) );
                     em.createItemInCollection( userEntity, "activities", 
"activity", activity.getProperties() );
+
+                    logger.debug("Created activity {}", activity.getContent());
                 }
 
                 if (users.size() > 10) {
                     for (int j = 0; j < 5; j++) {
                         try {
-                            em.createConnection( userEntity, "associate", 
users.get( (int) (Math.random() * users.size()) ) );
+                            Entity otherUser = users.get( (int) (Math.random() 
* users.size()) );
+                            em.createConnection( userEntity, "associate", 
otherUser );
+                            logger.debug("User {} now associated with user {}",
+                                userEntity.getName(), otherUser.getName());
                         } catch (Exception e) {
                             logger.error( "Error connecting user to user: " + 
e.getMessage() );
                         }
@@ -242,6 +256,8 @@ public class ExportDataCreator extends ToolBase {
             }
 
         }
+
+        em.refreshIndex();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java 
b/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
index c9fee00..7fb7015 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
@@ -135,6 +135,12 @@ public abstract class ToolBase {
         Option hostOption = OptionBuilder.withArgName( "host" ).hasArg()
             .withDescription( "Cassandra host" ).create( "host" );
 
+        Option esHostOption = OptionBuilder.withArgName( "eshost" ).hasArg()
+            .withDescription( "ElasticSearch host" ).create( "eshost" );
+
+        Option esClusterOption = OptionBuilder.withArgName( "escluster" 
).hasArg()
+            .withDescription( "ElasticSearch cluster name" ).create( 
"escluster" );
+
         Option remoteOption = OptionBuilder
             .withDescription( "Use remote Cassandra instance" ).create( 
"remote" );
 
@@ -144,6 +150,8 @@ public abstract class ToolBase {
 
         Options options = new Options();
         options.addOption( hostOption );
+        options.addOption( esHostOption );
+        options.addOption( esClusterOption );
         options.addOption( remoteOption );
         options.addOption( verbose );
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/resources/log4j.properties 
b/stack/tools/src/main/resources/log4j.properties
index cebf385..1b60906 100644
--- a/stack/tools/src/main/resources/log4j.properties
+++ b/stack/tools/src/main/resources/log4j.properties
@@ -27,7 +27,7 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) [%c] - %m%n
 
 log4j.category.org.apache.usergrid.tools=DEBUG
-log4j.category.org.apache.usergrid=WARN
+
 #log4j.logger.org.apache.usergrid.management.cassandra=DEBUG
 #log4j.logger.org.apache.usergrid.tools=INFO
 #log4j.logger.org.apache.usergrid=INFO
@@ -56,4 +56,3 @@ 
log4j.logger.me.prettyprint.hector.api.beans.AbstractComposite=ERROR
 
 #log4j.logger.org.apache.usergrid.persistence.collection=INFO
 #log4j.logger.org.apache.usergrid.persistence.index=DEBUG
-#log4j.logger.org.apache.usergrid.persistence.index.impl=DEBUG

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/main/resources/toolsApplicationContext.xml
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/resources/toolsApplicationContext.xml 
b/stack/tools/src/main/resources/toolsApplicationContext.xml
index 048fc58..7e55893 100644
--- a/stack/tools/src/main/resources/toolsApplicationContext.xml
+++ b/stack/tools/src/main/resources/toolsApplicationContext.xml
@@ -1,62 +1,62 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans";
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:p="http://www.springframework.org/schema/p";
-       xmlns:aop="http://www.springframework.org/schema/aop"; 
xmlns:beans="http://www.springframework.org/schema/beans";
-       xmlns:context="http://www.springframework.org/schema/context";
-       xmlns:jee="http://www.springframework.org/schema/jee"; 
xmlns:lang="http://www.springframework.org/schema/lang";
-       xmlns:task="http://www.springframework.org/schema/task"; 
xmlns:util="http://www.springframework.org/schema/util";
-       xsi:schemaLocation="http://www.springframework.org/schema/aop
-               http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
-               http://www.springframework.org/schema/beans
-               http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-               http://www.springframework.org/schema/context
-               
http://www.springframework.org/schema/context/spring-context-3.1.xsd
-               http://www.springframework.org/schema/jee
-               http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
-               http://www.springframework.org/schema/lang
-               http://www.springframework.org/schema/lang/spring-lang-3.1.xsd
-               http://www.springframework.org/schema/task
-               http://www.springframework.org/schema/task/spring-task-3.1.xsd
-               http://www.springframework.org/schema/util
-               http://www.springframework.org/schema/util/spring-util-3.1.xsd";>
-
-       
-       <bean id="properties"
-               
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
-               <property name="singleton" value="true" />
-               <property name="ignoreResourceNotFound" value="true" />
-               <property name="locations">
-                       <list>
-                               
<value>classpath:/usergrid-default.properties</value>
-                               <value>classpath:/usergrid.properties</value>
-                               
<value>file:./usergrid-custom-tools.properties</value>
-                       </list>
-               </property>
-       </bean>
-
-       <bean id="propertyPlaceholderConfigurer"
-               
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
-               <property name="properties" ref="properties" />
-               <property name="systemPropertiesModeName">
-                       <value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value>
-               </property>
-       </bean>
-
-       <import resource="classpath:/usergrid-rest-context.xml"/>
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:p="http://www.springframework.org/schema/p";
+       xmlns:aop="http://www.springframework.org/schema/aop"; 
xmlns:beans="http://www.springframework.org/schema/beans";
+       xmlns:context="http://www.springframework.org/schema/context";
+       xmlns:jee="http://www.springframework.org/schema/jee"; 
xmlns:lang="http://www.springframework.org/schema/lang";
+       xmlns:task="http://www.springframework.org/schema/task"; 
xmlns:util="http://www.springframework.org/schema/util";
+       xsi:schemaLocation="http://www.springframework.org/schema/aop
+               http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+               http://www.springframework.org/schema/beans
+               http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+               http://www.springframework.org/schema/context
+               
http://www.springframework.org/schema/context/spring-context-3.1.xsd
+               http://www.springframework.org/schema/jee
+               http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
+               http://www.springframework.org/schema/lang
+               http://www.springframework.org/schema/lang/spring-lang-3.1.xsd
+               http://www.springframework.org/schema/task
+               http://www.springframework.org/schema/task/spring-task-3.1.xsd
+               http://www.springframework.org/schema/util
+               http://www.springframework.org/schema/util/spring-util-3.1.xsd";>
+
+
+       <bean id="properties"
+               
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+               <property name="singleton" value="true" />
+               <property name="ignoreResourceNotFound" value="true" />
+               <property name="locations">
+                       <list>
+                               
<value>classpath:/usergrid-default.properties</value>
+                               <value>classpath:/usergrid.properties</value>
+                               
<value>file:./usergrid-custom-tools.properties</value>
+                       </list>
+               </property>
+       </bean>
+
+       <bean id="propertyPlaceholderConfigurer"
+               
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+               <property name="properties" ref="properties" />
+               <property name="systemPropertiesModeName">
+                       <value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value>
+               </property>
+       </bean>
+
+       <import resource="classpath:/usergrid-rest-context.xml"/>
+</beans>

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
----------------------------------------------------------------------
diff --git 
a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java 
b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
index 62d7676..429e700 100644
--- a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
+++ b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportAppTest.java
@@ -53,25 +53,29 @@ public class ExportAppTest {
 
         String orgName = "org_" + rand;
         String appName = "app_" + rand;
+        String userName = "user_" + rand;
 
         ExportDataCreator creator = new ExportDataCreator();
         creator.startTool( new String[] {
                 "-organization", orgName,
                 "-application", appName,
-                "-host", "localhost:9120",
+                "-username", userName,
+                "-host", "localhost:9160",
                 "-eshost", "localhost:9200",
                 "-escluster", "elasticsearch"
         }, false);
 
         long start = System.currentTimeMillis();
 
+        // export app to a directory
+
         String directoryName = "target/export" + rand;
 
         ExportApp exportApp = new ExportApp();
         exportApp.startTool( new String[] {
                 "-application", orgName + "/" + appName,
                 "-writeThreads", "100",
-                "-host", "localhost:9120",
+                "-host", "localhost:9160",
                 "-eshost", "localhost:9200",
                 "-escluster", "elasticsearch",
                 "-outputDir", directoryName
@@ -79,6 +83,8 @@ public class ExportAppTest {
 
         logger.info( "100 read and 100 write threads = " + 
(System.currentTimeMillis() - start) / 1000 + "s" );
 
+        // check that we got the expected number of export files
+
         File exportDir = new File(directoryName);
         assertTrue( getFileCount( exportDir, "entities"    ) > 0 );
         assertTrue( getFileCount( exportDir, "connections" ) > 0 );
@@ -89,7 +95,7 @@ public class ExportAppTest {
         exportApp.startTool( new String[] {
                 "-application", orgName + "/" + appName,
                 "-writeThreads", "1",
-                "-host", "localhost:9120",
+                "-host", "localhost:9160",
                 "-eshost", "localhost:9200",
                 "-escluster", "elasticsearch",
                 "-outputDir", directoryName + "1"

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
----------------------------------------------------------------------
diff --git 
a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
 
b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
index 5573279..72fad45 100644
--- 
a/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
+++ 
b/stack/tools/src/test/java/org/apache/usergrid/tools/ExportImportAdminsTest.java
@@ -83,7 +83,7 @@ public class ExportImportAdminsTest {
 
         ExportAdmins exportAdmins = new ExportAdmins();
         exportAdmins.startTool( new String[] {
-            "-host", "localhost:9120",
+            "-host", "localhost:9160",
             "-outputDir", directoryName
         }, false );
 
@@ -216,7 +216,7 @@ public class ExportImportAdminsTest {
 
         ImportAdmins importAdmins = new ImportAdmins();
         importAdmins.startTool( new String[]{
-            "-host", "localhost:9120",
+            "-host", "localhost:9160",
             "-eshost", "localhost:9200",
             "-escuster", "usergrid",
             "-inputDir", tempDir.getAbsolutePath()

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bdf518b4/stack/tools/src/test/resources/usergrid-test-context.xml
----------------------------------------------------------------------
diff --git a/stack/tools/src/test/resources/usergrid-test-context.xml 
b/stack/tools/src/test/resources/usergrid-test-context.xml
new file mode 100644
index 0000000..da82bd0
--- /dev/null
+++ b/stack/tools/src/test/resources/usergrid-test-context.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:util="http://www.springframework.org/schema/util";
+       xmlns:context="http://www.springframework.org/schema/context"; 
xmlns:p="http://www.springframework.org/schema/p";
+       xmlns:hz="http://www.hazelcast.com/schema/config"; 
xmlns:aop="http://www.springframework.org/schema/aop";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+       http://www.springframework.org/schema/util 
http://www.springframework.org/schema/util/spring-util-3.1.xsd
+       http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.1.xsd";>
+
+    <bean id="properties"
+          
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+        <property name="singleton" value="true" />
+        <property name="ignoreResourceNotFound" value="true" />
+        <property name="locations">
+            <list>
+                <value>classpath:/usergrid-default.properties</value>
+                <value>classpath:/usergrid-test.properties</value>
+                <value>classpath:/usergrid-custom-test.properties</value>
+            </list>
+        </property>
+    </bean>
+
+    <import resource="classpath:/toolsApplicationContext.xml"/>
+
+    <bean id="traceTagManager" 
class="org.apache.usergrid.persistence.cassandra.util.TraceTagManager">
+        <property name="reportUnattached" value="false"/>
+        <property name="traceEnabled" value="false"/>
+    </bean>
+
+    <bean id="setup" class="org.apache.usergrid.corepersistence.CpSetup">
+
+        <constructor-arg ref="entityManagerFactory"/>
+        <constructor-arg ref="cassandraService"/>
+        <constructor-arg ref="injector"/>
+    </bean>
+
+    <!-- refer to a named schemaManager from the DataControl annotation thusly 
-->
+    <bean id="coreManager" 
class="org.apache.usergrid.persistence.CoreSchemaManager">
+        <constructor-arg ref="setup"/>
+        <constructor-arg ref="cassandraCluster"/>
+    </bean>
+
+
+</beans>

Reply via email to