Author: wrzep Date: 2006-05-17 13:06:06 -0400 (Wed, 17 May 2006) New Revision: 4287 Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java Removed: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/model/ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ServiceConf.java Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/CellTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Column.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/Columns.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MatrixTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/MetricTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/templates/RowTemplate.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/Plugins.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ProjectsByScoreComparator.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/RecordManager.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerAsync.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/ScoresManagerSync.java labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/tools/TimestampedScore.java Log: JBLAB-599 refactoring Pawel Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/Status.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -38,15 +38,16 @@ import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.impl.PluginConfImpl; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.PluginsValues; +import org.jboss.forge.status.service.impl.protocol.PluginConfImpl; +import org.jboss.forge.status.service.impl.protocol.ServiceConfImpl; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.service.protocol.ServiceConf; import org.jboss.forge.status.templates.Column; import org.jboss.forge.status.templates.Columns; import org.jboss.forge.status.templates.MatrixTemplate; import org.jboss.forge.status.tools.ScoresManagerSync; import org.jboss.forge.status.tools.ScoresManagerAsync; -import org.jboss.forge.status.tools.ServiceConf; import org.jboss.forge.status.tools.Tags; import org.jboss.logging.Logger; @@ -85,7 +86,7 @@ // Get configuration projects = ProjectsHelper.getProjects(portalName); List<PluginConf> pluginsConf = getPluginsConfList(pluginsRoot); - ServiceConf serviceConf = new ServiceConf(serviceNode); + ServiceConf serviceConf = new ServiceConfImpl(serviceNode); ScoresManagerSync.init(portalName, serviceConf); Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresService.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,48 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service; + +import java.util.Date; +import java.util.List; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.exceptions.GetScoresException; +import org.jboss.forge.status.exceptions.ScoresSaveException; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginValues; +import org.jboss.forge.status.service.protocol.PluginsValues; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ +public interface ScoresService { + + public PluginsValues getPluginsValues(String portalName, + Date date) throws GetScoresException; + + public void save(Projects projects, List<PluginConf> pluginsConf, + String portalName) throws ScoresSaveException; + + public PluginValues get(String portalName, String pluginId, Date date) + throws GetScoresException; +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceLocal.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,32 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service; + + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ + +public interface ScoresServiceLocal extends ScoresService { + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/ScoresServiceRemote.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,31 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service; + + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ +public interface ScoresServiceRemote extends ScoresService { + +} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/GetScoresRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,63 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.forge.status.service.impl; - -import java.sql.Timestamp; -import java.util.Date; - -import org.jboss.forge.status.service.model.GetScoresRequest; - -/** -* @author Pawel Wrzeszcz -*/ -public class GetScoresRequestImpl implements GetScoresRequest { - - private static final long serialVersionUID = 7844595317056960170L; - - private Date date; - private Date toDate; - private Timestamp timestamp; - - public GetScoresRequestImpl(Date date, Date toDate, - Timestamp timestamp) { - - this.date = date; - this.toDate = toDate; - this.timestamp = timestamp; - } - - public Date getDate() { - return date; - } - - public Date getToDate() { - return toDate; - } - - public Timestamp getTimestamp() { - return timestamp; - } - - - -} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginConfImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,81 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.forge.status.service.impl; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.jboss.forge.common.XmlTools; -import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.tools.Tags; -import org.w3c.dom.Node; - -/** -* @author Pawel Wrzeszcz -*/ -public class PluginConfImpl implements PluginConf { - - private static final long serialVersionUID = 8598887068548048511L; - - private Map<String,String> fields = new HashMap<String,String>(); - private Properties properties; - - public PluginConfImpl(Node pluginNode) - throws InvalidPluginsConfigurationException { - - // Parse plugin configuration - parseField(pluginNode, Tags.PLUGIN_ID_ELEMENT); - parseField(pluginNode, Tags.PLUGIN_CLASS_ELEMENT); - - // Parse plugin properties - Node pluginPropertiesNode = - XmlTools.getFirstNodeWithName(pluginNode, - Tags.PLUGIN_PROPERTIES_ELEMENT); - - properties = XmlTools.parseProperties(pluginPropertiesNode); - } - - public String getFieldValue(String fieldName) { - return fields.get(fieldName); - } - - public Properties getProperties() { - return properties; - } - - private void parseField(Node pluginNode, String fieldName) - throws InvalidPluginsConfigurationException { - - String fieldValue = - XmlTools.getChildNodeValue(pluginNode, fieldName); - - if (fieldValue == null) { - throw new InvalidPluginsConfigurationException( - "Missing field: " + fieldName); - } - - fields.put(fieldName, fieldValue); - } -} \ No newline at end of file Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,82 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.forge.status.service.impl; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.jboss.forge.status.plugins.Plugin; -import org.jboss.forge.status.service.model.PluginValues; - -/** -* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) -* A class used to store plugin values in shotoku. -*/ - -public class PluginValuesImpl implements PluginValues { - - private static final long serialVersionUID = 5196364802717262757L; - - private Map<String,Long> values = new HashMap<String,Long>(); - private Map<String,Integer> rates = new HashMap<String,Integer>(); - private Map<String,String> links = new HashMap<String,String>(); - - private String pluginId; - private String linkName; - - public PluginValuesImpl(Plugin plugin, Set<String> projectIds) { - - // Get plugin properties - pluginId = plugin.getId(); - linkName = plugin.getLinkName(); - - // Get plugin values - for (String projectId : projectIds) { - - values.put(projectId, plugin.getValue(projectId)); - rates.put(projectId, new Integer(plugin.getRate(projectId))); - links.put(projectId, plugin.getLink(projectId)); - } - } - - public String getId() { - return pluginId; - } - - public Long getValue(String projectId) { - return values.get(projectId); - } - - public Integer getRate(String projectId) { - return rates.get(projectId); - } - - public String getLink(String projectId) { - return links.get(projectId); - } - - public String getLinkName() { - return linkName; - } -} Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/PluginsValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,115 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.forge.status.service.impl; - -import java.util.Calendar; -import java.util.Date; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; - -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; - -import org.jboss.forge.status.exceptions.GetScoresException; -import org.jboss.forge.status.plugins.Plugin; -import org.jboss.forge.status.service.model.PluginsValues; -import org.jboss.forge.status.tools.Plugins; - -/** -* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) -* A class used to store plugins values in shotoku. -*/ - -public class PluginsValuesImpl implements PluginsValues { - - private static final long serialVersionUID = -1669515339062166738L; - - /** Map : pluginId -> pluginValue */ - private Map<String,PluginValuesImpl> values; - - /** Creation date */ - private Date date; - - /** - * @param projects Projects present in the Status Matrix - * @param plugins Plugins which values will be stored - */ - public PluginsValuesImpl(Projects projects, Plugins plugins) { - - date = Calendar.getInstance().getTime(); - - values = new HashMap<String,PluginValuesImpl>(); - - Set<String> projectIds = - projects.getProjectIds(new NullPermissionsChecker(), null); - - for (Plugin plugin : plugins.getPlugins()) { - - PluginValuesImpl pluginValues = new PluginValuesImpl(plugin, projectIds); - - values.put(plugin.getId(), pluginValues); - } - } - - /** - * For the given plugin and project ids returns stored value. - * - * @param pluginId plugin id - * @param projectId project id - * @return stored plugin value for specified project - * @throws GetScoresException - * Thrown when requested value was not found - */ - public long getPluginValue(String pluginId, String projectId) - throws GetScoresException { - - Long val = null; - PluginValuesImpl pluginValues = values.get(pluginId); - - if (pluginValues != null) { - val = pluginValues.getValue(projectId); - } - - if (val == null) { - throw new GetScoresException(); - } - - return val; - } - - /** - * @return creation date - */ - public Date getDate() { - return date; - } - - public boolean hasPlugin(String pluginId) { - return values.containsKey(pluginId); - } - - public PluginValuesImpl getPluginValues(String pluginId) { - return values.get(pluginId); - } -} Deleted: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/SaveRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -1,55 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -package org.jboss.forge.status.service.impl; - -import java.util.List; - -import org.jboss.forge.common.projects.Projects; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.SaveRequest; - -/** -* @author Pawel Wrzeszcz -*/ -public class SaveRequestImpl implements SaveRequest { - - private static final long serialVersionUID = 7523633911740487129L; - - private List<PluginConf> pluginsConf; - private Projects projects; - - public SaveRequestImpl(List<PluginConf> pluginsConf, Projects projects) { - - this.pluginsConf = pluginsConf; - this.projects = projects; - } - - public List<PluginConf> getPluginsConf() { - return pluginsConf; - } - - public Projects getProjects() { - return projects; - } - -} \ No newline at end of file Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresMDB.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -37,10 +37,10 @@ import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.model.GetScoresRequest; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.PluginsValues; -import org.jboss.forge.status.service.model.SaveRequest; +import org.jboss.forge.status.service.protocol.GetScoresRequest; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.service.protocol.SaveRequest; import org.jboss.forge.status.tools.RecordManager; import org.jboss.forge.status.tools.ScoresManagerSync; @@ -107,8 +107,6 @@ private static void handleRequest(GetScoresRequest getScoresRequest) { - System.out.println("***"); - Date date = getScoresRequest.getDate(); Date toDate = getScoresRequest.getToDate(); Timestamp timestamp = getScoresRequest.getTimestamp(); Modified: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/ScoresServiceImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -45,10 +45,12 @@ import org.jboss.forge.status.exceptions.GetScoresException; import org.jboss.forge.status.exceptions.ScoresSaveException; -import org.jboss.forge.status.service.model.PluginConf; -import org.jboss.forge.status.service.model.ScoresService; -import org.jboss.forge.status.service.model.ScoresServiceLocal; -import org.jboss.forge.status.service.model.ScoresServiceRemote; +import org.jboss.forge.status.service.ScoresService; +import org.jboss.forge.status.service.ScoresServiceLocal; +import org.jboss.forge.status.service.ScoresServiceRemote; +import org.jboss.forge.status.service.impl.protocol.PluginValuesImpl; +import org.jboss.forge.status.service.impl.protocol.PluginsValuesImpl; +import org.jboss.forge.status.service.protocol.PluginConf; import org.jboss.forge.status.tools.Plugins; import org.jboss.forge.status.tools.Tools; Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/GetScoresRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,63 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.impl.protocol; + +import java.sql.Timestamp; +import java.util.Date; + +import org.jboss.forge.status.service.protocol.GetScoresRequest; + +/** +* @author Pawel Wrzeszcz +*/ +public class GetScoresRequestImpl implements GetScoresRequest { + + private static final long serialVersionUID = 7844595317056960170L; + + private Date date; + private Date toDate; + private Timestamp timestamp; + + public GetScoresRequestImpl(Date date, Date toDate, + Timestamp timestamp) { + + this.date = date; + this.toDate = toDate; + this.timestamp = timestamp; + } + + public Date getDate() { + return date; + } + + public Date getToDate() { + return toDate; + } + + public Timestamp getTimestamp() { + return timestamp; + } + + + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginConfImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,81 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.impl.protocol; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.jboss.forge.common.XmlTools; +import org.jboss.forge.status.exceptions.InvalidPluginsConfigurationException; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.tools.Tags; +import org.w3c.dom.Node; + +/** +* @author Pawel Wrzeszcz +*/ +public class PluginConfImpl implements PluginConf { + + private static final long serialVersionUID = 8598887068548048511L; + + private Map<String,String> fields = new HashMap<String,String>(); + private Properties properties; + + public PluginConfImpl(Node pluginNode) + throws InvalidPluginsConfigurationException { + + // Parse plugin configuration + parseField(pluginNode, Tags.PLUGIN_ID_ELEMENT); + parseField(pluginNode, Tags.PLUGIN_CLASS_ELEMENT); + + // Parse plugin properties + Node pluginPropertiesNode = + XmlTools.getFirstNodeWithName(pluginNode, + Tags.PLUGIN_PROPERTIES_ELEMENT); + + properties = XmlTools.parseProperties(pluginPropertiesNode); + } + + public String getFieldValue(String fieldName) { + return fields.get(fieldName); + } + + public Properties getProperties() { + return properties; + } + + private void parseField(Node pluginNode, String fieldName) + throws InvalidPluginsConfigurationException { + + String fieldValue = + XmlTools.getChildNodeValue(pluginNode, fieldName); + + if (fieldValue == null) { + throw new InvalidPluginsConfigurationException( + "Missing field: " + fieldName); + } + + fields.put(fieldName, fieldValue); + } +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,82 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.impl.protocol; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.jboss.forge.status.plugins.Plugin; +import org.jboss.forge.status.service.protocol.PluginValues; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugin values in shotoku. +*/ + +public class PluginValuesImpl implements PluginValues { + + private static final long serialVersionUID = 5196364802717262757L; + + private Map<String,Long> values = new HashMap<String,Long>(); + private Map<String,Integer> rates = new HashMap<String,Integer>(); + private Map<String,String> links = new HashMap<String,String>(); + + private String pluginId; + private String linkName; + + public PluginValuesImpl(Plugin plugin, Set<String> projectIds) { + + // Get plugin properties + pluginId = plugin.getId(); + linkName = plugin.getLinkName(); + + // Get plugin values + for (String projectId : projectIds) { + + values.put(projectId, plugin.getValue(projectId)); + rates.put(projectId, new Integer(plugin.getRate(projectId))); + links.put(projectId, plugin.getLink(projectId)); + } + } + + public String getId() { + return pluginId; + } + + public Long getValue(String projectId) { + return values.get(projectId); + } + + public Integer getRate(String projectId) { + return rates.get(projectId); + } + + public String getLink(String projectId) { + return links.get(projectId); + } + + public String getLinkName() { + return linkName; + } +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/PluginsValuesImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,115 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.impl.protocol; + +import java.util.Calendar; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.common.projects.permissions.NullPermissionsChecker; + +import org.jboss.forge.status.exceptions.GetScoresException; +import org.jboss.forge.status.plugins.Plugin; +import org.jboss.forge.status.service.protocol.PluginsValues; +import org.jboss.forge.status.tools.Plugins; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugins values in shotoku. +*/ + +public class PluginsValuesImpl implements PluginsValues { + + private static final long serialVersionUID = -1669515339062166738L; + + /** Map : pluginId -> pluginValue */ + private Map<String,PluginValuesImpl> values; + + /** Creation date */ + private Date date; + + /** + * @param projects Projects present in the Status Matrix + * @param plugins Plugins which values will be stored + */ + public PluginsValuesImpl(Projects projects, Plugins plugins) { + + date = Calendar.getInstance().getTime(); + + values = new HashMap<String,PluginValuesImpl>(); + + Set<String> projectIds = + projects.getProjectIds(new NullPermissionsChecker(), null); + + for (Plugin plugin : plugins.getPlugins()) { + + PluginValuesImpl pluginValues = new PluginValuesImpl(plugin, projectIds); + + values.put(plugin.getId(), pluginValues); + } + } + + /** + * For the given plugin and project ids returns stored value. + * + * @param pluginId plugin id + * @param projectId project id + * @return stored plugin value for specified project + * @throws GetScoresException + * Thrown when requested value was not found + */ + public long getPluginValue(String pluginId, String projectId) + throws GetScoresException { + + Long val = null; + PluginValuesImpl pluginValues = values.get(pluginId); + + if (pluginValues != null) { + val = pluginValues.getValue(projectId); + } + + if (val == null) { + throw new GetScoresException(); + } + + return val; + } + + /** + * @return creation date + */ + public Date getDate() { + return date; + } + + public boolean hasPlugin(String pluginId) { + return values.containsKey(pluginId); + } + + public PluginValuesImpl getPluginValues(String pluginId) { + return values.get(pluginId); + } +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/SaveRequestImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,55 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.impl.protocol; + +import java.util.List; + +import org.jboss.forge.common.projects.Projects; +import org.jboss.forge.status.service.protocol.PluginConf; +import org.jboss.forge.status.service.protocol.SaveRequest; + +/** +* @author Pawel Wrzeszcz +*/ +public class SaveRequestImpl implements SaveRequest { + + private static final long serialVersionUID = 7523633911740487129L; + + private List<PluginConf> pluginsConf; + private Projects projects; + + public SaveRequestImpl(List<PluginConf> pluginsConf, Projects projects) { + + this.pluginsConf = pluginsConf; + this.projects = projects; + } + + public List<PluginConf> getPluginsConf() { + return pluginsConf; + } + + public Projects getProjects() { + return projects; + } + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/impl/protocol/ServiceConfImpl.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,80 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.impl.protocol; + +import java.util.Properties; + +import org.jboss.forge.status.service.protocol.ServiceConf; +import org.jboss.forge.status.tools.Tags; +import org.jboss.shotoku.Node; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +*/ +public class ServiceConfImpl implements ServiceConf { + + boolean remoteService; + + Properties properties; + + public ServiceConfImpl(Node serviceNode) { + + properties = parseProperties(serviceNode); + + String remoteString = (String) properties.get(Tags.SERVICE_REMOTE_ELEMENT); + remoteService = remoteString.equals("true"); + + System.out.println("remote " + remoteService + "\n props: " + properties); + } + + public boolean isRemote() { + return remoteService; + } + + public Properties getProperties() { + return properties; + } + + private Properties parseProperties(Node serviceNode) { + + if (serviceNode == null) { + return null; + } + + Properties props = new Properties(); + + String propsString = serviceNode.getContent(); + String[] propsArr = propsString.split("\n"); + + for (String propString : propsArr) { + + String[] propArr = propString.split("="); + if ((propArr != null) && (propArr.length == 2)) { + props.put(propArr[0], propArr[1]); + } + + } + + return props; + } +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/GetScoresRequest.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,40 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.protocol; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; + +/** +* @author Pawel Wrzeszcz +*/ +public interface GetScoresRequest extends Serializable { + + public Date getDate(); + + public Date getToDate(); + + public Timestamp getTimestamp(); + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginConf.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,36 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.protocol; + +import java.io.Serializable; +import java.util.Properties; + +/** +* @author Pawel Wrzeszcz +*/ +public interface PluginConf extends Serializable { + + public String getFieldValue(String fieldName); + + public Properties getProperties(); +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginValues.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,44 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.protocol; + +import java.io.Serializable; + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugin values in shotoku. +*/ + +public interface PluginValues extends Serializable { + + public String getId(); + + public Long getValue(String projectId); + + public Integer getRate(String projectId); + + public String getLink(String projectId); + + public String getLinkName(); + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/PluginsValues.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,60 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.protocol; + +import java.util.Date; + +import java.io.Serializable; + +import org.jboss.forge.status.exceptions.GetScoresException; + + +/** +* @author Pawel Wrzeszcz (pawel.wrzeszcz [at] gmail.com) +* A class used to store plugins values in shotoku. +*/ + +public interface PluginsValues extends Serializable { + + /** + * For the given plugin and project ids returns stored value. + * + * @param pluginId plugin id + * @param projectId project id + * @return stored plugin value for specified project + * @throws GetScoresException + * Thrown when requested value was not found + */ + public long getPluginValue(String pluginId, String projectId) + throws GetScoresException; + + /** + * @return creation date + */ + public Date getDate(); + + public boolean hasPlugin(String pluginId); + + public PluginValues getPluginValues(String pluginId); + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/SaveRequest.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,39 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.protocol; + +import java.io.Serializable; +import java.util.List; + +import org.jboss.forge.common.projects.Projects; + +/** +* @author Pawel Wrzeszcz +*/ +public interface SaveRequest extends Serializable { + + public List<PluginConf> getPluginsConf(); + + public Projects getProjects(); + +} \ No newline at end of file Added: labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java 2006-05-17 16:41:58 UTC (rev 4286) +++ labs/jbosslabs/trunk/portal-extensions/forge-status/src/java/org/jboss/forge/status/service/protocol/ServiceConf.java 2006-05-17 17:06:06 UTC (rev 4287) @@ -0,0 +1,36 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package org.jboss.forge.status.service.protocol; + +import java.util.Properties;... [truncated message content] |