Skip to content

Commit

Permalink
Reformat all code. Remove unneeded source code
Browse files Browse the repository at this point in the history
  • Loading branch information
ggallotti committed May 20, 2022
1 parent 873c733 commit f5ed004
Show file tree
Hide file tree
Showing 24 changed files with 1,853 additions and 2,611 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ public LambdaSQSHandler(String className) throws Exception {
super(className);
}

//https://docs.aws.amazon.com/en_gb/lambda/latest/dg/with-sqs.html
@Override
public SQSBatchResponse handleRequest(SQSEvent sqsEvent, Context context) {
int msgCount = (int) sqsEvent.getRecords().stream().count();

logger.debug("handleRequest started with #sqsItems: " + msgCount);
if (logger.isDebugEnabled()) {
logger.debug("handleRequest started with #sqsItems: " + (int) sqsEvent.getRecords().size());
}

EventMessages msgs = new EventMessages();

Expand Down Expand Up @@ -76,7 +75,7 @@ public SQSBatchResponse handleRequest(SQSEvent sqsEvent, Context context) {
if (!wasHandled) {
logger.error(String.format("Messages were not handled. Marking all SQS Events as failed: %s", errorMessage));
List<SQSBatchResponse.BatchItemFailure> failures = new ArrayList<>();
//Assume all batch failed
//Assume all batch has failed.
for (SQSMessage sqsItem : sqsEvent.getRecords()) {
failures.add(new SQSBatchResponse.BatchItemFailure(sqsItem.getMessageId()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
* Request/response model
*/
public class MapResponseModel {
private Map<String, String> values;
private Map<String, String> values;

public MapResponseModel() {
this.values = new HashMap<>();
}
public MapResponseModel() {
this.values = new HashMap<>();
}

public void addValue(String key, String value) {
this.values.put(key, value);
}
public void addValue(String key, String value) {
this.values.put(key, value);
}

public Map<String, String> getValues() {
return values;
}
public Map<String, String> getValues() {
return values;
}

public void setValues(Map<String, String> values) {
this.values = values;
}
public void setValues(Map<String, String> values) {
this.values = values;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.util.*;


public class TestLambdaSQSHandler {
private static String SIMPLE_HANDLER = "com.unittest.eventdriven.queue.handlesimpleuserqueueevent";
private static String SIMPLE_RAW_HANDLER = "com.unittest.eventdriven.queue.handlesimplerawsqsevent";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,218 +1,112 @@
package com.genexus.genexusserverlessapi;

import com.genexus.*;
import com.genexus.*;
import com.genexus.xml.*;
import com.genexus.search.*;
import com.genexus.webpanels.*;

import java.util.*;

public final class SdtEventCustomPayload_CustomPayloadItem extends GxUserType
{
public SdtEventCustomPayload_CustomPayloadItem( )
{
this( new ModelContext(SdtEventCustomPayload_CustomPayloadItem.class));
}

public SdtEventCustomPayload_CustomPayloadItem( ModelContext context )
{
super( context, "SdtEventCustomPayload_CustomPayloadItem");
}

public SdtEventCustomPayload_CustomPayloadItem( int remoteHandle ,
ModelContext context )
{
super( remoteHandle, context, "SdtEventCustomPayload_CustomPayloadItem");
}

public SdtEventCustomPayload_CustomPayloadItem( StructSdtEventCustomPayload_CustomPayloadItem struct )
{
this();
setStruct(struct);
}

private static java.util.HashMap mapper = new java.util.HashMap();
static
{
}

public String getJsonMap( String value )
{
return (String) mapper.get(value);
}

public short readxml( com.genexus.xml.XMLReader oReader ,
String sName )
{
short GXSoapError = 1;
formatError = false ;
sTagName = oReader.getName() ;
if ( oReader.getIsSimple() == 0 )
{
GXSoapError = oReader.read() ;
nOutParmCount = (short)(0) ;
while ( ( ( GXutil.strcmp(oReader.getName(), sTagName) != 0 ) || ( oReader.getNodeType() == 1 ) ) && ( GXSoapError > 0 ) )
{
readOk = (short)(0) ;
readElement = false ;
if ( GXutil.strcmp2( oReader.getLocalName(), "PropertyId") )
{
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = oReader.getValue() ;
readElement = true ;
if ( GXSoapError > 0 )
{
readOk = (short)(1) ;
}
GXSoapError = oReader.read() ;
}
if ( GXutil.strcmp2( oReader.getLocalName(), "PropertyValue") )
{
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = oReader.getValue() ;
readElement = true ;
if ( GXSoapError > 0 )
{
readOk = (short)(1) ;
}
GXSoapError = oReader.read() ;
}
if ( ! readElement )
{
readOk = (short)(1) ;
GXSoapError = oReader.read() ;
}
nOutParmCount = (short)(nOutParmCount+1) ;
if ( ( readOk == 0 ) || formatError )
{
context.globals.sSOAPErrMsg += "Error reading " + sTagName + GXutil.newLine( ) ;
context.globals.sSOAPErrMsg += "Message: " + oReader.readRawXML() ;
GXSoapError = (short)(nOutParmCount*-1) ;
}
}
}
return GXSoapError ;
}

public void writexml( com.genexus.xml.XMLWriter oWriter ,
String sName ,
String sNameSpace )
{
writexml(oWriter, sName, sNameSpace, true);
}

public void writexml( com.genexus.xml.XMLWriter oWriter ,
String sName ,
String sNameSpace ,
boolean sIncludeState )
{
if ( (GXutil.strcmp("", sName)==0) )
{
sName = "EventCustomPayload.CustomPayloadItem" ;
}
oWriter.writeStartElement(sName);
if ( GXutil.strcmp(GXutil.left( sNameSpace, 10), "[*:nosend]") != 0 )
{
oWriter.writeAttribute("xmlns", sNameSpace);
}
else
{
sNameSpace = GXutil.right( sNameSpace, GXutil.len( sNameSpace)-10) ;
}
oWriter.writeElement("PropertyId", gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid);
if ( GXutil.strcmp(sNameSpace, "ServerlessAPI") != 0 )
{
oWriter.writeAttribute("xmlns", "ServerlessAPI");
}
oWriter.writeElement("PropertyValue", gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue);
if ( GXutil.strcmp(sNameSpace, "ServerlessAPI") != 0 )
{
oWriter.writeAttribute("xmlns", "ServerlessAPI");
}
oWriter.writeEndElement();
}

public void tojson( )
{
tojson( true) ;
}

public void tojson( boolean includeState )
{
tojson( includeState, true) ;
}

public void tojson( boolean includeState ,
boolean includeNonInitialized )
{
AddObjectProperty("PropertyId", gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid, false, false);
AddObjectProperty("PropertyValue", gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue, false, false);
}

public String getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid( )
{
return gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid ;
}

public void setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid( String value )
{
gxTv_SdtEventCustomPayload_CustomPayloadItem_N = (byte)(0) ;
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = value ;
}

public String getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue( )
{
return gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue ;
}

public void setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue( String value )
{
gxTv_SdtEventCustomPayload_CustomPayloadItem_N = (byte)(0) ;
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = value ;
}

public void initialize( int remoteHandle )
{
initialize( ) ;
}

public void initialize( )
{
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = "" ;
gxTv_SdtEventCustomPayload_CustomPayloadItem_N = (byte)(1) ;
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = "" ;
sTagName = "" ;
}

public byte isNull( )
{
return gxTv_SdtEventCustomPayload_CustomPayloadItem_N ;
}

public com.genexus.genexusserverlessapi.SdtEventCustomPayload_CustomPayloadItem Clone( )
{
return (com.genexus.genexusserverlessapi.SdtEventCustomPayload_CustomPayloadItem)(clone()) ;
}

public void setStruct( com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem struct )
{
setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid(struct.getPropertyid());
setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue(struct.getPropertyvalue());
}

@SuppressWarnings("unchecked")
public com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem getStruct( )
{
com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem struct = new com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem ();
struct.setPropertyid(getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid());
struct.setPropertyvalue(getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue());
return struct ;
}

protected byte gxTv_SdtEventCustomPayload_CustomPayloadItem_N ;
protected short readOk ;
protected short nOutParmCount ;
protected String gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue ;
protected String sTagName ;
protected boolean readElement ;
protected boolean formatError ;
protected String gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid ;
public final class SdtEventCustomPayload_CustomPayloadItem extends GxUserType {
public SdtEventCustomPayload_CustomPayloadItem() {
this(new ModelContext(SdtEventCustomPayload_CustomPayloadItem.class));
}

public SdtEventCustomPayload_CustomPayloadItem(ModelContext context) {
super(context, "SdtEventCustomPayload_CustomPayloadItem");
}

public SdtEventCustomPayload_CustomPayloadItem(int remoteHandle,
ModelContext context) {
super(remoteHandle, context, "SdtEventCustomPayload_CustomPayloadItem");
}

public SdtEventCustomPayload_CustomPayloadItem(StructSdtEventCustomPayload_CustomPayloadItem struct) {
this();
setStruct(struct);
}

private static java.util.HashMap mapper = new java.util.HashMap();

static {
}

public String getJsonMap(String value) {
return (String) mapper.get(value);
}

public void tojson() {
tojson(true);
}

public void tojson(boolean includeState) {
tojson(includeState, true);
}

public void tojson(boolean includeState,
boolean includeNonInitialized) {
AddObjectProperty("PropertyId", gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid, false, false);
AddObjectProperty("PropertyValue", gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue, false, false);
}

public String getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid() {
return gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid;
}

public void setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid(String value) {
gxTv_SdtEventCustomPayload_CustomPayloadItem_N = (byte) (0);
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = value;
}

public String getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue() {
return gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue;
}

public void setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue(String value) {
gxTv_SdtEventCustomPayload_CustomPayloadItem_N = (byte) (0);
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = value;
}

public void initialize(int remoteHandle) {
initialize();
}

public void initialize() {
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid = "";
gxTv_SdtEventCustomPayload_CustomPayloadItem_N = (byte) (1);
gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue = "";
sTagName = "";
}

public byte isNull() {
return gxTv_SdtEventCustomPayload_CustomPayloadItem_N;
}

public com.genexus.genexusserverlessapi.SdtEventCustomPayload_CustomPayloadItem Clone() {
return (com.genexus.genexusserverlessapi.SdtEventCustomPayload_CustomPayloadItem) (clone());
}

public void setStruct(com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem struct) {
setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid(struct.getPropertyid());
setgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue(struct.getPropertyvalue());
}

@SuppressWarnings("unchecked")
public com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem getStruct() {
com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem struct = new com.genexus.genexusserverlessapi.StructSdtEventCustomPayload_CustomPayloadItem();
struct.setPropertyid(getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid());
struct.setPropertyvalue(getgxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue());
return struct;
}

protected byte gxTv_SdtEventCustomPayload_CustomPayloadItem_N;
protected short readOk;
protected short nOutParmCount;
protected String gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyvalue;
protected String sTagName;
protected boolean readElement;
protected boolean formatError;
protected String gxTv_SdtEventCustomPayload_CustomPayloadItem_Propertyid;
}

Loading

0 comments on commit f5ed004

Please sign in to comment.