Skip to content

Commit

Permalink
Fix image in cache Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
clun committed Apr 27, 2017
1 parent c08dded commit 4484821
Show file tree
Hide file tree
Showing 10 changed files with 352 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class InMemoryCacheManager implements FF4JCacheManager {
/** {@inheritDoc} */
@Override
public String getCacheProviderName() {
return "In-Memory";
return "InMemory";
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
ff4j-store-jdbc
%%
Copyright (C) 2013 Ff4J
%%
Licensed 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.
#L%
-->

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd" >

<bean id="ff4j" class="org.ff4j.FF4j">
<constructor-arg index="0" type="java.lang.String" value="classpath:ff4j.xml"/>
</bean>

</beans>

Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package org.ff4j.store;

/*
* #%L
* ff4j-store-ehcache
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/

import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.ff4j.audit.Event;
import org.ff4j.audit.EventQueryDefinition;
import org.ff4j.audit.EventSeries;
import org.ff4j.audit.MutableHitCount;
import org.ff4j.audit.chart.TimeSeriesChart;
import org.ff4j.audit.repository.AbstractEventRepository;
import org.ff4j.audit.repository.EventRepository;

/**
* Provides implementation of {@link EventRepository} working with EHCACHE storage.
*
* @author Cedrick LUNVEN (@clunven)
*/
public class EventRepositoryEhCache extends AbstractEventRepository {

/** {@inheritDoc} */
@Override
public boolean saveEvent(Event e) {
return false;
}

/** {@inheritDoc} */
@Override
public Event getEventByUUID(String uuid, Long timestamp) {
return null;
}

@Override
public Map<String, MutableHitCount> getFeatureUsageHitCount(EventQueryDefinition query) {
// TODO Auto-generated method stub
return null;
}

@Override
public TimeSeriesChart getFeatureUsageHistory(EventQueryDefinition query, TimeUnit tu) {
// TODO Auto-generated method stub
return null;
}

@Override
public EventSeries searchFeatureUsageEvents(EventQueryDefinition query) {
// TODO Auto-generated method stub
return null;
}

@Override
public void purgeFeatureUsage(EventQueryDefinition query) {
// TODO Auto-generated method stub

}

@Override
public Map<String, MutableHitCount> getHostHitCount(EventQueryDefinition query) {
// TODO Auto-generated method stub
return null;
}

@Override
public Map<String, MutableHitCount> getUserHitCount(EventQueryDefinition query) {
// TODO Auto-generated method stub
return null;
}

@Override
public Map<String, MutableHitCount> getSourceHitCount(EventQueryDefinition query) {
// TODO Auto-generated method stub
return null;
}

@Override
public EventSeries getAuditTrail(EventQueryDefinition query) {
// TODO Auto-generated method stub
return null;
}

@Override
public void purgeAuditTrail(EventQueryDefinition query) {
// TODO Auto-generated method stub

}

@Override
public void createSchema() {
// TODO Auto-generated method stub

}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
package org.ff4j.springjdbc.store;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/

import static org.ff4j.audit.EventConstants.ACTION_CHECK_OK;
import static org.ff4j.store.JdbcStoreConstants.COL_EVENT_HOSTNAME;
import static org.ff4j.store.JdbcStoreConstants.COL_EVENT_NAME;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
package org.ff4j.springjdbc.store.dto;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/

import java.io.Serializable;

import org.ff4j.audit.MutableHitCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
package org.ff4j.springjdbc.store.rowmapper;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/

import java.sql.ResultSet;
import java.sql.SQLException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
package org.ff4j.springjdbc.store.rowmapper;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/

import java.sql.ResultSet;
import java.sql.SQLException;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package org.ff4j.test.store;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2016 FF4J
* %%
* Licensed 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.
* #L%
*/


import org.ff4j.core.FeatureStore;
import org.ff4j.springjdbc.store.FeatureStoreSpringJdbc;
import org.junit.After;
import org.junit.Before;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;

/**
*
* @author <a href="mailto:[email protected]">Cedrick LUNVEN</a>
*/
public class SpringJdbcFeatureStoreTestInitXml extends FeatureStoreTestSupport {

/** DataBase. */
private EmbeddedDatabase db;

/** Database builder. */
private EmbeddedDatabaseBuilder builder = null;

/** {@inheritDoc} */
@Override
protected FeatureStore initStore() {
builder = new EmbeddedDatabaseBuilder();
db = builder.setType(EmbeddedDatabaseType.HSQL)//
.addScript("classpath:schema-ddl.sql")//
.addScript("classpath:ff-store.sql")//
.build();
FeatureStoreSpringJdbc jdbcStore = new FeatureStoreSpringJdbc();
jdbcStore.setDataSource(db);
jdbcStore.getJdbcTemplate();
return jdbcStore;
}

/** {@inheritDoc} */
@Override
@Before
public void setUp() throws Exception {
super.setUp();
db = builder.setType(EmbeddedDatabaseType.HSQL).//
addScript("classpath:schema-ddl.sql").//
addScript("classpath:ff-store.sql")
.build();
}

/** {@inheritDoc} */
@After
public void tearDown() throws Exception {
db.shutdown();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
package org.ff4j.test.store;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/


import org.ff4j.springjdbc.store.FeatureStoreSpringJdbc;
import org.ff4j.springjdbc.store.PropertyStoreSpringJdbc;
import org.ff4j.store.JdbcQueryBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
package org.ff4j.test.store;

/*
* #%L
* ff4j-store-springjdbc
* %%
* Copyright (C) 2013 - 2017 FF4J
* %%
* Licensed 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.
* #L%
*/


import org.ff4j.springjdbc.store.FeatureStoreSpringJdbc;
import org.ff4j.springjdbc.store.PropertyStoreSpringJdbc;
import org.junit.Test;
Expand Down

0 comments on commit 4484821

Please sign in to comment.