mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ACE-2173 : EOL RMI Services Attempt 2
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@86135 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -149,16 +149,10 @@
|
||||
alfresco.rmi.services.host=0.0.0.0
|
||||
|
||||
#
|
||||
# RMI service ports for the individual services.
|
||||
# These seven services are available remotely.
|
||||
#
|
||||
# Assign individual ports for each service for best performance
|
||||
# or run several services on the same port. You can even run everything on 50500 if needed.
|
||||
#
|
||||
# Select 0 to use a random unused port.
|
||||
#
|
||||
#attribute.rmi.service.port=50503
|
||||
#authentication.rmi.service.port=50504
|
||||
#repo.rmi.service.port=50505
|
||||
#action.rmi.service.port=50506
|
||||
#monitor.rmi.service.port=50508
|
@@ -12,6 +12,7 @@
|
||||
<import resource="classpath:alfresco/st-context.xml"/>
|
||||
<import resource="classpath*:alfresco/extension/mt/mt-context.xml"/>
|
||||
<import resource="classpath:alfresco/encryption-context.xml" />
|
||||
<import resource="classpath*:alfresco/enterprise/jmx/jmx-context.xml" />
|
||||
<import resource="classpath:alfresco/core-services-context.xml" />
|
||||
<import resource="classpath:alfresco/copy-services-context.xml" />
|
||||
<import resource="classpath:alfresco/public-services-context.xml" />
|
||||
|
@@ -5,7 +5,6 @@
|
||||
<beans>
|
||||
<import resource="classpath:alfresco/bulk-import-context.xml" />
|
||||
<import resource="classpath:alfresco/scheduled-jobs-context.xml" />
|
||||
<import resource="classpath:alfresco/remote-services-context.xml"/>
|
||||
<import resource="classpath*:alfresco/office-addin-context.xml"/>
|
||||
<import resource="classpath:alfresco/blog-context.xml"/>
|
||||
<import resource="classpath:alfresco/calendar-services-context.xml"/>
|
||||
|
@@ -4,17 +4,7 @@
|
||||
<!-- Core and miscellaneous bean definitions -->
|
||||
<beans>
|
||||
|
||||
<bean id="hostConfigurableSocketFactory" class="org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory">
|
||||
<property name="host" value="${alfresco.rmi.services.host}" />
|
||||
<property name="retryInterval" value="${alfresco.rmi.services.retryInterval}" />
|
||||
<property name="retries" value="${alfresco.rmi.services.retries}" />
|
||||
</bean>
|
||||
|
||||
<bean id="baseServiceExporter" class="org.alfresco.util.remote.server.AlfrescoRMIServiceExporter" abstract="true">
|
||||
<property name="registryPort" value="${alfresco.rmi.services.port}" />
|
||||
<property name="registryServerSocketFactory" ref="hostConfigurableSocketFactory" />
|
||||
<property name="registryClientSocketFactory" ref="hostConfigurableSocketFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- -->
|
||||
<!-- PERSISTENCE -->
|
||||
@@ -114,21 +104,6 @@
|
||||
<!-- "repository-properties" in a dev-context.xml -->
|
||||
<!-- or custom-db-and-data-context.xml file. -->
|
||||
|
||||
<bean id="shared-properties"
|
||||
parent="common-placeholder-configurer" class="org.alfresco.config.JndiPropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:alfresco/alfresco-shared.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="order">
|
||||
<value>10</value>
|
||||
</property>
|
||||
<property name="searchSystemEnvironment">
|
||||
<value>false</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Custom MBeanServer -->
|
||||
<bean id="alfrescoMBeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
|
||||
<property name="locateExistingServerIfPossible" value="${mbean.server.locateExistingServerIfPossible}" />
|
||||
@@ -141,47 +116,7 @@
|
||||
<bean id="managedResource" class="org.alfresco.repo.management.DummyManagedResource">
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
The local in process RMI registry which will be bound to the address in
|
||||
java.rmi.server.hostname
|
||||
-->
|
||||
|
||||
<bean id="registry"
|
||||
class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"
|
||||
lazy-init="true">
|
||||
<property name="port" value="${alfresco.rmi.services.port}"/>
|
||||
<property name="clientSocketFactory" ref="hostConfigurableSocketFactory" />
|
||||
<property name="serverSocketFactory" ref="hostConfigurableSocketFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- MBeanServer Connector (registers itself with custom alfrescoMBeanServer) -->
|
||||
<bean id="jmxUrl" factory-bean="sysAdminParams" factory-method="subsituteHost">
|
||||
<constructor-arg value="service:jmx:rmi://${alfresco.rmi.services.external.host}:${monitor.rmi.service.port}/jndi/rmi://${alfresco.rmi.services.host}:${alfresco.rmi.services.port}/alfresco/jmxrmi" />
|
||||
</bean>
|
||||
|
||||
<bean id="serverConnector"
|
||||
class="org.alfresco.mbeans.ConnectorServerFactory"
|
||||
depends-on="registry">
|
||||
|
||||
<property name="server" ref="alfrescoMBeanServer"/>
|
||||
<property name="objectName" value="connector:name=rmi"/>
|
||||
<property name="serviceUrl" ref="jmxUrl" />
|
||||
<property name="enabled" value="${alfresco.jmx.connector.enabled}" />
|
||||
|
||||
<property name="environment">
|
||||
<map>
|
||||
<!-- The following keys are only valid when sun jmx is used -->
|
||||
<entry key="jmx.remote.x.password.file" value="${alfresco.jmx.dir}/alfresco-jmxrmi.password"/>
|
||||
<entry key="jmx.remote.x.access.file" value="${alfresco.jmx.dir}/alfresco-jmxrmi.access"/>
|
||||
<entry>
|
||||
<key>
|
||||
<value>jmx.remote.rmi.server.socket.factory</value>
|
||||
</key>
|
||||
<ref bean="hostConfigurableSocketFactory" />
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="propertyBackedBeanRegistry" class="org.alfresco.repo.management.subsystems.DefaultPropertyBackedBeanRegistry"/>
|
||||
|
||||
|
@@ -1,31 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="remoteEmailServiceProperties"
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="ignoreUnresolvablePlaceholders">
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:alfresco/remote-email-service-test.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="searchSystemEnvironment">
|
||||
<value>false</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Remote email-service. -->
|
||||
<bean id="emailService" class="org.alfresco.email.server.EmailServiceRemotable">
|
||||
<property name="rmiRegistryHost">
|
||||
<value>${email.service.rmi.registry.host}</value>
|
||||
</property>
|
||||
<property name="rmiRegistryPort">
|
||||
<value>${email.service.rmi.registry.port}</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -1,133 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN"
|
||||
"http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<!-- The AuthenticationService exported as an RMI service. -->
|
||||
<bean id="rmiAuthenticationService" class="org.alfresco.util.remote.server.AlfrescoRMIServiceExporter" parent="baseServiceExporter">
|
||||
<property name="service">
|
||||
<ref bean="AuthenticationService"/>
|
||||
</property>
|
||||
<property name="serviceInterface">
|
||||
<value>org.alfresco.service.cmr.security.AuthenticationService</value>
|
||||
</property>
|
||||
<property name="serviceName">
|
||||
<value>authentication</value>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<value>${authentication.rmi.service.enabled}</value>
|
||||
</property>
|
||||
<property name="servicePort">
|
||||
<value>${authentication.rmi.service.port}</value>
|
||||
</property>
|
||||
<property name="clientSocketFactory">
|
||||
<ref bean="hostConfigurableSocketFactory" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- A Simple Filesystem like API for the repo implementation.
|
||||
Unfinished, experimental, and probably ephemeral. -->
|
||||
<bean id="repoRemoteService" class="org.alfresco.repo.remote.RepoRemoteService">
|
||||
<property name="nodeService">
|
||||
<ref bean="mtAwareNodeService"/>
|
||||
</property>
|
||||
<property name="fileFolderService">
|
||||
<ref bean="fileFolderService"/>
|
||||
</property>
|
||||
<property name="contentService">
|
||||
<ref bean="contentService"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Transactionally wrapped version of above. -->
|
||||
<bean id="RepoRemoteService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
|
||||
<property name="proxyInterfaces">
|
||||
<value>org.alfresco.service.cmr.remote.RepoRemote</value>
|
||||
</property>
|
||||
<property name="target">
|
||||
<ref bean="repoRemoteService"/>
|
||||
</property>
|
||||
<property name="transactionManager">
|
||||
<ref bean="transactionManager"/>
|
||||
</property>
|
||||
<property name="transactionAttributes">
|
||||
<props>
|
||||
<prop key="create*">${server.transaction.mode.default}</prop>
|
||||
<prop key="get*">${server.transaction.mode.readOnly}</prop>
|
||||
<prop key="lookup">${server.transaction.mode.readOnly}</prop>
|
||||
<prop key="read*">${server.transaction.mode.readOnly}</prop>
|
||||
<prop key="remove*">${server.transaction.mode.default}</prop>
|
||||
<prop key="rename">${server.transaction.mode.default}</prop>
|
||||
<prop key="write*">${server.transaction.mode.default}</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- The server side repo remote transport, to be exported via RMI, etc. -->
|
||||
<bean id="repoRemoteTransport" class="org.alfresco.repo.remote.RepoRemoteTransportService">
|
||||
<property name="authenticationService">
|
||||
<ref bean="AuthenticationService"/>
|
||||
</property>
|
||||
<property name="repoRemote">
|
||||
<ref bean="RepoRemoteService"/>
|
||||
</property>
|
||||
<property name="idleTimeout">
|
||||
<value>30000</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- The RMI export of the repo remote transport. -->
|
||||
<bean id="repoRemoteTransportRMI" class="org.alfresco.util.remote.server.AlfrescoRMIServiceExporter" parent="baseServiceExporter">
|
||||
<property name="service">
|
||||
<ref bean="repoRemoteTransport"/>
|
||||
</property>
|
||||
<property name="serviceInterface">
|
||||
<value>org.alfresco.service.cmr.remote.RepoRemoteTransport</value>
|
||||
</property>
|
||||
<property name="serviceName">
|
||||
<value>repo</value>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<value>${repo.rmi.service.enabled}</value>
|
||||
</property>
|
||||
<property name="servicePort">
|
||||
<value>${repo.rmi.service.port}</value>
|
||||
</property>
|
||||
<property name="clientSocketFactory">
|
||||
<ref bean="hostConfigurableSocketFactory" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Remoting the ActionService -->
|
||||
<bean id="actionServiceTransport" class="org.alfresco.repo.action.ActionServiceTransportImpl">
|
||||
<property name="actionService">
|
||||
<ref bean="ActionService"/>
|
||||
</property>
|
||||
<property name="authenticationService">
|
||||
<ref bean="AuthenticationService"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- The RMI export of the ActionService Transport -->
|
||||
<bean id="actionServiceTransportRMI" class="org.alfresco.util.remote.server.AlfrescoRMIServiceExporter" parent="baseServiceExporter">
|
||||
<property name="service">
|
||||
<ref bean="actionServiceTransport"/>
|
||||
</property>
|
||||
<property name="serviceInterface">
|
||||
<value>org.alfresco.service.cmr.action.ActionServiceTransport</value>
|
||||
</property>
|
||||
<property name="serviceName">
|
||||
<value>action</value>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<value>${action.rmi.service.enabled}</value>
|
||||
</property>
|
||||
<property name="servicePort">
|
||||
<value>${action.rmi.service.port}</value>
|
||||
</property>
|
||||
<property name="clientSocketFactory">
|
||||
<ref bean="hostConfigurableSocketFactory" />
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
@@ -584,14 +584,11 @@ home.folder.creation.disabled=false
|
||||
# for some clients such as Mac OS X Finder
|
||||
policy.content.update.ignoreEmpty=true
|
||||
|
||||
# The well known RMI registry port and external host name published in the stubs
|
||||
# is defined in the alfresco-shared.properties file
|
||||
#
|
||||
# alfresco.rmi.services.port=50500
|
||||
|
||||
# Default value of alfresco.rmi.services.host is 0.0.0.0 which means 'listen on all adapters'.
|
||||
# This allows connections to JMX both remotely and locally.
|
||||
#
|
||||
alfresco.rmi.services.port=50500
|
||||
alfresco.rmi.services.external.host=localhost
|
||||
alfresco.rmi.services.host=0.0.0.0
|
||||
|
||||
# If the RMI address is in-use, how many retries should be done before aborting
|
||||
@@ -609,17 +606,11 @@ alfresco.rmi.services.retryInterval=250
|
||||
#
|
||||
# Specify 0 to use a random unused port.
|
||||
#
|
||||
authentication.rmi.service.port=50504
|
||||
repo.rmi.service.port=50505
|
||||
action.rmi.service.port=50506
|
||||
monitor.rmi.service.port=50508
|
||||
|
||||
#
|
||||
# enable or disable individual RMI services
|
||||
#
|
||||
authentication.rmi.service.enabled=true
|
||||
repo.rmi.service.enabled=true
|
||||
action.rmi.service.enabled=true
|
||||
monitor.rmi.service.enabled=true
|
||||
|
||||
|
||||
|
@@ -53,19 +53,6 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean class="org.springframework.remoting.rmi.RmiServiceExporter" parent="baseServiceExporter">
|
||||
<property name="service">
|
||||
<ref bean="emailService"/>
|
||||
</property>
|
||||
<property name="serviceInterface">
|
||||
<value>org.alfresco.service.cmr.email.EmailService</value>
|
||||
</property>
|
||||
<property name="serviceName">
|
||||
<value>EmailService</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<alias name="emailService" alias="EmailService"/>
|
||||
|
||||
<bean id="emailService" class="org.alfresco.email.server.EmailServiceImpl"
|
||||
|
@@ -1,265 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.repo.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionCondition;
|
||||
import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.action.ActionServiceTransport;
|
||||
import org.alfresco.service.cmr.action.CompositeAction;
|
||||
import org.alfresco.service.cmr.action.ParameterConstraint;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
|
||||
/**
|
||||
* Server side implementation for transport of ActionService.
|
||||
* @author britt
|
||||
*/
|
||||
public class ActionServiceTransportImpl implements ActionServiceTransport
|
||||
{
|
||||
private ActionService fActionService;
|
||||
|
||||
private AuthenticationService fAuthenticationService;
|
||||
|
||||
public void setActionService(ActionService service)
|
||||
{
|
||||
fActionService = service;
|
||||
}
|
||||
|
||||
public void setAuthenticationService(AuthenticationService service)
|
||||
{
|
||||
fAuthenticationService = service;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createAction(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public Action createAction(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createAction(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createAction(java.lang.String, java.lang.String, java.util.Map)
|
||||
*/
|
||||
public Action createAction(String ticket, String name,
|
||||
Map<String, Serializable> params)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createAction(name, params);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createActionCondition(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ActionCondition createActionCondition(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createActionCondition(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createActionCondition(java.lang.String, java.lang.String, java.util.Map)
|
||||
*/
|
||||
public ActionCondition createActionCondition(String ticket, String name,
|
||||
Map<String, Serializable> params)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createActionCondition(name, params);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createCompositeAction(java.lang.String)
|
||||
*/
|
||||
public CompositeAction createCompositeAction(String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createCompositeAction();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#evaluateAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public boolean evaluateAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.evaluateAction(action, actionedUponNodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#evaluateActionCondition(java.lang.String, org.alfresco.service.cmr.action.ActionCondition, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public boolean evaluateActionCondition(String ticket,
|
||||
ActionCondition condition, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.evaluateActionCondition(condition, actionedUponNodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#executeAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public void executeAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.executeAction(action, actionedUponNodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#executeAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
*/
|
||||
public void executeAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef, boolean checkConditions)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.executeAction(action, actionedUponNodeRef, checkConditions);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#executeAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef, boolean, boolean)
|
||||
*/
|
||||
public void executeAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef, boolean checkConditions,
|
||||
boolean executeAsynchronously)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.executeAction(action, actionedUponNodeRef, checkConditions, executeAsynchronously);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getAction(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
|
||||
*/
|
||||
public Action getAction(String ticket, NodeRef nodeRef, String actionId)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getAction(nodeRef, actionId);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionConditionDefinition(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ActionConditionDefinition getActionConditionDefinition(
|
||||
String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionConditionDefinition(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionConditionDefinitions(java.lang.String)
|
||||
*/
|
||||
public List<ActionConditionDefinition> getActionConditionDefinitions(
|
||||
String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionConditionDefinitions();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionDefinition(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ActionDefinition getActionDefinition(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionDefinition(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionDefinitions(java.lang.String)
|
||||
*/
|
||||
public List<ActionDefinition> getActionDefinitions(String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionDefinitions();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionDefinitions(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public List<ActionDefinition> getActionDefinitions(String ticket,
|
||||
NodeRef nodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionDefinitions(nodeRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getParameterConstraint(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ParameterConstraint getParameterConstraint(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getParameterConstraint(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getParameterConstraints(java.lang.String)
|
||||
*/
|
||||
public List<ParameterConstraint> getParameterConstraints(String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getParameterConstraints();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActions(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public List<Action> getActions(String ticket, NodeRef nodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActions(nodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#removeAction(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.action.Action)
|
||||
*/
|
||||
public void removeAction(String ticket, NodeRef nodeRef, Action action)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.removeAction(nodeRef, action);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#removeAllActions(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public void removeAllActions(String ticket, NodeRef nodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.removeAllActions(nodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#saveAction(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.action.Action)
|
||||
*/
|
||||
public void saveAction(String ticket, NodeRef nodeRef, Action action)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.saveAction(nodeRef, action);
|
||||
}
|
||||
}
|
@@ -1,240 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.service.cmr.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* This is the interface for over the transport of ActionService.
|
||||
* It's job is to tunnel an authentication token for each call.
|
||||
* @author britt
|
||||
*/
|
||||
public interface ActionServiceTransport
|
||||
{
|
||||
/**
|
||||
* Get a named action definition
|
||||
*
|
||||
* @param name the name of the action definition
|
||||
* @return the action definition
|
||||
*/
|
||||
ActionDefinition getActionDefinition(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Get all the action definitions
|
||||
*
|
||||
* @return the list action definitions
|
||||
*/
|
||||
List<ActionDefinition> getActionDefinitions(String ticket);
|
||||
|
||||
/**
|
||||
* Get all the action definitions that are applicable for the given node, based on
|
||||
* its type and aspects.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @return a list of applicable action definitions
|
||||
*/
|
||||
List<ActionDefinition> getActionDefinitions(String ticket, NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Get a named action condition definition
|
||||
*
|
||||
* @param name the name of the action condition definition
|
||||
* @return the action condition definition
|
||||
*/
|
||||
ActionConditionDefinition getActionConditionDefinition(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Get all the action condition definitions
|
||||
*
|
||||
* @return the list of action condition definitions
|
||||
*/
|
||||
List<ActionConditionDefinition> getActionConditionDefinitions(String ticket);
|
||||
|
||||
/**
|
||||
* Get a named parameter constraint
|
||||
*
|
||||
* @param name the name of the parameter constraint
|
||||
* @return this parameter condition
|
||||
*/
|
||||
ParameterConstraint getParameterConstraint(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Get all the parameter constraints
|
||||
*
|
||||
* @return the list of all parameter constraints
|
||||
*/
|
||||
List<ParameterConstraint> getParameterConstraints(String ticket);
|
||||
|
||||
/**
|
||||
* Create a new action
|
||||
*
|
||||
* @param name the action definition name
|
||||
* @return the action
|
||||
*/
|
||||
Action createAction(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Create a new action specifying the initial set of parameter values
|
||||
*
|
||||
* @param name the action definition name
|
||||
* @param params the parameter values
|
||||
* @return the action
|
||||
*/
|
||||
Action createAction(String ticket, String name, Map<String, Serializable> params);
|
||||
|
||||
/**
|
||||
* Create a composite action
|
||||
*
|
||||
* @return the composite action
|
||||
*/
|
||||
CompositeAction createCompositeAction(String ticket);
|
||||
|
||||
/**
|
||||
* Create an action condition
|
||||
*
|
||||
* @param name the action condition definition name
|
||||
* @return the action condition
|
||||
*/
|
||||
ActionCondition createActionCondition(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Create an action condition specifying the initial set of parameter values
|
||||
*
|
||||
* @param name the action condition definition name
|
||||
* @param params the parameter values
|
||||
* @return the action condition
|
||||
*/
|
||||
ActionCondition createActionCondition(String ticket, String name, Map<String, Serializable> params);
|
||||
|
||||
/**
|
||||
* The actions conditions are always checked.
|
||||
*
|
||||
* @see ActionService#executeAction(Action, NodeRef, boolean)
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
*/
|
||||
void executeAction(String ticket, Action action, NodeRef actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* The action is executed based on the asynchronous attribute of the action.
|
||||
*
|
||||
* @see ActionService#executeAction(Action, NodeRef, boolean, boolean)
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @param checkConditions indicates whether the conditions should be checked
|
||||
*/
|
||||
void executeAction(String ticket, Action action, NodeRef actionedUponNodeRef, boolean checkConditions);
|
||||
|
||||
/**
|
||||
* Executes the specified action upon the node reference provided.
|
||||
* <p>
|
||||
* If specified that the conditions should be checked then any conditions
|
||||
* set on the action are evaluated.
|
||||
* <p>
|
||||
* If the conditions fail then the action is not executed.
|
||||
* <p>
|
||||
* If an action has no conditions then the action will always be executed.
|
||||
* <p>
|
||||
* If the conditions are not checked then the action will always be executed.
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @param checkConditions indicates whether the conditions should be checked before
|
||||
* executing the action
|
||||
* @param executeAsynchronously indicates whether the action should be executed asychronously or not, this value overrides
|
||||
* the value set on the action its self
|
||||
*/
|
||||
void executeAction(String ticket, Action action, NodeRef actionedUponNodeRef, boolean checkConditions, boolean executeAsynchronously);
|
||||
|
||||
/**
|
||||
* Evaluted the conditions set on an action.
|
||||
* <p>
|
||||
* Returns true if the action has no conditions.
|
||||
* <p>
|
||||
* If the action has more than one condition their results are combined using the 'AND'
|
||||
* logical operator.
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @return true if the condition succeeds, false otherwise
|
||||
*/
|
||||
boolean evaluateAction(String ticket, Action action, NodeRef actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* Evaluate an action condition.
|
||||
*
|
||||
* @param condition the action condition
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @return true if the condition succeeds, false otherwise
|
||||
*/
|
||||
boolean evaluateActionCondition(String ticket, ActionCondition condition, NodeRef actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* Save an action against a node reference.
|
||||
* <p>
|
||||
* The node will be made configurable if it is not already.
|
||||
* <p>
|
||||
* If the action already exists then its details will be updated.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @param action the action
|
||||
*/
|
||||
void saveAction(String ticket, NodeRef nodeRef, Action action);
|
||||
|
||||
/**
|
||||
* Gets all the actions currently saved on the given node reference.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @return the list of actions
|
||||
*/
|
||||
List<Action> getActions(String ticket, NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Gets an action stored against a given node reference.
|
||||
* <p>
|
||||
* Returns null if the action can not be found.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @param actionId the action id
|
||||
* @return the action
|
||||
*/
|
||||
Action getAction(String ticket, NodeRef nodeRef, String actionId);
|
||||
|
||||
/**
|
||||
* Removes an action associated with a node reference.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @param action the action
|
||||
*/
|
||||
void removeAction(String ticket, NodeRef nodeRef, Action action);
|
||||
|
||||
/**
|
||||
* Removes all actions associated with a node reference
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
*/
|
||||
void removeAllActions(String ticket, NodeRef nodeRef);
|
||||
}
|
Reference in New Issue
Block a user