001: /*****************************************************************************
002: * Java Plug-in Framework (JPF)
003: * Copyright (C) 2004-2007 Dmitry Olshansky
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *****************************************************************************/package org.java.plugin.registry;
019:
020: import java.util.Collection;
021: import java.util.Locale;
022:
023: /**
024: * Result of validation performed by registry on all registered plug-ins. This
025: * includes dependencies check, parameters check (against parameter definitions)
026: * and any other kind of validation.
027: *
028: * @version $Id$
029: */
030: public interface IntegrityCheckReport {
031: /**
032: * @return number of items with severity {@link Severity#ERROR}
033: * in this report
034: */
035: int countErrors();
036:
037: /**
038: * @return number of items with severity {@link Severity#WARNING}
039: * in this report
040: */
041: int countWarnings();
042:
043: /**
044: * @return collection of {@link ReportItem} objects
045: */
046: Collection<ReportItem> getItems();
047:
048: /**
049: * Integrity check report item severity constants.
050: *
051: * @version $Id$
052: */
053: enum Severity {
054: /**
055: * Integrity check report item severity constant.
056: */
057: ERROR,
058:
059: /**
060: * Integrity check report item severity constant.
061: */
062: WARNING,
063:
064: /**
065: * Integrity check report item severity constant.
066: */
067: INFO
068: }
069:
070: /**
071: * Integrity check error constants.
072: *
073: * @version $Id$
074: */
075: enum Error {
076: /**
077: * Integrity check error constant.
078: */
079: NO_ERROR,
080:
081: /**
082: * Integrity check error constant.
083: */
084: CHECKER_FAULT,
085:
086: /**
087: * Integrity check error constant.
088: */
089: MANIFEST_PROCESSING_FAILED,
090:
091: /**
092: * Integrity check error constant.
093: */
094: UNSATISFIED_PREREQUISITE,
095:
096: /**
097: * Integrity check error constant.
098: */
099: BAD_LIBRARY,
100:
101: /**
102: * Integrity check error constant.
103: */
104: INVALID_EXTENSION_POINT,
105:
106: /**
107: * Integrity check error constant.
108: */
109: INVALID_EXTENSION
110: }
111:
112: /**
113: * Integrity check report element. Holds all information about particular
114: * check event.
115: * @version $Id$
116: */
117: interface ReportItem {
118: /**
119: * @return severity code for this report item
120: */
121: Severity getSeverity();
122:
123: /**
124: * @return source for this report item, can be <code>null</code>
125: */
126: Identity getSource();
127:
128: /**
129: * @return error code for this report item
130: */
131: Error getCode();
132:
133: /**
134: * @return message, associated with this report item for the system
135: * default locale
136: */
137: String getMessage();
138:
139: /**
140: * @param locale locale to get message for
141: * @return message, associated with this report item for given locale
142: */
143: String getMessage(Locale locale);
144: }
145: }
|