Lotus Notes / Domino Sonstiges > Java und .NET mit Notes/Domino
Überprüfen ob 1 oder 2 Mailboxen auf dem Server mit Java
Ralf_M_Petter:
Schade sonst hätte mal über das Filesystem die Abfrage machen können. Bin ich leider ratlos sorry
Grüße
Ralf
D. Roth.:
Ich hab ne Lösung ist zwar nicht schön aber funktioniert !!
private boolean isMailboxBalancing(){
Database maildb = null;
Database maildb1 = null;
View vw = null;
View vw1 = null;
if (thisdebuglevel == 99)
System.out.println("Running .... (function isMailboxBalancin)"); //This prints out
boolean isMailboxBalance = false;
try {
maildb = ncon.s.getDatabase("","mail.box");
vw1 = maildb.getView("Mail");
}
catch (Exception e){
if (vw1==null)
isMailboxBalance = true;
else{
if (thisdebuglevel == 99){
System.out.println("Error : function isMailboxBalancing() => Class: Check");
e.printStackTrace();
}
errorcode = 13;
ncon.closeNotesThread();
}
}
return isMailboxBalance;
}
Semeaphoros:
Na ja, das fällt aber auf die Nase, wenn mal ein Server von einer auf mehrere Mailboxen umgestellt wurde. Dann liegt in der Regel eine nicht mehr gebrauchte mail.box einfach rum, und die bekommst Du mit Deinem Code geöffnet. Ist praktisch bei jedem neu aufgesetzten Server der Fall, weil das Erhöhen der Mehldosen in der Regel erst nach dem Aufsetzen erfolgt.
D. Roth.:
Jo , ich weiß aber ich bin gerade auf ein Anderes Problem gestossen. Ich will ja die Mailboxen Abfragen und die DEAD Mails auslesen. Aber so wie es aussieht kann ich die DB nicht öffnen weil ich keine Berechtigung habe. Obwohl ich mich mit meinem User anmelde wenn ich jedem rechte auf die DB gebe gehts .
Error : function checkmailbox() => Class: Check
lotus.domino.NotesException
at lotus.domino.NotesExceptionHelper.read(NotesExceptionHelper.java)
at lotus.domino.NotesExceptionHolder._read(NotesExceptionHolder.java)
at com.ibm.CORBA.iiop.RepImpl.invoke(RepImpl.java:325)
at com.ibm.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:36)
at lotus.domino.corba._ISessionStub.getDatabase(_ISessionStub.java)
at lotus.domino.cso.Session.getDatabase(Session.java:484)
at lotus.domino.cso.Session.getDatabase(Session.java:495)
at main.Check.getmaildb(Check.java:82)
at main.Check.checkmailbox(Check.java:39)
at main.nagios2notes.main(nagios2notes.java:50)
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln