Commit 0d9ad1e8 authored by Francesco Chicchiricco's avatar Francesco Chicchiricco
Browse files

[CRV-17][CRV-19] Adding logic layer

parent 388dd900
......@@ -37,6 +37,7 @@ limitations under the License.
<modules>
<module>rest-api</module>
<module>rest-cxf</module>
<module>logic</module>
</modules>
</project>
......@@ -40,6 +40,12 @@ limitations under the License.
<artifactId>syncope-common-rest-api</artifactId>
<version>${syncope.version}</version>
</dependency>
<dependency>
<groupId>eu.chorevolution.idm</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
......
......@@ -15,16 +15,17 @@
*/
package org.apache.syncope.common.rest.api.service;
import eu.chorevolution.idm.common.types.ChoreographyAction;
import eu.chorevolution.idm.common.types.ServiceAction;
import java.io.InputStream;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.rest.api.type.ServiceAction;
import org.apache.syncope.common.rest.api.type.ChoreographyAction;
/**
* REST services to be invoked by - and to - the Enactment Engine.
......@@ -54,6 +55,14 @@ public interface ChoreographyService extends JAXRSService {
@Consumes({ MediaType.APPLICATION_XML })
void update(@NotNull @PathParam("id") String id, InputStream in);
/**
* This operation can be invoked when a choreography is retired.
*
* @param id choreography id
*/
@DELETE
void delete(@NotNull @PathParam("id") String id);
/**
* Performs the given action on the given choreography.
*
......
/*
* Copyright 2015 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.syncope.common.rest.api.type;
public enum ChoreographyAction {
PAUSE,
RESUME,
SHUTDOWN,
RELEASE;
}
/*
* Copyright 2015 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.syncope.common.rest.api.type;
public enum ServiceAction {
SCALE_UP,
SCALE_DOWN,
SCALE_UP_ACROSS,
SCALE_DOWN_ACROSS,
REPLACE_SERVICE;
}
......@@ -51,6 +51,11 @@ limitations under the License.
<version>${project.version}</version>
<classifier>javadoc</classifier>
</dependency>
<dependency>
<groupId>eu.chorevolution.idm.ext.ee</groupId>
<artifactId>syncope-ext-ee-logic</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
......
......@@ -15,29 +15,43 @@
*/
package org.apache.syncope.core.rest.cxf.service;
import eu.chorevolution.idm.common.types.ChoreographyAction;
import eu.chorevolution.idm.common.types.ServiceAction;
import org.apache.syncope.core.logic.ChoreographyLogic;
import java.io.InputStream;
import org.apache.syncope.common.rest.api.type.ChoreographyAction;
import org.apache.syncope.common.rest.api.service.ChoreographyService;
import org.apache.syncope.common.rest.api.type.ServiceAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ChoreographyServiceImpl extends AbstractServiceImpl implements ChoreographyService {
@Autowired
private ChoreographyLogic logic;
@Override
public void create(final String id, final InputStream in) {
logic.create(id, in);
}
@Override
public void update(final String id, final InputStream in) {
logic.update(id, in);
}
@Override
public void delete(final String id) {
logic.delete(id);
}
@Override
public void onChoreography(final String id, final ChoreographyAction action) {
// Proxy invocation to EE
}
@Override
public void onChoreographyService(final String id, final String serviceId, final ServiceAction action) {
// Proxy invocation to EE
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment