Package org.fcrepo.kernel.impl.observer
Class ResourceOperationEventBuilder
- java.lang.Object
-
- org.fcrepo.kernel.impl.observer.ResourceOperationEventBuilder
-
- All Implemented Interfaces:
EventBuilder
public class ResourceOperationEventBuilder extends Object implements EventBuilder
Converts a ResourceOperation into an Event.- Author:
- pwinckles
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Eventbuild()Constructs a new Event object from the details in the builder.static ResourceOperationEventBuilderfromResourceOperation(FedoraId fedoraId, ResourceOperation operation, String userAgentBaseUri)Creates a new EventBuilder based on an ResourceOperationEventBuildermerge(EventBuilder other)Merges another EventBuilder into this EventBuilder.StringtoString()EventBuilderwithBaseUrl(String baseUrl)Sets the baseUrl of the requestsEventBuilderwithResourceTypes(Set<String> resourceTypes)Sets the resource's RDF Types on the eventEventBuilderwithUserAgent(String userAgent)Sets the user's user-agent
-
-
-
Method Detail
-
fromResourceOperation
public static ResourceOperationEventBuilder fromResourceOperation(FedoraId fedoraId, ResourceOperation operation, String userAgentBaseUri)
Creates a new EventBuilder based on an ResourceOperation- Parameters:
fedoraId- the FedoraId the operation is onoperation- the ResourceOperation to create an event foruserAgentBaseUri- the base uri of the user agent, optional- Returns:
- new builder
-
merge
public EventBuilder merge(EventBuilder other)
Description copied from interface:EventBuilderMerges another EventBuilder into this EventBuilder. This should be used to combine multiple events on the same resource.- Specified by:
mergein interfaceEventBuilder- Parameters:
other- another EventBuilder- Returns:
- this builder
-
withResourceTypes
public EventBuilder withResourceTypes(Set<String> resourceTypes)
Description copied from interface:EventBuilderSets the resource's RDF Types on the event- Specified by:
withResourceTypesin interfaceEventBuilder- Parameters:
resourceTypes- RDF Types- Returns:
- this builder
-
withBaseUrl
public EventBuilder withBaseUrl(String baseUrl)
Description copied from interface:EventBuilderSets the baseUrl of the requests- Specified by:
withBaseUrlin interfaceEventBuilder- Parameters:
baseUrl- the base url- Returns:
- this builder
-
withUserAgent
public EventBuilder withUserAgent(String userAgent)
Description copied from interface:EventBuilderSets the user's user-agent- Specified by:
withUserAgentin interfaceEventBuilder- Parameters:
userAgent- the user's user-agent- Returns:
- this builder
-
build
public Event build()
Description copied from interface:EventBuilderConstructs a new Event object from the details in the builder.- Specified by:
buildin interfaceEventBuilder- Returns:
- new event
-
-