Mailbox mbox = getMailbox(); OperationContext octxt = mbox.getOperationContext();
    private String processPartStat(Invite invite)    throws ServiceException {        String partStat = IcalXmlStrMap.PARTSTAT_NEEDS_ACTION;        Account account = getMailbox().getAccount();        if (invite.thisAcctIsOrganizer(account)) {            partStat = IcalXmlStrMap.PARTSTAT_ACCEPTED;        } else if (account instanceof CalendarResource) {            CalendarResource resource = (CalendarResource) account;            if (resource.autoAcceptDecline()) {                partStat = IcalXmlStrMap.PARTSTAT_ACCEPTED;                if (isRecurring() && resource.autoDeclineRecurring()) {                    partStat = IcalXmlStrMap.PARTSTAT_DECLINED;                    Mailbox mbox = getMailbox();                    OperationContext octxt = mbox.getOperationContext();                    CalendarMailSender.sendReply(                            octxt, mbox, false,                            CalendarMailSender.VERB_DECLINE,                            "This resource/location cannot be booked in a recurring appointment.",                            invite);                } else if (resource.autoDeclineIfBusy()) {                    Mailbox mbox = getMailbox();                    OperationContext octxt = mbox.getOperationContext();                    List<Availability> avail = checkAvailability();                    if (!Availability.isAvailable(avail)) {                        partStat = IcalXmlStrMap.PARTSTAT_DECLINED;                        String msg =                            "This resource/location is already booked for other appointments,\r\n" +                            "and is unavailable for the following requested times:\r\n\r\n" +                            Availability.getBusyTimesString(avail);                        CalendarMailSender.sendReply(                                octxt, mbox, false,                                CalendarMailSender.VERB_DECLINE,                                msg,                                invite);                    } else {                        CalendarMailSender.sendReply(                                octxt, mbox, false,                                CalendarMailSender.VERB_ACCEPT,                                null,                                invite);                    }                }            }        }        // TODO: Skip the update below if no real change is being made.        // The saveMetadata call goes to the database and thus is        // expensive.        invite.updateMyPartStat(account, partStat);        Invite defaultInvite = getDefaultInvite();        if (!defaultInvite.equals(invite))            getDefaultInvite().updateMyPartStat(account, partStat);        saveMetadata();        return partStat;    }