Searching for Events

The Rights Management service tracks specific actions as they occur, such as applying a policy to a document, opening a policy-protected document, and revoking access to documents. Event auditing must be enabled for the Rights Management service or events are not tracked.

Events fall into one of the following categories:

  • Administrator events are actions related to an administrator, such as creating a new administrator account.

  • Document events are actions related to a document, such as closing a policy-protected document.

  • Policy events are actions related to a policy, such as creating a new policy.

  • Service events are actions related to the Rights Management service, such as synchronizing with the user directory.

You can search for specify specific events by using the Rights Management Java API or web service API. By searching for events, you can perform tasks, such as creating a log file of certain events.

Hinweis: For more information about the Rights Management service, see Services Reference for LiveCycle.

Summary of steps

To search for a Rights Management event, perform the following steps:

  1. Include project files.

  2. Create a Rights Management Client API object.

  3. Specify the event for which to search.

  4. Search for the event.

Include project files

Include necessary files into your development project. If you are creating a client application using Java, then include the necessary JAR files. If you are using web services, then make sure that you include the proxy files.

Create a Rights Management Client API object

Before you can programmatically perform a Rights Management service operation, you must create a Rights Management service client object. If you are using the Java API, create a RightsManagementClient object. If you are using the Rights Management web service API, create a RightsManagementServiceService object.

Specify the events to search for

You must specify the event to search for. For example, you can search for the policy create event, which occurs when a new policy is created.

Search for the event

After you specify the event to search for, you can use either the Rights Management Java API or the Rights Management web service API to search for the event.

Search for events using the Java API

Search for events by using the Rights Management API (Java):

  1. Include project files

    Include client JAR files, such as adobe-rightsmanagement-client.jar, in your Java project’s class path.

  2. Create a Rights Management Client API object

    Create a RightsManagementClient object by using its constructor and passing a ServiceClientFactory object that contains connection properties.

  3. Specify the events to search for

    • Create an EventManager object by invoking the RightsManagementClient object’s getEventManager method. This method returns an EventManager object.

    • Create an EventSearchFilter object by invoking its constructor.

    • Specify the event for which to search by invoking the EventSearchFilter object’s setEventCode method and passing a static data member that belongs to the EventManager class that represents the event for which to search. For example, to search for the policy create event, pass EventManager.POLICY_CREATE_EVENT.

    Hinweis: You can define additional search criteria by invoking EventSearchFilter object methods. For example, invoke the setUserName method to specify a user associated with the event.
  4. Search for the event

    Search for the event by invoking the EventManager object’s searchForEvents method and passing the EventSearchFilter object that defines the event search criteria. This method returns an array of Event objects.

Code examples

For code examples using the Rights Management service, see the following Quick Starts in API Quick Starts (Code Examples):

  • “Quick Start (EJB mode): Searching for events using the Java API”

  • “Quick Start (SOAP): Searching for events using the Java API”

Search for events using the web service API

