|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContextOperationsEndpoint
Web Service end point interface for Context Operations. The context related operations cover the tasks that a context manager would typically perform on a ContextInstance
. This includes altering ContextInstance
names and descriptions, specifying the set of ContextInstance
managers and setting ContextInstance
level ItemCode
exclusions. Journal operations are also included. The content journal contains a log of all activity performed on Context
sealed content. This includes actions performed while off-line as well as on-line. It includes actions performed on the desktop as well as actions perform on the server. The journal is filled automatically when users perform actions on content, e.g. when content is opened or printed. Failed actions are also added to the journal.
The WSDL for this end point interface can be downloaded from the server using the following URL:
http://irm.example.com/irm_services/context_operations?wsdl
Requests for this web service should be sent to the following URL:
https://irm.example.com/irm_services/context_operations
Method Summary | |
---|---|
void |
addContextManagers(ContextInstanceRef context, AccountRef[] accounts) Add one or managers to a context. |
void |
addInspectors(DomainRef domain, AccountRef[] accounts) Add one or inspectors to a domain. |
ContextInstance |
createContextFromTemplate(UUID uuid, ContextTemplateRef template, Label[] labels, ContextInstance.Visibility visibility, AccountRef[] managers) Create a context. |
void |
deleteContext(ContextInstanceRef context) Delete a context. |
AccountRef[] |
listContextManagers(ContextInstanceRef context) List context managers. |
ContextInstance[] |
listContexts(PageRange pageRange) List contexts that the authenticated principal is authorized to access. |
AccountRef[] |
listInspectors(DomainRef domain) List inspectors. |
void |
removeContextManagers(ContextInstanceRef context, AccountRef[] accounts) Remove one or managers from a context. |
void |
removeInspectors(DomainRef domain, AccountRef[] accounts) Remove one or inspectors from a domain. |
ContextInstance |
saveChangesToContext(ContextInstance context, ContextInstance delta) Save changes to a context. |
ContextJournalEntry[] |
searchJournal(String[] accountNames, ItemCode[] items, TimeRange timeRange, PageRange pageRange, ContextJournalSorting sorting) Search the context journal. |
Method Detail |
---|
ContextInstance createContextFromTemplate(UUID uuid, ContextTemplateRef template, Label[] labels, ContextInstance.Visibility visibility, AccountRef[] managers) throws InactiveContextTemplateFault, UnknownContextTemplateFault, ContextInstanceAlreadyExistsFault, UnsupportedCryptoSchemaFault, AuthorizationDeniedFault
KeySet
is also generated and associated with the context.
addDomainAdministrators
method. This method can be invoked by users that have the Domain Manager role in the related domain. This role can be assigned using the addDomainManagers
method.
import static oracle.irm.j2ee.jws.rights.context.ContextOperations.getContextOperationsEndpoint; import java.net.Authenticator; import java.net.PasswordAuthentication; import java.util.Locale; import java.util.UUID; import oracle.irm.engine.types.core.general.Label; import oracle.irm.engine.types.rights.context.ContextTemplateRef; import oracle.irm.engine.types.rights.context.DomainRef; import oracle.irm.engine.types.rights.context.ContextInstance.Visibility; import oracle.irm.j2ee.jws.rights.context.ContextOperationsEndpoint; public class CreateContextFromTemplateWS { public static void main(String[] args) throws Exception { final String hostPort = args[0]; 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()); } }); // Domain UUID is fixed for sample code UUID domainUUID = UUID.fromString("6fab93fd-2858-461a-a0b3-34e261dbf8fd"); // Context Template UUID is for the "standard" template automatically installed with a domain UUID templateUUID = UUID.fromString("930876e6-a505-4a10-8d93-bc43d9a37c23"); // Context UUID is fixed for sample code UUID contextUUID = UUID.fromString("46f910d9-dd30-476e-b060-4d01f88f8b05"); // Use the first domain available DomainRef domainRef = new DomainRef(domainUUID); // Use the first template available ContextTemplateRef templateRef = new ContextTemplateRef(templateUUID, domainRef); // Get the context operations web service ContextOperationsEndpoint contextOperations = getContextOperationsEndpoint(hostPort); // Context has two labels, English and German Label english = new Label(Locale.ENGLISH, "Sample Classification", "Created from sample code."); Label german = new Label(Locale.GERMAN, "Beispielklassifikation", "Verursacht vom Beispielcode."); // Create a context based on that template contextOperations.createContextFromTemplate( contextUUID, // context UUID value templateRef, // context template new Label[] { english, german }, // labels Visibility.DOMAIN, // visibility null); // additional context managers } }
uuid
- uUID for the context. If this UUID is not provided one will be generated automatically. Providing an explicit UUID can be useful to make the context identity deterministic. This parameter is optional, it is valid to pass null.template
- the template.labels
- the context's names and descriptions. This parameter is optional, it is valid to pass null or an empty collection.visibility
- context visibility to inspectors.managers
- additional context managers. This parameter is optional, it is valid to pass null or an empty collection.InactiveContextTemplateFault
- inactive context. When creating a context from a template the template must be marked as active.UnknownContextTemplateFault
- the context template does not exist.ContextInstanceAlreadyExistsFault
- a context instance with the same UUID already exists.UnsupportedCryptoSchemaFault
- unsupported cryptographic schema.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.ContextInstance saveChangesToContext(ContextInstance context, ContextInstance delta) throws UnknownContextFault, AuthorizationDeniedFault
ContextInstance
by providing two copies. Changes are made by comparing the two copies of the context. If there are no differences in a property then no changes are made to persistent storage for that property. Changes in collection based properties cause additions or removals to occur in persistent storage. For example, if the delta contains a new Label
as compared to the context then a new label will be added.
addContextManagers
method.
context
- the context to compare to the delta.delta
- the changes. The Template
and Uuid
properties must match with the context parameter.UnknownContextFault
- the context does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.void deleteContext(ContextInstanceRef context) throws CannotRemoveContextInstanceFault, AuthorizationDeniedFault
ContextInstance
and associated cryptography keys.ContextInstance
also deletes the content related cryptography keys, making content sealed against this Context
permanently inaccessible. Deleting a context also deletes any related journal entries.
addContextManagers
method.
context
- the context.CannotRemoveContextInstanceFault
- the context cannot be removed as rights are assigned within the context. A context cannot be deleted if there are any contexts assignments within the context. The context can only be deleted after the rights are unassigned.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.ContextInstance[] listContexts(PageRange pageRange) throws AuthorizationDeniedFault
Visibility
property to the DOMAIN.pageRange
- page range for the search result.AuthorizationDeniedFault
- if the authenticated user is not allowed to list contexts. This will typically indicate that the authenticated user no longer exists in the user store. e.g. session is still valid but the user has been deleted from the user store.AccountRef[] listContextManagers(ContextInstanceRef context) throws UnknownContextFault, AuthorizationDeniedFault
ContextInstance
classification. A context manager can also specify the context names and descriptions using saveChangesToContext
. A context manager can also specify the context level item exclusions using the same saveChangesToContext
method.
addContextManagers
method. This method can be invoked by users that have the Inspector role in the related context. This role can be assigned using the addInspectors
method.context
- the context.UnknownContextFault
- the context does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.addContextManagers
void addContextManagers(ContextInstanceRef context, AccountRef[] accounts) throws AccountAlreadyManagerFault, UnknownContextFault, AuthorizationDeniedFault
ContextInstance
will always have at least one manager. When a ContextInstance
has multiple managers, each manager will have equal permissions to perform ContextInstance
related activities.
addContextManagers
method.
context
- the context.accounts
- the accounts. Duplicates are ignored. This parameter is optional, it is valid to pass null or an empty collection.AccountAlreadyManagerFault
- one of the provided accounts is already a context manager.UnknownContextFault
- the context does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.void removeContextManagers(ContextInstanceRef context, AccountRef[] accounts) throws CannotRemoveManagersFault, UnknownContextFault, AuthorizationDeniedFault
ContextInstance
must have at least one manager.
addContextManagers
method.
context
- the context.accounts
- the accounts. This parameter is optional, it is valid to pass null or an empty collection.CannotRemoveManagersFault
- managers cannot be removed, as it would leave the context with no managers.UnknownContextFault
- the context does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.AccountRef[] listInspectors(DomainRef domain) throws UnknownDomainFault, AuthorizationDeniedFault
addInspectors
.ContextInstance
.
addDomainAdministrators
method.domain
- the domain.UnknownDomainFault
- the domain does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.void addInspectors(DomainRef domain, AccountRef[] accounts) throws AccountAlreadyInspectorFault, UnknownDomainFault, AuthorizationDeniedFault
addDomainAdministrators
method.
domain
- the domain.accounts
- the accounts. Duplicates are ignored. This parameter is optional, it is valid to pass null or an empty collection.AccountAlreadyInspectorFault
- one of the provided accounts is already an inspector.UnknownDomainFault
- the domain does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.void removeInspectors(DomainRef domain, AccountRef[] accounts) throws UnknownDomainFault, AuthorizationDeniedFault
addDomainAdministrators
method.
domain
- the domain.accounts
- the accounts. This parameter is optional, it is valid to pass null or an empty collection.UnknownDomainFault
- the domain does not exist.AuthorizationDeniedFault
- authorization denied. The authenticated user is not authorized to call this operation.ContextJournalEntry[] searchJournal(String[] accountNames, ItemCode[] items, TimeRange timeRange, PageRange pageRange, ContextJournalSorting sorting) throws AuthorizationDeniedFault
import static oracle.irm.j2ee.jws.rights.context.ContextOperations.getContextOperationsEndpoint; import java.net.Authenticator; import java.net.PasswordAuthentication; import java.util.Calendar; import java.util.Date; import oracle.irm.engine.types.core.general.PageRange; import oracle.irm.engine.types.core.time.TimeRange; import oracle.irm.engine.types.rights.journal.ContextJournalEntry; import oracle.irm.j2ee.jws.rights.context.ContextOperationsEndpoint; public class SearchJournalWS { public static void main(String[] args) throws Exception { // The server address. e.g. https://irm.example.com final String hostPort = args[0]; 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()); } }); // Search for all records from the last 24 hours Date end = new Date(); // Use a calendar to work out the time range Calendar calendar = Calendar.getInstance(); calendar.setTime(end); calendar.add(Calendar.DAY_OF_MONTH, -1); Date begin = calendar.getTime(); TimeRange timeRange = new TimeRange(begin, end); // Get the context operations web service ContextOperationsEndpoint contextOperations = getContextOperationsEndpoint(hostPort); // Search the context journal PageRange pageRange = new PageRange(1, 100); ContextJournalEntry[] journalResults = contextOperations.searchJournal( null, // no accounts filter null, // no item codes filter timeRange, pageRange, null); // no sorting details if (journalResults.length == 0) return; // Display the timestamp, URI and and feature for each entry for (ContextJournalEntry entry : journalResults) { System.out.print("Timestamp : " + entry.getTime()); System.out.print(" Account : " + entry.getAccount().getName()); System.out.print(" Content : " + (entry.getUri() != null ? entry.getUri() : "")); System.out.print(" Feature : " + entry.getFeature().getId()); } } }
accountNames
- the account names. The accounts names are used to perform a sub-string search for context journal entries containing the account names. The number of accounts names that can be provided has an upper limit. The maximum number of account names that can be passed to this function is defined by ContextOperations.MAXIMUM_JOURNAL_SEARCH_ACCOUNTS
. This parameter is optional, it is valid to pass null or an empty collection.items
- the item codes. The item code value is used to perform a sub-string search for context journal entries. For example an item code value of 'report' would match documents where the item code is 'report.doc' and 'report.xls'. This parameter is optional, it is valid to pass null or an empty collection.timeRange
- time range for the search. This parameter is optional, it is valid to pass null.pageRange
- page range for the search result.sorting
- sorting criteria. This parameter is optional, it is valid to pass null.AuthorizationDeniedFault
- if the authenticated user is not allowed to search any contexts.
|
Oracle® Information Rights Management Server Java API Reference 11g Release 1 (11.1.1) E12907-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |