/hostadmiral/trunk/src/ak/hostadmiral/core/listener/file/ConfigServlet.java |
---|
1,26 → 1,26 |
package ak.hostadmiral.core.listener.file; |
import java.io.IOException; |
import javax.servlet.ServletRequest; |
import javax.servlet.ServletResponse; |
import javax.servlet.GenericServlet; |
import javax.servlet.ServletException; |
package ak.hostadmiral.core.listener.file; |
import java.io.IOException; |
import javax.servlet.ServletRequest; |
import javax.servlet.ServletResponse; |
import javax.servlet.GenericServlet; |
import javax.servlet.ServletException; |
import org.apache.log4j.Logger; |
public class ConfigServlet |
extends GenericServlet |
{ |
public class ConfigServlet |
extends GenericServlet |
{ |
private static final Logger logger = Logger.getLogger(ConfigServlet.class); |
public void init() |
throws ServletException |
{ |
FileListener.setFileName(getInitParameter("fileName")); |
} |
public void service(ServletRequest req, ServletResponse res) |
throws ServletException, IOException |
{ |
} |
} |
public void init() |
throws ServletException |
{ |
FileListener.setFileName(getInitParameter("fileName")); |
} |
public void service(ServletRequest req, ServletResponse res) |
throws ServletException, IOException |
{ |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/listener/file/FileListener.java |
---|
10,7 → 10,7 |
import org.apache.log4j.Logger; |
public class FileListener |
public class FileListener |
implements |
UserCreatedListener, |
UserModifiedListener, |
29,7 → 29,7 |
MailAliasDeletedListener |
{ |
private static final Logger logger = Logger.getLogger(FileListener.class); |
private static String fileName; |
protected static Object lock = new Object(); |
86,88 → 86,88 |
//=== user ==================================================================================== |
public void userCreated(User editor, User user) |
throws ModelException |
{ |
throws ModelException |
{ |
send("user\tcreate\t" + escape(user.getLogin()) + "\t" |
+ escape(/* FIXME user.getPassword() */ "") + "\t" |
+ user.getEnabled() + "\t" |
+ escape(user.getComment())); |
+ escape(user.getComment())); |
} |
public void userModified(User editor, User user, User oldUser) |
throws ModelException |
{ |
throws ModelException |
{ |
send("user\tmodify\t" + escape(oldUser.getLogin()) + "\t" |
+ escape(user.getLogin()) + "\t" |
+ escape(/* FIXME user.getPassword() */ "") + "\t" |
+ user.getEnabled() + "\t" |
+ escape(user.getComment())); |
+ escape(user.getComment())); |
} |
public void userDeleted(User editor, User user) |
throws ModelException |
{ |
send("user\tdelete\t" + escape(user.getLogin())); |
throws ModelException |
{ |
send("user\tdelete\t" + escape(user.getLogin())); |
} |
//=== inet domain ============================================================================= |
public void inetDomainCreated(User editor, InetDomain domain) |
throws ModelException |
{ |
throws ModelException |
{ |
send("inetDomain\tcreate\t" + escape(domain.getName()) + "\t" |
+ domain.getEnabled() + "\t" |
+ escape(domain.getComment())); |
+ escape(domain.getComment())); |
} |
public void inetDomainModified(User editor, InetDomain domain, InetDomain oldDomain) |
throws ModelException |
{ |
throws ModelException |
{ |
send("inetDomain\tmodify\t" + escape(oldDomain.getName()) + "\t" |
+ escape(domain.getName()) + "\t" |
+ domain.getEnabled() + "\t" |
+ escape(domain.getComment())); |
+ escape(domain.getComment())); |
} |
public void inetDomainDeleted(User editor, InetDomain domain) |
throws ModelException |
{ |
send("inetDomain\tdelete\t" + escape(domain.getName())); |
throws ModelException |
{ |
send("inetDomain\tdelete\t" + escape(domain.getName())); |
} |
//=== system user ============================================================================= |
public void systemUserCreated(User editor, SystemUser systemUser) |
throws ModelException |
{ |
throws ModelException |
{ |
send("systemUser\tcreate\t" + systemUser.getUid() + "\t" |
+ escape(systemUser.getName()) + "\t" |
+ systemUser.getEnabled() + "\t" |
+ escape(systemUser.getComment())); |
+ escape(systemUser.getComment())); |
} |
public void systemUserModified(User editor, SystemUser systemUser, SystemUser oldSystemUser) |
throws ModelException |
{ |
throws ModelException |
{ |
send("systemUser\tmodify\t" + oldSystemUser.getUid() + "\t" |
+ escape(oldSystemUser.getName()) + "\t" |
+ systemUser.getUid() + "\t" |
+ escape(systemUser.getName()) + "\t" |
+ systemUser.getEnabled() + "\t" |
+ escape(systemUser.getComment())); |
+ escape(systemUser.getComment())); |
} |
public void systemUserDeleted(User editor, SystemUser systemUser) |
throws ModelException |
{ |
send("systemUser\tdelete\t" + systemUser.getUid() + "\t" + escape(systemUser.getName())); |
throws ModelException |
{ |
send("systemUser\tdelete\t" + systemUser.getUid() + "\t" + escape(systemUser.getName())); |
} |
//=== mailbox ================================================================================= |
public void mailboxCreated(User editor, Mailbox mailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
send("mailbox\tcreate\t" + escape(mailbox.getLogin()) + "\t" |
+ escape(/* FIXME user.getPassword() */ "") + "\t" |
+ escape(mailbox.getDomain().getName()) + "\t" |
176,12 → 176,12 |
+ (mailbox.getSystemUser() == null ? "" : mailbox.getSystemUser().getUid().toString()) |
+ "\t" |
+ mailbox.getEnabled() + "\t" |
+ escape(mailbox.getComment())); |
+ escape(mailbox.getComment())); |
} |
public void mailboxModified(User editor, Mailbox mailbox, Mailbox oldMailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
send("mailbox\tmodify\t" + escape(oldMailbox.getLogin()) + "\t" |
+ escape(oldMailbox.getDomain().getName()) + "\t" |
+ escape(mailbox.getLogin()) + "\t" |
192,20 → 192,20 |
+ (mailbox.getSystemUser() == null ? "" : mailbox.getSystemUser().getUid().toString()) |
+ "\t" |
+ mailbox.getEnabled() + "\t" |
+ escape(mailbox.getComment())); |
+ escape(mailbox.getComment())); |
} |
public void mailboxDeleted(User editor, Mailbox mailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
send("mailbox\tdelete\t" + escape(mailbox.getLogin()) + "\t" |
+ escape(mailbox.getDomain().getName())); |
+ escape(mailbox.getDomain().getName())); |
} |
//=== mail alias ============================================================================== |
private String formMailAliasDestinations(User editor, MailAlias mailAlias) |
throws ModelException |
throws ModelException |
{ |
StringBuffer b = new StringBuffer(); |
225,18 → 225,18 |
} |
public void mailAliasCreated(User editor, MailAlias mailAlias) |
throws ModelException |
throws ModelException |
{ |
send(" mailAlias\tcreate\t" + escape(mailAlias.getAddress()) + "\t" |
+ escape(mailAlias.getDomain().getName()) + "\t" |
+ mailAlias.getEnabled() + "\t" |
+ escape(mailAlias.getComment()) |
+ formMailAliasDestinations(editor, mailAlias)); |
+ formMailAliasDestinations(editor, mailAlias)); |
} |
public void mailAliasModified(User editor, MailAlias mailAlias, MailAlias oldMailAlias) |
throws ModelException |
{ |
throws ModelException |
{ |
send(" mailAlias\tmodify\t" + escape(oldMailAlias.getAddress()) + "\t" |
+ escape(oldMailAlias.getDomain().getName()) + "\t" |
+ escape(mailAlias.getAddress()) + "\t" |
243,13 → 243,13 |
+ escape(mailAlias.getDomain().getName()) + "\t" |
+ mailAlias.getEnabled() + "\t" |
+ escape(mailAlias.getComment()) |
+ formMailAliasDestinations(editor, mailAlias)); |
+ formMailAliasDestinations(editor, mailAlias)); |
} |
public void mailAliasDeleted(User editor, MailAlias mailAlias) |
throws ModelException |
{ |
throws ModelException |
{ |
send(" mailAlias\tdelete\t" + escape(mailAlias.getAddress())+ "\t" |
+ escape(mailAlias.getDomain().getName())); |
+ escape(mailAlias.getDomain().getName())); |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/listener/dummy/DummyListener.java |
---|
3,7 → 3,7 |
import ak.hostadmiral.util.ModelException; |
import ak.hostadmiral.core.model.*; |
public class DummyListener |
public class DummyListener |
implements |
UserCreatedListener, |
UserModifiedListener, |
24,116 → 24,116 |
//=== user ==================================================================================== |
public void userCreated(User editor, User user) |
throws ModelException |
{ |
System.out.println("DummyListener.userCreated: " |
+ user + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.userCreated: " |
+ user + " by " + editor); |
} |
public void userModified(User editor, User user, User oldUser) |
throws ModelException |
{ |
throws ModelException |
{ |
System.out.println("DummyListener.userModified: from " + oldUser |
+ " to " + user + " by " + editor); |
+ " to " + user + " by " + editor); |
} |
public void userDeleted(User editor, User user) |
throws ModelException |
{ |
System.out.println("DummyListener.userDeleted: " |
+ user + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.userDeleted: " |
+ user + " by " + editor); |
} |
//=== inet domain ============================================================================= |
public void inetDomainCreated(User editor, InetDomain domain) |
throws ModelException |
{ |
System.out.println("DummyListener.inetDomainCreated: " |
+ domain + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.inetDomainCreated: " |
+ domain + " by " + editor); |
} |
public void inetDomainModified(User editor, InetDomain domain, InetDomain oldDomain) |
throws ModelException |
{ |
throws ModelException |
{ |
System.out.println("DummyListener.inetDomainModified: from " + oldDomain |
+ " to " + domain + " by " + editor); |
+ " to " + domain + " by " + editor); |
} |
public void inetDomainDeleted(User editor, InetDomain domain) |
throws ModelException |
{ |
System.out.println("DummyListener.inetDomainDeleted: " |
+ domain + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.inetDomainDeleted: " |
+ domain + " by " + editor); |
} |
//=== system user ============================================================================= |
public void systemUserCreated(User editor, SystemUser systemUser) |
throws ModelException |
{ |
System.out.println("DummyListener.systemUserCreated: " |
+ systemUser + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.systemUserCreated: " |
+ systemUser + " by " + editor); |
} |
public void systemUserModified(User editor, SystemUser systemUser, SystemUser oldSystemUser) |
throws ModelException |
{ |
throws ModelException |
{ |
System.out.println("DummyListener.systemUserModified: from " + oldSystemUser |
+ " to " + systemUser + " by " + editor); |
+ " to " + systemUser + " by " + editor); |
} |
public void systemUserDeleted(User editor, SystemUser systemUser) |
throws ModelException |
{ |
System.out.println("DummyListener.systemUserDeleted: " |
+ systemUser + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.systemUserDeleted: " |
+ systemUser + " by " + editor); |
} |
//=== mailbox ================================================================================= |
public void mailboxCreated(User editor, Mailbox mailbox) |
throws ModelException |
{ |
System.out.println("DummyListener.mailboxCreated: " |
+ mailbox + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.mailboxCreated: " |
+ mailbox + " by " + editor); |
} |
public void mailboxModified(User editor, Mailbox mailbox, Mailbox oldMailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
System.out.println("DummyListener.mailboxModified: from " + oldMailbox |
+ " to " + mailbox + " by " + editor); |
+ " to " + mailbox + " by " + editor); |
} |
public void mailboxDeleted(User editor, Mailbox mailbox) |
throws ModelException |
{ |
System.out.println("DummyListener.mailboxDeleted: " |
+ mailbox + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.mailboxDeleted: " |
+ mailbox + " by " + editor); |
} |
//=== mail alias ============================================================================== |
public void mailAliasCreated(User editor, MailAlias mailAlias) |
throws ModelException |
{ |
System.out.println("DummyListener.mailAliasCreated: " |
+ mailAlias + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.mailAliasCreated: " |
+ mailAlias + " by " + editor); |
} |
public void mailAliasModified(User editor, MailAlias mailAlias, MailAlias oldMailAlias) |
throws ModelException |
{ |
throws ModelException |
{ |
System.out.println("DummyListener.mailAliasModified: from " + oldMailAlias |
+ " to " + mailAlias + " by " + editor); |
+ " to " + mailAlias + " by " + editor); |
} |
public void mailAliasDeleted(User editor, MailAlias mailAlias) |
throws ModelException |
{ |
System.out.println("DummyListener.mailAliasDeleted: " |
+ mailAlias + " by " + editor); |
throws ModelException |
{ |
System.out.println("DummyListener.mailAliasDeleted: " |
+ mailAlias + " by " + editor); |
} |
} |