|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DesktopServices
Desktop services. Provides services that a user would typically perform on a desktop. When operations occur on the desktop licenses, classifications and cryptography key details are shipped to the desktop and stored locally in a DesktopStore
. The licenses control how long these details are cached and determine such things as whether these licenses are stored on disk. When operations such as sealing, resealing or unsealing are performed this cache is automatically accessed or updated. The synchronization operation allows all rights to be obtained and cached. The check in operation release the use of these details so they can be used on another location (a different desktop). The desktop services are thread safe and it is valid for multiple threads and multiple users to use the services concurrently.
The desktop services can be used from J2SE applications using local libraries (license details stored and used locally) as well as being used remotely by accessing the J2EE sealing server application using web services (license details user and stored on a server).
The methods on DesktopServices can be invoked using DesktopServicesInstance
.
Method Summary | |
---|---|
boolean |
checkForAvailableLicenses(Feature feature, Classification classification) Check that the authenticated account has a license. |
void |
checkIn(URI uri) Perform a check in for the specified server and update the store. |
DesktopStore |
getDesktopStore() The desktop store. |
Collection<Classification> |
listClassifications(URI uri) Lists classifications. |
void |
refresh(Classification classification, UUID uuid) Perform a license refresh and update the store. |
void |
request(Feature feature, Classification classification) Perform a request and update the store. |
void |
reset() Reset the store. |
void |
synchronize(URI uri) Perform a synchronize for the specified server and update the store. |
Method Detail |
---|
DesktopStore getDesktopStore()
void checkIn(URI uri)
import static oracle.irm.engine.core.storage.DesktopServicesInstance.checkIn; import java.net.Authenticator; import java.net.PasswordAuthentication; import java.net.URI; public class CheckIn { public static void main(String[] args) { // The server URI is the first command line argument // e.g. https://irm.example.com/irm_desktop/request URI serverURI = URI.create(args[0]); // The username and password that will be used to contact the // IRM server are the last command line arguments final String username = args[1]; final String password = args[2]; // Configure an authenticator to provide the credentials // for the web service Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password.toCharArray()); } }); // Check in all the licenses currently within the // desktop store for the given server checkIn(serverURI); }
uri
- the server URI.void synchronize(URI uri) throws RepudiateException
synchronize
method. The DesktopStore
will be updated. The sample code displays the updated list of Classifications available to the user in the store.
import static oracle.irm.engine.core.storage.DesktopServicesInstance.getDesktopStore; import static oracle.irm.engine.core.storage.DesktopServicesInstance.synchronize; import java.net.Authenticator; import java.net.PasswordAuthentication; import java.net.URI; import java.util.Collection; import oracle.irm.engine.core.classification.Classification; import oracle.irm.engine.core.general.Label; public class Synchronize { public static void main(String[] args) throws Exception { final String username = args[0]; final String password = args[1]; // Configure an authenticator to provide the credentials // for the web service Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password.toCharArray()); } }); // The server to synchronize with is the first command line // argument e.g. http://irm.example.com/irm_desktop/request URI serverURI = URI.create(args[2]); // Synchronize with the specified server synchronize(serverURI); Collection<Classification> classifications = getDesktopStore().getClassifications(); // Display the labels of the classifications for (Classification classification : classifications) { for (Label label : classification.getLabels()) { String name = label.getName(); System.out.println(name); } } } }
uri
- the server URI.UpgradeRequiredException
- the desktop must be upgraded before synchronization can complete.RepudiateException
- the desktop has been repudiated and is not allowed to complete a synchronization.void request(Feature feature, Classification classification) throws UnknownClassificationException, LicenseInUseException, LicenseUnavailableException, RepudiateException
feature
- the feature being requested, such as opening or printing content.classification
- the content classification information.UnknownClassificationException
- the content's classification is unknown to the server.LicenseInUseException
- the only licenses that are available are in use on another desktop.LicenseUnavailableException
- a license exists, but cannot be used for the specified feature and classification.UpgradeRequiredException
- the desktop must be upgraded before licenses can be requested.RepudiateException
- the desktop has been repudiated and is not allowed to complete a license request.void refresh(Classification classification, UUID uuid) throws RepudiateException
classification
- the content classification information.uuid
- the license UUID.RepudiateException
- the desktop has been repudiated and is not allowed to complete a license request.void reset()
boolean checkForAvailableLicenses(Feature feature, Classification classification) throws UnknownClassificationException, LicenseInUseException, LicenseUnavailableException
feature
- the application feature being requested.classification
- the classification being used.UnknownClassificationException
- the classification provided is known, but the exact instance of classification is unknown.LicenseInUseException
- a license exists, but is in use on another device.LicenseUnavailableException
- a license exists, but cannot be used for the specified feature and classification.Collection<Classification> listClassifications(URI uri)
Context
classification system this method should list all the contexts that the user has been assigned rights.uri
- the server URI.
|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |