You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2005/11/22 08:56:56 UTC

svn commit: r348123 - in /portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed: ./ administration/ aggregator/

Author: taylor
Date: Mon Nov 21 23:56:54 2005
New Revision: 348123

URL: http://svn.apache.org/viewcvs?rev=348123&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-412

Portal Adminstration API

Added:
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/AdministrationEmailException.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/RegistrationException.java
Modified:
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/aggregator/WorkerMonitor.java

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java?rev=348123&r1=348122&r2=348123&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/CommonPortletServices.java Mon Nov 21 23:56:54 2005
@@ -40,5 +40,6 @@
     public final static String CPS_HEADER_RESOURCE_FACTORY = "cps:HeaderResource";
     public final static String CPS_PERMISSION_MANAGER = "cps:PermissionManager";
     public final static String CPS_PORTAL_STATISTICS = "cps:PortalStatistics";
-    
+    public final static String CPS_PORTAL_ADMINISTRATION = "cps:PortalAdministration";
+    public final static String CPS_PREFERENCES_PROVIDER = "cps:PreferencesProvider";
 }

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/AdministrationEmailException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/AdministrationEmailException.java?rev=348123&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/AdministrationEmailException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/AdministrationEmailException.java Mon Nov 21 23:56:54 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.administration;
+
+import org.apache.jetspeed.exception.JetspeedException;
+import org.apache.jetspeed.i18n.KeyedMessage;
+
+/**
+ * Administration Email exceptions
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class AdministrationEmailException extends JetspeedException
+{
+
+    public AdministrationEmailException()
+    {
+        super();
+        // TODO Auto-generated constructor stub
+    }
+
+    public AdministrationEmailException(KeyedMessage keyedMessage, Throwable nested)
+    {
+        super(keyedMessage, nested);
+        // TODO Auto-generated constructor stub
+    }
+
+    public AdministrationEmailException(KeyedMessage typedMessage)
+    {
+        super(typedMessage);
+        // TODO Auto-generated constructor stub
+    }
+
+    public AdministrationEmailException(String msg, Throwable nested)
+    {
+        super(msg, nested);
+        // TODO Auto-generated constructor stub
+    }
+
+    public AdministrationEmailException(String message)
+    {
+        super(message);
+        // TODO Auto-generated constructor stub
+    }
+
+    public AdministrationEmailException(Throwable nested)
+    {
+        super(nested);
+        // TODO Auto-generated constructor stub
+    }
+
+}

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java?rev=348123&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalAdministration.java Mon Nov 21 23:56:54 2005
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.administration;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jetspeed.security.User;
+
+/**
+ * PortalAdministration
+ * 
+ * Aggregate portal administration functions:
+ *  - Emails
+ *  - Registration
+ *  - Password Generation
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface PortalAdministration
+{    
+    /**
+     * Registers and creates a new user, assigning userInfo, roles, groups, 
+     * profiling rules and a folder template. If any values are null, defaults
+     * are used from the system wide configuration.
+     * 
+     * @param userName Unique user principal identifier
+     * @param password Password for this user
+     * @param roles A list of roles to assign to this user
+     * @param groups A list of groups to assign to this user
+     * @param userInfo Portlet API User Information Attributes name value pairs (PLT.D) 
+     * @param rules A map of name value pairs of profiling rules. 
+     *              Well known rules names are 'page' and 'menu' 
+     * @param folderTemplate The full PSML path name of a folder to be deep
+     *               copied as the new user's set of folders, pages, links
+     */
+    void registerUser(String userName, 
+                      String password, 
+                      List roles, 
+                      List groups,
+                      Map userInfo,                       
+                      Map rules,
+                      String template)
+        throws RegistrationException;
+ 
+    /**
+     * Register a new user using all default values
+     * 
+     * @param userName
+     * @param password
+     */
+    void registerUser(String userName, String password)
+        throws RegistrationException;
+    
+    /**
+     * Generate a unique password
+     * 
+     * @return unique password
+     */
+    String generatePassword();
+    
+    /**
+     * Helper to send an email to a recipient
+     * 
+     * @param recipient the email address of the recipient
+     * @param localizedSubject the subject of the email as a localized string
+     * @param message the email message content
+     * @parm userAttributes map of user attributes
+     * @throws AdministrationEmailException
+     */
+    public void sendEmail(String emailAddress, 
+                          String localizedSubject, 
+                          String templatePath,
+                          Map userAttributes)
+        throws AdministrationEmailException;
+    
+    /**
+     * Lookup a user given an email address
+     * 
+     * @param email Given email address
+     * @return a Jetspeed <code>User</code>, or throw exception if not found
+     * @throws AdministrationEmailException
+     */
+    public User lookupUserFromEmail(String email)
+    throws AdministrationEmailException;
+    
+    
+}
+

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java?rev=348123&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java Mon Nov 21 23:56:54 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.administration;
+
+/**
+ * PortalConfiguration portal configuration contants
+ * TODO: integrate Configuration with JMX 
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface PortalConfigurationConstants
+{
+    /** EMAIL */
+    /** email of the system administrator */
+    static final String EMAIL_ADMIN = "email.admin";
+    /** email of the system manager */
+    static final String EMAIL_MANAGER = "email.manager";
+    /** email sender */
+    static final String EMAIL_SENDER = "email.sender";
+    /** email user info attribute **/
+    static final String EMAIL_USERINFO_ATTRIBUTE = "email.userinfo.attribute";
+    
+    /** LAYOUT */
+    /** the default page layout if none is specified */
+    static final String LAYOUT_PAGE_DEFAULT = "layout.page.default";
+    
+    /** Decorators */
+    /** default page decorator if none specified */
+    static final String DECORATOR_PAGE_DEFAULT = "decorator.page.default";
+    /** default portlet decorator if none specified */    
+    static final String DECORATOR_PORTLET_DEFAULT = "decorator.portlet.default";
+    
+    /** PSML **/
+    /** default psml page */
+    static final String PSML_PAGE_DEFAULT = "psml.page.default";
+    
+    /** PSML Templates */
+    /** PSML Folder Template to copy during new user creation and registration */
+    static final String PSML_TEMPLATE_FOLDER = "psml.template.folder";
+    
+    /** PROFILER **/
+    static final String PROFILER_RULE_NAMES_DEFAULT = "profiler.rule.names.default";
+    static final String PROFILER_RULE_VALUES_DEFAULT = "profiler.rule.values.default";
+    
+    /** Registration */ 
+    /** Registration default Roles assigned during registration or new user creation **/
+    static final String REGISTRATION_ROLES_DEFAULT = "registration.roles.default";
+    /** Registration default groups assigned during registration or new user creation **/    
+    static final String REGISTRATION_GROUPS_DEFAULT = "registration.groups.default";
+    /** Registration default profiling rules assigned during registration or new user creation **/        
+    static final String REGISTRATION_RULES_DEFAULT = "registration.rules.default";
+    
+}

