Skip to content

Commit 90efd7b

Browse files
committed
Initial commit
0 parents  commit 90efd7b

21 files changed

+1528
-0
lines changed

.gitignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Created by https://www.gitignore.io/api/java,maven
2+
3+
### Java ###
4+
*.class
5+
6+
# Mobile Tools for Java (J2ME)
7+
.mtj.tmp/
8+
9+
# Package Files #
10+
*.jar
11+
*.war
12+
*.ear
13+
14+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15+
hs_err_pid*
16+
17+
18+
### Maven ###
19+
target/
20+
pom.xml.tag
21+
pom.xml.releaseBackup
22+
pom.xml.versionsBackup
23+
pom.xml.next
24+
release.properties
25+
dependency-reduced-pom.xml
26+
buildNumber.properties
27+
.mvn/timing.properties

LICENSE

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Copyright 2015, Yahoo Inc.
2+
3+
Licensed under the terms of the New BSD license. See below for terms.
4+
5+
Redistribution and use of this software in source and binary forms,
6+
with or without modification, are permitted provided that the following
7+
conditions are met:
8+
9+
* Redistributions of source code must retain the above
10+
copyright notice, this list of conditions and the
11+
following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above
14+
copyright notice, this list of conditions and the
15+
following disclaimer in the documentation and/or other
16+
materials provided with the distribution.
17+
18+
* Neither the name of Yahoo Inc. nor the names of its
19+
contributors may be used to endorse or promote products
20+
derived from this software without specific prior
21+
written permission of Yahoo Inc.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# YCB
2+
3+
YCB is a multi-dimensional configuration library that builds bundles from
4+
resource files describing a variety of values. The library allows applications
5+
to configure themselves based on multiple dimensions describing locations,
6+
languages, environments, etc.
7+
8+
## License
9+
10+
Code licensed under the BSD license. See LICENSE file for terms.

pom.xml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2015 Yahoo inc.
4+
~ Licensed under the terms of the BSD License. Please see LICENSE file in the project home directory for terms.
5+
-->
6+
7+
<project xmlns="http://maven.apache.org/POM/4.0.0"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<groupId>com.yahoo</groupId>
13+
<artifactId>ycb</artifactId>
14+
<version>1.0-SNAPSHOT</version>
15+
<packaging>jar</packaging>
16+
<name>YCB</name>
17+
18+
<build>
19+
<plugins>
20+
<plugin>
21+
<groupId>org.apache.maven.plugins</groupId>
22+
<artifactId>maven-compiler-plugin</artifactId>
23+
<version>3.3</version>
24+
<configuration>
25+
<source>1.8</source>
26+
<target>1.8</target>
27+
</configuration>
28+
</plugin>
29+
<plugin>
30+
<groupId>org.apache.maven.plugins</groupId>
31+
<artifactId>maven-surefire-plugin</artifactId>
32+
<version>2.18.1</version>
33+
<dependencies>
34+
<dependency>
35+
<groupId>org.apache.maven.surefire</groupId>
36+
<artifactId>surefire-junit47</artifactId>
37+
<version>2.18.1</version>
38+
</dependency>
39+
</dependencies>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
44+
<dependencies>
45+
<dependency>
46+
<groupId>com.fasterxml.jackson.dataformat</groupId>
47+
<artifactId>jackson-dataformat-yaml</artifactId>
48+
<version>${jackson.version}</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>com.fasterxml.jackson.core</groupId>
52+
<artifactId>jackson-databind</artifactId>
53+
<version>${jackson.version}</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.apache.commons</groupId>
57+
<artifactId>commons-lang3</artifactId>
58+
<version>3.4</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>com.google.guava</groupId>
62+
<artifactId>guava</artifactId>
63+
<version>18.0</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
67+
<artifactId>concurrentlinkedhashmap-lru</artifactId>
68+
<version>1.4.2</version>
69+
</dependency>
70+
71+
<dependency>
72+
<groupId>junit</groupId>
73+
<artifactId>junit</artifactId>
74+
<version>4.11</version>
75+
<scope>test</scope>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.testng</groupId>
79+
<artifactId>testng</artifactId>
80+
<version>6.9.4</version>
81+
<scope>test</scope>
82+
</dependency>
83+
</dependencies>
84+
85+
<properties>
86+
<jackson.version>2.5.1</jackson.version>
87+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
88+
</properties>
89+
</project>
90+
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2015 Yahoo inc.
3+
* Licensed under the terms of the BSD License. Please see LICENSE file in the project home directory for terms.
4+
*/
5+
6+
package com.yahoo.ycb;
7+
8+
import com.fasterxml.jackson.databind.JsonNode;
9+
10+
import java.util.Map;
11+
12+
/**
13+
* A Bundle is an association between a Context and a Delta.
14+
* <p>
15+
* A Context is a map between Dimension Names, and Dimension values -
16+
* specifying in which situation the Delta will be applied.
17+
* <p>
18+
* A Delta is a piece of arbitrary unstructured configuration.
19+
*/
20+
public class Bundle {
21+
22+
private final Map<String, String> context;
23+
private final JsonNode delta;
24+
25+
public Bundle(Map<String, String> context, JsonNode delta) {
26+
this.context = context;
27+
this.delta = delta;
28+
}
29+
30+
public Map<String, String> getContext() {
31+
return context;
32+
}
33+
34+
public JsonNode getDelta() {
35+
return delta;
36+
}
37+
}

0 commit comments

Comments
 (0)