@ApiParam(value = "Major Version",required = true) @PathParam("version") String version,
@ApiParam(value = "Minor Version",required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
- @ApiParam(value = "Application namespace",required = true) @HeaderParam(NS) String ns,
+ @ApiParam(value = "Application namespace",required = false, hidden = true) @HeaderParam(NS) String ns,
JsonKeySpace kspObject,
@ApiParam(value = "Keyspace Name",required = true) @PathParam("name") String keyspaceName) {
try {
@ApiParam(value = "Major Version",required = true) @PathParam("version") String version,
@ApiParam(value = "Minor Version",required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
- @ApiParam(value = "Application namespace",required = true) @HeaderParam(NS) String ns,
+ @ApiParam(value = "Application namespace",required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Keyspace Name",required = true) @PathParam("name") String keyspaceName) throws Exception {
try {
ResponseBuilder response = MusicUtil.buildVersionResponse(VERSION, minorVersion, patchVersion);
@ApiParam(value = "Major Version",required = true) @PathParam("version") String version,
@ApiParam(value = "Minor Version",required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
- @ApiParam(value = "Application namespace",required = true) @HeaderParam(NS) String ns,
+ @ApiParam(value = "AID", required = false,hidden = true) @HeaderParam("aid") String aid,
+ @ApiParam(value = "Application namespace",required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
JsonTable tableObj,
@ApiParam(value = "Keyspace Name",required = true) @PathParam("keyspace") String keyspace,
@ApiParam(value = "Table Name",required = true) @PathParam("tablename") String tablename) throws Exception {
try {
ResponseBuilder response = MusicUtil.buildVersionResponse(VERSION, minorVersion, patchVersion);
+ if ( null == tableObj ) {
+ return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
+ .setError(ResultType.BODYMISSING.getResult()).toMap()).build();
+ }
if(keyspace == null || keyspace.isEmpty() || tablename == null || tablename.isEmpty()){
return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
.setError("One or more path parameters are not set, please check and try again."
@ApiParam(value = "Major Version",required = true) @PathParam("version") String version,
@ApiParam(value = "Minor Version",required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
- @ApiParam(value = "Application namespace",required = true) @HeaderParam(NS) String ns,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
+ @ApiParam(value = "Application namespace",required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
JsonInsert insObj,
@ApiParam(value = "Keyspace Name",
required = true) @PathParam("tablename") String tablename) {
try {
ResponseBuilder response = MusicUtil.buildVersionResponse(VERSION, minorVersion, patchVersion);
- if((keyspace == null || keyspace.isEmpty()) || (tablename == null || tablename.isEmpty())){
+ if ( null == insObj ) {
return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
- .setError("one or more path parameters are not set, please check and try again")
- .toMap()).build();
+ .setError(ResultType.BODYMISSING.getResult()).toMap()).build();
+ }
+ if((keyspace == null || keyspace.isEmpty()) || (tablename == null || tablename.isEmpty())){
+ return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
+ .setError("one or more path parameters are not set, please check and try again")
+ .toMap()).build();
}
EELFLoggerDelegate.mdcPut("keyspace","(" + keyspace + ")");
PreparedQueryObject queryObject = new PreparedQueryObject();
required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",
required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Application namespace",
- required = true) @HeaderParam(NS) String ns,
+ required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
JsonUpdate updateObj,
@ApiParam(value = "Keyspace Name",
@Context UriInfo info) throws MusicQueryException, MusicServiceException {
try {
ResponseBuilder response = MusicUtil.buildVersionResponse(VERSION, minorVersion, patchVersion);
+ if ( null == updateObj ) {
+ return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
+ .setError(ResultType.BODYMISSING.getResult()).toMap()).build();
+ }
if((keyspace == null || keyspace.isEmpty()) || (tablename == null || tablename.isEmpty())){
return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE)
.setError("one or more path parameters are not set, please check and try again")
required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",
required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Application namespace",
- required = true) @HeaderParam(NS) String ns,
+ required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
JsonDelete delObj,
@ApiParam(value = "Keyspace Name",
}
EELFLoggerDelegate.mdcPut("keyspace", "( "+keyspace+" ) ");
if(delObj == null) {
- logger.error(EELFLoggerDelegate.errorLogger,"Required HTTP Request body is missing.", AppMessages.MISSINGDATA ,ErrorSeverity.WARN, ErrorTypes.DATAERROR);
- return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE).setError("Required HTTP Request body is missing.").toMap()).build();
+ logger.error(EELFLoggerDelegate.errorLogger,ResultType.BODYMISSING.getResult(), AppMessages.MISSINGDATA ,ErrorSeverity.WARN, ErrorTypes.DATAERROR);
+ return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE).setError(ResultType.BODYMISSING.getResult()).toMap()).build();
}
PreparedQueryObject queryObject = new PreparedQueryObject();
StringBuilder columnString = new StringBuilder();
required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",
required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false,hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Application namespace",
- required = true) @HeaderParam(NS) String ns,
+ required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
@ApiParam(value = "Keyspace Name",
required = true) @PathParam("keyspace") String keyspace,
required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",
required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Application namespace",
- required = true) @HeaderParam(NS) String ns,
+ required = false, hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
JsonInsert selObj,
@ApiParam(value = "Keyspace Name",
.setError("one or more path parameters are not set, please check and try again")
.toMap()).build();
}
+ if(selObj == null) {
+ logger.error(EELFLoggerDelegate.errorLogger,ResultType.BODYMISSING.getResult(), AppMessages.MISSINGDATA ,ErrorSeverity.WARN, ErrorTypes.DATAERROR);
+ return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE).setError(ResultType.BODYMISSING.getResult()).toMap()).build();
+ }
+
EELFLoggerDelegate.mdcPut("keyspace", "( "+keyspace+" ) ");
String lockId = selObj.getConsistencyInfo().get("lockId");
PreparedQueryObject queryObject = new PreparedQueryObject();
required = false) @HeaderParam(XMINORVERSION) String minorVersion,
@ApiParam(value = "Patch Version",
required = false) @HeaderParam(XPATCHVERSION) String patchVersion,
- @ApiParam(value = "AID", required = false) @HeaderParam("aid") String aid,
+ @ApiParam(value = "AID", required = false, hidden = true) @HeaderParam("aid") String aid,
@ApiParam(value = "Application namespace",
- required = true) @HeaderParam(NS) String ns,
+ required = false,hidden = true) @HeaderParam(NS) String ns,
@ApiParam(value = "Authorization", required = true) @HeaderParam(MusicUtil.AUTHORIZATION) String authorization,
@ApiParam(value = "Keyspace Name",
required = true) @PathParam("keyspace") String keyspace,