Added: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/RegistrationException.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/RegistrationException.java?rev=348123&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/RegistrationException.java (added)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/administration/RegistrationException.java Mon Nov 21 23:56:54 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.administration;
+
+import org.apache.jetspeed.exception.JetspeedException;
+import org.apache.jetspeed.i18n.KeyedMessage;
+
+/**
+ * Registration-related exceptions
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class RegistrationException extends JetspeedException
+{
+
+    public RegistrationException()
+    {
+        super();
+        // TODO Auto-generated constructor stub
+    }
+
+    public RegistrationException(KeyedMessage keyedMessage, Throwable nested)
+    {
+        super(keyedMessage, nested);
+        // TODO Auto-generated constructor stub
+    }
+
+    public RegistrationException(KeyedMessage typedMessage)
+    {
+        super(typedMessage);
+        // TODO Auto-generated constructor stub
+    }
+
+    public RegistrationException(String msg, Throwable nested)
+    {
+        super(msg, nested);
+        // TODO Auto-generated constructor stub
+    }
+
+    public RegistrationException(String message)
+    {
+        super(message);
+        // TODO Auto-generated constructor stub
+    }
+
+    public RegistrationException(Throwable nested)
+    {
+        super(nested);
+        // TODO Auto-generated constructor stub
+    }
+
+}

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/aggregator/WorkerMonitor.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/aggregator/WorkerMonitor.java?rev=348123&r1=348122&r2=348123&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/aggregator/WorkerMonitor.java (original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/aggregator/WorkerMonitor.java Mon Nov 21 23:56:54 2005
@@ -15,6 +15,8 @@
  */
 package org.apache.jetspeed.aggregator;
 
+import java.util.List;
+
 import org.apache.jetspeed.util.Queue;
 
 /**
@@ -26,10 +28,54 @@
  */
 public interface WorkerMonitor 
 {
+    /**
+     * Start processing the worker monitor
+     *
+     */
     void start();
+    
+    /**
+     * Stop processing the worker monitor
+     * Finish all jobs
+     *
+     */
     void stop();
+    
+    /**
+     * Retrieves a snapshot of job count in the waiting (backlogged) queue
+     * 
+     * @return snapshot count of waiting jobs
+     */
+    int getQueuedJobsCount();
+    
+    /**
+     * Returns a snapshot count of the available jobs
+     * @return available jobs count
+     */
+    int getAvailableJobsCount();
+    
+    /**
+     * Returns a snapshot count of the jobs currently running
+     * 
+     * @return snapshot count of running jobs
+     */
+    int getRunningJobsCount();
+    
     void setQueue(Queue queue);
+    
     Worker getWorker();
+    
+    /** 
+     * Start processing a job, assign it to a worker thread.
+     * 
+     * @param job
+     */
     void process(RenderingJob job);
+    
+    /**
+     * Release a job on completion
+     * 
+     * @param worker
+     */
     void release(Worker worker);
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org