Skip to content

Commit

Permalink
chore: remove J2ME related code [DHIS2-18213] (#19801)
Browse files Browse the repository at this point in the history
* chore: remove J2ME related code

* chore: remove unused code and fix linting errors

* chore: remove parsertype and migrate to store name
  • Loading branch information
teleivo authored Jan 31, 2025
1 parent cc67b78 commit f717088
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 473 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@

public enum ParserType {
KEY_VALUE_PARSER,
J2ME_PARSER,
ALERT_PARSER,
UNREGISTERED_PARSER,
TRACKED_ENTITY_REGISTRATION_PARSER,
PROGRAM_STAGE_DATAENTRY_PARSER,
EVENT_REGISTRATION_PARSER;
EVENT_REGISTRATION_PARSER
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ public void delete(SMSCommand cmd) {
smsCommandStore.delete(cmd);
}

@Override
@Transactional(readOnly = true)
public List<SMSCommand> getJ2MESMSCommands() {
return smsCommandStore.getJ2MESMSCommands();
}

@Override
@Transactional(readOnly = true)
public SMSCommand getSMSCommand(String commandName, ParserType parserType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public interface SMSCommandService {

void delete(SMSCommand cmd);

List<SMSCommand> getJ2MESMSCommands();

SMSCommand getSMSCommand(String commandName, ParserType parserType);

void addSpecialCharacterSet(Set<SMSSpecialCharacter> specialCharacters, long commandId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ public HibernateSMSCommandStore(
super(entityManager, jdbcTemplate, publisher, SMSCommand.class, aclService, true);
}

@Override
public List<SMSCommand> getJ2MESMSCommands() {
CriteriaBuilder builder = getCriteriaBuilder();

return getList(
builder,
newJpaParameters()
.addPredicate(root -> builder.equal(root.get("parserType"), ParserType.J2ME_PARSER)));
}

@Override
public SMSCommand getSMSCommand(String commandName, ParserType parserType) {
CriteriaBuilder builder = getCriteriaBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
import org.hisp.dhis.sms.parse.ParserType;

public interface SMSCommandStore extends IdentifiableObjectStore<SMSCommand> {
List<SMSCommand> getJ2MESMSCommands();

SMSCommand getSMSCommand(String commandName, ParserType parserType);

int countDataSetSmsCommands(DataSet dataSet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected void sendSMSResponse(SmsResponse resp, IncomingSms sms, int messageID)
update(sms, status, true);

if (smsMessageSender.isConfigured()) {
String msg = String.format("%d:%s", messageID, resp.toString());
String msg = String.format("%d:%s", messageID, resp);
smsMessageSender.sendMessage(null, msg, sms.getOriginator());
return;
}
Expand Down
Loading

0 comments on commit f717088

Please sign in to comment.