import org.onap.music.exceptions.MusicQueryException;
import org.onap.music.exceptions.MusicServiceException;
import org.onap.music.main.MusicUtil;
import org.onap.music.exceptions.MusicQueryException;
import org.onap.music.exceptions.MusicServiceException;
import org.onap.music.main.MusicUtil;
throw new MusicQueryException("Table name doesn't exists. Please check the table name.",
Status.BAD_REQUEST.getStatusCode());
}
} catch (MusicServiceException e) {
logger.error(EELFLoggerDelegate.errorLogger, e, AppMessages.UNKNOWNERROR ,ErrorSeverity.CRITICAL, ErrorTypes.GENERALSERVICEERROR);
throw new MusicQueryException("Table name doesn't exists. Please check the table name.",
Status.BAD_REQUEST.getStatusCode());
}
} catch (MusicServiceException e) {
logger.error(EELFLoggerDelegate.errorLogger, e, AppMessages.UNKNOWNERROR ,ErrorSeverity.CRITICAL, ErrorTypes.GENERALSERVICEERROR);
throw new MusicQueryException("Nothing to insert. No values provided in request.",
Status.BAD_REQUEST.getStatusCode());
}
throw new MusicQueryException("Nothing to insert. No values provided in request.",
Status.BAD_REQUEST.getStatusCode());
}
} catch(NullPointerException ex) {
logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage() +" Invalid column name : "+entry.getKey
(), AppMessages.INCORRECTDATA ,ErrorSeverity.CRITICAL, ErrorTypes.DATAERROR, ex);
} catch(NullPointerException ex) {
logger.error(EELFLoggerDelegate.errorLogger,ex.getMessage() +" Invalid column name : "+entry.getKey
(), AppMessages.INCORRECTDATA ,ErrorSeverity.CRITICAL, ErrorTypes.DATAERROR, ex);
throw new MusicQueryException("Invalid column name : " + entry.getKey(),
Status.BAD_REQUEST.getStatusCode());
}
throw new MusicQueryException("Invalid column name : " + entry.getKey(),
Status.BAD_REQUEST.getStatusCode());
}
this.setPrimaryKeyVal(primaryKey);
if(primaryKey == null || primaryKey.length() <= 0) {
logger.error(EELFLoggerDelegate.errorLogger, "Some required partition key parts are missing: "+primaryKeyName );
this.setPrimaryKeyVal(primaryKey);
if(primaryKey == null || primaryKey.length() <= 0) {
logger.error(EELFLoggerDelegate.errorLogger, "Some required partition key parts are missing: "+primaryKeyName );
throw new MusicQueryException("Some required partition key parts are missing: " + primaryKeyName,
Status.BAD_REQUEST.getStatusCode());
}
throw new MusicQueryException("Some required partition key parts are missing: " + primaryKeyName,
Status.BAD_REQUEST.getStatusCode());
}
String consistency = this.getConsistencyInfo().get("type");
if(consistency.equalsIgnoreCase(MusicUtil.EVENTUAL) && this.getConsistencyInfo().get("consistency") != null) {
if(MusicUtil.isValidConsistency(this.getConsistencyInfo().get("consistency"))) {
queryObject.setConsistency(this.getConsistencyInfo().get("consistency"));
} else {
String consistency = this.getConsistencyInfo().get("type");
if(consistency.equalsIgnoreCase(MusicUtil.EVENTUAL) && this.getConsistencyInfo().get("consistency") != null) {
if(MusicUtil.isValidConsistency(this.getConsistencyInfo().get("consistency"))) {
queryObject.setConsistency(this.getConsistencyInfo().get("consistency"));
} else {
if((this.getKeyspaceName() == null || this.getKeyspaceName().isEmpty())
|| (this.getTableName() == null || this.getTableName().isEmpty())){
if((this.getKeyspaceName() == null || this.getKeyspaceName().isEmpty())
|| (this.getTableName() == null || this.getTableName().isEmpty())){
throw new MusicQueryException("one or more path parameters are not set, please check and try again",
Status.BAD_REQUEST.getStatusCode());
}
throw new MusicQueryException("one or more path parameters are not set, please check and try again",
Status.BAD_REQUEST.getStatusCode());
}
} catch (MusicServiceException ex) {
logger.error(EELFLoggerDelegate.errorLogger,ex, AppMessages.UNKNOWNERROR ,ErrorSeverity.WARN, ErrorTypes
.GENERALSERVICEERROR, ex);
} catch (MusicServiceException ex) {
logger.error(EELFLoggerDelegate.errorLogger,ex, AppMessages.UNKNOWNERROR ,ErrorSeverity.WARN, ErrorTypes
.GENERALSERVICEERROR, ex);