Class MetacardIngestNetworkPlugin
java.lang.Object
org.codice.ddf.catalog.plugin.metacard.MetacardIngestNetworkPlugin
- All Implemented Interfaces:
ddf.catalog.plugin.PreAuthorizationPlugin
public class MetacardIngestNetworkPlugin
extends Object
implements ddf.catalog.plugin.PreAuthorizationPlugin
Conditional attribute adjustments for metacards based on IP, hostname, scheme, and context path.
The list of new attributes are parsed into a map whose key is the attribute name and attribute descriptor name, and value is the desired value of that attribute by the admin. If the value in the client-info map (populated by) at key "criteria key" is equal to the "expected value", then the plugin will attempt to add the list of new attributes to the metacards in the given request.
Any attribute already set on the metacards cannot be changed. Currently there is no support for appending new values within a multi-valued attribute onto an already existing one. As long as an attribute is not null, it cannot be overwritten.
See MetacardCondition for details on its immutability and volatility.
-
Constructor Summary
ConstructorsConstructorDescriptionMetacardIngestNetworkPlugin(KeyValueParser keyValueParser, MetacardServices metacardServices, AttributeFactory attributeFactory, MetacardCondition metacardCondition) Constructor requires all dependencies. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Method required by the component-managed strategy.voidinit()Method required by the component-managed strategy.ddf.catalog.operation.DeleteResponseprocessPostDelete(ddf.catalog.operation.DeleteResponse input) ddf.catalog.operation.QueryResponseprocessPostQuery(ddf.catalog.operation.QueryResponse input) ddf.catalog.operation.ResourceResponseprocessPostResource(ddf.catalog.operation.ResourceResponse input, ddf.catalog.data.Metacard metacard) ddf.catalog.operation.CreateRequestprocessPreCreate(ddf.catalog.operation.CreateRequest input) ddf.catalog.operation.DeleteRequestprocessPreDelete(ddf.catalog.operation.DeleteRequest input) ddf.catalog.operation.QueryRequestprocessPreQuery(ddf.catalog.operation.QueryRequest input) ddf.catalog.operation.ResourceRequestprocessPreResource(ddf.catalog.operation.ResourceRequest input) ddf.catalog.operation.UpdateRequestprocessPreUpdate(ddf.catalog.operation.UpdateRequest input, Map<String, ddf.catalog.data.Metacard> existingMetacards) voidsetCriteriaKey(String criteriaKey) voidsetExpectedValue(String expectedValue) voidsetNewAttributes(List<String> newAttributes) voidupdateCondition(Map<String, Object> properties) Atomically update the condition so that ingest rules are not evaluated based on an invalid rule.
-
Constructor Details
-
MetacardIngestNetworkPlugin
public MetacardIngestNetworkPlugin(KeyValueParser keyValueParser, MetacardServices metacardServices, AttributeFactory attributeFactory, MetacardCondition metacardCondition) Constructor requires all dependencies.
-
-
Method Details
-
getCriteriaKey
-
getExpectedValue
-
getNewAttributes
-
setCriteriaKey
-
setExpectedValue
-
setNewAttributes
-
init
public void init()Method required by the component-managed strategy. Performs set-up based on initial values passed to the service. -
destroy
public void destroy()Method required by the component-managed strategy. -
updateCondition
Atomically update the condition so that ingest rules are not evaluated based on an invalid rule. -
processPreCreate
public ddf.catalog.operation.CreateRequest processPreCreate(ddf.catalog.operation.CreateRequest input) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPreCreatein interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPreUpdate
public ddf.catalog.operation.UpdateRequest processPreUpdate(ddf.catalog.operation.UpdateRequest input, Map<String, ddf.catalog.data.Metacard> existingMetacards) throws ddf.catalog.plugin.StopProcessingException- Specified by:
processPreUpdatein interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPreDelete
public ddf.catalog.operation.DeleteRequest processPreDelete(ddf.catalog.operation.DeleteRequest input) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPreDeletein interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPostDelete
public ddf.catalog.operation.DeleteResponse processPostDelete(ddf.catalog.operation.DeleteResponse input) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPostDeletein interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPreQuery
public ddf.catalog.operation.QueryRequest processPreQuery(ddf.catalog.operation.QueryRequest input) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPreQueryin interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPostQuery
public ddf.catalog.operation.QueryResponse processPostQuery(ddf.catalog.operation.QueryResponse input) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPostQueryin interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPreResource
public ddf.catalog.operation.ResourceRequest processPreResource(ddf.catalog.operation.ResourceRequest input) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPreResourcein interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-
processPostResource
public ddf.catalog.operation.ResourceResponse processPostResource(ddf.catalog.operation.ResourceResponse input, ddf.catalog.data.Metacard metacard) throws ddf.catalog.plugin.StopProcessingException - Specified by:
processPostResourcein interfaceddf.catalog.plugin.PreAuthorizationPlugin- Throws:
ddf.catalog.plugin.StopProcessingException
-