Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


oracle.irm.engine.core.status
Class StatusPageOperationsInstance

java.lang.Object
  extended by oracle.irm.engine.core.status.StatusPageOperationsInstance


public final class StatusPageOperationsInstance
extends Object

Operations relating to the status pages. Status pages are displayed when the desktop wishes to inform the user that some event has occurred. For example, status pages are displayed when the user does not have the rights to open content, or when the server is forcing the user to upgrade the server desktop software. The desktop also provides equivalent off-line status pages when the server cannot be accessed.

The desktop finds out the location of the desktop web site by examining the Uri sealed into content.

The user does not need to authenticate to access the status pages.

This class provides static methods for a set of procedural style methods. The methods can be made to appear as global methods by using import static. e.g.

import static oracle.irm.engine.core.status.StatusPageOperationsInstance.*;

Method Summary
static DesktopState extractStateFromBody(InputStream stream)
          Extract the classification from a HTTP body.
static String getRedirectionParameter(String parameter, Locale locale, StatusPageRequest.StatusPage page, DesktopState state)
          Gets the value for the status page redirection URI parameter given.
static Label getStatusLabel(Locale locale, StatusPageRequest.StatusPage page, DesktopState state)
          Get a caption and description for a status page.
static ContentType getStatusPageContentType(DesktopState state)
          Gets the appropriate content type from the desktop state.
static StatusPageRequest.StatusPage getStatusPageFromQuery(String query)
          Extract the status page from a query.
static StatusPageInformation getStatusPageInformation(Locale locale, StatusPageRequest.StatusPage page, DesktopState state)
          Obtain status page information.
static Collection<HyperLink> getStatusPageLinks(Locale locale, StatusPageRequest.StatusPage page, DesktopState state)
          Get status page links.
static StatusPageResponse getStatusPageResponse(String query, DesktopState state)
          Obtain a status page response.
static URI getStatusPageURI(URI uri, StatusPageRequest.StatusPage page)
          Get the full URI for a status page.
static void insertStateIntoBody(DesktopState state, OutputStream stream)
          Create the response body for a status page.
static URI populateRedirectionURI(URI uri, Locale locale, String query, DesktopState state)
          Populates a status page redirection URI with all of the requested parameters.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getStatusPageURI

public static URI getStatusPageURI(URI uri,
                                   StatusPageRequest.StatusPage page)
Get the full URI for a status page. A Classification only contains the root URI for the desktop web site. This method allows the full URI to be determined for a given classification and status page.

e.g. for the license expired status page the information URI would be prepending with /info?page=LICENSE_EXPIRED.

To obtain the status page a HTTP POST should be made to the URI. The body of the HTTP request should contain the XML representation of the classification. The content type should be set as 'application/xml'.

The insertStateIntoBody method can be used to transform a DesktopState into XML and stream it into an output stream.
Parameters:
uri - the information URI.
page - the status page.
Returns:
the URI that can be used to obtain the status page. This method will never return null.
See Also:
getStatusPageFromQuery

getStatusPageFromQuery

public static StatusPageRequest.StatusPage getStatusPageFromQuery(String query)
Extract the status page from a query. Extract the status page details from a query POSTed from the desktop. Once the status page has been identified the desktop details can be extracted from the HTTP body using extractStateFromBody.
Parameters:
query - the decoded query. If no query string is provided, or it does not match a valid status page then the status page of UNKNOWN is returned. This parameter is optional, it is valid to pass null.
Returns:
the status page requested. This method will never return null.
See Also:
getStatusPageURI

insertStateIntoBody

public static void insertStateIntoBody(DesktopState state,
                                       OutputStream stream)
                                throws IOException
Create the response body for a status page. To obtain the status page a client would perform a HTTP POST to the desktop web site. The body of the HTTP request should contain the XML representation of the DesktopState. This method can be used to stream the DesktopState into a HTTP response output stream.

The content type should be set as 'application/xml'.
Parameters:
state - the desktop state.
stream - the output stream.
Throws:
IOException - output stream exception.
See Also:
extractStateFromBody

extractStateFromBody

public static DesktopState extractStateFromBody(InputStream stream)
                                         throws IOException
Extract the classification from a HTTP body. A request for a status page will include the desktop state in the HTTP body. This method can be used to read the HTTP request input stream and recreate the DesktopState sent from the client.
Parameters:
stream - the input stream.
Returns:
the desktop state. This method will never return null.
Throws:
IOException - there was a problem reading the state from the input stream.
See Also:
insertStateIntoBody

getStatusLabel

public static Label getStatusLabel(Locale locale,
                                   StatusPageRequest.StatusPage page,
                                   DesktopState state)
Get a caption and description for a status page. When displaying a status page a status caption is displayed along with a longer description of what the status means. This method returns a localized caption and description which can be displayed on the appropriate HTML status page.
Parameters:
locale - required locale. The locale to render the status page name and description.
page - the status page.
state - desktop state. The state of the desktop when the status page was requested.
Returns:
the caption and description for the status page. This method will never return null.

getStatusPageLinks

public static Collection<HyperLink> getStatusPageLinks(Locale locale,
                                                       StatusPageRequest.StatusPage page,
                                                       DesktopState state)
Get status page links. The standard status page provides a number of links that are useful to a desktop user. These include information about sealed content and help. This method allows this standard links to be obtained and used to create a StatusPageInformation instance.
Parameters:
locale - required locale. The locale to render the status page link details.
page - the status page.
state - desktop state. The state of the desktop when the status page was requested.
Returns:
the status page links. If applicable, this method will return an empty collection rather than null to indicate no results.

getStatusPageInformation

public static StatusPageInformation getStatusPageInformation(Locale locale,
                                                             StatusPageRequest.StatusPage page,
                                                             DesktopState state)
                                                      throws StatusPageRedirectException
Obtain status page information. Some of the information displayed on a status page cannot be obtained directly from DesktopState, as provided by the desktop. Additional information can be obtained using this method. This additional information includes things such as a company name, classification name and description, content details and further assistance links.

The following status pages will never return assistance links as they are deemed to be normal desktop behaviour and do not require a contact to be given: LICENSES_CHECKED_IN, LICENSE_CHANGED, MOVIE_AFTER_MOVIE, MOVIE_BEFORE_MOVIE.
Parameters:
locale - required locale. The locale to render the status page details.
page - the status page.
state - desktop state. The state of the desktop when the status page was requested.
Returns:
the status page information details. This method will never return null.
Throws:
StatusPageRedirectException - if the status page is provided by an external web page.

getStatusPageContentType

public static ContentType getStatusPageContentType(DesktopState state)
Gets the appropriate content type from the desktop state. Determines the correct content type to be used when generating a status page from the given desktop state.
Parameters:
state - the desktop state.
Returns:
the content type to use on the status page. This method will never return null.

getStatusPageResponse

public static StatusPageResponse getStatusPageResponse(String query,
                                                       DesktopState state)
                                                throws StatusPageRedirectException,
                                                       IOException
Obtain a status page response. Some information displayed on a status page is derived from the provided DesktopState. This additional information could include things such as a company name, classification name and description, content details and further assistance links. The response also includes a localized version of the status.
Parameters:
query - the query string. This string identifies the status page requested. This parameter is optional, it is valid to pass null.
state - desktop state. The state of the desktop when the status page was requested.
Returns:
the status page response details. This method will never return null.
Throws:
StatusPageRedirectException - if the status page is provided by an external web page.
IOException - in an input/output error occurred reading the HTTP request body.

populateRedirectionURI

public static URI populateRedirectionURI(URI uri,
                                         Locale locale,
                                         String query,
                                         DesktopState state)
                                  throws IOException
Populates a status page redirection URI with all of the requested parameters. Fills all recognised parameters in the URI query string that have no value. For example http://irm.example.com/status?irm-locale= will have irm-locale filled in with the correct value giving something like http://irm.example.com/status?irm-locale=en. If the parameter is already filled no population will occur. So if in the previous example page had a value already then it would be left unchanged.
Parameters:
uri - the URI to populate.
locale - the locale. The locale to use for locale specific parameter values. If a desktop state is present its locale will override this setting.
query - the query string of the status page request. This parameter is optional, it is valid to pass null.
state - the state of the desktop when the status page was requested.
Returns:
the populated URI. This method will never return null.
Throws:
IOException - an input/output error occurred reading the HTTP request body.

getRedirectionParameter

public static String getRedirectionParameter(String parameter,
                                             Locale locale,
                                             StatusPageRequest.StatusPage page,
                                             DesktopState state)
Gets the value for the status page redirection URI parameter given.
Parameters:
parameter - the status page redirection URI parameter.
locale - the locale to use for the value.
page - the status page type.
state - the state of the desktop when the status page was requested.
Returns:
the parameter value. The parameter value is a name value pair separated by an equals sign. For example asking for the locate parameter could result in irm-locale=en. The value part of the name value pair is encoded in the application/x-www-form-urlencoded MIME format. Nothing will be returned if the value cannot be determined or if the parameter isn't recognized. This method can return null.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-03


Copyright © 2011, Oracle. All rights reserved.