01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.core;
19:
20: import java.io.IOException;
21: import java.net.URL;
22:
23: import javax.transaction.HeuristicMixedException;
24: import javax.transaction.HeuristicRollbackException;
25: import javax.transaction.RollbackException;
26: import javax.transaction.SystemException;
27:
28: import de.finix.contelligent.Contelligent;
29: import de.finix.contelligent.core.cpkg.ClientModuleManager;
30: import de.finix.contelligent.exception.ContelligentException;
31: import de.finix.contelligent.logging.LoggingService;
32: import de.finix.contelligent.persistence.PackageManagerPersistenceAdapter;
33:
34: class IgnorePackage extends SystemStateCommand {
35:
36: final static org.apache.log4j.Logger log = LoggingService
37: .getLogger(IgnorePackage.class);
38:
39: public IgnorePackage(ContelligentPackage pkg, URL url) {
40: super (pkg, url);
41: }
42:
43: void prepare() {
44: }
45:
46: void validate(PackageValidator validator)
47: throws ContelligentException {
48: validator.ignoredPackage(getPkg(), getUrl());
49: }
50:
51: void execute(Contelligent contelligent,
52: PackageManagerPersistenceAdapter pkgPersistence)
53: throws IOException, SystemException,
54: HeuristicMixedException, RollbackException,
55: HeuristicRollbackException, ContelligentException {
56: ClientModuleManager.getInstance().processPackage(
57: getPkg().getElement(), getUrl());
58: }
59:
60: public String toString() {
61: return "Ignore " + getPkg().getName();
62: }
63: }
|