repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
psiegman/ehcachetag
ehcachetag/src/test/java/nl/siegmann/ehcachetag/CacheTagTest.java
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/CacheTag.java // static final class ModifierNotFoundException extends Exception { // // private static final long serialVersionUID = 4535024464306691589L; // // public ModifierNotFoundException(String message) { // super(message); // } // } // // Path: eh...
import java.io.IOException; import javax.servlet.ServletContext; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspContext; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.PageContext; import javax.servlet.j...
// TODO Auto-generated method stub return null; } @Override public void beforeLookup(CacheTag cacheTag, JspContext jspContext) { cacheTag.setKey(cacheTag.getKey().toString() + "B"); } @Override public String afterRetrieval(CacheTag cacheTag, JspContext jspContext, String conte...
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/CacheTag.java // static final class ModifierNotFoundException extends Exception { // // private static final long serialVersionUID = 4535024464306691589L; // // public ModifierNotFoundException(String message) { // super(message); // } // } // // Path: eh...
@Test(expected = ModifierNotFoundException.class)
psiegman/ehcachetag
ehcachetag/src/main/java/nl/siegmann/ehcachetag/EHCacheTagServletContextListener.java
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/cachetagmodifier/CacheTagModifierFactory.java // public interface CacheTagModifierFactory { // // /** // * Called once after application is initialized. // * // * @param servletContext // */ // void init(ServletContext servletContext); // // /** // ...
import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import net.sf.ehcache.CacheManager; import nl.siegmann.ehcachetag.cachetagmodifier.CacheTagModifierFactory; import nl.siegmann.ehcachetag.cachetagmodifier.DefaultCacheTagModifierFactory; import or...
package nl.siegmann.ehcachetag; public class EHCacheTagServletContextListener implements ServletContextListener { private static final Logger LOG = LoggerFactory.getLogger(EHCacheTagServletContextListener.class); @Override public void contextInitialized(ServletContextEvent servletContextEvent) { ServletC...
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/cachetagmodifier/CacheTagModifierFactory.java // public interface CacheTagModifierFactory { // // /** // * Called once after application is initialized. // * // * @param servletContext // */ // void init(ServletContext servletContext); // // /** // ...
CacheTagModifierFactory cacheKeyMetaFactory;
psiegman/ehcachetag
ehcachetag/src/main/java/nl/siegmann/ehcachetag/EHCacheTagServletContextListener.java
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/cachetagmodifier/CacheTagModifierFactory.java // public interface CacheTagModifierFactory { // // /** // * Called once after application is initialized. // * // * @param servletContext // */ // void init(ServletContext servletContext); // // /** // ...
import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import net.sf.ehcache.CacheManager; import nl.siegmann.ehcachetag.cachetagmodifier.CacheTagModifierFactory; import nl.siegmann.ehcachetag.cachetagmodifier.DefaultCacheTagModifierFactory; import or...
package nl.siegmann.ehcachetag; public class EHCacheTagServletContextListener implements ServletContextListener { private static final Logger LOG = LoggerFactory.getLogger(EHCacheTagServletContextListener.class); @Override public void contextInitialized(ServletContextEvent servletContextEvent) { ServletC...
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/cachetagmodifier/CacheTagModifierFactory.java // public interface CacheTagModifierFactory { // // /** // * Called once after application is initialized. // * // * @param servletContext // */ // void init(ServletContext servletContext); // // /** // ...
cacheKeyMetaFactory = new DefaultCacheTagModifierFactory();
psiegman/ehcachetag
ehcachetag/src/test/java/nl/siegmann/ehcachetag/cachetagmodifier/CompositeCacheKeyTest.java
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/cachetagmodifier/CompositeCacheKey.java // public class CompositeCacheKey { // // private Object[] keyComponents; // // public CompositeCacheKey(Object... keyComponents) { // this.keyComponents = keyComponents; // } // // public boolean equals(Object o...
import junit.framework.Assert; import nl.siegmann.ehcachetag.cachetagmodifier.CompositeCacheKey; import org.junit.Test;
package nl.siegmann.ehcachetag.cachetagmodifier; public class CompositeCacheKeyTest { @Test public void test1() {
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/cachetagmodifier/CompositeCacheKey.java // public class CompositeCacheKey { // // private Object[] keyComponents; // // public CompositeCacheKey(Object... keyComponents) { // this.keyComponents = keyComponents; // } // // public boolean equals(Object o...
CompositeCacheKey cacheKey1 = new CompositeCacheKey("foo");
psiegman/ehcachetag
ehcachetag/src/test/java/nl/siegmann/ehcachetag/util/BeanFactoryTest.java
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/util/BeanFactory.java // public class BeanFactory { // // public static final String QUERY_STRING_CHARACTER_ENCODING = "UTF-8"; // // private static final Logger LOG = LoggerFactory.getLogger(BeanFactory.class); // private static final PropertyUtilsBean pr...
import org.junit.Test; import java.util.Map; import junit.framework.Assert; import nl.siegmann.ehcachetag.util.BeanFactory;
package nl.siegmann.ehcachetag.util; public class BeanFactoryTest { @Test public void testCreateBeansFromProperties_simple() { // given String input = "messageBean=" + TestBean.class.getName() + "?message=hi&name=jerry\n" + "secondBean=" + SecondTestBean.class.getName() + "?color=red&size=large"; // ...
// Path: ehcachetag/src/main/java/nl/siegmann/ehcachetag/util/BeanFactory.java // public class BeanFactory { // // public static final String QUERY_STRING_CHARACTER_ENCODING = "UTF-8"; // // private static final Logger LOG = LoggerFactory.getLogger(BeanFactory.class); // private static final PropertyUtilsBean pr...
Map<String, Object> actualResult = BeanFactory.createBeansFromProperties(input);
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiRoundRobinEndpointTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
import org.apache.camel.CamelContext; import org.apache.camel.Component; import org.apache.camel.Processor; import org.apache.camel.osgi.service.util.BundleDelegatingClassLoader; import org.junit.Test; import org.osgi.framework.Bundle; import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.a...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
ClassLoader classLoader = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiMulticastEndpointTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
import org.apache.camel.CamelContext; import org.apache.camel.Component; import org.apache.camel.Processor; import org.apache.camel.osgi.service.util.BundleDelegatingClassLoader; import org.junit.Test; import org.osgi.framework.Bundle; import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.a...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
ClassLoader classLoader = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiComponentTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
import static org.mockito.Matchers.same; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.apache.camel.CamelContext; import org.apache.camel.TypeConverter; import org.apache.camel.osgi.service.util.BundleDelegatingClassLoader; import or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
BundleDelegatingClassLoader classLoader = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiDefaultEndpointTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
import org.apache.camel.CamelContext; import org.apache.camel.Component; import org.apache.camel.Processor; import org.apache.camel.osgi.service.util.BundleDelegatingClassLoader; import org.junit.Test; import org.osgi.framework.Bundle; import org.osgi.framework.BundleReference; import java.util.Collections; import stat...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
ClassLoader classLoader = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiDefaultProducerTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/OsgiServiceList.java // public class OsgiServiceList<E> extends OsgiServiceCollection<E> implements List<E>, RandomAccess { // // public OsgiServiceList(BundleContext context, String filter, ClassLoader classLoader, // OsgiProxyCreator pro...
import static org.mockito.Matchers.same; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.osgi.service.util.OsgiServiceList; import org.apache.camel.proce...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/OsgiServiceList.java // public class OsgiServiceList<E> extends OsgiServiceCollection<E> implements List<E>, RandomAccess { // // public OsgiServiceList(BundleContext context, String filter, ClassLoader classLoader, // OsgiProxyCreator pro...
assertThat(((LoadBalancer) processor).getProcessors(), instanceOf(OsgiServiceList.class));
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiEndpointTypeTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
import org.apache.camel.CamelContext; import org.apache.camel.osgi.service.util.BundleDelegatingClassLoader; import org.junit.Test; import org.osgi.framework.Bundle; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.sameInstance;...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
BundleDelegatingClassLoader classLoader = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/OsgiRandomEndpointTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
import org.apache.camel.CamelContext; import org.apache.camel.Component; import org.apache.camel.Processor; import org.apache.camel.osgi.service.util.BundleDelegatingClassLoader; import org.junit.Test; import org.osgi.framework.Bundle; import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.a...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/util/BundleDelegatingClassLoader.java // public class BundleDelegatingClassLoader extends ClassLoader { // private final Bundle bundle; // private final ClassLoader classLoader; // // public BundleDelegatingClassLoader(Bundle bundle) { // ...
ClassLoader classLoader = new BundleDelegatingClassLoader(bundle, getClass().getClassLoader());
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
Criterion criterion = allEq(attrs);
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
Criterion criterion = anyEq(attrs);
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
Criterion criterion = and(
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
eq("a", "b"),
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
ne("b", "d"),
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
approx("g", "s"),
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
le("y", "z"),
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
/* * 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 u...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
raw("(&(g=n)(f=n))"),
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
attrs.put("c", "d"); Criterion criterion = allEq(attrs); assertThat(criterion.value(), equalTo("(&(a=b)(c=d))")); assertThat(criterion.filter(), notNullValue()); } @Test public void testAnyEq() throws Exception { Map<String, String> attrs = new LinkedHashMap<String,...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
like("f", "g", LikeCriterion.MatchMode.ANYWHERE),
szhem/camel-osgi
component/src/test/java/org/apache/camel/osgi/service/filter/FiltersTest.java
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; import static org.apache.camel.osgi.service.filter.Filters.allEq; import static org.apache.camel.osgi.service.filter.Filters.and; import static or...
Criterion criterion = allEq(attrs); assertThat(criterion.value(), equalTo("(&(a=b)(c=d))")); assertThat(criterion.filter(), notNullValue()); } @Test public void testAnyEq() throws Exception { Map<String, String> attrs = new LinkedHashMap<String, String>(); attrs.put...
// Path: component/src/main/java/org/apache/camel/osgi/service/filter/Filters.java // public static Criterion allEq(Map<String, ?> vals) { // List<Criterion> filters = new ArrayList<Criterion>(vals.size()); // for(Entry<String, ?> entry : vals.entrySet()) { // filters.add(eq(entry.getKey(), entry.getVal...
not(anyEq(attrs))
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/DoSomethingActivity.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.CircularGeofence; import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.app.enterprise.geofencing.LatLongPoint; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; i...
package com.akexorcist.knoxgeofencingapp; public class DoSomethingActivity extends AppCompatActivity implements View.OnClickListener { private Button btnGeofencingStart; private Button btnGeofencingStop; private Button btnCreateGeofence; private Button btnClearGeofence; private Geofencing geofe...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
BusProvider.getProvider().unregister(this);
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/DoSomethingActivity.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.CircularGeofence; import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.app.enterprise.geofencing.LatLongPoint; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; i...
private void createGeofence() { LatLongPoint center = new LatLongPoint(13.678505, 100.615474); double radius = 1000; CircularGeofence circularGeofence = new CircularGeofence(center, radius); int id = geofencingService.createGeofence(circularGeofence); if (id == -1) { ...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
public void onInsideGeofenceEvent(InsideGeofenceEvent event) {
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/DoSomethingActivity.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.CircularGeofence; import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.app.enterprise.geofencing.LatLongPoint; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; i...
if (id == -1) { Toast.makeText(this, R.string.already_exists_geofence, Toast.LENGTH_SHORT).show(); } else { Toast.makeText(this, getString(R.string.geofence_was_created, id), Toast.LENGTH_SHORT).show(); } } private void clearGeofence() { List<Geofence> ge...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
public void onOutsideGeofenceEvent(OutsideGeofenceEvent event) {
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/DoSomethingActivity.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.CircularGeofence; import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.app.enterprise.geofencing.LatLongPoint; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; i...
} private void clearGeofence() { List<Geofence> geofenceList = geofencingService.getGeofences(); if (geofenceList != null) { for (Geofence geofence : geofenceList) { geofencingService.destroyGeofence(geofence.id); } } } private void start...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
public void onLocationUnavailable(LocationUnavailableEvent event) {
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationManager.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
import android.app.Activity; import android.app.admin.DevicePolicyManager; import android.app.enterprise.EnterpriseDeviceManager; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler...
package com.akexorcist.knoxactivator; /** * Created by Akexorcist on 4/20/2016 AD. */ public class KnoxActivationManager { private static final long EVENT_LISTENER_DELAY = 500; public static final int REQUEST_CODE_KNOX = 4545; private static KnoxActivationManager knoxActivationManager; public sta...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
ComponentName componentName = new ComponentName(context, AdminActivationReceiver.class);
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationManager.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
import android.app.Activity; import android.app.admin.DevicePolicyManager; import android.app.enterprise.EnterpriseDeviceManager; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler...
package com.akexorcist.knoxactivator; /** * Created by Akexorcist on 4/20/2016 AD. */ public class KnoxActivationManager { private static final long EVENT_LISTENER_DELAY = 500; public static final int REQUEST_CODE_KNOX = 4545; private static KnoxActivationManager knoxActivationManager; public sta...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
public void onDeviceAdminDeactivated(AdminDeactivatedEvent event) {
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationManager.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
import android.app.Activity; import android.app.admin.DevicePolicyManager; import android.app.enterprise.EnterpriseDeviceManager; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler...
} return knoxActivationManager; } private ActivationCallback activationCallback; public void register(ActivationCallback callback) { activationCallback = callback; KnoxActivationBus.getInstance().getBus().register(this); } public void unregister() { activat...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
public void onLicenseActivated(LicenseActivatedEvent event) {
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationManager.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
import android.app.Activity; import android.app.admin.DevicePolicyManager; import android.app.enterprise.EnterpriseDeviceManager; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Handler...
activationCallback = callback; KnoxActivationBus.getInstance().getBus().register(this); } public void unregister() { activationCallback = null; KnoxActivationBus.getInstance().getBus().unregister(this); } public boolean isDeviceAdminActivated(Context context) { ...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/AdminDeactivatedEvent.java // public class AdminDeactivatedEvent { } // // Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/event/LicenseActivatedEvent.java // public class LicenseActivatedEvent { } // //...
public void onLicenseActivationFailed(LicenseActivationFailedEvent event) {
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/receiver/AdminActivationReceiver.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
import com.akexorcist.knoxactivator.event.AdminDeactivatedEvent; import android.app.admin.DeviceAdminReceiver; import android.content.Context; import android.content.Intent; import android.os.Handler; import com.akexorcist.knoxactivator.KnoxActivationBus; import com.akexorcist.knoxactivator.R;
/** * DISCLAIMER: PLEASE TAKE NOTE THAT THE SAMPLE APPLICATION AND * SOURCE CODE DESCRIBED HEREIN IS PROVIDED FOR TESTING PURPOSES ONLY. * <p/> * Samsung expressly disclaims any and all warranties of any kind, * whether express or implied, including but not limited to the implied warranties and conditions * of me...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
KnoxActivationBus.getInstance().getBus().post(new AdminDeactivatedEvent());
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/receiver/AdminActivationReceiver.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
import com.akexorcist.knoxactivator.event.AdminDeactivatedEvent; import android.app.admin.DeviceAdminReceiver; import android.content.Context; import android.content.Intent; import android.os.Handler; import com.akexorcist.knoxactivator.KnoxActivationBus; import com.akexorcist.knoxactivator.R;
/** * DISCLAIMER: PLEASE TAKE NOTE THAT THE SAMPLE APPLICATION AND * SOURCE CODE DESCRIBED HEREIN IS PROVIDED FOR TESTING PURPOSES ONLY. * <p/> * Samsung expressly disclaims any and all warranties of any kind, * whether express or implied, including but not limited to the implied warranties and conditions * of me...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
KnoxActivationBus.getInstance().getBus().post(new AdminDeactivatedEvent());
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/GeofencingReceiver.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.akexorcist.knoxgeofencingapp.bus.BusProvider; import com.akexorcist.knoxgeofencingapp.bus.event.Insi...
package com.akexorcist.knoxgeofencingapp; /** * Created by Akexorcist on 5/10/16 AD. */ public class GeofencingReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equalsIgnoreCase(Geofencing.A...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
BusProvider.getProvider().post(new InsideGeofenceEvent(geofenceIdList));
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/GeofencingReceiver.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.akexorcist.knoxgeofencingapp.bus.BusProvider; import com.akexorcist.knoxgeofencingapp.bus.event.Insi...
package com.akexorcist.knoxgeofencingapp; /** * Created by Akexorcist on 5/10/16 AD. */ public class GeofencingReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equalsIgnoreCase(Geofencing.A...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
BusProvider.getProvider().post(new InsideGeofenceEvent(geofenceIdList));
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/GeofencingReceiver.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.akexorcist.knoxgeofencingapp.bus.BusProvider; import com.akexorcist.knoxgeofencingapp.bus.event.Insi...
package com.akexorcist.knoxgeofencingapp; /** * Created by Akexorcist on 5/10/16 AD. */ public class GeofencingReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equalsIgnoreCase(Geofencing.A...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
BusProvider.getProvider().post(new OutsideGeofenceEvent(geofenceIdList));
akexorcist/Example-SamsungSDK
KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/GeofencingReceiver.java
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
import android.app.enterprise.geofencing.Geofence; import android.app.enterprise.geofencing.Geofencing; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.akexorcist.knoxgeofencingapp.bus.BusProvider; import com.akexorcist.knoxgeofencingapp.bus.event.Insi...
package com.akexorcist.knoxgeofencingapp; /** * Created by Akexorcist on 5/10/16 AD. */ public class GeofencingReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equalsIgnoreCase(Geofencing.A...
// Path: KNOXGeofencingApp/app/src/main/java/com/akexorcist/knoxgeofencingapp/bus/BusProvider.java // public class BusProvider { // private static Bus bus; // // public static Bus getProvider() { // if (bus == null) { // bus = new Bus(); // } // return bus; // } // } // ...
BusProvider.getProvider().post(new LocationUnavailableEvent());
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/receiver/LicenseActivationReceiver.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
import com.akexorcist.knoxactivator.event.LicenseActivatedEvent; import com.akexorcist.knoxactivator.event.LicenseActivationFailedEvent; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android...
/** * DISCLAIMER: PLEASE TAKE NOTE THAT THE SAMPLE APPLICATION AND * SOURCE CODE DESCRIBED HEREIN IS PROVIDED FOR TESTING PURPOSES ONLY. * <p/> * Samsung expressly disclaims any and all warranties of any kind, * whether express or implied, including but not limited to the implied warranties and conditions * of me...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
KnoxActivationBus.getInstance().getBus().post(new LicenseActivatedEvent());
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/receiver/LicenseActivationReceiver.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
import com.akexorcist.knoxactivator.event.LicenseActivatedEvent; import com.akexorcist.knoxactivator.event.LicenseActivationFailedEvent; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android...
/** * DISCLAIMER: PLEASE TAKE NOTE THAT THE SAMPLE APPLICATION AND * SOURCE CODE DESCRIBED HEREIN IS PROVIDED FOR TESTING PURPOSES ONLY. * <p/> * Samsung expressly disclaims any and all warranties of any kind, * whether express or implied, including but not limited to the implied warranties and conditions * of me...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
KnoxActivationBus.getInstance().getBus().post(new LicenseActivatedEvent());
akexorcist/Example-SamsungSDK
KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/receiver/LicenseActivationReceiver.java
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
import com.akexorcist.knoxactivator.event.LicenseActivatedEvent; import com.akexorcist.knoxactivator.event.LicenseActivationFailedEvent; import android.app.enterprise.license.EnterpriseLicenseManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android...
} @Override public void onReceive(Context context, Intent intent) { if (intent != null) { String action = intent.getAction(); if (action != null && action.equals(EnterpriseLicenseManager.ACTION_LICENSE_STATUS)) { int errorCode = intent.getIntExtra(EnterpriseL...
// Path: KNOXSampleApp/knoxActivator/src/main/java/com/akexorcist/knoxactivator/KnoxActivationBus.java // public class KnoxActivationBus { // private static KnoxActivationBus knoxActivationBus; // // public static KnoxActivationBus getInstance() { // if (knoxActivationBus == null) { // knox...
KnoxActivationBus.getInstance().getBus().post(new LicenseActivationFailedEvent(errorCode));
akexorcist/Example-SamsungSDK
KNOXLSOApp/app/src/main/java/com/akexorcist/knoxlsoapp/DoSomethingActivity.java
// Path: KNOXLSOApp/app/src/main/java/com/akexorcist/knoxlsoapp/manager/FileAssetManager.java // public class FileAssetManager { // public static void copyFileFromAssetToStorage(Context context, String assetFilePath, String filePath) { // InputStream in = null; // OutputStream out = null; // ...
import android.app.enterprise.lso.LockscreenOverlay; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import com.akexorcist.knoxlsoapp.manager.FileAssetManager;
package com.akexorcist.knoxlsoapp; public class DoSomethingActivity extends AppCompatActivity implements View.OnClickListener { private String logoFileName = "akexorcist_logo.png"; private Button btnSetCustomLSO; private Button btnClearCustomLSO; private LockscreenOverlay lso; @Override pro...
// Path: KNOXLSOApp/app/src/main/java/com/akexorcist/knoxlsoapp/manager/FileAssetManager.java // public class FileAssetManager { // public static void copyFileFromAssetToStorage(Context context, String assetFilePath, String filePath) { // InputStream in = null; // OutputStream out = null; // ...
FileAssetManager.copyFileFromAssetToStorage(this, logoFileName, getFilesDir().getAbsolutePath() + logoFileName);
jferrater/Tap-And-Eat-MicroServices
AccountService/src/main/java/com/github/joffryferrater/accountservice/AccountServiceApplication.java
// Path: AccountService/src/main/java/com/github/joffryferrater/accountservice/models/Account.java // @Entity // @Table(name = "users") // @Data // @RequiredArgsConstructor // public class Account { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // @NotNull // @JsonProp...
import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import com.github.joffryf...
package com.github.joffryferrater.accountservice; /** * * @author Joffry Ferrater * */ @SpringBootApplication @EnableDiscoveryClient public class AccountServiceApplication { public static void main(String[] args) { SpringApplication.run(AccountServiceApplication.class, args); } @Autowired
// Path: AccountService/src/main/java/com/github/joffryferrater/accountservice/models/Account.java // @Entity // @Table(name = "users") // @Data // @RequiredArgsConstructor // public class Account { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // @NotNull // @JsonProp...
AccountRepository accountRepo;
jferrater/Tap-And-Eat-MicroServices
AccountService/src/main/java/com/github/joffryferrater/accountservice/AccountServiceApplication.java
// Path: AccountService/src/main/java/com/github/joffryferrater/accountservice/models/Account.java // @Entity // @Table(name = "users") // @Data // @RequiredArgsConstructor // public class Account { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // @NotNull // @JsonProp...
import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import com.github.joffryf...
package com.github.joffryferrater.accountservice; /** * * @author Joffry Ferrater * */ @SpringBootApplication @EnableDiscoveryClient public class AccountServiceApplication { public static void main(String[] args) { SpringApplication.run(AccountServiceApplication.class, args); } @Autowired AccountRepo...
// Path: AccountService/src/main/java/com/github/joffryferrater/accountservice/models/Account.java // @Entity // @Table(name = "users") // @Data // @RequiredArgsConstructor // public class Account { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // @NotNull // @JsonProp...
Account account = new Account("joffry.ferrater@gmail.com", "Joffry", "Ferrater",
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/PriceServiceRepository.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Price.java // @lombok.Getter // public class Price { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Price") // private String price; // // public Price(){ // super(); // } // ...
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.github.joffryferrater.foodtrayservice.domain.Price;
package com.github.joffryferrater.foodtrayservice.repository; /** * * @author Joffry Ferrater * */ @FeignClient(value="PRICE-SERVICE", fallback=PriceServiceRepository.class) public interface PriceServiceRepository { @RequestMapping(method=RequestMethod.GET, value="/prices/search/findByItemCode?ite...
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Price.java // @lombok.Getter // public class Price { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Price") // private String price; // // public Price(){ // super(); // } // ...
Price findByItemCode(@PathVariable("itemCode") String itemCode);
jferrater/Tap-And-Eat-MicroServices
ItemService/src/main/java/com/github/joffryferrater/itemservice/ItemServiceApplication.java
// Path: ItemService/src/main/java/com/github/joffryferrater/itemservice/models/Item.java // @Entity // @Table(name = "items") // @Data // public class Item { // // @Id // @GeneratedValue(strategy=GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; // @Jso...
import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discove...
package com.github.joffryferrater.itemservice; /** * * @author Joffry Ferrater * */ @SpringBootApplication @EnableDiscoveryClient public class ItemServiceApplication { public static void main(String[] args) { SpringApplication.run(ItemServiceApplication.class, args); } @Autowired
// Path: ItemService/src/main/java/com/github/joffryferrater/itemservice/models/Item.java // @Entity // @Table(name = "items") // @Data // public class Item { // // @Id // @GeneratedValue(strategy=GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; // @Jso...
ItemRepository itemRepository;
jferrater/Tap-And-Eat-MicroServices
ItemService/src/main/java/com/github/joffryferrater/itemservice/ItemServiceApplication.java
// Path: ItemService/src/main/java/com/github/joffryferrater/itemservice/models/Item.java // @Entity // @Table(name = "items") // @Data // public class Item { // // @Id // @GeneratedValue(strategy=GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; // @Jso...
import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discove...
package com.github.joffryferrater.itemservice; /** * * @author Joffry Ferrater * */ @SpringBootApplication @EnableDiscoveryClient public class ItemServiceApplication { public static void main(String[] args) { SpringApplication.run(ItemServiceApplication.class, args); } @Autowired ItemRepository itemR...
// Path: ItemService/src/main/java/com/github/joffryferrater/itemservice/models/Item.java // @Entity // @Table(name = "items") // @Data // public class Item { // // @Id // @GeneratedValue(strategy=GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; // @Jso...
List<Item> items = new ArrayList<Item>();
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayServiceApplication.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/ItemServiceRepository.java // @FeignClient(value="ITEM-SERVICE", fallback=ItemServiceFallback.class) // public interface ItemServiceRepository { // // @RequestMapping(method=RequestMethod.GET, value="/items/search/findByIte...
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.feign.Ena...
package com.github.joffryferrater.foodtrayservice; @SpringBootApplication @EnableDiscoveryClient @EnableCircuitBreaker @EnableHystrixDashboard @EnableHystrix //@EnableFeignClients
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/ItemServiceRepository.java // @FeignClient(value="ITEM-SERVICE", fallback=ItemServiceFallback.class) // public interface ItemServiceRepository { // // @RequestMapping(method=RequestMethod.GET, value="/items/search/findByIte...
@EnableFeignClients(basePackageClasses = {ItemServiceRepository.class, PriceServiceRepository.class})
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayServiceApplication.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/ItemServiceRepository.java // @FeignClient(value="ITEM-SERVICE", fallback=ItemServiceFallback.class) // public interface ItemServiceRepository { // // @RequestMapping(method=RequestMethod.GET, value="/items/search/findByIte...
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.netflix.feign.Ena...
package com.github.joffryferrater.foodtrayservice; @SpringBootApplication @EnableDiscoveryClient @EnableCircuitBreaker @EnableHystrixDashboard @EnableHystrix //@EnableFeignClients
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/ItemServiceRepository.java // @FeignClient(value="ITEM-SERVICE", fallback=ItemServiceFallback.class) // public interface ItemServiceRepository { // // @RequestMapping(method=RequestMethod.GET, value="/items/search/findByIte...
@EnableFeignClients(basePackageClasses = {ItemServiceRepository.class, PriceServiceRepository.class})
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayController.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.spr...
package com.github.joffryferrater.foodtrayservice; /** * * @author Joffry Ferrater * */ @RestController @RequestMapping("/foodtrays") public class FoodTrayController { @Autowired
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
ItemServiceRepository itemServiceRepository;
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayController.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.spr...
package com.github.joffryferrater.foodtrayservice; /** * * @author Joffry Ferrater * */ @RestController @RequestMapping("/foodtrays") public class FoodTrayController { @Autowired ItemServiceRepository itemServiceRepository; @Autowired
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
PriceServiceRepository priceServiceRepo;
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayController.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.spr...
package com.github.joffryferrater.foodtrayservice; /** * * @author Joffry Ferrater * */ @RestController @RequestMapping("/foodtrays") public class FoodTrayController { @Autowired ItemServiceRepository itemServiceRepository; @Autowired PriceServiceRepository priceServiceRepo;
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
private List<TrayItem> trayItems = new ArrayList<TrayItem>();
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayController.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.spr...
package com.github.joffryferrater.foodtrayservice; /** * * @author Joffry Ferrater * */ @RestController @RequestMapping("/foodtrays") public class FoodTrayController { @Autowired ItemServiceRepository itemServiceRepository; @Autowired PriceServiceRepository priceServiceRepo; privat...
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
public Price getPrice(@PathVariable("itemCode") String itemCode) {
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayController.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.spr...
package com.github.joffryferrater.foodtrayservice; /** * * @author Joffry Ferrater * */ @RestController @RequestMapping("/foodtrays") public class FoodTrayController { @Autowired ItemServiceRepository itemServiceRepository; @Autowired PriceServiceRepository priceServiceRepo; privat...
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
public Item getItem(@PathVariable("itemCode") String itemCode) {
jferrater/Tap-And-Eat-MicroServices
PriceService/src/main/java/com/github/joffryferrater/priceservice/PriceServiceApplication.java
// Path: PriceService/src/main/java/com/github/joffryferrater/priceservice/models/Price.java // @Entity // @Table (name="prices") // @Data // public class Price { // // @Id // @GeneratedValue (strategy = GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; /...
import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import com.github.jo...
package com.github.joffryferrater.priceservice; @SpringBootApplication @EnableDiscoveryClient public class PriceServiceApplication { public static void main(String[] args) { SpringApplication.run(PriceServiceApplication.class, args); } @Autowired
// Path: PriceService/src/main/java/com/github/joffryferrater/priceservice/models/Price.java // @Entity // @Table (name="prices") // @Data // public class Price { // // @Id // @GeneratedValue (strategy = GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; /...
PriceRepository priceRepo;
jferrater/Tap-And-Eat-MicroServices
PriceService/src/main/java/com/github/joffryferrater/priceservice/PriceServiceApplication.java
// Path: PriceService/src/main/java/com/github/joffryferrater/priceservice/models/Price.java // @Entity // @Table (name="prices") // @Data // public class Price { // // @Id // @GeneratedValue (strategy = GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; /...
import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import com.github.jo...
package com.github.joffryferrater.priceservice; @SpringBootApplication @EnableDiscoveryClient public class PriceServiceApplication { public static void main(String[] args) { SpringApplication.run(PriceServiceApplication.class, args); } @Autowired PriceRepository priceRepo; @PostConstruct...
// Path: PriceService/src/main/java/com/github/joffryferrater/priceservice/models/Price.java // @Entity // @Table (name="prices") // @Data // public class Price { // // @Id // @GeneratedValue (strategy = GenerationType.AUTO) // private Long id; // @JsonProperty("Item Code") // private String itemCode; /...
Price price = new Price("BUR01", "150");
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/PriceServiceFallback.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Price.java // @lombok.Getter // public class Price { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Price") // private String price; // // public Price(){ // super(); // } // ...
import com.github.joffryferrater.foodtrayservice.domain.Price;
package com.github.joffryferrater.foodtrayservice.repository; /** * Fall back function if price service is not available. * * @author Joffry Ferrater * */ public class PriceServiceFallback implements PriceServiceRepository { @Override
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Price.java // @lombok.Getter // public class Price { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Price") // private String price; // // public Price(){ // super(); // } // ...
public Price findByItemCode(String itemCode) {
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/ItemServiceFallback.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import org.springframework.stereotype.Component; import com.github.joffryferrater.foodtrayservice.domain.Item;
package com.github.joffryferrater.foodtrayservice.repository; /** * Fall back function if ItemService is not available. * * @author Joffry Ferrater * */ @Component public class ItemServiceFallback implements ItemServiceRepository { @Override
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
public Item findByItemCode(String itemCode) {
jferrater/Tap-And-Eat-MicroServices
FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/repository/ItemServiceRepository.java
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.github.joffryferrater.foodtrayservice.domain.Item;
package com.github.joffryferrater.foodtrayservice.repository; /** * * @author Joffry Ferrater * */ @FeignClient(value="ITEM-SERVICE", fallback=ItemServiceFallback.class) public interface ItemServiceRepository { @RequestMapping(method=RequestMethod.GET, value="/items/search/findByItemCode?itemCode=...
// Path: FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/domain/Item.java // @lombok.Getter // public class Item { // // @JsonProperty("Item Code") // private String itemCode; // @JsonProperty("Name") // private String name; // // public Item() { // super(); // } // // ...
Item findByItemCode(@PathVariable("itemCode") String itemCode);
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/Model/Communication/TXSourceUtil.java
// Path: src/com/blochstech/bitcoincardterminal/Model/Communication/TXSourceId.java // class TXSourceId { // String OutIndex = null; //Len 4 (8 in hex) // String TXHash = null; //Len 32 (64 in hex) // long Satoshi = 0; // boolean Verified; // boolean Unusable; //Card did not accept due to unusual script, error or ...
import java.util.ArrayList; import java.util.Locale; import android.util.Log; import com.blochstech.bitcoincardterminal.Model.Communication.TXSourceId; import com.blochstech.bitcoincardterminal.Utils.Tags;
package com.blochstech.bitcoincardterminal.Model.Communication; public class TXSourceUtil { public static boolean containsSource(ArrayList<TXSourceId> list, String hash){ try{ if(hash == null || list == null) return false; for(int i = 0; i < list.size(); i++){ if(list.get(i).TXHash.toLowerCase(...
// Path: src/com/blochstech/bitcoincardterminal/Model/Communication/TXSourceId.java // class TXSourceId { // String OutIndex = null; //Len 4 (8 in hex) // String TXHash = null; //Len 32 (64 in hex) // long Satoshi = 0; // boolean Verified; // boolean Unusable; //Card did not accept due to unusual script, error or ...
Log.e(Tags.APP_TAG, "ContainsSource failed: " + e.toString());
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/DataLayer/DAL.java
// Path: src/com/blochstech/bitcoincardterminal/Interfaces/IDAL.java // public interface IDAL { // //Events: // public Event<Message> MessageEventReference(); // // //Database mehtods: // public void setReceiveAddress(String address); // public String getReceiveAddress(); // // public void setFee(String fee);...
import android.util.Log; import com.blochstech.bitcoincardterminal.Interfaces.IDAL; import com.blochstech.bitcoincardterminal.Interfaces.Message; import com.blochstech.bitcoincardterminal.Interfaces.Message.MessageType; import com.blochstech.bitcoincardterminal.Utils.*;
package com.blochstech.bitcoincardterminal.DataLayer; public class DAL implements IDAL { //Singleton pattern: private static IDAL instance = null; public static IDAL Instance() { if(instance == null) { instance = new DAL(); } return instance; } private DAL() { try {
// Path: src/com/blochstech/bitcoincardterminal/Interfaces/IDAL.java // public interface IDAL { // //Events: // public Event<Message> MessageEventReference(); // // //Database mehtods: // public void setReceiveAddress(String address); // public String getReceiveAddress(); // // public void setFee(String fee);...
messageEvent = new Event<Message>(this);
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/DataLayer/DAL.java
// Path: src/com/blochstech/bitcoincardterminal/Interfaces/IDAL.java // public interface IDAL { // //Events: // public Event<Message> MessageEventReference(); // // //Database mehtods: // public void setReceiveAddress(String address); // public String getReceiveAddress(); // // public void setFee(String fee);...
import android.util.Log; import com.blochstech.bitcoincardterminal.Interfaces.IDAL; import com.blochstech.bitcoincardterminal.Interfaces.Message; import com.blochstech.bitcoincardterminal.Interfaces.Message.MessageType; import com.blochstech.bitcoincardterminal.Utils.*;
messageEvent = new Event<Message>(this); addressCache = new GenericFileCache<String>(addressCachePath, ""); feeCache = new GenericFileCache<String>(feeCachePath, "100"); courtesyOKCache = new GenericFileCache<Boolean>(courtesyOKCachePath, false); currencyCache = new GenericFileCache<Integer>(currencyCach...
// Path: src/com/blochstech/bitcoincardterminal/Interfaces/IDAL.java // public interface IDAL { // //Events: // public Event<Message> MessageEventReference(); // // //Database mehtods: // public void setReceiveAddress(String address); // public String getReceiveAddress(); // // public void setFee(String fee);...
messageEvent.fire(this, new Message("Error: " + e.getMessage() + e.toString(), MessageType.Error));
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/DataLayer/GenericFileCache.java
// Path: src/com/blochstech/bitcoincardterminal/Utils/ResourceHolder.java // public class ResourceHolder { // //private Object lockKey; Usually as key in hashmap or unnecessary. // private Object holder; // private Thread holdingThread; // // //public Object LockKey(){ return lockKey; } //The value or resource be...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.HashMap; import android.os.Environment; import android.util.Log; import com.blochstech.bitcoincardterminal.Utils.Resour...
} public synchronized void Open(Object holder) throws Exception{ ResourceHolder holderObj; long startTime = System.currentTimeMillis(); boolean wait = true; while(wait){ holderObj = pathsInUse.get(FileCachePath); if(holderObj == null){ pathsInUse.put(FileCachePath, new ResourceHolder(holder)); ...
// Path: src/com/blochstech/bitcoincardterminal/Utils/ResourceHolder.java // public class ResourceHolder { // //private Object lockKey; Usually as key in hashmap or unnecessary. // private Object holder; // private Thread holdingThread; // // //public Object LockKey(){ return lockKey; } //The value or resource be...
if(Tags.DEBUG)
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/DataLayer/GenericFileCache.java
// Path: src/com/blochstech/bitcoincardterminal/Utils/ResourceHolder.java // public class ResourceHolder { // //private Object lockKey; Usually as key in hashmap or unnecessary. // private Object holder; // private Thread holdingThread; // // //public Object LockKey(){ return lockKey; } //The value or resource be...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.HashMap; import android.os.Environment; import android.util.Log; import com.blochstech.bitcoincardterminal.Utils.Resour...
{ dir.mkdirs(); } if(!dir.exists()) throw new Exception("Getting directory failed. Path: " + FileCachePath); File file = new File(FileCachePath); if(file == null || !file.exists()) SaveFileValue(initialValue); }catch(Exception ex) ...
// Path: src/com/blochstech/bitcoincardterminal/Utils/ResourceHolder.java // public class ResourceHolder { // //private Object lockKey; Usually as key in hashmap or unnecessary. // private Object holder; // private Thread holdingThread; // // //public Object LockKey(){ return lockKey; } //The value or resource be...
return SyntacticSugar.<T>castAs(readObj);
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/View/MainFragmentPager.java
// Path: src/com/blochstech/bitcoincardterminal/ViewModel/ViewStateManagers/MessageManager.java // public class MessageManager { // //Singleton pattern: // private static MessageManager instance = null; // public static MessageManager Instance() // { // if(instance == null) // { // instance = new MessageMana...
import com.blochstech.bitcoincardterminal.ViewModel.ViewStateManagers.MessageManager; import com.blochstech.bitcoincardterminal.ViewModel.ViewStateManagers.NavigationManager; import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet;
package com.blochstech.bitcoincardterminal.View; public class MainFragmentPager extends ViewPager { public MainFragmentPager(Context context) { super(context); } public MainFragmentPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onTouchEvent(android....
// Path: src/com/blochstech/bitcoincardterminal/ViewModel/ViewStateManagers/MessageManager.java // public class MessageManager { // //Singleton pattern: // private static MessageManager instance = null; // public static MessageManager Instance() // { // if(instance == null) // { // instance = new MessageMana...
if(event.getActionMasked() == 2 && !NavigationManager.Instance().AllowLeftSwipe() && !NavigationManager.Instance().AllowRightSwipe())
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/View/MainFragmentPager.java
// Path: src/com/blochstech/bitcoincardterminal/ViewModel/ViewStateManagers/MessageManager.java // public class MessageManager { // //Singleton pattern: // private static MessageManager instance = null; // public static MessageManager Instance() // { // if(instance == null) // { // instance = new MessageMana...
import com.blochstech.bitcoincardterminal.ViewModel.ViewStateManagers.MessageManager; import com.blochstech.bitcoincardterminal.ViewModel.ViewStateManagers.NavigationManager; import android.content.Context; import android.support.v4.view.ViewPager; import android.util.AttributeSet;
package com.blochstech.bitcoincardterminal.View; public class MainFragmentPager extends ViewPager { public MainFragmentPager(Context context) { super(context); } public MainFragmentPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onTouchEvent(android....
// Path: src/com/blochstech/bitcoincardterminal/ViewModel/ViewStateManagers/MessageManager.java // public class MessageManager { // //Singleton pattern: // private static MessageManager instance = null; // public static MessageManager Instance() // { // if(instance == null) // { // instance = new MessageMana...
MessageManager.Instance().AddMessage("Failed to set page to page #" + i + ". Likely the page's startup code or XML layout file is invalid."
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/Model/Communication/BitcoinCardStateObject.java
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java // public class AppSettings { // public static final double DUST_LIMIT = 0.00005460; // public static final double MIN_FEE_BITCOINS = 0.0001; // } // // Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java // public class ...
import java.util.ArrayList; import java.util.LinkedList; import java.util.Locale; import com.blochstech.bitcoincardterminal.Model.AppSettings; import com.blochstech.bitcoincardterminal.Utils.ShortNumberConverter; import com.blochstech.bitcoincardterminal.Utils.SyntacticSugar;
if(go1 == true && go2 == true) break; if(go1 == false){ if(addressBytes != null && waitingAddress != null) { if(addressBytes[i] != waitingAddress[i]){ waitingAddressMatch = false; go1 = true; } }else{ waitingAddressMatch = amount <= 0.0; go1 = true; } } if...
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java // public class AppSettings { // public static final double DUST_LIMIT = 0.00005460; // public static final double MIN_FEE_BITCOINS = 0.0001; // } // // Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java // public class ...
&& SyntacticSugar.EqualWithinMargin(amount, waitingAmount, 0.001)
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/Model/Communication/BitcoinCardStateObject.java
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java // public class AppSettings { // public static final double DUST_LIMIT = 0.00005460; // public static final double MIN_FEE_BITCOINS = 0.0001; // } // // Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java // public class ...
import java.util.ArrayList; import java.util.LinkedList; import java.util.Locale; import com.blochstech.bitcoincardterminal.Model.AppSettings; import com.blochstech.bitcoincardterminal.Utils.ShortNumberConverter; import com.blochstech.bitcoincardterminal.Utils.SyntacticSugar;
if(knownSources.get(i).TXHash.toLowerCase(Locale.ENGLISH).equals(txHash.toLowerCase(Locale.ENGLISH))) return knownSources.get(i).Verified; } return false; } //TODO: This is becomming too complex to understand, consider moving logic into separated self-contained "steps"... //basically what we are doing wit...
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java // public class AppSettings { // public static final double DUST_LIMIT = 0.00005460; // public static final double MIN_FEE_BITCOINS = 0.0001; // } // // Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java // public class ...
if(amount < AppSettings.DUST_LIMIT)
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/Model/Communication/BitcoinCardStateObject.java
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java // public class AppSettings { // public static final double DUST_LIMIT = 0.00005460; // public static final double MIN_FEE_BITCOINS = 0.0001; // } // // Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java // public class ...
import java.util.ArrayList; import java.util.LinkedList; import java.util.Locale; import com.blochstech.bitcoincardterminal.Model.AppSettings; import com.blochstech.bitcoincardterminal.Utils.ShortNumberConverter; import com.blochstech.bitcoincardterminal.Utils.SyntacticSugar;
} //TODO: This is becomming too complex to understand, consider moving logic into separated self-contained "steps"... //basically what we are doing with ProcessStateChange... CONSIDER solutions void addKnownSource(TXSourceId source){ if(!knownSource(source)){ knownSources.add(source); }else{ for(int i =...
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java // public class AppSettings { // public static final double DUST_LIMIT = 0.00005460; // public static final double MIN_FEE_BITCOINS = 0.0001; // } // // Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java // public class ...
return "Over max " + ShortNumberConverter.ToShort(maxCardCharge) + ".";
BlochsTech/BitcoinCardTerminal
src/com/blochstech/bitcoincardterminal/Utils/ByteConversionUtil.java
// Path: src/com/blochstech/bitcoincardterminal/Model/Communication/MerkleBranchElement.java // public class MerkleBranchElement { // public String hash; //This is the one sent to the card. // public boolean rightNode; //True if property hash is on the right side of the pair. // public String otherHash; //In the fi...
import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.LinkedList; import java.util.List; import java.io.UnsupportedEncodingException; import java.math.BigInteger; import com.blochstech.bitcoincardterminal.Model.Communication.MerkleBranchElement;
public static int[] toUnsigned(byte[] bytes) { if (bytes == null) return null; int[] res = new int[bytes.length]; for(int i = 0; i < bytes.length; i++){ res[i] = (int) (bytes[i] < 0 ? bytes[i] + 256 : bytes[i]); } return res; } public static int toUnsigned(byte singleByte) { return (int) (...
// Path: src/com/blochstech/bitcoincardterminal/Model/Communication/MerkleBranchElement.java // public class MerkleBranchElement { // public String hash; //This is the one sent to the card. // public boolean rightNode; //True if property hash is on the right side of the pair. // public String otherHash; //In the fi...
public static MerkleBranchElement[] MerkleListToArray(LinkedList<MerkleBranchElement> list){
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/mip/Variable.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
import java.io.Serializable; import edu.harvard.econcs.jopt.solver.MIPException;
/* * Copyright (c) 2005-2017 Benjamin Lubin * Copyright (c) 2005-2017 The President and Fellows of Harvard College * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions o...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
throw new MIPException("Lowerbound must be less than upperBound");
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/mip/LinearTerm.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
import java.io.Serializable; import edu.harvard.econcs.jopt.solver.MIPException;
/* * Copyright (c) 2005-2017 Benjamin Lubin * Copyright (c) 2005-2017 The President and Fellows of Harvard College * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions o...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
throw new MIPException("Problem in clone", e);
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/mip/Constraint.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import edu.harvard.econcs.jopt.solver.MIPException;
return false; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; return true; } protected Object clone() throws CloneNotSupportedException { Constraint ret = (Constraint)super.clone(); if(linearTerms != null) { ret.linearTerms = n...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
throw new MIPException("Problem in clone", e);
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/server/SolverServer.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/IMIPSolver.java // public interface IMIPSolver { // /** Solves a MIP that you have constructed. Results for the solve are in the return value. */ // IMIPResult solve(IMIP mip) throws MIPException; // } // // Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPE...
import java.rmi.AccessException; import java.rmi.AlreadyBoundException; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import edu.harvard.econcs.jopt.solver.IMIPSolver; import edu.harvard.econcs.jopt.solver.MIPExce...
/* * Copyright (c) 2005-2017 Benjamin Lubin * Copyright (c) 2005-2017 The President and Fellows of Harvard College * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions o...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/IMIPSolver.java // public interface IMIPSolver { // /** Solves a MIP that you have constructed. Results for the solve are in the return value. */ // IMIPResult solve(IMIP mip) throws MIPException; // } // // Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPE...
public static void createServer(int port, Class solverClass) throws MIPException {
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/server/SolverServer.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/IMIPSolver.java // public interface IMIPSolver { // /** Solves a MIP that you have constructed. Results for the solve are in the return value. */ // IMIPResult solve(IMIP mip) throws MIPException; // } // // Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPE...
import java.rmi.AccessException; import java.rmi.AlreadyBoundException; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import edu.harvard.econcs.jopt.solver.IMIPSolver; import edu.harvard.econcs.jopt.solver.MIPExce...
/* * Copyright (c) 2005-2017 Benjamin Lubin * Copyright (c) 2005-2017 The President and Fellows of Harvard College * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions o...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/IMIPSolver.java // public interface IMIPSolver { // /** Solves a MIP that you have constructed. Results for the solve are in the return value. */ // IMIPResult solve(IMIP mip) throws MIPException; // } // // Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPE...
IMIPSolver solver = null;
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/mip/QuadraticTerm.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
import java.io.Serializable; import edu.harvard.econcs.jopt.solver.MIPException;
/** * @return Returns the coefficient. */ public double getCoefficient() { return coefficient; } public String getVarNameA() { return varNameA; } public String getVarNameB() { return varNameB; } public String toString() { //return coefficient +"*V" + varName; return coefficient +"*" + varN...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
throw new MIPException("Problem in clone", e);
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/server/cplex/InstanceManager.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
import ilog.concert.IloException; import ilog.cplex.IloCplex; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import edu.harvard.econcs.jopt.solver.MIPException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger;
logger.error("Exception trying to close CPLEX", ex); } } inUse.clear(); } } IloCplex cplex = getCplex(); inUse.add(cplex); return cplex; } private boolean notAvailable() { return inU...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPException.java // public class MIPException extends RuntimeException { // // /** // * // */ // private static final long serialVersionUID = 3257289123487103030L; // // public MIPException(String msg) { // super(msg); // } // // public MIPException...
throw new MIPException("Could not obtain cplex instance");
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/server/cplex/CPlexMIPSolver.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPInfeasibleException.java // public static class Cause implements Serializable { // public static Cause LOWER = new Cause(1); // public static Cause UPPER = new Cause(2); // private static final long serialVersionUID = 200504191645l; // private int type; // ...
import edu.harvard.econcs.jopt.solver.*; import edu.harvard.econcs.jopt.solver.MIPInfeasibleException.Cause; import edu.harvard.econcs.jopt.solver.mip.*; import edu.harvard.econcs.jopt.solver.server.SolverServer; import ilog.concert.*; import ilog.cplex.IloCplex; import ilog.cplex.IloCplex.*; import org.apache.logging....
Map<IloNumVarBound, Variable> vConstToVars = new HashMap<>(vars.size()); for (String varName : vars.keySet()) { IloNumVar numVar = vars.get(varName); Variable mipVar = mip.getVar(varName); if (mipVar.getType() != VarType.BOOLEAN) { // only include non...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPInfeasibleException.java // public static class Cause implements Serializable { // public static Cause LOWER = new Cause(1); // public static Cause UPPER = new Cause(2); // private static final long serialVersionUID = 200504191645l; // private int type; // ...
Map<Variable, Cause> mipVarsToCauses = new HashMap<>();
blubin/JOpt
src/main/java/edu/harvard/econcs/jopt/solver/server/cplex/CPlexMIPSolver.java
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPInfeasibleException.java // public static class Cause implements Serializable { // public static Cause LOWER = new Cause(1); // public static Cause UPPER = new Cause(2); // private static final long serialVersionUID = 200504191645l; // private int type; // ...
import edu.harvard.econcs.jopt.solver.*; import edu.harvard.econcs.jopt.solver.MIPInfeasibleException.Cause; import edu.harvard.econcs.jopt.solver.mip.*; import edu.harvard.econcs.jopt.solver.server.SolverServer; import ilog.concert.*; import ilog.cplex.IloCplex; import ilog.cplex.IloCplex.*; import org.apache.logging....
private PoolSolution createSolution() { Map<String, Double> values = new HashMap<String, Double>(); for (String name : vars.keySet()) { IloNumVar var = vars.get(name); try { values.put(name, getIncumbentValue(var)); } c...
// Path: src/main/java/edu/harvard/econcs/jopt/solver/MIPInfeasibleException.java // public static class Cause implements Serializable { // public static Cause LOWER = new Cause(1); // public static Cause UPPER = new Cause(2); // private static final long serialVersionUID = 200504191645l; // private int type; // ...
SolverServer.createServer(port, CPlexMIPSolver.class);
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/XPathUtil.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Expr.java // public class Expr extends AbstractASTNode { // private final List<? extends ASTNode> exprSingles; // // public Expr(final List<? e...
import static org.parboiled.errors.ErrorUtils.printParseErrors; import com.evolvedbinary.xpath.parser.ast.ASTNode; import com.evolvedbinary.xpath.parser.ast.Expr; import org.parboiled.Parboiled; import org.parboiled.parserunners.ParseRunner; import org.parboiled.parserunners.RecoveringParseRunner; import org.parboiled....
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Expr.java // public class Expr extends AbstractASTNode { // private final List<? extends ASTNode> exprSingles; // // public Expr(final List<? e...
public static Expr parseXPath(final String xpath, final PrintStream out, final PrintStream err) {
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/XPathUtil.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Expr.java // public class Expr extends AbstractASTNode { // private final List<? extends ASTNode> exprSingles; // // public Expr(final List<? e...
import static org.parboiled.errors.ErrorUtils.printParseErrors; import com.evolvedbinary.xpath.parser.ast.ASTNode; import com.evolvedbinary.xpath.parser.ast.Expr; import org.parboiled.Parboiled; import org.parboiled.parserunners.ParseRunner; import org.parboiled.parserunners.RecoveringParseRunner; import org.parboiled....
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Expr.java // public class Expr extends AbstractASTNode { // private final List<? extends ASTNode> exprSingles; // // public Expr(final List<? e...
final ParseRunner<ASTNode> parseRunner = new RecoveringParseRunner<ASTNode>(parser.withEOI(parser.XPath()));
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialElementTest.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ElementTest.java // public class ElementTest extends KindTest { // @Nullable final QNameW name; // @Nullable QNameW typeName; // @Nullable boolean optionalType; // // public ElementTest() { // this(null); // } // // public Eleme...
import com.evolvedbinary.xpath.parser.ast.ElementTest; import com.evolvedbinary.xpath.parser.ast.QNameW; import org.jetbrains.annotations.Nullable;
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ElementTest.java // public class ElementTest extends KindTest { // @Nullable final QNameW name; // @Nullable QNameW typeName; // @Nullable boolean optionalType; // // public ElementTest() { // this(null); // } // // public Eleme...
public class PartialElementTest2 extends AbstractPartialASTNode<ElementTest, Boolean> {
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialDoubleLiteral.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/DoubleLiteral.java // public class DoubleLiteral extends NumericLiteral<BigDecimal> { // public DoubleLiteral(final String value) { // super(new BigDecimal(value)); // } // // @Override // protected String describe() { // return ...
import com.evolvedbinary.xpath.parser.ast.DoubleLiteral; import org.jetbrains.annotations.Nullable;
return "DoubleLiteral(" + characteristic + ".?)e??"; } @Override public PartialDoubleLiteral1 complete(@Nullable final String mantissa) { return new PartialDoubleLiteral1(mantissa); } public class PartialDoubleLiteral1 extends AbstractPartialASTNode<PartialDoubleLiteral1.PartialDou...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/DoubleLiteral.java // public class DoubleLiteral extends NumericLiteral<BigDecimal> { // public DoubleLiteral(final String value) { // super(new BigDecimal(value)); // } // // @Override // protected String describe() { // return ...
public class PartialDoubleLiteral2 extends AbstractPartialASTNode<DoubleLiteral, String> {
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialComparisonExpr.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AbstractOperand.java // public abstract class AbstractOperand extends AbstractASTNode { // // //TODO(AR) make generic and move constructor etc from sub-classes into here // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Comparison.java // p...
import com.evolvedbinary.xpath.parser.ast.AbstractOperand; import com.evolvedbinary.xpath.parser.ast.Comparison; import com.evolvedbinary.xpath.parser.ast.ComparisonExpr;
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AbstractOperand.java // public abstract class AbstractOperand extends AbstractASTNode { // // //TODO(AR) make generic and move constructor etc from sub-classes into here // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Comparison.java // p...
public class PartialComparisonExpr1 extends AbstractPartialASTNode<ComparisonExpr, AbstractOperand> {
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialQuantifierExpr.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/QuantifiedExpr.java // public class QuantifiedExpr extends AbstractASTNode implements ExprSingle { // // public enum Quantifier { // SOME, ...
import java.util.List; import com.evolvedbinary.xpath.parser.ast.ASTNode; import com.evolvedbinary.xpath.parser.ast.QuantifiedExpr;
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/QuantifiedExpr.java // public class QuantifiedExpr extends AbstractASTNode implements ExprSingle { // // public enum Quantifier { // SOME, ...
public class PartialQuantifierExpr1 extends AbstractPartialASTNode<QuantifiedExpr, ASTNode> {
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialAttributeTest.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AttributeTest.java // public class AttributeTest extends KindTest { // @Nullable final QNameW name; // @Nullable QNameW typeName; // // public AttributeTest() { // this(null); // } // // public AttributeTest(final QNameW name) { // ...
import com.evolvedbinary.xpath.parser.ast.AttributeTest; import com.evolvedbinary.xpath.parser.ast.QNameW; import org.jetbrains.annotations.Nullable;
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/AttributeTest.java // public class AttributeTest extends KindTest { // @Nullable final QNameW name; // @Nullable QNameW typeName; // // public AttributeTest() { // this(null); // } // // public AttributeTest(final QNameW name) { // ...
public class PartialAttributeTest1 extends AbstractPartialASTNode<AttributeTest, QNameW> {
exquery/xpath2-parser
src/main/java/com/evolvedbinary/xpath/parser/ast/partial/PartialIfExpr.java
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Expr.java // public class Expr extends AbstractASTNode { // private final List<? extends ASTNode> exprSingles; // // public Expr(final List<? e...
import com.evolvedbinary.xpath.parser.ast.ASTNode; import com.evolvedbinary.xpath.parser.ast.Expr; import com.evolvedbinary.xpath.parser.ast.IfExpr;
/** * XPath 2 Parser * A Parser for XPath 2 * Copyright (C) 2016 Evolved Binary Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your opti...
// Path: src/main/java/com/evolvedbinary/xpath/parser/ast/ASTNode.java // public interface ASTNode { // } // // Path: src/main/java/com/evolvedbinary/xpath/parser/ast/Expr.java // public class Expr extends AbstractASTNode { // private final List<? extends ASTNode> exprSingles; // // public Expr(final List<? e...
public class PartialIfExpr1 extends AbstractPartialASTNode<IfExpr, ASTNode> {
jacek99/immutizer4j
src/test/java/org/immutizer4j/test/sample/ImmutableArrayPojo.java
// Path: src/test/java/org/immutizer4j/test/sample/generics/ImmutableArray.java // @Value // public class ImmutableArray<T> { // // private T[] array; // // /** // * Constructor. Creates a copy of the source array // */ // public ImmutableArray(T[] a){ // array = Arrays.copyOf(a, a.lengt...
import lombok.Value; import org.immutizer4j.test.sample.generics.ImmutableArray;
package org.immutizer4j.test.sample; /** * A POJO that uses ImmutableArray to wrap both mutable and immutable object types * and ensure we correctly process both */ @Value public class ImmutableArrayPojo { // this one is OK, as ImmutablePojo is obviously immutable
// Path: src/test/java/org/immutizer4j/test/sample/generics/ImmutableArray.java // @Value // public class ImmutableArray<T> { // // private T[] array; // // /** // * Constructor. Creates a copy of the source array // */ // public ImmutableArray(T[] a){ // array = Arrays.copyOf(a, a.lengt...
private ImmutableArray<ImmutablePojo> immutablePojoArray;
indexiatech/antiquity
src/main/java/co/indexia/antiquity/graph/IndexableTransactionalVersionedGraphImpl.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
import com.tinkerpop.blueprints.Element; import com.tinkerpop.blueprints.Index; import com.tinkerpop.blueprints.IndexableGraph; import com.tinkerpop.blueprints.KeyIndexableGraph; import com.tinkerpop.blueprints.Parameter; import com.tinkerpop.blueprints.TransactionalGraph; import com.tinkerpop.blueprints.util.wrappers....
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
IndexableTransactionalVersionedGraphImpl(T baseGraph, GraphIdentifierBehavior<V> identifierBehavior) {
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/matchers/HasElementIds.java
// Path: src/main/java/co/indexia/antiquity/graph/HistoricVersionedElement.java // public abstract class HistoricVersionedElement<V extends Comparable<V>, T extends Element> implements Element { // /** // * The graph instance which loaded this edge. // */ // private final HistoricVersionedGraph<?, V> ...
import com.google.common.collect.Lists; import com.tinkerpop.blueprints.Element; import co.indexia.antiquity.graph.HistoricVersionedElement; import org.hamcrest.Description; import org.hamcrest.Factory; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import java.util.ArrayList; import java.util.List;
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or (a...
// Path: src/main/java/co/indexia/antiquity/graph/HistoricVersionedElement.java // public abstract class HistoricVersionedElement<V extends Comparable<V>, T extends Element> implements Element { // /** // * The graph instance which loaded this edge. // */ // private final HistoricVersionedGraph<?, V> ...
if (!(e instanceof HistoricVersionedElement)) {
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/GraphInitTest.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
import com.google.common.collect.Lists; import com.tinkerpop.blueprints.impls.tg.TinkerGraph; import co.indexia.antiquity.graph.identifierBehavior.LongGraphIdentifierBehavior; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat;
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
graph, new LongGraphIdentifierBehavior()).init(false).conf(conf).build();
indexiatech/antiquity
src/main/java/co/indexia/antiquity/graph/TransactionalVersionedGraph.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.Map; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Element; import com.tinkerpop.blueprints.IndexableGraph; import com.tinkerpop.blueprints.KeyIndexableGraph; import com.tinkerpop.blueprints.Trans...
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
TransactionalVersionedGraph(T baseGraph, GraphIdentifierBehavior<V> identifierBehavior) {
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/TitanTxLongVersionedGraphTest.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
import com.thinkaurelius.titan.core.TitanFactory; import com.thinkaurelius.titan.core.TitanGraph; import co.indexia.antiquity.graph.identifierBehavior.LongGraphIdentifierBehavior; import org.apache.commons.configuration.BaseConfiguration; import org.apache.commons.configuration.Configuration; import org.apache.commons....
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
return new ActiveVersionedGraph.ActiveVersionedTransactionalGraphBuilder<TitanGraph, Long>(g, new LongGraphIdentifierBehavior())
indexiatech/antiquity
src/main/java/co/indexia/antiquity/graph/NonTransactionalVersionedGraph.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import com.google.common.collect.Maps; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.IndexableGraph; import com.tinkerpop.blueprints.KeyIndexableGraph; import com.tin...
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
public NonTransactionalVersionedGraph(T baseGraph, GraphIdentifierBehavior<V> identifierBehavior) {
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/NonTransactionalLongTypeVersionedGraphTest.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import com.tinkerpop.blueprints.impls.tg.TinkerGraph; import co.indexia.antiquity.graph.identifierBehavior.LongGraphIdentifierBehavior; import org.junit.Test;
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
new TinkerGraph(), new LongGraphIdentifierBehavior()).init(true).conf(conf).build();
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/Neo4j2TxLongVersionedGraphTest.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
import com.tinkerpop.blueprints.impls.neo4j2.Neo4j2Graph; import co.indexia.antiquity.graph.identifierBehavior.LongGraphIdentifierBehavior; import org.neo4j.test.ImpermanentGraphDatabase;
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/LongGraphIdentifierBehavior.java // public class LongGraphIdentifierBehavior extends BaseGraphIdentifierBehavior<Long> { // @Override // public Long getMinPossibleGraphVersion() { // return (long) 1; // } // // @Override // ...
new ImpermanentGraphDatabase()), new LongGraphIdentifierBehavior()).init(true).conf(null).build();
indexiatech/antiquity
src/main/java/co/indexia/antiquity/graph/VersionedGraphBase.java
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
import java.util.Set; import com.google.common.base.Preconditions; import com.tinkerpop.blueprints.Element; import com.tinkerpop.blueprints.Features; import com.tinkerpop.blueprints.IndexableGraph; import com.tinkerpop.blueprints.KeyIndexableGraph; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints...
/** * Copyright (c) 2012-2014 "Indexia Technologies, ltd." * * This file is part of Antiquity. * * Antiquity is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or ...
// Path: src/main/java/co/indexia/antiquity/graph/identifierBehavior/GraphIdentifierBehavior.java // public interface GraphIdentifierBehavior<V extends Comparable<V>> { // /** // * Get the latest(current) graph version. // * // * <p> // * Graph latest version is stored in the root historic vert...
protected GraphIdentifierBehavior<V> identifierBehavior;
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/VersionContextGraphTest.java
// Path: src/main/java/co/indexia/antiquity/graph/VersionContextGraph.java // public static <V extends Comparable<V>> VersionContextGraph<V> vc(HistoricVersionedGraph<?, V> graph, V version) { // return new VersionContextGraph<V>(graph, version); // } // // Path: src/test/java/co/indexia/antiquity/graph/matchers/H...
import co.indexia.antiquity.graph.matchers.HasElementIds; import org.junit.BeforeClass; import org.junit.Test; import org.neo4j.test.ImpermanentGraphDatabase; import static co.indexia.antiquity.graph.VersionContextGraph.vc; import static co.indexia.antiquity.graph.matchers.HasAmount.hasAmount; import static co.indexia....
vc3 = vc(h, ver3); assertThat(vc3, notNullValue()); } @Test public void contextCreationTest() { Long v104 = 104L; VersionContextGraph<Long> vc = vc(graph.getHistoricGraph(), v104); assertThat(vc, notNullValue()); assertThat(v104, is(vc.getVersion())); ...
// Path: src/main/java/co/indexia/antiquity/graph/VersionContextGraph.java // public static <V extends Comparable<V>> VersionContextGraph<V> vc(HistoricVersionedGraph<?, V> graph, V version) { // return new VersionContextGraph<V>(graph, version); // } // // Path: src/test/java/co/indexia/antiquity/graph/matchers/H...
assertThat(vc1.getVertices(), elementIds(HasElementIds.ID.ID, HasElementIds.TYPE.EXACTLY_MATCHES, vertex1Id));
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/VersionContextGraphTest.java
// Path: src/main/java/co/indexia/antiquity/graph/VersionContextGraph.java // public static <V extends Comparable<V>> VersionContextGraph<V> vc(HistoricVersionedGraph<?, V> graph, V version) { // return new VersionContextGraph<V>(graph, version); // } // // Path: src/test/java/co/indexia/antiquity/graph/matchers/H...
import co.indexia.antiquity.graph.matchers.HasElementIds; import org.junit.BeforeClass; import org.junit.Test; import org.neo4j.test.ImpermanentGraphDatabase; import static co.indexia.antiquity.graph.VersionContextGraph.vc; import static co.indexia.antiquity.graph.matchers.HasAmount.hasAmount; import static co.indexia....
vc3 = vc(h, ver3); assertThat(vc3, notNullValue()); } @Test public void contextCreationTest() { Long v104 = 104L; VersionContextGraph<Long> vc = vc(graph.getHistoricGraph(), v104); assertThat(vc, notNullValue()); assertThat(v104, is(vc.getVersion())); ...
// Path: src/main/java/co/indexia/antiquity/graph/VersionContextGraph.java // public static <V extends Comparable<V>> VersionContextGraph<V> vc(HistoricVersionedGraph<?, V> graph, V version) { // return new VersionContextGraph<V>(graph, version); // } // // Path: src/test/java/co/indexia/antiquity/graph/matchers/H...
assertThat(vc1.getVertices(), elementIds(HasElementIds.ID.ID, HasElementIds.TYPE.EXACTLY_MATCHES, vertex1Id));
honeybadger-io/honeybadger-java
honeybadger-java/src/test/java/io/honeybadger/reporter/spring/HoneybadgerSpringExceptionHandlerTest.java
// Path: honeybadger-java/src/test/java/io/honeybadger/reporter/UnitTestExpectedException.java // public class UnitTestExpectedException extends RuntimeException { // private static final long serialVersionUID = -4503310108779513186L; // // public UnitTestExpectedException() { // } // // public UnitTe...
import static org.junit.Assert.assertThrows; import static org.mockito.Mockito.mock; import com.google.common.collect.ImmutableSet; import io.honeybadger.reporter.UnitTestExpectedException; import io.honeybadger.reporter.config.SpringConfigContext; import javax.servlet.http.HttpServletRequest; import org.junit.Test;
package io.honeybadger.reporter.spring; /** * Tests {@link HoneybadgerSpringExceptionHandler}. */ public class HoneybadgerSpringExceptionHandlerTest { private final SpringConfigContext context = new SpringConfigContext(null); private final HttpServletRequest request = mock(HttpServletRequest.class); @Test ...
// Path: honeybadger-java/src/test/java/io/honeybadger/reporter/UnitTestExpectedException.java // public class UnitTestExpectedException extends RuntimeException { // private static final long serialVersionUID = -4503310108779513186L; // // public UnitTestExpectedException() { // } // // public UnitTe...
assertThrows(UnitTestExpectedException.class,
honeybadger-io/honeybadger-java
honeybadger-java/src/main/java/io/honeybadger/reporter/config/PlayConfigContext.java
// Path: honeybadger-java/src/main/java/io/honeybadger/util/HBStringUtils.java // public final class HBStringUtils { // private HBStringUtils() { } // // /** // * Removes a single character from the end of a string if it matches. // * @param input String to remove from, if null returns null // *...
import com.typesafe.config.Config; import com.typesafe.config.ConfigValue; import io.honeybadger.util.HBStringUtils; import org.slf4j.LoggerFactory; import play.Environment; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.stream.Collectors; impor...
/** * Flattens a hierarchical map of nested maps into a single map with each * nesting delineated by a dot. * @param map nested map * @param level level of nesting * @return a flat map */ static Map<String, Object> flattenNestedMap(final Map<String, Object> map, final long level) ...
// Path: honeybadger-java/src/main/java/io/honeybadger/util/HBStringUtils.java // public final class HBStringUtils { // private HBStringUtils() { } // // /** // * Removes a single character from the end of a string if it matches. // * @param input String to remove from, if null returns null // *...
String subKey = HBStringUtils.stripTrailingChar(subEntry.getKey(), '.');
honeybadger-io/honeybadger-java
honeybadger-java/src/main/java/io/honeybadger/reporter/FeedbackForm.java
// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/config/ConfigContext.java // public interface ConfigContext { // /** @return name of environment */ // String getEnvironment(); // // /** @return Honeybadger URL to use */ // URI getHoneybadgerUrl(); // // /** @return Honeybadger API ...
import com.github.mustachejava.DefaultMustacheFactory; import com.github.mustachejava.Mustache; import com.github.mustachejava.MustacheFactory; import io.honeybadger.reporter.config.ConfigContext; import java.io.IOException; import java.io.Writer; import java.util.Enumeration; import java.util.HashMap; import java.util...
package io.honeybadger.reporter; /** * Utility class responsible for rendering the Honeybadger feedback form. * * @author <a href="https://github.com/dekobon">Elijah Zupancic</a> * @since 1.0.9 */ public class FeedbackForm { public static final int INITIAL_SCOPE_HASHMAP_CAPACITY = 30;
// Path: honeybadger-java/src/main/java/io/honeybadger/reporter/config/ConfigContext.java // public interface ConfigContext { // /** @return name of environment */ // String getEnvironment(); // // /** @return Honeybadger URL to use */ // URI getHoneybadgerUrl(); // // /** @return Honeybadger API ...
private final ConfigContext config;