Skip to content

Commit

Permalink
Delete unused SantanderNoRoleAvailableException STDSDK-6 #resolve (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoppinho authored Jul 19, 2019
1 parent 1f45bad commit 2d2a8d6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;

import javax.imageio.ImageIO;

Expand All @@ -21,7 +20,7 @@ public class CreateRegisterRequest {
private byte[] photo;
private RegisterAction action;
private PickupAddress pickupAddress;

public CreateRegisterRequest() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public CreateRegisterResponse(ErrorType errorType, String responseLine, String e
}

public CreateRegisterResponse(TUIResponseData response) {
String status = response.getStatus() == null || response.getStatus().getValue() == null ? "" : response
.getStatus().getValue().trim();
String status =
response.getStatus() == null || response.getStatus().getValue() == null ? "" : response.getStatus().getValue()
.trim();

ErrorType errorType =
!status.isEmpty() && !status.toLowerCase().equals("error") ? null : ErrorType.REQUEST_REFUSED;
ErrorType errorType = !status.isEmpty() && !status.toLowerCase().equals("error") ? null : ErrorType.REQUEST_REFUSED;

setErrorType(errorType);

Expand All @@ -48,7 +48,8 @@ public CreateRegisterResponse(TUIResponseData response) {
}
}

public CreateRegisterResponse() {}
public CreateRegisterResponse() {
}

public boolean wasRegisterSuccessful() {
return errorType == null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public GetRegisterResponse(RegisterData registerData) {
.isNullOrEmpty(registerData.getSerialNumber().getValue()) ? null : registerData.getSerialNumber().getValue();
}

public GetRegisterResponse() {}
public GetRegisterResponse() {
}

public GetRegisterStatus getStatus() {
return status;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public CardPreviewBean generateLine(CreateRegisterRequest request) throws Santan

String[] names = harvestNames(request.getName());
String[] cardNames = normalizeCardName(names);

String name = names[0];
String surname = names[1];
String middleNames = names[2];
Expand Down Expand Up @@ -255,17 +255,17 @@ public CardPreviewBean generateLine(CreateRegisterRequest request) throws Santan

private String getRoleCode(String role) {
switch (role) {
case "STUDENT":
return "01";
case "STUDENT":
return "01";

case "TEACHER":
return "02";
case "TEACHER":
return "02";

case "EMPLOYEE":
return "03";
case "EMPLOYEE":
return "03";

default:
return "99";
default:
return "99";
}
}

Expand Down Expand Up @@ -305,18 +305,18 @@ private String purgeString(final String name) {

private String getRoleDescripriton(String role) {
switch (role) {
case "STUDENT":
return "Estudante/Student";
case "TEACHER":
return "Docente/Faculty";
case "EMPLOYEE":
return "Funcionario/Staff";
case "RESEARCHER":
return "Invest./Researcher";
case "GRANT_OWNER":
return "Bolseiro/Grant Owner";
default:
return "00";
case "STUDENT":
return "Estudante/Student";
case "TEACHER":
return "Docente/Faculty";
case "EMPLOYEE":
return "Funcionario/Staff";
case "RESEARCHER":
return "Invest./Researcher";
case "GRANT_OWNER":
return "Bolseiro/Grant Owner";
default:
return "00";
}
}

Expand All @@ -327,5 +327,5 @@ private String makeZeroPaddedNumber(int number, int size) {
String format = "%0" + size + "d";
return String.format(format, number);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import pt.sibscartoes.portal.wcf.tui.dto.TuiPhotoRegisterData;
import pt.sibscartoes.portal.wcf.tui.dto.TuiSignatureRegisterData;


@Service
public class SantanderSdkService {

Expand Down Expand Up @@ -79,12 +78,9 @@ public CreateRegisterResponse createRegister(CardPreviewBean cardPreviewBean) {
}

private TuiPhotoRegisterData createPhoto(byte[] photoContents) {
final QName FILE_NAME =
new QName(NAMESPACE_URI, "FileName");
final QName FILE_EXTENSION =
new QName(NAMESPACE_URI, "Extension");
final QName FILE_CONTENTS =
new QName(NAMESPACE_URI, "FileContents");
final QName FILE_NAME = new QName(NAMESPACE_URI, "FileName");
final QName FILE_EXTENSION = new QName(NAMESPACE_URI, "Extension");
final QName FILE_CONTENTS = new QName(NAMESPACE_URI, "FileContents");
final QName FILE_SIZE = new QName(NAMESPACE_URI, "Size");

final String EXTENSION = ".jpeg";
Expand All @@ -101,8 +97,8 @@ private TuiPhotoRegisterData createPhoto(byte[] photoContents) {
private <T> T initPort(Class<T> serviceType, String endpoint) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(serviceType);
factory.setAddress(String.format(SantanderSdkSpringConfiguration.getConfiguration().sibsWebServiceAddress() + "/%s.svc",
endpoint));
factory.setAddress(
String.format(SantanderSdkSpringConfiguration.getConfiguration().sibsWebServiceAddress() + "/%s.svc", endpoint));
factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/");
factory.getFeatures().add(new WSAddressingFeature());

Expand Down

0 comments on commit 2d2a8d6

Please sign in to comment.