|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A Provider manages a set of portlets. As such it is the conduit between the Portal Adapter and a given portlet. I.e. calls are mapped to portlets their controllers by calling Provider APIs. Thus the primary function of the Provider interface is to expose its portlets to a Portal. As a manager it additionally takes on the role of "application" manager. That is the Provider is used to expose function that is shared between the portlets it is managing. In the JPDK shared function is (commonly) controlled via a session. The session is created and maintained by the Provider.
| Method Summary | |
void |
deregister()
Deregister this provider. |
Portlet |
getPortlet(long id,
ProviderUser user)
Returns a Portlet by its Id. |
Portlet[] |
getPortlets(int start,
int count,
boolean byUser,
ProviderUser user)
Returns array of Portlets managed by this Provider. |
long |
getProviderId()
Returns this provider's ID. |
java.lang.String |
getProviderRepositoryPath()
Gets the default storage path used for meta data associated with this provider, if any |
ProviderSubscriber |
getSubscriber()
Returns the subscriber for this portal. |
int |
getVersion()
Provider's version -- version of the PDK API it implements. |
void |
init(long providerId,
ProviderLog logger)
Initialize the provider. |
java.lang.Object[] |
initSession(ProviderUser user)
Deprecated. As of Portal 3.0.8 use initSession that receives the externalApp parameter. Called to initialize the Provider in a particular user session. This may be called never, once per user session, or once per request depending on how the provider is configured in the portal. If the Provider uses HTTP cookies or maintains state via a cookie-based HTTP session, it is imperative that (all) cookies be established during this call. A session is established via the user object. I.e. the user object contains the methods for creating and retrieving a session. As this interface is designed for use in both servlet and non-serlvet environments servlet interfaces could not be used. initSession returns an array of cookie objects of the type expected in the particular framework the provider is executing in. For HttpProviders this is servlets and hence the returned object array should contain object of type javax.servlet.http.Cookie. |
java.lang.Object[] |
initSession(ProviderUser user,
ExternalPrincipal externalApp)
Called to initialize the Provider in a particular user session. |
void |
log(java.lang.String msg)
Writes the specified message to a provider log, which is usually an event log. |
void |
log(java.lang.String message,
java.lang.Throwable throwable)
Writes the stack trace and an explanatory message for a given Throwable exception
to the provider log file. |
ProviderSubscriber |
register(java.lang.String subscriberId,
java.lang.String portalVersion)
Register this newly created provider. |
| Method Detail |
public void init(long providerId,
ProviderLog logger)
throws ProviderException
providerId - this providers ID.logger - logging mechanism this provider should use. If null the
provider may implement a default logging facility (but is not required to do so).public long getProviderId()
public java.lang.String getProviderRepositoryPath()
null if not applicablepublic ProviderSubscriber getSubscriber()
public int getVersion()
public ProviderSubscriber register(java.lang.String subscriberId,
java.lang.String portalVersion)
throws ProviderException
In some cases, such as when customers are billed on a subscription basis for using a particular provider, a Provider needs to distinguish the particular portal being registered. This is supported by passing a subscriberId to the register method. A subscriberID is controlled by the Provider owner. A portal customer requests/receives a subscriber ID from the Provider owner when they "purchase" the service. This subscriberId is entered by the portal customer when the Provider is installed/registered. The portal in turn sends this ID to the Provider software to complete the registration. Providers that don't support this subscription model will receive a null subscriberID.
This mechanism is also used to enhance security. Along with the subscriberId a Provider can supply an encryption key to the portal customer. If provided, the portal encrypts all requests to the Provider using this key. The request then sent to the Provider with the subscriberID encoded in the requests header. The Provider uses the subscriberID to identify the proper key to use for decryption.
Recognizing that certain Providers would like the enhanced security that encrpyted messaging supports but don't want to deal with providing a non-programmatic mechanism for communicating the encryption key to the portal customer, the register() method can alternatively generate a subscriberID and encryption key that it returns to the registering portal for use with all subsequent requests. Currently, this id/key pair must be communicated over an unsecure channel making this a less then bullet-proof mechanism. However, given that all subsequent messages occur in a secure manner, the level of security to the Provider is greatly enhanced.
Providers that don't dynamically generate and return an id/key pair should return null.
subscriberId - Subscriber identifier the portal customer supplied when
registering the Provider in the Portal UI. If none was provided this value
is null.PortalVersion - the version of the portal registering this provider.
In the typical Oracle form: 1.0.1.0.1.
public void deregister()
throws ProviderException
public java.lang.Object[] initSession(ProviderUser user,
ExternalPrincipal externalApp)
throws ProviderException
A session is established via the user object. I.e. the user object contains the methods for creating and retrieving a session.
As this interface is designed for use in both servlet and non-serlvet environments servlet interfaces could not be used. initSession returns an array of cookie objects of the type expected in the particular framework the provider is executing in. For HttpProviders this is servlets and hence the returned object array should contain object of type javax.servlet.http.Cookie.
user - Current portal user.externalApp - External Applciation information (if it exists)
public java.lang.Object[] initSession(ProviderUser user)
throws ProviderException
Called to initialize the Provider in a particular user session. This may be called never, once per user session, or once per request depending on how the provider is configured in the portal. If the Provider uses HTTP cookies or maintains state via a cookie-based HTTP session, it is imperative that (all) cookies be established during this call.
A session is established via the user object. I.e. the user object contains the methods for creating and retrieving a session.
As this interface is designed for use in both servlet and non-serlvet environments servlet interfaces could not be used. initSession returns an array of cookie objects of the type expected in the particular framework the provider is executing in. For HttpProviders this is servlets and hence the returned object array should contain object of type javax.servlet.http.Cookie.
user - Current portal user.
public Portlet[] getPortlets(int start,
int count,
boolean byUser,
ProviderUser user)
throws ProviderException
byUser is true, then the array is further
constrained to only those Portlets that the passed user has priveleges to.start - The starting element in the range being requested. This value is
0 based. I.e. a start of 0 indicates the first element in the set.count - The number of elements in the range. The returned array
should contain a maximum of count elements.byUser - If true then the set should be restricted to those
portlets this user has access privileges to.user - The user on whose behalf this request is being made. Used to
both validated that this user has the privileges to make this request, to
get access to session state if needed, and to restrict the response set if
byUser is true.null or a zero
length array.
public Portlet getPortlet(long id,
ProviderUser user)
throws ProviderException
null is returned.id - Portlet Id.user - The user on whose behalf this request is being made. Used to
both validated that this user has the privileges to make this request, to
get access to session state if needed, and most importantly to check if
this user has access privileges to this portlet.public void log(java.lang.String msg)
msg - a String specifying the explanatory
message to be written to the log file
public void log(java.lang.String message,
java.lang.Throwable throwable)
Throwable exception
to the provider log file. The stack trace is
part of the Throwable object, and
the message is the one you specify in the message
parameter. The name and type of the provider log file is specific to
the provider engine, but it is usually an event log.message - a String that
describes the error or exceptionthrowable - the Throwable error
or exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||