Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBCIHandler::get{+OrCreate}DialogFor #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/org/kapott/hbci/manager/HBCIHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private String fixUnspecifiedCustomerId(String customerId)

/* gibt ein Dialog-Objekt für eine bestimmte Kunden-ID zurück. Existiert für
* die Kunden-ID noch kein Dialog-Objekt, so wird eines erzeugt */
private HBCIDialog getDialogFor(String customerId)
private HBCIDialog getOrCreateDialogFor(String customerId)
{
HBCIDialog dialog=dialogs.get(customerId);
if (dialog==null) {
Expand All @@ -350,7 +350,7 @@ private HBCIDialog getDialogFor(String customerId)
public void newMsg(String customerId)
{
HBCIUtils.log("have to create new message for dialog for customer "+customerId,HBCIUtils.LOG_DEBUG);
getDialogFor(fixUnspecifiedCustomerId(customerId)).newMsg();
getOrCreateDialogFor(fixUnspecifiedCustomerId(customerId)).newMsg();
}

/** Erzwingen einer neuen Nachricht im Dialog für die aktuelle Kunden-ID.
Expand Down Expand Up @@ -430,7 +430,7 @@ public void addJobToDialog(String customerId,HBCIJob job)

HBCIDialog dialog = null;
try {
dialog = getDialogFor(customerId);
dialog = getOrCreateDialogFor(customerId);
dialog.addTask((HBCIJobImpl)job);
} finally {
// wenn beim hinzufügen des jobs ein fehler auftrat, und wenn der
Expand Down Expand Up @@ -475,7 +475,7 @@ public void createEmptyDialog(String customerId)
{
customerId=fixUnspecifiedCustomerId(customerId);
HBCIUtils.log("creating empty dialog for customerid "+customerId,HBCIUtils.LOG_DEBUG);
getDialogFor(customerId);
getOrCreateDialogFor(customerId);
}

/** Entspricht {@link #createEmptyDialog(String) createEmptyDialog(null)} */
Expand Down Expand Up @@ -522,7 +522,7 @@ public HBCIExecStatus execute()
passport.setCustomerId(customerid);

try {
HBCIDialog dialog=getDialogFor(customerid);
HBCIDialog dialog= getOrCreateDialogFor(customerid);
HBCIDialogStatus dialogStatus=dialog.doIt();
ret.addDialogStatus(customerid,dialogStatus);
} catch (Exception e) {
Expand Down Expand Up @@ -1038,7 +1038,7 @@ public HBCIDialogStatus refreshXPD(int selectX)
reset();

String customerId=passport.getCustomerId();
getDialogFor(customerId);
getOrCreateDialogFor(customerId);
HBCIDialogStatus result=execute().getDialogStatus(customerId);
return result;
}
Expand Down