The GridSphere Portlet Service Model An Overview Jason Novotny

advertisement
The GridSphere Portlet
Service Model
An Overview
Jason Novotny novotny@aei.mpg.de
Michael Russell russell@aei.mpg.de
Oliver Wehrens wehrens@aei.mpg.de
Albert Einstein Institute
Portals & Portlets 2003
Portlet Services Introduction
Origination of portlet services concept began with
Jetspeed/Turbine
Jakarta Turbine project aimed at developing reusable
“services”
Caching, Localization
Logging, XSLT tansformation
Security, Unique ID generation
Persistence, Object Pooling, etc.
Services provide standard interface consisting of init()
and destroy() methods
Portlet Services provide a mechanism for performing
logic operations that can be reused by one or more
portlets
Portlet Services Evolution
Jakarta Turbine evolved into separate sofwtare package/model
for providing a collection of reusable services
Initialization of services specified in properties files
IBM WebSphere adapted portlet services model
“Portlet services are discoverable extensions to the Portlet API
which can be plugged into the portal server”
IBM WebSphere provides methods in the Portlet API to get
instances of a portlet service via the PortletContext
config.getContext.getService(AnyService.class);
Services consist primarily of an interface description and a
concrete service implementation
Portlet Services Cont.
PortletService is the base interface for all portlet
services.
PortletService classes define “reusable services”
within the context of a Portal.
Portlets can obtain portlet service instances by calling
the method PortletContext.getService.
PortletService instances are created by a
PortletServiceFactory.
Similar to Portlets, PortletService objects are
configured at initialization with a
PortletServiceConfig object.
Writing a Portlet Service
Define a service interface
Provide service methods
Write the service implementation
Can also provide implementations for init() and destroy()
methods which get called when service is first instantiated and
destroyed
Write the service’s factory
Generally one can use the PortltetServiceFactory which creates
a new service insatnce or can return a cached service instance
Register the service
IBM WebSphere uses PortletServiceRegistryService.properties
to store mappings between service interface and implementation
as well as service configuration information
GridSphere Portlet Services
Adopted WebSphere approach to portlet services
Replaced properties file with an XML specified services
descriptor file:
<service>
<name>Login Service</name>
<description>Provides Login Capabilities</description>
<interface>org.gridsphere.services.LoginService</interface>
<implementation>org.gridsphere.services.impl.LoginServiceImpl</implementation
>
</service>
PortletServiceFactory provides createService methods to
instantiate new service instance or reuse existing service
instance
Introduced notion of “user services” that allow service methods
to provide particluar capabilities based on user’s role
Portlet Service Security
Portlet service security uses role based access control
(RBAC) model
Groups contain Users which have Roles
Roles can be Guest, User, Admin, and Super
“User Services” must specify additional services attribute
in XML definition:
<user-required>true</user-required>
Currently, users can have only one predefined role within
a group but this can be extended in future releases
Group and role information available from the
AccessControlManagerService
Portlet Services Descriptor
<portlet-services>
<service>
<name>Portlet Manager Service</name>
<user-required>true</user-required>
<description>Provides Administration Capabilities for Portlet Web
Applications</description>
<interface>org.gridsphere.services.core.registry.PortletManagerService</interface>
<implementation>org.gridsphere.services.core.registry.impl.PortletManagerServiceImpl
</implementation>
<service-config>
<param-name>init-portlet-webapps</param-name>
<param-value>gsmanager, coreportlets, gridportlets, exampleportlets</param-value>
</service-config>
</service>
Core Services
Portlet Manager Service
Provides lifecycle methods to allow portlets to be installed,
removed, initialized and destroyed by authorized users
Login Service
Allows a User to be retrieved from a username and password
User Manager Service
Add/Remove User Accounts
Edit User Profiles
Access Control Service
Add/Remove User Groups
Add/Remove User Roles
Grid Services (the beginning)
Credential Manager Service
Add/Remove allowed User Credentials
Configure use of Credential Retrieval Service
Job Manager Service
For listing, starting, migrating, stopping jobs.
Job Monitoring Service
Specify what to monitor for any given job and archive related
information.
File Transfer Service
For managing and scheduling file transfers.
Data Manager Service
Access to data replica catalogues.
Describe data with meta-data.
Notification Service
Define events to be notified about.
Specify how to be notified about those events.
Conclusion
Portlet services provide resuable business logic that
can be used/shared by portlets
Portlet services allow for separation of service
descriptions (interfaces) from actual concrete
implementations
Portlet service model may be part of Portlet API
User services allow for method-level access control
based on user’s role in portal
GridSphere implements several core services
including login service, user management, access
control management and portlet management
Download