diff options
author | lj1412 <lji@research.att.com> | 2017-02-14 15:10:09 +0000 |
---|---|---|
committer | lj1412 <lji@research.att.com> | 2017-02-14 15:10:11 +0000 |
commit | 7927ff179242b796330d17869c83fa07751abf95 (patch) | |
tree | ba2b93e26ec71bff863bc7be9fb5dbd0b5d9c928 /cdf/src/cdf-prop-value/cdf-prop-value | |
parent | d1bf35c127a238238b573103edf7dbcb1ebd48ed (diff) |
Init dcae.pgaas
Change-Id: Ieef6b600f4cbb0bf4ee3910c1bfc6b36773cd2d2
Signed-off-by: lj1412 <lji@research.att.com>
Diffstat (limited to 'cdf/src/cdf-prop-value/cdf-prop-value')
7 files changed, 198 insertions, 0 deletions
diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/pom.xml b/cdf/src/cdf-prop-value/cdf-prop-value/pom.xml new file mode 100644 index 0000000..208d5f7 --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/pom.xml @@ -0,0 +1,28 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.openecomp.dcae.cdf</groupId> + <artifactId>cdf-prop-value</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>cdf-prop-value</name> + <url>http://maven.apache.org</url> + + <dependencies> + <dependency> + <groupId>org.openecomp.dcae.cdf</groupId> + <artifactId>cdf-util</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + + </dependencies> + +</project> diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/.gitignore b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/.gitignore new file mode 100644 index 0000000..863d673 --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/.gitignore @@ -0,0 +1 @@ +javadoc diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar Binary files differnew file mode 100644 index 0000000..ba5a4a7 --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/makefile b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/makefile new file mode 100644 index 0000000..3591a88 --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/makefile @@ -0,0 +1,29 @@ +go=../../../../buildjars/gnu_getopt.jar +cu=../../../../cdf-util/src/main/java/cdf-util.jar + +.SUFFIXES= .class + +JAVA=org/openecomp/dcae/cdf/CdfPropValue.java +CLASSES=$(JAVA:.java=.class) + +all: + +build: cdf-prop-value.jar + +classes: $(CLASSES) + +clean: + find . -name '*.class' -exec rm -f {} + + rm -rf javadoc + +cdf-prop-value.jar: classes + rm -f cdf-prop-value.jar + jar cvf cdf-prop-value.jar $(CLASSES) + +$(CLASSES): $(JAVA) + javac -cp $(go):$(cu) $(JAVA) + +javadocs: + rm -rf javadoc + mkdir -p javadoc + javadoc -d javadoc -classpath $(go):$(cu) $(JAVA) diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/org/openecomp/dcae/cdf/.gitignore b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/org/openecomp/dcae/cdf/.gitignore new file mode 100644 index 0000000..6b468b6 --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/org/openecomp/dcae/cdf/.gitignore @@ -0,0 +1 @@ +*.class diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/org/openecomp/dcae/cdf/CdfPropValue.java b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/org/openecomp/dcae/cdf/CdfPropValue.java new file mode 100644 index 0000000..870835a --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/org/openecomp/dcae/cdf/CdfPropValue.java @@ -0,0 +1,86 @@ +/* + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this code except in compliance + with the License. You may obtain a copy of the License + at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + +*/ +package org.openecomp.dcae.cdf; + +import org.openecomp.dcae.cdf.util.config.PropValue; +import java.util.logging.Logger; +import org.openecomp.dcae.cdf.util.config.Configuration; +import java.io.InputStream; +import java.io.PrintStream; + +public class CdfPropValue extends PropValue { + public static String getCDFHOME() { + String optCdf = System.getProperty("CDF_HOME"); + if (optCdf == null) optCdf = System.getenv("CDF_HOME"); + if (optCdf == null) optCdf = "/opt/app/cdf"; + return optCdf; + } + + public static String getGLOBALPROPFILE() { + String optCdfCfg = System.getProperty("CDF_CFG"); + if (optCdfCfg == null) optCdfCfg = System.getenv("CDF_CFG"); + if (optCdfCfg == null) optCdfCfg = getCDFHOME() + "/lib/cdf.cfg"; + return optCdfCfg; + } + + public static void init() { + PropValue.setGlobalPropFile(getGLOBALPROPFILE()); + PropValue.setEncryptionKeyProperty("Global_Title"); + } + static { + init(); + } + + public static void printEncryptedProperty(String method, String name, String salt, String value, String globalPropFile) { + PropValue.printEncryptedProperty(method, name, salt, value, globalPropFile); + } + public static String generateEncryptedProperty(String method, String salt, String value, String globalPropFile) throws Exception { + return PropValue.generateEncryptedProperty(method, salt, value, globalPropFile); + } + public static String generateEncryptedProperty(String method, String salt, String value, PropValue propValue) throws Exception { + return PropValue.generateEncryptedProperty(method, salt, value, propValue); + } + public static void extractProperty(String f, String name, boolean encrypted) { + PropValue.extractProperty(f, name, encrypted); + } + public static void extractProperty(String f, String name, boolean encrypted, String globalPropFile) { + PropValue.extractProperty(f, name, encrypted, globalPropFile); + } + public static String decryptTriple(String triple, String globalPropFile) { + return PropValue.decryptTriple(triple, globalPropFile); + } + public static String decryptTriple(String triple, PropValue propValue) { + return PropValue.decryptTriple(triple, propValue); + } + public static void encryptInput(InputStream in, PrintStream out) throws Exception { + PropValue.encryptInput(in, out); + } + public static void encryptInput() throws Exception { + PropValue.encryptInput(); + } + public static void encryptInput(String globalPropFile, InputStream sysin, PrintStream sysout) throws Exception { + PropValue.encryptInput(globalPropFile, sysin, sysout); + } + public static void main(String args[]) throws Exception { + PropValue.main(args); + } + + + public CdfPropValue(Configuration globalConfig, Logger logger) { + super(globalConfig, logger); + } + +} diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/test/java/org/openecomp/dcae/cdf/cdfpropvalue/AppTest.java b/cdf/src/cdf-prop-value/cdf-prop-value/src/test/java/org/openecomp/dcae/cdf/cdfpropvalue/AppTest.java new file mode 100644 index 0000000..23ae351 --- /dev/null +++ b/cdf/src/cdf-prop-value/cdf-prop-value/src/test/java/org/openecomp/dcae/cdf/cdfpropvalue/AppTest.java @@ -0,0 +1,53 @@ +/* + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this code except in compliance + with the License. You may obtain a copy of the License + at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + +*/ +package org.openecomp.dcae.cdf.cdfpropvalue; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} |