Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fabio martelli
syncope
Commits
2389571c
Commit
2389571c
authored
Dec 10, 2015
by
Francesco Chicchiricco
Browse files
[CRV-17][CRV-19] Adding logic layer
parent
0d9ad1e8
Changes
6
Hide whitespace changes
Inline
Side-by-side
common/src/main/java/eu/chorevolution/idm/common/ChorevolutionEntitlement.java
0 → 100644
View file @
2389571c
/*
* 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
eu.chorevolution.idm.common
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.util.Collections
;
import
java.util.Set
;
import
java.util.TreeSet
;
public
final
class
ChorevolutionEntitlement
{
public
static
final
String
CHOREOGRAPHY_CREATE
=
"CHOREOGRAPHY_CREATE"
;
public
static
final
String
CHOREOGRAPHY_UPDATE
=
"CHOREOGRAPHY_UPDATE"
;
public
static
final
String
CHOREOGRAPHY_DELETE
=
"CHOREOGRAPHY_DELETE"
;
private
static
final
Set
<
String
>
VALUES
;
static
{
Set
<
String
>
values
=
new
TreeSet
<>();
for
(
Field
field
:
ChorevolutionEntitlement
.
class
.
getDeclaredFields
())
{
if
(
Modifier
.
isStatic
(
field
.
getModifiers
())
&&
String
.
class
.
equals
(
field
.
getType
()))
{
values
.
add
(
field
.
getName
());
}
}
VALUES
=
Collections
.
unmodifiableSet
(
values
);
}
public
static
Set
<
String
>
values
()
{
return
VALUES
;
}
private
ChorevolutionEntitlement
()
{
// private constructor for static utility class
}
}
common/src/main/java/eu/chorevolution/idm/common/types/ChoreographyAction.java
0 → 100644
View file @
2389571c
/*
* 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
eu.chorevolution.idm.common.types
;
public
enum
ChoreographyAction
{
PAUSE
,
RESUME
,
SHUTDOWN
,
RELEASE
;
}
common/src/main/java/eu/chorevolution/idm/common/types/ServiceAction.java
0 → 100644
View file @
2389571c
/*
* 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
eu.chorevolution.idm.common.types
;
public
enum
ServiceAction
{
SCALE_UP
,
SCALE_DOWN
,
SCALE_UP_ACROSS
,
SCALE_DOWN_ACROSS
,
REPLACE_SERVICE
;
}
ext/ee/logic/pom.xml
0 → 100644
View file @
2389571c
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
eu.chorevolution.idm.ext
</groupId>
<artifactId>
syncope-ext-ee
</artifactId>
<version>
0.1-SNAPSHOT
</version>
</parent>
<name>
CHOReVOLUTION IdM Extensions: EE Logic
</name>
<description>
CHOReVOLUTION IdM Extensions: EE Logic
</description>
<groupId>
eu.chorevolution.idm.ext.ee
</groupId>
<artifactId>
syncope-ext-ee-logic
</artifactId>
<packaging>
jar
</packaging>
<properties>
<rootpom.basedir>
${basedir}/../../..
</rootpom.basedir>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.syncope.core
</groupId>
<artifactId>
syncope-core-logic
</artifactId>
<version>
${syncope.version}
</version>
</dependency>
<dependency>
<groupId>
eu.chorevolution.idm
</groupId>
<artifactId>
common
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
ext/ee/logic/src/main/java/org/apache/syncope/core/logic/ChoreographyLogic.java
0 → 100644
View file @
2389571c
/*
* 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.core.logic
;
import
eu.chorevolution.idm.common.ChorevolutionEntitlement
;
import
java.io.InputStream
;
import
java.lang.reflect.Method
;
import
org.apache.syncope.common.lib.AbstractBaseBean
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ChoreographyLogic
extends
AbstractTransactionalLogic
<
AbstractBaseBean
>
{
@PreAuthorize
(
"hasRole('"
+
ChorevolutionEntitlement
.
CHOREOGRAPHY_CREATE
+
"')"
)
public
void
create
(
final
String
id
,
final
InputStream
in
)
{
}
@PreAuthorize
(
"hasRole('"
+
ChorevolutionEntitlement
.
CHOREOGRAPHY_UPDATE
+
"')"
)
public
void
update
(
final
String
id
,
final
InputStream
in
)
{
}
@PreAuthorize
(
"hasRole('"
+
ChorevolutionEntitlement
.
CHOREOGRAPHY_DELETE
+
"')"
)
public
void
delete
(
final
String
id
)
{
}
@Override
protected
AbstractBaseBean
resolveReference
(
final
Method
method
,
final
Object
...
args
)
throws
UnresolvedReferenceException
{
throw
new
UnresolvedReferenceException
();
}
}
ext/ee/logic/src/main/java/org/apache/syncope/core/logic/init/ChoreographyLoader.java
0 → 100644
View file @
2389571c
/*
* 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.core.logic.init
;
import
eu.chorevolution.idm.common.ChorevolutionEntitlement
;
import
org.apache.syncope.core.misc.EntitlementsHolder
;
import
org.apache.syncope.core.persistence.api.SyncopeLoader
;
public
class
ChoreographyLoader
implements
SyncopeLoader
{
@Override
public
Integer
getPriority
()
{
return
1100
;
}
@Override
public
void
load
()
{
EntitlementsHolder
.
getInstance
().
init
(
ChorevolutionEntitlement
.
values
());
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment