Package org.apache.camel.component.jcr
Class JcrEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.jcr.JcrEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="1.3.0", scheme="jcr", title="JCR", syntax="jcr:host/base", alternativeSyntax="jcr:username:password@host/base", category={DATABASE,CMS}) public class JcrEndpoint extends org.apache.camel.support.DefaultEndpoint
Read and write nodes to/from a JCR compliant content repository.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JcrEndpoint(String endpointUri, JcrComponent component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Producer
createProducer()
protected void
doStart()
protected String
getBase()
Get the base node when accessing the repositoryprotected javax.jcr.Credentials
getCredentials()
Get theCredentials
for establishing the JCR repository connectionString
getEndpointConfiguredDestinationName()
Gets the destination name which was configured from the endpoint uri.int
getEventTypes()
eventTypes
(a combination of one or more event types encoded as a bit mask value such as javax.jcr.observation.Event.NODE_ADDED, javax.jcr.observation.Event.NODE_REMOVED, etc.).String
getHost()
String
getNodeTypeNames()
When a comma separatednodeTypeName
list string is set, only events whose associated parent node has one of the node types (or a subtype of one of the node types) in this list will be received.String
getPassword()
protected javax.jcr.Repository
getRepository()
Get theRepository
long
getSessionLiveCheckInterval()
Interval in milliseconds to wait before each session live checking The default value is 60000 ms.long
getSessionLiveCheckIntervalOnStart()
Interval in milliseconds to wait before the first session live checking.String
getUsername()
String
getUuids()
When a comma separated uuid list string is set, only events whose associated parent node has one of the identifiers in the comma separated uuid list will be received.String
getWorkspaceName()
The workspace to access.boolean
isDeep()
WhenisDeep
is true, events whose associated parent node is atabsPath
or within its subgraph are received.boolean
isNoLocal()
IfnoLocal
istrue
, then events generated by the session through which the listener was registered are ignored.void
setBase(String base)
void
setDeep(boolean deep)
void
setEventTypes(int eventTypes)
void
setHost(String host)
Name of theRepository
to lookup from the Camel registry to be used.void
setNodeTypeNames(String nodeTypeNames)
void
setNoLocal(boolean noLocal)
void
setPassword(String password)
Password for loginvoid
setSessionLiveCheckInterval(long sessionLiveCheckInterval)
void
setSessionLiveCheckIntervalOnStart(long sessionLiveCheckIntervalOnStart)
void
setUsername(String username)
Username for loginvoid
setUuids(String uuids)
void
setWorkspaceName(String workspaceName)
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
JcrEndpoint
protected JcrEndpoint(String endpointUri, JcrComponent component)
-
-
Method Detail
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
getHost
public String getHost()
-
setHost
public void setHost(String host)
Name of theRepository
to lookup from the Camel registry to be used.
-
getRepository
protected javax.jcr.Repository getRepository()
Get theRepository
- Returns:
- the repository
-
getCredentials
protected javax.jcr.Credentials getCredentials()
Get theCredentials
for establishing the JCR repository connection- Returns:
- the credentials
-
getBase
protected String getBase()
Get the base node when accessing the repository- Returns:
- the base node
-
setBase
public void setBase(String base)
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
Username for login
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
Password for login
-
getEventTypes
public int getEventTypes()
eventTypes
(a combination of one or more event types encoded as a bit mask value such as javax.jcr.observation.Event.NODE_ADDED, javax.jcr.observation.Event.NODE_REMOVED, etc.).- Returns:
- eventTypes
-
setEventTypes
public void setEventTypes(int eventTypes)
-
isDeep
public boolean isDeep()
WhenisDeep
is true, events whose associated parent node is atabsPath
or within its subgraph are received.- Returns:
- deep
-
setDeep
public void setDeep(boolean deep)
-
getUuids
public String getUuids()
When a comma separated uuid list string is set, only events whose associated parent node has one of the identifiers in the comma separated uuid list will be received.- Returns:
- comma separated uuid list string
-
setUuids
public void setUuids(String uuids)
-
getNodeTypeNames
public String getNodeTypeNames()
When a comma separatednodeTypeName
list string is set, only events whose associated parent node has one of the node types (or a subtype of one of the node types) in this list will be received.
-
setNodeTypeNames
public void setNodeTypeNames(String nodeTypeNames)
-
isNoLocal
public boolean isNoLocal()
IfnoLocal
istrue
, then events generated by the session through which the listener was registered are ignored. Otherwise, they are not ignored.- Returns:
- noLocal
-
setNoLocal
public void setNoLocal(boolean noLocal)
-
getSessionLiveCheckIntervalOnStart
public long getSessionLiveCheckIntervalOnStart()
Interval in milliseconds to wait before the first session live checking. The default value is 3000 ms.- Returns:
- sessionLiveCheckIntervalOnStart
-
setSessionLiveCheckIntervalOnStart
public void setSessionLiveCheckIntervalOnStart(long sessionLiveCheckIntervalOnStart)
-
getSessionLiveCheckInterval
public long getSessionLiveCheckInterval()
Interval in milliseconds to wait before each session live checking The default value is 60000 ms.
-
setSessionLiveCheckInterval
public void setSessionLiveCheckInterval(long sessionLiveCheckInterval)
-
getWorkspaceName
public String getWorkspaceName()
The workspace to access. If it's not specified then the default one will be used
-
setWorkspaceName
public void setWorkspaceName(String workspaceName)
-
getEndpointConfiguredDestinationName
public String getEndpointConfiguredDestinationName()
Gets the destination name which was configured from the endpoint uri.- Returns:
- the destination name resolved from the endpoint uri
-
-