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 Event
build()
Constructs a new Event object from the details in the builder.static ResourceOperationEventBuilder
fromResourceOperation(FedoraId fedoraId, ResourceOperation operation, String userAgentBaseUri)
Creates a new EventBuilder based on an ResourceOperationEventBuilder
merge(EventBuilder other)
Merges another EventBuilder into this EventBuilder.String
toString()
EventBuilder
withBaseUrl(String baseUrl)
Sets the baseUrl of the requestsEventBuilder
withResourceTypes(Set<String> resourceTypes)
Sets the resource's RDF Types on the eventEventBuilder
withUserAgent(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:EventBuilder
Merges another EventBuilder into this EventBuilder. This should be used to combine multiple events on the same resource.- Specified by:
merge
in interfaceEventBuilder
- Parameters:
other
- another EventBuilder- Returns:
- this builder
-
withResourceTypes
public EventBuilder withResourceTypes(Set<String> resourceTypes)
Description copied from interface:EventBuilder
Sets the resource's RDF Types on the event- Specified by:
withResourceTypes
in interfaceEventBuilder
- Parameters:
resourceTypes
- RDF Types- Returns:
- this builder
-
withBaseUrl
public EventBuilder withBaseUrl(String baseUrl)
Description copied from interface:EventBuilder
Sets the baseUrl of the requests- Specified by:
withBaseUrl
in interfaceEventBuilder
- Parameters:
baseUrl
- the base url- Returns:
- this builder
-
withUserAgent
public EventBuilder withUserAgent(String userAgent)
Description copied from interface:EventBuilder
Sets the user's user-agent- Specified by:
withUserAgent
in interfaceEventBuilder
- Parameters:
userAgent
- the user's user-agent- Returns:
- this builder
-
build
public Event build()
Description copied from interface:EventBuilder
Constructs a new Event object from the details in the builder.- Specified by:
build
in interfaceEventBuilder
- Returns:
- new event
-
-