Search for events by using the Rights Management API (web service):

  1. Include project files

    Create a Microsoft .NET project that uses MTOM. Ensure that you use the following WSDL definition: http://localhost:8080/soap/services/RightsManagementService?WSDL&lc_version=9.0.1.

    Hinweis: Replace localhost with the IP address of the server hosting LiveCycle.
  2. Create a Rights Management Client API object

    • Create a RightsManagementServiceClient object by using its default constructor.

    • Create a RightsManagementServiceClient.Endpoint.Address object by using the System.ServiceModel.EndpointAddress constructor. Pass a string value that specifies the WSDL to the LiveCycle service (for example, http://localhost:8080/soap/services/RightsManagementService?WSDL.) You do not need to use the lc_version attribute. This attribute is used when you create a service reference.)

    • Create a System.ServiceModel.BasicHttpBinding object by getting the value of the RightsManagementServiceClient.Endpoint.Binding field. Cast the return value to BasicHttpBinding.

    • Set the System.ServiceModel.BasicHttpBinding object’s MessageEncoding field to WSMessageEncoding.Mtom. This value ensures that MTOM is used.

    • Enable basic HTTP authentication by performing the following tasks:

      • Assign the LiveCycle user name to the field RightsManagementServiceClient.ClientCredentials.UserName.UserName.

      • Assign the corresponding password value to the field RightsManagementServiceClient.ClientCredentials.UserName.Password.

      • Assign the constant value HttpClientCredentialType.Basic to the field BasicHttpBindingSecurity.Transport.ClientCredentialType.

    • Assign the constant value BasicHttpSecurityMode.TransportCredentialOnly to the field BasicHttpBindingSecurity.Security.Mode.

  3. Specify the events to search for

    • Create an EventSpec object by using its constructor.

    • Specify the start of the time period during which the event occurred by setting the EventSpec object’s firstTime.date data member with DataTime instance that represents the start of the date range when the event occurred.

    • Assign the value true to the EventSpec object’s firstTime.dateSpecified data member.

    • Specify the end of the time period during which the event occurred by setting the EventSpec object’s lastTime.date data member with DataTime instance that represents the end of the date range when the event occurred.

    • Assign the value true to the EventSpec object’s lastTime.dateSpecified data member.

    • Set the event to search for by assigning a string value to the EventSpec object’s eventCode data member. The following table lists the numeric values that you can assign to this property:

      Event type

      Value

      ALL_EVENTS

      999

      USER_CHANGE_PASSWORD_EVENT

      1000

      USER_REGISTER_EVENT

      1001

      USER_PREREGISTER_EVENT

      1002

      USER_ACTIVATE_EVENT

      1003

      USER_DEACTIVATE_EVENT

      1004

      USER_AUTHENTICATE_EVENT

      1005

      USER_AUTHENTICATE_DENY_EVENT

      1006

      USER_ACCOUNT_LOCK_EVENT

      1007

      USER_DELETE_EVENT

      1008

      USER_UPDATE_PROFILE_EVENT

      1009

      DOCUMENT_VIEW_EVENT

      2000

      DOCUMENT_PRINT_LOW_EVENT

      2001

      DOCUMENT_PRINT_HIGH_EVENT

      2002

      DOCUMENT_SIGN_EVENT

      2003

      DOCUMENT_ADD_ANNOTATION_EVENT

      2004

      DOCUMENT_FORM_FILL_EVENT

      2005

      DOCUMENT_CLOSE_EVENT

      2006

      DOCUMENT_MODIFY_EVENT

      2007

      DOCUMENT_CHANGE_SECURITY_HANDLER_EVENT

      2008

      DOCUMENT_SWITCH_POLICY_EVENT

      2009

      DOCUMENT_REVOKE_EVENT

      2010

      DOCUMENT_UNREVOKE_EVENT

      2011

      DOCUMENT_SECURE_EVENT

      2012

      DOCUMENT_UNKNOWN_CLIENT_EVENT

      2013

      DOCUMENT_CHANGE_REVOKE_URL_EVENT

      2014

      POLICY_CHANGE_EVENT

      3000

      POLICY_ENABLE_EVENT

      3001

      POLICY_DISABLE_EVENT

      3002

      POLICY_CREATE_EVENT

      3003

      POLICY_DELETE_EVENT

      3004

      POLICY_CHANGE_OWNER_EVENT

      3005

      SERVER_CLIENT_SYNC_EVENT

      4000

      SERVER_SYNC_DIR_INFO_EVENT

      4001

      SERVER_SYNC_DIR_COMPLETE_EVENT

      4002

      SERVER_VERSION_MISMATCH_EVENT

      4003

      SERVER_CONFIG_CHANGE_EVENT

      4004

      SERVER_ENABLE_OFFLINE_ACCESS_EVENT

      4005

      ADMIN_ADD_EVENT

      5000

      ADMIN_DELETE_EVENT

      5001

      ADMIN_EDIT_EVENT

      5002

      ADMIN_ACTIVATE_EVENT

      5003

      ADMIN_DEACTIVATE_EVENT

      5004

      ERROR_DIRECTORY_SERVICE_EVENT

      6000

      CREATED_POLICYSET_EVENT

      7000

      DELETED_POLICYSET_EVENT

      7001

      MODIFIED_POLICYSET_EVENT

      7002

  4. Search for the event

    Search for the event by invoking the RightsManagementServiceClient object’s searchForEvents method and passing the EventSpec object that represents the event for which to search and the maximum number of results. This method returns a MyArrayOf_xsd_anyType collection where each element is an AuditSpec instance. Using an AuditSpec instance, you can obtain information about the event such as the time that it occurred. The AuditSpec instance contains a timestamp data member that specifies this information.

Code examples

For code examples using the Rights Management service, see the following Quick Starts in API Quick Starts (Code Examples):

  • “Quick Start (MTOM): Searching for events using the web service API”

  • “Quick Start (SwaRef): Searching for events using the web service API”