summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass/src/main/java
diff options
context:
space:
mode:
authorezhil <ezhrajam@in.ibm.com>2018-11-28 22:59:35 +0530
committerezhil <ezhrajam@in.ibm.com>2018-11-28 22:59:47 +0530
commitdf40ceda123528e27df349a9716a1a0116235e6c (patch)
tree58e0ffd4dc1de84f293da87310032317abd3d611 /auth/auth-cass/src/main/java
parentdfe29e3ea4028ff04f73606f46404baf63f81f5b (diff)
Fixed sonar issues in FutureDAO.java
Fixed Sonar issues Issue-ID: AAF-648 Change-Id: I45feb124a17aafd6192c024d63200b20ce3ef768 Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'auth/auth-cass/src/main/java')
-rw-r--r--auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java
index a98f101f..96cbf28a 100644
--- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java
+++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java
@@ -4,6 +4,8 @@
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
* ===========================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ==============================================================================
* 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
@@ -46,9 +48,9 @@ import com.datastax.driver.core.Row;
public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> {
private static final String TABLE = "future";
private final HistoryDAO historyDAO;
-// private static String createString;
private PSInfo psByStartAndTarget;
-
+ public static final int KEYLIMIT = 1;
+
public FutureDAO(AuthzTrans trans, Cluster cluster, String keyspace) {
super(trans, FutureDAO.class.getSimpleName(),cluster, keyspace, Data.class,TABLE, readConsistency(trans,TABLE), writeConsistency(trans,TABLE));
historyDAO = new HistoryDAO(trans, this);
@@ -61,7 +63,7 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> {
init(trans);
}
- public static final int KEYLIMIT = 1;
+
public static class Data {
public UUID id;
public String target;
@@ -112,13 +114,6 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> {
// Set up sub-DAOs
String[] helpers = setCRUD(trans, TABLE, Data.class, new FLoader(KEYLIMIT));
- // Uh, oh. Can't use "now()" in Prepared Statements (at least at this level)
-// createString = "INSERT INTO " + TABLE + " ("+helpers[FIELD_COMMAS] +") VALUES (now(),";
-//
-// // Need a specialty Creator to handle the "now()"
-// replace(CRUD.Create, new PSInfo(trans, "INSERT INTO future (" + helpers[FIELD_COMMAS] +
-// ") VALUES(now(),?,?,?,?,?)",new FLoader(0)));
-
// Other SELECT style statements... match with a local Method
psByStartAndTarget = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] +
" FROM future WHERE start <= ? and target = ? ALLOW FILTERING", new FLoader(2) {
@@ -134,7 +129,7 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> {
}
- public Result<List<Data>> readByStartAndTarget(AuthzTrans trans, Date start, String target) throws DAOException {
+ public Result<List<Data>> readByStartAndTarget(AuthzTrans trans, Date start, String target) {
return psByStartAndTarget.read(trans, R_TEXT, new Object[]{start, target});
}
t-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>sliapi</artifactId>
		<groupId>org.onap.ccsdk.sli.core</groupId>
		<version>0.2.0-SNAPSHOT</version>
	</parent>
	<artifactId>sliapi-features</artifactId>

	<packaging>jar</packaging>

	<dependencies>
		<dependency>
			<groupId>org.onap.ccsdk.sli.core</groupId>
			<artifactId>sliapi-model</artifactId>
		</dependency>
		<dependency>
			<groupId>org.onap.ccsdk.sli.core</groupId>
			<artifactId>sliapi-provider</artifactId>
			<classifier>config</classifier>
			<type>xml</type>
		</dependency>
		<dependency>
			<groupId>org.onap.ccsdk.sli.core</groupId>
			<artifactId>sliapi-provider</artifactId>
		</dependency>

		<dependency>
			<groupId>org.opendaylight.mdsal</groupId>
			<artifactId>features-mdsal</artifactId>
			<version>${odl.mdsal.features.version}</version>
			<classifier>features</classifier>
			<type>xml</type>

			<scope>runtime</scope>
		</dependency>



		<!-- dependency for opendaylight-karaf-empty for use by testing -->
		<dependency>
			<groupId>org.opendaylight.odlparent</groupId>
			<artifactId>opendaylight-karaf-empty</artifactId>
			<version>${odl.karaf.empty.distro.version}</version>
			<type>zip</type>
		</dependency>


		<dependency>
		    <!-- Required for launching the feature tests-->
			<groupId>org.opendaylight.odlparent</groupId>
			<artifactId>features-test</artifactId>
			<scope>test</scope>
			<version>${odl.commons.opendaylight.version}</version>
		</dependency>

		<dependency>
			<groupId>org.opendaylight.yangtools</groupId>
			<artifactId>features-yangtools</artifactId>
			<version>${odl.yangtools.version}</version>
			<classifier>features</classifier>
			<type>xml</type>
			<scope>runtime</scope>
		</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<filtering>true</filtering>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>filter</id>
						<goals>
							<goal>resources</goal>
						</goals>
						<phase>generate-resources</phase>
					</execution>
				</executions>
			</plugin>
		 <!-- launches the feature test, which validates that your karaf feature can
			         be installed inside of a karaf container. It doesn't validate that your
			         functionality works correctly, just that you have all of the dependent
			         bundles defined correctly.
			<plugin>

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.16</version>
				<configuration>
					<systemPropertyVariables>
						<karaf.distro.groupId>org.opendaylight.odlparent</karaf.distro.groupId>
						<karaf.distro.artifactId>opendaylight-karaf-empty</karaf.distro.artifactId>
						<karaf.distro.version>${odl.karaf.empty.distro.version}</karaf.distro.version>
					</systemPropertyVariables>
					<dependenciesToScan>
						<dependency>org.opendaylight.yangtools:features-test</dependency>
					</dependenciesToScan>
				</configuration>
			</plugin>
			-->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<phase>package</phase>
						<configuration>
							<artifacts>
								<artifact>
									<file>${project.build.directory}/classes/${features.file}</file>
									<type>xml</type>
									<classifier>features</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>