svn commit: r1708733 - in /syncope/site/2.0.0-SNAPSHOT/docs: getting-started.html getting-started.pdf reference-guide.html reference-guide.pdf
Author: ilgrosso Date: Thu Oct 15 06:47:44 2015 New Revision: 1708733 URL: http://svn.apache.org/viewvc?rev=1708733&view=rev Log: [SYNCOPE-700] Publish updates after first grammar fixes by Colm in http://git-wip-us.apache.org/repos/asf/syncope/commit/ae88f405 Modified: syncope/site/2.0.0-SNAPSHOT/docs/getting-started.html syncope/site/2.0.0-SNAPSHOT/docs/getting-started.pdf syncope/site/2.0.0-SNAPSHOT/docs/reference-guide.html syncope/site/2.0.0-SNAPSHOT/docs/reference-guide.pdf Modified: syncope/site/2.0.0-SNAPSHOT/docs/getting-started.html URL: http://svn.apache.org/viewvc/syncope/site/2.0.0-SNAPSHOT/docs/getting-started.html?rev=1708733&r1=1708732&r2=1708733&view=diff == --- syncope/site/2.0.0-SNAPSHOT/docs/getting-started.html (original) +++ syncope/site/2.0.0-SNAPSHOT/docs/getting-started.html Thu Oct 15 06:47:44 2015 @@ -426,8 +426,8 @@ body.book #toc,body.book #preamble,body. 1. Introduction -1.1. What is this Identity Management, anyway? -1.2. Bird’s eye view on Architecture +1.1. What is Identity Management, anyway? +1.2. A bird’s eye view on the Architecture of Apache Syncope 2. System Requirements @@ -511,25 +511,25 @@ compliance. Apache Syncope is an Open Source system for managing digital identities in enterprise environments, implemented in -Java EE technology and released under Apache 2.0 license. +Java EE technology and released under the Apache 2.0 license. -Identity management (or IdM) represents the joint result of business process and IT to manage user data on systems and -applications. IdM involves considering user attributes, roles, resources and entitlements in trying to give a decent -answer to the question bumping up every time in an IT administrator’s mind: +Identity Management (or IdM) means to manage user data on systems and applications, using the combination of +business processes and IT. IdM involves considering user attributes, roles, resources and entitlements in trying to answer the +following thorny question: Who has access to What, When, How, and Why? -1.1. What is this Identity Management, anyway? +1.1. What is Identity Management, anyway? Account -Computers work with records of data about persons. Such records contains technical information needed by the system for +Computers work with records of data about people. Such records contain technical information needed by the system for which the account is created and managed. (Digital) Identity @@ -541,17 +541,17 @@ which the account is created and managed -Have you ever been hired by a company, entered an organization or just subscribed a new Google account? +Have you ever been hired by a company, entered an organization or just created a new Google account? Companies, organizations and cloud entities work with applications that need your data to function properly: username, password, e-mail, first name, surname, and more. -Who is going to feed such information? And what happens when you need to be enabled for more applications? And what if +Where is this information going to come from? And what happens when you need to be enabled for more applications? And what if you get promoted and acquire more rights on the applications you already had access to? Most important, what happens when you quit or they gently let you go? -Shortly, Identity Management takes care of managing identity data throughout what is called the Identity Lifecycle. +In brief, Identity Management takes care of managing identity data throughout what is called the Identity Lifecycle. @@ -564,46 +564,46 @@ Most important, what happens when you qu Users, groups and any objects With Apache Syncope 2.0.0, the managed identities are not limited anymore to users and groups. New object types can be -defined so that any object’s data can be managed through Syncope: workstations, printers, folders, sensors, services, -and so on. This positions Apache Syncope at best places for bringing Identity Management in the IoT world. +defined so that any objects data can be managed through Syncope: workstations, printers, folders, sensors, services, +and so on. This positions Apache Syncope at the forefront for bringing Identity Management in the IoT world. -1.2. Bird’s eye view on Architecture - +1.2. A bird’s eye view on the Architecture of Apache Syncope + + + Core is the central component, providing all services offered by Apache Syncope. -It exposes a full-compliant https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services"; target="_blank">JAX-RS 2.0 +It exposes a fully-compliant https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services"; target="_blank">JAX-RS 2.0 https://en.wikipedia.org/wiki/Representational_state_transfer"; target="_blank">RESTful interface which enables third-party applications, written in any programming language, to consu
[2/2] syncope git commit: added info and help command, some bugfix and code improvements, SYNCOPE-158
added info and help command, some bugfix and code improvements, SYNCOPE-158 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4133c240 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4133c240 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4133c240 Branch: refs/heads/master Commit: 4133c2402e491342d0c32a1a6c5a9bb7d5a8870b Parents: ae88f40 Author: massi Authored: Wed Oct 14 18:20:09 2015 +0200 Committer: massi Committed: Wed Oct 14 18:20:09 2015 +0200 -- .../apache/syncope/client/cli/ArgsManager.java | 2 +- .../org/apache/syncope/client/cli/Input.java| 37 +- .../apache/syncope/client/cli/SyncopeAdm.java | 13 +- .../client/cli/commands/AbstractCommand.java| 12 + .../cli/commands/ConfigurationCommand.java | 69 ++-- .../client/cli/commands/HelpCommand.java| 115 +++ .../client/cli/commands/InfoCommand.java| 340 +++ .../client/cli/commands/LoggerCommand.java | 53 +-- .../cli/commands/NotificationCommand.java | 33 +- .../client/cli/commands/PolicyCommand.java | 41 ++- .../client/cli/commands/ReportCommand.java | 76 +++-- .../client/cli/commands/SchemaCommand.java | 49 ++- .../cli/commands/install/InstallCommand.java| 7 +- .../syncope/client/cli/messages/Messages.java | 40 +++ .../client/cli/messages/UsageMessages.java | 40 --- .../syncope/client/cli/util/CommandUtils.java | 74 16 files changed, 803 insertions(+), 198 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/4133c240/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java index f323dce..926b4dd 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java @@ -25,7 +25,7 @@ public final class ArgsManager { public static void validator(final String[] args) throws IllegalArgumentException { if (args.length == 0) { -throw new IllegalArgumentException(); +throw new IllegalArgumentException("Syntax error: no options"); } else if (!"install".equalsIgnoreCase(args[0])) { final File configFile = new File(InstallConfigFileTemplate.FILE_PATH); if (!configFile.exists()) { http://git-wip-us.apache.org/repos/asf/syncope/blob/4133c240/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java b/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java index a7092e7..6e2aeeb 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/Input.java @@ -18,21 +18,11 @@ */ package org.apache.syncope.client.cli; -import java.util.List; import org.apache.syncope.client.cli.commands.AbstractCommand; +import org.apache.syncope.client.cli.util.CommandUtils; public class Input { -private boolean ssl = false; - -private String host = "localhost"; - -private String port = "9080"; - -private String username = "admin"; - -private String password = "password"; - private final AbstractCommand command; private String option; @@ -42,7 +32,7 @@ public class Input { public Input(final String[] args) throws InstantiationException, IllegalAccessException, IllegalArgumentException { -command = fromArgs(args[0]); +command = CommandUtils.fromArgs(args[0]); if (args.length > 1) { option = args[1]; @@ -77,7 +67,7 @@ public class Input { public String firstParameter() { return parameters[0]; } - + public String lastParameter() { return parameters[parameters.length - 1]; } @@ -90,27 +80,6 @@ public class Input { return new PairParameter(pairParameterArray[0], pairParameterArray[1]); } -private AbstractCommand fromArgs(final String arg) -throws InstantiationException, IllegalAccessException, IllegalArgumentException { - -final CommandClassScanner ccs = new CommandClassScanner(); -final List> commands = ccs.getComponentClasses(); - -Class commandClass = null; -for (Class cmd : commands) { -if (arg.equals(cmd.getAnnotation(Command.class).name())) { -commandClass = cmd; -} -} - -if (commandClass == null) {
[1/2] syncope git commit: added info and help command, some bugfix and code improvements, SYNCOPE-158
Repository: syncope Updated Branches: refs/heads/master ae88f405f -> 4133c2402 http://git-wip-us.apache.org/repos/asf/syncope/blob/4133c240/client/cli/src/main/java/org/apache/syncope/client/cli/messages/UsageMessages.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/messages/UsageMessages.java b/client/cli/src/main/java/org/apache/syncope/client/cli/messages/UsageMessages.java deleted file mode 100644 index 0442897..000 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/messages/UsageMessages.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.client.cli.messages; - -public final class UsageMessages { - -private static final String OPTION_COMMAND_MESSAGE_TEMPLATE = "\n - Usage: %s\n"; - -public static String optionCommandMessage(final String message) { -return String.format(OPTION_COMMAND_MESSAGE_TEMPLATE, message); -} - -public static void printErrorMessage(final String... errors) { -final StringBuilder errorMessage = new StringBuilder("\n").append(" - "); -for (final String error : errors) { -errorMessage.append(error).append("\n"); -} -System.out.println(errorMessage.toString()); -} - -private UsageMessages() { - -} -} http://git-wip-us.apache.org/repos/asf/syncope/blob/4133c240/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java b/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java new file mode 100644 index 000..2007743 --- /dev/null +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/util/CommandUtils.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.client.cli.util; + +import java.util.ArrayList; +import java.util.List; +import org.apache.syncope.client.cli.Command; +import org.apache.syncope.client.cli.CommandClassScanner; +import org.apache.syncope.client.cli.commands.AbstractCommand; + +public final class CommandUtils { + +public static AbstractCommand fromArgs(final String arg) +throws InstantiationException, IllegalAccessException, IllegalArgumentException { + +final CommandClassScanner ccs = new CommandClassScanner(); +final List> commands = ccs.getComponentClasses(); + +Class commandClass = null; +for (final Class cmd : commands) { +if (arg.equals(cmd.getAnnotation(Command.class).name())) { +commandClass = cmd; +} +} + +if (commandClass == null) { +throw new IllegalArgumentException(arg + " is not a valid command"); +} + +return commandClass.newInstance(); + +} + +public static List commands() +throws InstantiationException, IllegalAccessException, IllegalArgumentException { + +final List listCommands = new ArrayList<>(); + +final CommandClassScanner ccs = new CommandClassScanner(); +final List> commands = ccs.getComponentClasses(); + +Class commandClass = null; +for (final Class cmd : commands) { +commandClass = cmd; +if
syncope git commit: An initial grammatical update to the docs
Repository: syncope Updated Branches: refs/heads/master 7642af97c -> ae88f405f An initial grammatical update to the docs Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/ae88f405 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/ae88f405 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/ae88f405 Branch: refs/heads/master Commit: ae88f405f78aac4553db390c82982b858f459859 Parents: 7642af9 Author: Colm O hEigeartaigh Authored: Wed Oct 14 17:16:37 2015 +0100 Committer: Colm O hEigeartaigh Committed: Wed Oct 14 17:16:37 2015 +0100 -- src/main/asciidoc/introduction.adoc| 52 ++--- src/main/asciidoc/reference-guide.adoc | 6 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/ae88f405/src/main/asciidoc/introduction.adoc -- diff --git a/src/main/asciidoc/introduction.adoc b/src/main/asciidoc/introduction.adoc index f880ab5..cd108e3 100644 --- a/src/main/asciidoc/introduction.adoc +++ b/src/main/asciidoc/introduction.adoc @@ -20,32 +20,32 @@ == Introduction *Apache Syncope* is an Open Source system for managing digital identities in enterprise environments, implemented in -Java EE technology and released under Apache 2.0 license. +Java EE technology and released under the Apache 2.0 license. -*Identity management* (or IdM) represents the joint result of business process and IT to manage user data on systems and -applications. IdM involves considering user attributes, roles, resources and entitlements in trying to give a decent -answer to the question bumping up every time in an IT administrator's mind: +*Identity Management* (or IdM) means to manage user data on systems and applications, using the combination of +business processes and IT. IdM involves considering user attributes, roles, resources and entitlements in trying to answer the +following thorny question: [.text-center] _Who has access to What, When, How, and Why?_ -=== What is this Identity Management, anyway? +=== What is Identity Management, anyway? -Account:: Computers work with records of data about persons. Such records contains technical information needed by the system for +Account:: Computers work with records of data about people. Such records contain technical information needed by the system for which the account is created and managed. (Digital) Identity:: A representation of a set of claims made by one digital subject about itself. *It's you!* -Have you ever been hired by a company, entered an organization or just subscribed a new Google account? +Have you ever been hired by a company, entered an organization or just created a new Google account? Companies, organizations and cloud entities work with applications that need your data to function properly: username, password, e-mail, first name, surname, and more. -Who is going to feed such information? And what happens when you need to be enabled for more applications? And what if +Where is this information going to come from? And what happens when you need to be enabled for more applications? And what if you get promoted and acquire more rights on the applications you already had access to? Most important, what happens when you quit or they gently let you go? -Shortly, Identity Management takes care of managing identity data throughout what is called the *Identity Lifecycle*. +In brief, Identity Management takes care of managing identity data throughout what is called the *Identity Lifecycle*. [.text-center] image::identityLifecycle.png[title="Identity Lifecycle",alt="Identity Lifecycle",width="505",height="324"] @@ -53,34 +53,34 @@ image::identityLifecycle.png[title="Identity Lifecycle",alt="Identity Lifecycle" .Users, groups and any objects With Apache Syncope 2.0.0, the managed identities are not limited anymore to users and groups. New object types can be -defined so that any object's data can be managed through Syncope: workstations, printers, folders, sensors, services, -and so on. This positions Apache Syncope at best places for bringing Identity Management in the IoT world. +defined so that any objects data can be managed through Syncope: workstations, printers, folders, sensors, services, +and so on. This positions Apache Syncope at the forefront for bringing Identity Management in the IoT world. -=== Bird's eye view on Architecture +=== A bird's eye view on the Architecture of Apache Syncope -*_Core_* is the central component, providing all services offered by Apache Syncope. + -It exposes a full-compliant https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services[JAX-RS 2.0^] + * *_Core_* is the
syncope git commit: [SYNCOPE-710] Reworking password propagation request and virtual attributes management
Repository: syncope Updated Branches: refs/heads/1_2_X 91cb526c6 -> 2524280eb [SYNCOPE-710] Reworking password propagation request and virtual attributes management Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2524280e Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2524280e Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2524280e Branch: refs/heads/1_2_X Commit: 2524280ebeaff46bc351f4692fb4f966148bc87e Parents: 91cb526 Author: Francesco Chicchiriccò Authored: Wed Oct 14 17:39:02 2015 +0200 Committer: Francesco Chicchiriccò Committed: Wed Oct 14 17:39:02 2015 +0200 -- .../propagation/impl/PropagationManager.java| 47 ++ .../core/rest/controller/UserController.java| 93 +--- .../syncope/core/rest/data/UserDataBinder.java | 15 ++-- .../user/AbstractUserWorkflowAdapter.java | 9 +- .../workflow/user/NoOpUserWorkflowAdapter.java | 28 +++--- .../core/workflow/user/UserWorkflowAdapter.java | 3 +- .../activiti/ActivitiUserWorkflowAdapter.java | 18 +++- .../user/activiti/task/PasswordReset.java | 25 +- .../workflow/user/activiti/task/Update.java | 13 +-- .../syncope/core/rest/UserTestITCase.java | 40 + .../syncope/core/rest/VirAttrTestITCase.java| 9 +- 11 files changed, 167 insertions(+), 133 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/2524280e/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java -- diff --git a/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java b/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java index eddbbb4..166017a 100644 --- a/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java +++ b/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java @@ -248,31 +248,6 @@ public class PropagationManager { } /** - * Performs update on each resource associated to the user excluding the specified into 'resourceNames' parameter. - * - * @param user to be propagated - * @param enable whether user must be enabled or not - * @param noPropResourceNames external resource names not to be considered for propagation - * @return list of propagation tasks - * @throws NotFoundException if user is not found - */ -public List getUserUpdateTaskIds(final SyncopeUser user, final Boolean enable, -final Set noPropResourceNames) -throws NotFoundException { - -return getUpdateTaskIds( -user, // SyncopeUser to be updated on external resources -null, // no password -false, -enable, // status to be propagated -Collections.emptySet(), // no virtual attributes to be managed -Collections.emptySet(), // no virtual attributes to be managed -null, // no propagation by resources -noPropResourceNames, -Collections.emptySet()); -} - -/** * Performs update on each resource associated to the user. * * @param wfResult user to be propagated (and info associated), as per result from workflow @@ -388,8 +363,12 @@ public class PropagationManager { PropagationByResource localPropByRes = binder.fillVirtual(subject, vAttrsToBeRemoved == null ? Collections.emptySet() : vAttrsToBeRemoved, vAttrsToBeUpdated == null -? Collections.emptySet() -: vAttrsToBeUpdated, AttributableUtil.getInstance(subject)); +? Collections.emptySet() +: vAttrsToBeUpdated, AttributableUtil.getInstance(subject)); +localPropByRes.merge(propByRes); +if (noPropResourceNames != null) { +localPropByRes.removeAll(noPropResourceNames); +} // SYNCOPE-458 fill membership virtual attributes if (subject instanceof SyncopeUser) { @@ -402,23 +381,13 @@ public class PropagationManager { ? Collections.emptySet() : membershipMod.getVirAttrsToRemove(), membershipMod.getVirAttrsToUpdate() == null ? Collections.emptySet() -: membershipMod.getVirAttrsToUpdate(), AttributableUtil.getInstance( -AttributableType.MEMBERSHIP)); +: membershipMod.getVirAttrsToUpdate(), AttributableUtil.getInstance( +AttributableType.MEMBERSHIP)); }
[5/5] syncope git commit: Fixed SYNCOPE-590
Fixed SYNCOPE-590 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/7642af97 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/7642af97 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/7642af97 Branch: refs/heads/master Commit: 7642af97ccdfbd1086be7d1bcea5510235237ebf Parents: a61c801 Author: massi Authored: Wed Oct 14 15:10:45 2015 +0200 Committer: massi Committed: Wed Oct 14 15:10:45 2015 +0200 -- .../client/cli/commands/SchemaCommand.java | 94 1 file changed, 77 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/7642af97/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java index 3671cf0..3c182c7 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java @@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.syncope.client.cli.Command; import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.SyncopeServices; +import org.apache.syncope.client.cli.messages.UsageMessages; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.AbstractSchemaTO; import org.apache.syncope.common.lib.to.DerSchemaTO; @@ -43,6 +44,9 @@ public class SchemaCommand extends AbstractCommand { + " Options:\n" + "--help \n" + "--list-all\n" ++ "--list-plain\n" ++ "--list-derived\n" ++ "--list-virtual\n" + "--list {SCHEMA-TYPE}\n" + " Schema type: PLAIN / DERIVED / VIRTUAL"; @@ -63,11 +67,13 @@ public class SchemaCommand extends AbstractCommand { final SchemaService schemaService = SyncopeServices.get(SchemaService.class); switch (Options.fromName(input.getOption())) { case LIST: -final String listErrorMessage = "Usage: schema --list {SCHEMA-TYPE}\n" -+ " Schema type: PLAIN / DERIVED / VIRTUAL"; +final String listErrorMessage = UsageMessages.optionCommandMessage( +"schema --list {SCHEMA-TYPE}\n" ++ " Schema type: PLAIN / DERIVED / VIRTUAL"); if (parameters.length == 1) { try { final SchemaType schemaType = SchemaType.valueOf(input.firstParameter()); +System.out.println(""); for (final AbstractSchemaTO schemaTO : schemaService.list(schemaType)) { switch (schemaType) { case PLAIN: @@ -87,14 +93,16 @@ public class SchemaCommand extends AbstractCommand { break; } } +System.out.println(""); } catch (final SyncopeClientException ex) { -System.out.println(" - Error: " + ex.getMessage()); +UsageMessages.printErrorMessage(ex.getMessage()); } catch (final IllegalArgumentException ex) { -System.out.println(" - Error: " + input.firstParameter() -+ " isn't a valid schema type, try with:"); +UsageMessages.printErrorMessage( +input.firstParameter() + " isn't a valid schema type, try with:"); for (final SchemaType type : SchemaType.values()) { System.out.println(" *** " + type.name()); } +System.out.println(""); } } else { System.out.println(listErrorMessage); @@ -103,23 +111,64 @@ public class SchemaCommand extends AbstractCommand { case LIST_ALL: try { for (final SchemaType value : SchemaType.values()) { -System.out.println("Schemas for " + value); +System.out.println(""); +System.out.println(value + " schemas"); for (final AbstractSchemaTO schemaTO : schemaService.list(value)) { System.out.println(" - Name: " + schemaTO.getKey() + " type: "
[2/5] syncope git commit: Fixed SYNCOPE-585
Fixed SYNCOPE-585 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/237f90f1 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/237f90f1 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/237f90f1 Branch: refs/heads/master Commit: 237f90f12a852497afef707d74aea864e0cc5e91 Parents: 87ad997 Author: massi Authored: Wed Oct 14 15:10:01 2015 +0200 Committer: massi Committed: Wed Oct 14 15:10:01 2015 +0200 -- .../cli/commands/NotificationCommand.java | 163 +-- 1 file changed, 115 insertions(+), 48 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/237f90f1/client/cli/src/main/java/org/apache/syncope/client/cli/commands/NotificationCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/NotificationCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/NotificationCommand.java index 473ebdc..9028617 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/NotificationCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/NotificationCommand.java @@ -18,74 +18,141 @@ */ package org.apache.syncope.client.cli.commands; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; +import javax.xml.ws.WebServiceException; +import org.apache.commons.lang3.StringUtils; +import org.apache.syncope.client.cli.Command; +import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.SyncopeServices; +import org.apache.syncope.client.cli.messages.UsageMessages; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.NotificationTO; import org.apache.syncope.common.rest.api.service.NotificationService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@Parameters( -commandNames = "notification", -optionPrefixes = "-", -separators = "=", -commandDescription = "Apache Syncope notification service") +@Command(name = "notification") public class NotificationCommand extends AbstractCommand { private static final Logger LOG = LoggerFactory.getLogger(NotificationCommand.class); -private final String helpMessage = "Usage: notification [options]\n" +private static final String HELP_MESSAGE = "Usage: notification [options]\n" + " Options:\n" -+ "-h, --help \n" -+ "-l, --list \n" -+ "-r, --read \n" -+ " Syntax: -r={NOTIFICATION-ID} \n" -+ "-d, --delete \n" -+ " Syntax: -d={NOTIFICATION-ID}"; ++ "--help \n" ++ "--list \n" ++ "--read \n" ++ " Syntax: --read {NOTIFICATION-ID} \n" ++ "--delete \n" ++ " Syntax: --delete {NOTIFICATION-ID}"; -@Parameter(names = { "-r", "--read" }) -private Long notificationIdToRead = -1L; +@Override +public void execute(final Input input) { +LOG.debug("Option: {}", input.getOption()); +LOG.debug("Parameters:"); +for (final String parameter : input.getParameters()) { +LOG.debug(" > " + parameter); +} -@Parameter(names = { "-d", "--delete" }) -private Long notificationIdToDelete = -1L; +final String[] parameters = input.getParameters(); + +if (StringUtils.isBlank(input.getOption())) { +input.setOption(Options.HELP.getOptionName()); +} -@Override -public void execute() { final NotificationService notificationService = SyncopeServices.get(NotificationService.class); +switch (Options.fromName(input.getOption())) { +case LIST: +try { +for (final NotificationTO notificationTO : notificationService.list()) { +System.out.println(notificationTO); +} +} catch (final SyncopeClientException ex) { +UsageMessages.printErrorMessage(ex.getMessage()); +} +break; +case READ: +final String readErrorMessage = UsageMessages.optionCommandMessage( +"notification --read {NOTIFICATION-ID} {NOTIFICATION-ID} [...]"); +if (parameters.length >= 1) { +for (final String parameter : parameters) { +try { + System.out.println(notificationService.read(Long.valueOf(parameter))); +} catch (final NumberFormatException ex) { +System.out.println("Error reading
[1/5] syncope git commit: Fixed SYNCOPE-584
Repository: syncope Updated Branches: refs/heads/master 958919948 -> 7642af97c Fixed SYNCOPE-584 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/87ad9977 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/87ad9977 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/87ad9977 Branch: refs/heads/master Commit: 87ad997748fa7197584463e2aabcb7745f89f5b0 Parents: 9589199 Author: massi Authored: Wed Oct 14 15:09:37 2015 +0200 Committer: massi Committed: Wed Oct 14 15:09:37 2015 +0200 -- .../client/cli/commands/LoggerCommand.java | 339 --- 1 file changed, 225 insertions(+), 114 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/87ad9977/client/cli/src/main/java/org/apache/syncope/client/cli/commands/LoggerCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/LoggerCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/LoggerCommand.java index 469e68a..00f12b1 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/LoggerCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/LoggerCommand.java @@ -18,13 +18,12 @@ */ package org.apache.syncope.client.cli.commands; -import com.beust.jcommander.DynamicParameter; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import java.util.HashMap; -import java.util.Map; +import javax.xml.ws.WebServiceException; import org.apache.commons.lang3.StringUtils; +import org.apache.syncope.client.cli.Command; +import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.SyncopeServices; +import org.apache.syncope.client.cli.messages.UsageMessages; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.LoggerTO; import org.apache.syncope.common.lib.types.LoggerLevel; @@ -33,135 +32,247 @@ import org.apache.syncope.common.rest.api.service.LoggerService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@Parameters( -commandNames = "logger", -optionPrefixes = "-", -separators = "=", -commandDescription = "Apache Syncope logger service") +@Command(name = "logger") public class LoggerCommand extends AbstractCommand { private static final Logger LOG = LoggerFactory.getLogger(LoggerCommand.class); -private final String helpMessage = "Usage: logger [options]\n" +private static final String HELP_MESSAGE = "Usage: logger [options]\n" + " Options:\n" -+ "-h, --help \n" -+ "-l, --list \n" -+ "-r, --read \n" -+ " Syntax: -r={LOG-NAME} \n" -+ "-u, --update \n" -+ " Syntax: {LOG-NAME}={LOG-LEVEL} \n" -+ "-ua, --update-all \n" -+ " Syntax: -ua={LOG-LEVEL} \n" -+ "-c, --create \n" -+ " Syntax: {LOG-NAME}={LOG-LEVEL} \n" -+ "-d, --delete \n" -+ " Syntax: -d={LOG-NAME}"; - -@Parameter(names = { "-r", "--read" }) -private String logNameToRead; - -@DynamicParameter(names = { "-u", "--update" }) -private final Map updateLogs = new HashMap(); - -@Parameter(names = { "-ua", "--update-all" }) -private String logLevel; - -@DynamicParameter(names = { "-c", "--create" }) -private final Map createLogs = new HashMap(); - -@Parameter(names = { "-d", "--delete" }) -private String logNameToDelete; ++ "--help \n" ++ "--list \n" ++ "--read \n" ++ " Syntax: --read {LOG-NAME} {LOG-NAME} [...]\n" ++ "--update \n" ++ " Syntax: --update {LOG-NAME}={LOG-LEVEL} {LOG-NAME}={LOG-LEVEL} [...]\n" ++ "--update-all \n" ++ " Syntax: --update-all {LOG-LEVEL} \n" ++ "--create \n" ++ " Syntax: --create {LOG-NAME}={LOG-LEVEL} {LOG-NAME}={LOG-LEVEL} [...]\n" ++ "--delete \n" ++ " Syntax: --delete {LOG-NAME} {LOG-NAME} [...]"; @Override -public void execute() { -final LoggerService loggerService = SyncopeServices.get(LoggerService.class); +public void execute(final Input input) { +LOG.debug("Option: {}", input.getOption()); +LOG.debug("Parameters:"); +for (final String parameter : input.getParameters()) { +LOG.debug(" > " + parameter); +} -LOG.debug("Logger service successfully created"); +final String[] parameters = input.getParameters(); -if (help) { -LOG.debu
[3/5] syncope git commit: Fixed SYNCOPE-586
Fixed SYNCOPE-586 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1483986e Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1483986e Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1483986e Branch: refs/heads/master Commit: 1483986e37ba33d62be19f8fc3370cd5b79a0d34 Parents: 237f90f Author: massi Authored: Wed Oct 14 15:10:16 2015 +0200 Committer: massi Committed: Wed Oct 14 15:10:16 2015 +0200 -- .../client/cli/commands/PolicyCommand.java | 193 +-- 1 file changed, 134 insertions(+), 59 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/1483986e/client/cli/src/main/java/org/apache/syncope/client/cli/commands/PolicyCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/PolicyCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/PolicyCommand.java index ae34f53..d17419f 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/PolicyCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/PolicyCommand.java @@ -18,10 +18,12 @@ */ package org.apache.syncope.client.cli.commands; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; +import javax.xml.ws.WebServiceException; import org.apache.commons.lang3.StringUtils; +import org.apache.syncope.client.cli.Command; +import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.SyncopeServices; +import org.apache.syncope.client.cli.messages.UsageMessages; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.policy.AbstractPolicyTO; import org.apache.syncope.common.lib.types.PolicyType; @@ -29,76 +31,149 @@ import org.apache.syncope.common.rest.api.service.PolicyService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@Parameters( -commandNames = "policy", -optionPrefixes = "-", -separators = "=", -commandDescription = "Apache Syncope policy service") +@Command(name = "policy") public class PolicyCommand extends AbstractCommand { private static final Logger LOG = LoggerFactory.getLogger(PolicyCommand.class); -private final String helpMessage = "Usage: policy [options]\n" +private static final String HELP_MESSAGE = "Usage: policy [options]\n" + " Options:\n" -+ "-h, --help \n" -+ "-l, --list \n" -+ "-ll, --list-policy \n" -+ " Syntax: -ll={POLICY-TYPE} \n" -+ "-r, --read \n" -+ " Syntax: -r={POLICY-ID} \n" -+ "-d, --delete \n" -+ " Syntax: -d={POLICY-ID}"; ++ "--help \n" ++ "--list-policy \n" ++ " Syntax: --list-policy {POLICY-TYPE} \n" ++ " Policy type: ACCOUNT / PASSWORD / SYNC / PUSH\n" ++ "--read \n" ++ " Syntax: --read {POLICY-ID} {POLICY-ID} [...]\n" ++ "--delete \n" ++ " Syntax: --delete {POLICY-ID} {POLICY-ID} [...]"; -@Parameter(names = { "-ll", "--list-policy" }) -private String policyType; +@Override +public void execute(final Input input) { +LOG.debug("Option: {}", input.getOption()); +LOG.debug("Parameters:"); +for (final String parameter : input.getParameters()) { +LOG.debug(" > " + parameter); +} -@Parameter(names = { "-r", "--read" }) -private Long policyIdToRead = -1L; +final String[] parameters = input.getParameters(); -@Parameter(names = { "-d", "--delete" }) -private Long policyIdToDelete = -1L; +if (StringUtils.isBlank(input.getOption())) { +input.setOption(Options.HELP.getOptionName()); +} -@Override -public void execute() { final PolicyService policyService = SyncopeServices.get(PolicyService.class); -LOG.debug("Policy service successfully created"); - -if (help) { -LOG.debug("- policy help command"); -System.out.println(helpMessage); -} else if (list) { -// do nothing for the moment... -} else if (StringUtils.isNotBlank(policyType)) { -LOG.debug("- policy list command for type {}", policyType); -try { -for (final AbstractPolicyTO policyTO : policyService.list(PolicyType.valueOf(policyType))) { -System.out.println(policyTO); +switch (Options.fromName(input.getOption())) { +case LIST_POLICY: +final String listPolicyErrorMessage = UsageMessages.option
[4/5] syncope git commit: Fixed SYNCOPE-587
Fixed SYNCOPE-587 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/a61c801b Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/a61c801b Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/a61c801b Branch: refs/heads/master Commit: a61c801b00b854390b170a964b919de7f98ce2b8 Parents: 1483986 Author: massi Authored: Wed Oct 14 15:10:29 2015 +0200 Committer: massi Committed: Wed Oct 14 15:10:29 2015 +0200 -- .../client/cli/commands/ReportCommand.java | 438 +-- 1 file changed, 308 insertions(+), 130 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/a61c801b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java index def8f50..ffa8ecd 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java @@ -18,162 +18,340 @@ */ package org.apache.syncope.client.cli.commands; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; import java.io.IOException; import java.io.SequenceInputStream; +import java.util.Arrays; import java.util.List; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; +import javax.xml.ws.WebServiceException; +import org.apache.commons.lang3.StringUtils; +import org.apache.syncope.client.cli.Command; +import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.SyncopeServices; +import org.apache.syncope.client.cli.messages.UsageMessages; import org.apache.syncope.client.cli.util.XMLUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.ReportExecTO; import org.apache.syncope.common.lib.to.ReportTO; +import org.apache.syncope.common.lib.types.JobStatusType; import org.apache.syncope.common.lib.types.ReportExecExportFormat; import org.apache.syncope.common.rest.api.service.ReportService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; -@Parameters( -commandNames = "report", -optionPrefixes = "-", -separators = "=", -commandDescription = "Apache Syncope report service") +@Command(name = "report") public class ReportCommand extends AbstractCommand { private static final Logger LOG = LoggerFactory.getLogger(ReportCommand.class); -private final String helpMessage = "Usage: report [options]\n" +private static final String HELP_MESSAGE = "Usage: report [options]\n" + " Options:\n" -+ "-h, --help \n" -+ "-l, --list \n" -+ "-r, --read \n" -+ " Syntax: -r={POLICY-ID} \n" -+ "-d, --delete \n" -+ " Syntax: -d={POLICY-ID} \n" -+ "-e, --execute \n" -+ " Syntax: -e={POLICY-ID} \n" -+ "-re, --read-executecution \n" -+ " Syntax: -re={EXECUTION-ID} \n" -+ "-de, --delete-executecution \n" -+ " Syntax: -de={EXECUTION-ID} \n" -+ "-eer, --export-executecution-result \n" -+ " Syntax: -eer={EXECUTION-ID} \n" -+ "-rc, --reportlet-class"; - -@Parameter(names = { "-r", "--read" }) -private Long reportIdToRead = -1L; - -@Parameter(names = { "-d", "--delete" }) -private Long reportIdToDelete = -1L; - -@Parameter(names = { "-e", "--execute" }) -private Long reportIdToExecute = -1L; - -@Parameter(names = { "-re", "--read-execution" }) -private Long executionIdToRead = -1L; - -@Parameter(names = { "-de", "--delete-execution" }) -private Long executionIdToDelete = -1L; - -@Parameter(names = { "-eer", "--export-execution-result" }) -private Long exportId = -1L; ++ "--help \n" ++ "--list \n" ++ "--read \n" ++ " Syntax: --read {REPORT-ID} {REPORT-ID} [...] \n" ++ "--delete \n" ++ " Syntax: --delete {REPORT-ID} {REPORT-ID} [...]\n" ++ "--execute \n" ++ " Syntax: --execute {REPORT-ID} \n" ++ "--read-execution \n" ++ " Syntax: --read-execution {EXECUTION-ID} {EXECUTION-ID} [...]\n" ++ "--delete-execution \n" ++ " Syntax: --delete-execution {
syncope git commit: Fixed SYNCOPE-581
Repository: syncope Updated Branches: refs/heads/master 4a28d6c83 -> 958919948 Fixed SYNCOPE-581 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/95891994 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/95891994 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/95891994 Branch: refs/heads/master Commit: 9589199482b8823bb630bf901014f816f179475e Parents: 4a28d6c Author: massi Authored: Wed Oct 14 15:08:49 2015 +0200 Committer: massi Committed: Wed Oct 14 15:08:49 2015 +0200 -- .../client/cli/commands/AbstractCommand.java| 10 +- .../cli/commands/ConfigurationCommand.java | 412 --- .../client/cli/messages/UsageMessages.java | 2 +- 3 files changed, 262 insertions(+), 162 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/95891994/client/cli/src/main/java/org/apache/syncope/client/cli/commands/AbstractCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/AbstractCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/AbstractCommand.java index a6753bf..b374e33 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/AbstractCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/AbstractCommand.java @@ -18,15 +18,9 @@ */ package org.apache.syncope.client.cli.commands; -import com.beust.jcommander.Parameter; +import org.apache.syncope.client.cli.Input; public abstract class AbstractCommand { -@Parameter(names = {"-h", "--help"}) -protected boolean help = false; - -@Parameter(names = {"-l", "--list"}) -protected boolean list = false; - -protected abstract void execute(); +public abstract void execute(final Input input); } http://git-wip-us.apache.org/repos/asf/syncope/blob/95891994/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ConfigurationCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ConfigurationCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ConfigurationCommand.java index 70c532d..282e2d1 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ConfigurationCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ConfigurationCommand.java @@ -18,192 +18,298 @@ */ package org.apache.syncope.client.cli.commands; -import com.beust.jcommander.DynamicParameter; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.SequenceInputStream; -import java.util.HashMap; -import java.util.Map; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; +import javax.xml.ws.WebServiceException; import org.apache.commons.lang3.StringUtils; +import org.apache.syncope.client.cli.Command; +import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.SyncopeServices; +import org.apache.syncope.client.cli.messages.UsageMessages; import org.apache.syncope.client.cli.util.XMLUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.AttrTO; import org.apache.syncope.common.lib.to.ConfTO; import org.apache.syncope.common.rest.api.service.ConfigurationService; -import org.apache.syncope.common.rest.api.service.SyncopeService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; -@Parameters( -commandNames = "config", -optionPrefixes = "-", -separators = "=", -commandDescription = "Apache Syncope configuration service") +@Command(name = "configuration") public class ConfigurationCommand extends AbstractCommand { private static final Logger LOG = LoggerFactory.getLogger(ConfigurationCommand.class); private static final String EXPORT_FILE_NAME = "/content.xml"; -private final String helpMessage = "Usage: config [options]\n" +private static final String HELP_MESSAGE = "Usage: config [options]\n" + " Options:\n" -+ "-h, --help \n" -+ "-l, --list \n" -+ "-r, --read \n" -+ " Syntax: -r={CONF-NAME} \n" -+ "-u, --update \n" -+ " Syntax: {CONF-NAME}={CONF-VALUE} \n" -+ "-c, --create \n" -+ " Syntax: {CONF-NAME}={CONF-VALUE} \n" -+ "-d, --delete \n" -+ " Syntax:
[2/2] syncope git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/syncope
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/syncope Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4a28d6c8 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4a28d6c8 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4a28d6c8 Branch: refs/heads/master Commit: 4a28d6c835e8f47658e5a8ef6d171249750f992e Parents: 729cf5b 2f137b2 Author: massi Authored: Wed Oct 14 15:07:50 2015 +0200 Committer: massi Committed: Wed Oct 14 15:07:50 2015 +0200 -- .../client/cli/commands/SchemaCommand.java | 251 .../cli/commands/install/InstallCommand.java| 298 +++ .../install/InstallConfigFileTemplate.java | 57 .../client/cli/messages/UsageMessages.java | 40 +++ 4 files changed, 646 insertions(+) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/4a28d6c8/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java -- diff --cc client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java index 000,000..3671cf0 new file mode 100644 --- /dev/null +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/SchemaCommand.java @@@ -1,0 -1,0 +1,251 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one ++ * or more contributor license agreements. See the NOTICE file ++ * distributed with this work for additional information ++ * regarding copyright ownership. The ASF licenses this file ++ * to you 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.client.cli.commands; ++ ++import java.util.Arrays; ++import javax.xml.ws.WebServiceException; ++import org.apache.commons.lang3.StringUtils; ++import org.apache.syncope.client.cli.Command; ++import org.apache.syncope.client.cli.Input; ++import org.apache.syncope.client.cli.SyncopeServices; ++import org.apache.syncope.common.lib.SyncopeClientException; ++import org.apache.syncope.common.lib.to.AbstractSchemaTO; ++import org.apache.syncope.common.lib.to.DerSchemaTO; ++import org.apache.syncope.common.lib.to.PlainSchemaTO; ++import org.apache.syncope.common.lib.to.VirSchemaTO; ++import org.apache.syncope.common.lib.types.SchemaType; ++import org.apache.syncope.common.rest.api.service.SchemaService; ++import org.slf4j.Logger; ++import org.slf4j.LoggerFactory; ++ ++@Command(name = "schema") ++public class SchemaCommand extends AbstractCommand { ++ ++private static final Logger LOG = LoggerFactory.getLogger(SchemaCommand.class); ++ ++private static final String HELP_MESSAGE = "Usage: schema [options]\n" +++ " Options:\n" +++ "--help \n" +++ "--list-all\n" +++ "--list {SCHEMA-TYPE}\n" +++ " Schema type: PLAIN / DERIVED / VIRTUAL"; ++ ++@Override ++public void execute(final Input input) { ++LOG.debug("Option: {}", input.getOption()); ++LOG.debug("Parameters:"); ++for (final String parameter : input.getParameters()) { ++LOG.debug(" > " + parameter); ++} ++ ++String[] parameters = input.getParameters(); ++ ++if (StringUtils.isBlank(input.getOption())) { ++input.setOption(Options.HELP.getOptionName()); ++} ++ ++final SchemaService schemaService = SyncopeServices.get(SchemaService.class); ++switch (Options.fromName(input.getOption())) { ++case LIST: ++final String listErrorMessage = "Usage: schema --list {SCHEMA-TYPE}\n" +++ " Schema type: PLAIN / DERIVED / VIRTUAL"; ++if (parameters.length == 1) { ++try { ++final SchemaType schemaType = SchemaType.valueOf(input.firstParameter()); ++for (final AbstractSchemaTO schemaTO : schemaService.list(schemaType)) { ++switch (schemaType) { ++case PLAIN: ++System.out.println(" - Schema key: " + ((PlainSchemaTO) schemaTO).getKey()); ++System.out.println(" type: " + ((PlainSchemaTO) schemaTO).ge
[1/2] syncope git commit: refactoring to manage the command line parameters without external library, SYNCOPE-158
Repository: syncope Updated Branches: refs/heads/master 2f137b211 -> 4a28d6c83 refactoring to manage the command line parameters without external library, SYNCOPE-158 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/729cf5b3 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/729cf5b3 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/729cf5b3 Branch: refs/heads/master Commit: 729cf5b3206435a2526e92cea759f249e964ce9d Parents: 009a87e Author: massi Authored: Wed Oct 14 15:07:25 2015 +0200 Committer: massi Committed: Wed Oct 14 15:07:25 2015 +0200 -- client/cli/pom.xml | 15 ++- .../apache/syncope/client/cli/ArgsManager.java | 50 +++ .../syncope/client/cli/AvailableServices.java | 31 + .../org/apache/syncope/client/cli/Command.java | 32 + .../syncope/client/cli/CommandClassScanner.java | 29 .../client/cli/ComponentClassScanner.java | 44 ++ .../org/apache/syncope/client/cli/Input.java| 134 +++ .../apache/syncope/client/cli/SyncopeAdm.java | 86 +++- .../syncope/client/cli/SyncopeServices.java | 32 - .../client/cli/util/FileSystemUtils.java| 48 +++ .../syncope/client/cli/util/JasyptUtils.java| 49 +++ .../cli/validators/DebugLevelValidator.java | 60 - .../src/main/resources/configuration.properties | 18 +++ client/cli/src/main/resources/log4j2.xml| 24 +++- .../cli/src/main/resources/syncope.properties | 19 --- pom.xml | 7 - 16 files changed, 508 insertions(+), 170 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/729cf5b3/client/cli/pom.xml -- diff --git a/client/cli/pom.xml b/client/cli/pom.xml index 36ee452..d68c6a1 100644 --- a/client/cli/pom.xml +++ b/client/cli/pom.xml @@ -40,10 +40,6 @@ under the License. - - com.beust - jcommander - org.apache.syncope.client @@ -52,6 +48,15 @@ under the License. + org.jasypt + jasypt + + + org.springframework + spring-context + + + org.slf4j slf4j-api @@ -117,7 +122,7 @@ under the License. -org.apache.syncope.cli.SyncopeAdm + org.apache.syncope.client.cli.SyncopeAdm http://git-wip-us.apache.org/repos/asf/syncope/blob/729cf5b3/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java new file mode 100644 index 000..f323dce --- /dev/null +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/ArgsManager.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.client.cli; + +import java.io.File; +import org.apache.syncope.client.cli.commands.install.InstallConfigFileTemplate; + +public final class ArgsManager { + +public static void validator(final String[] args) throws IllegalArgumentException { +if (args.length == 0) { +throw new IllegalArgumentException(); +} else if (!"install".equalsIgnoreCase(args[0])) { +final File configFile = new File(InstallConfigFileTemplate.FILE_PATH); +if (!configFile.exists()) { +throw new IllegalArgumentException( +"It seems you need to setup the CLI client before. Run install --setup."); +} +} +} + +public static String[] operands(final String[] args) { +final String[] operands = new String[args.length - 1]; +for (int i = 1; i < args.length; i++) { +
[5/5] syncope git commit: Merge branch '1_2_X'
Merge branch '1_2_X' Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2f137b21 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2f137b21 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2f137b21 Branch: refs/heads/master Commit: 2f137b211e14b8c97d610f7a1831885774ef644b Parents: 009a87e 91cb526 Author: Francesco Chicchiriccò Authored: Wed Oct 14 13:26:35 2015 +0200 Committer: Francesco Chicchiriccò Committed: Wed Oct 14 13:26:35 2015 +0200 -- --
[3/5] syncope git commit: Fixed SYNCOPE-708
Fixed SYNCOPE-708 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5063ce6e Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5063ce6e Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5063ce6e Branch: refs/heads/master Commit: 5063ce6e1b6db266470e42e17cae244b789e1dc4 Parents: 876fde9 Author: massi Authored: Wed Oct 14 11:51:54 2015 +0200 Committer: massi Committed: Wed Oct 14 11:51:54 2015 +0200 -- .../core/rest/controller/LoggerController.java | 32 +--- .../core/services/LoggerServiceImpl.java| 15 + .../syncope/core/rest/LoggerTestITCase.java | 16 ++ 3 files changed, 53 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/5063ce6e/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java -- diff --git a/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java b/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java index f38d0b2..d077cd1 100644 --- a/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java +++ b/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java @@ -116,6 +116,31 @@ public class LoggerController extends AbstractTransactionalController throw sce; } +@PreAuthorize("hasRole('LOG_LIST')") +@Transactional(readOnly = true) +public LoggerTO readLog(final String name) { +for (final LoggerTO logger : listLogs()) { +if (logger.getName().equals(name)) { +return logger; +} +} +throw new NotFoundException("Logger " + name); +} + +@PreAuthorize("hasRole('AUDIT_LIST')") +@Transactional(readOnly = true) +public LoggerTO readAudit(final String name) { +for (final AuditLoggerName logger : listAudits()) { +if (logger.toLoggerName().equals(name)) { +final LoggerTO loggerTO = new LoggerTO(); +loggerTO.setName(logger.toLoggerName()); +loggerTO.setLevel(LoggerLevel.DEBUG); +return loggerTO; +} +} +throw new NotFoundException("Logger " + name); +} + private LoggerTO setLevel(final String name, final Level level, final LoggerType expectedType) { SyncopeLogger syncopeLogger = loggerDAO.find(name); if (syncopeLogger == null) { @@ -213,11 +238,10 @@ public class LoggerController extends AbstractTransactionalController try { final ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(); -final MetadataReaderFactory metadataReaderFactory = -new CachingMetadataReaderFactory(resourcePatternResolver); +final MetadataReaderFactory metadataReaderFactory += new CachingMetadataReaderFactory(resourcePatternResolver); -final String packageSearchPath = -ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +final String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath( SystemPropertyUtils.resolvePlaceholders(this.getClass().getPackage().getName())) + "/" + "**/*.class"; http://git-wip-us.apache.org/repos/asf/syncope/blob/5063ce6e/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java -- diff --git a/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java b/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java index 1308e1f..2b106d1 100644 --- a/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java +++ b/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java @@ -80,13 +80,16 @@ public class LoggerServiceImpl extends AbstractServiceImpl implements LoggerServ @Override public LoggerTO read(final LoggerType type, final String name) { -List logger = list(type); -for (LoggerTO l : logger) { -if (l.getName().equals(name)) { -return l; -} +switch (type) { +case LOG: +return controller.readLog(name); + +case AUDIT: +return controller.readAudit(name); + +default: +throw new BadRequestException(); } -throw new NotFoundException(); } @Override http://git-wip-us.apache.org/repos/asf/syncope/blob/5063ce6e/core/src/test/java/org/apache/
[1/5] syncope git commit: Fixed SYNCOPE-707
Repository: syncope Updated Branches: refs/heads/master 009a87e08 -> 2f137b211 Fixed SYNCOPE-707 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/091b0662 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/091b0662 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/091b0662 Branch: refs/heads/master Commit: 091b0662c8d77b84bc96e7e4047a36da8c12643b Parents: 7dd33ce Author: massi Authored: Tue Oct 13 15:50:08 2015 +0200 Committer: massi Committed: Tue Oct 13 15:50:08 2015 +0200 -- .../core/rest/controller/ConfigurationController.java| 8 .../apache/syncope/core/rest/ConfigurationTestITCase.java| 2 ++ 2 files changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/091b0662/core/src/main/java/org/apache/syncope/core/rest/controller/ConfigurationController.java -- diff --git a/core/src/main/java/org/apache/syncope/core/rest/controller/ConfigurationController.java b/core/src/main/java/org/apache/syncope/core/rest/controller/ConfigurationController.java index b64d224..c71db6e 100644 --- a/core/src/main/java/org/apache/syncope/core/rest/controller/ConfigurationController.java +++ b/core/src/main/java/org/apache/syncope/core/rest/controller/ConfigurationController.java @@ -69,6 +69,14 @@ public class ConfigurationController extends AbstractTransactionalControllerhttp://git-wip-us.apache.org/repos/asf/syncope/blob/091b0662/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java -- diff --git a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java index d81afb7..ca70092 100644 --- a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java +++ b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java @@ -71,6 +71,7 @@ public class ConfigurationTestITCase extends AbstractTest { public void delete() throws UnsupportedEncodingException { try { configurationService.delete("nonExistent"); +fail("The delete operation should throw an exception because of nonExistent schema"); } catch (SyncopeClientException e) { assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus()); } @@ -80,6 +81,7 @@ public class ConfigurationTestITCase extends AbstractTest { configurationService.delete("token.length"); try { configurationService.read("token.length"); +fail("The delete operation should throw an exception because token.length does not exist anymore"); } catch (SyncopeClientException e) { assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus()); }
[4/5] syncope git commit: changed message error, SYNCOPE-708
changed message error, SYNCOPE-708 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/91cb526c Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/91cb526c Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/91cb526c Branch: refs/heads/master Commit: 91cb526c6ccb853d20677562e812d88fc53c252d Parents: 5063ce6 Author: massi Authored: Wed Oct 14 11:56:13 2015 +0200 Committer: massi Committed: Wed Oct 14 11:56:13 2015 +0200 -- .../test/java/org/apache/syncope/core/rest/LoggerTestITCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/91cb526c/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java -- diff --git a/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java index 8092098..025dc25 100644 --- a/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java +++ b/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java @@ -221,7 +221,7 @@ public class LoggerTestITCase extends AbstractTest { public void issueSYNCOPE708() { try { loggerService.read(LoggerType.LOG, "notExists"); -fail("Read a not exists logger, it should go in exception"); +fail("Reading non-existing logger, it should go in exception"); } catch (final WebServiceException ex) { fail("Exception is WebServiceException but it should be SyncopeClientException"); } catch (final SyncopeClientException ex) {
[2/5] syncope git commit: removed useless try/catch for delete test, SYNCOPE-707
removed useless try/catch for delete test, SYNCOPE-707 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/876fde9a Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/876fde9a Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/876fde9a Branch: refs/heads/master Commit: 876fde9aa6abe7501a6cfdd53e32be0828ecdf03 Parents: 091b066 Author: massi Authored: Tue Oct 13 16:22:05 2015 +0200 Committer: massi Committed: Tue Oct 13 16:22:05 2015 +0200 -- .../syncope/core/rest/ConfigurationTestITCase.java | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/876fde9a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java -- diff --git a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java index ca70092..c34015c 100644 --- a/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java +++ b/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java @@ -19,6 +19,7 @@ package org.apache.syncope.core.rest; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -79,16 +80,13 @@ public class ConfigurationTestITCase extends AbstractTest { AttributeTO tokenLength = configurationService.read("token.length"); configurationService.delete("token.length"); -try { -configurationService.read("token.length"); -fail("The delete operation should throw an exception because token.length does not exist anymore"); -} catch (SyncopeClientException e) { -assertEquals(Response.Status.NOT_FOUND, e.getType().getResponseStatus()); -} + +AttributeTO actual = configurationService.read(tokenLength.getSchema()); +assertNotEquals(actual, tokenLength); configurationService.set(tokenLength.getSchema(), tokenLength); -AttributeTO actual = configurationService.read(tokenLength.getSchema()); +actual = configurationService.read(tokenLength.getSchema()); assertEquals(actual, tokenLength); }
[CONF] Apache Syncope > [DISCUSS] Virtual attributes management refactoring
Title: Message Title Francesco Chicchiricco edited a page [DISCUSS] Virtual attributes management refactoring Info This page contains topics supporting ongoing discussion at d...@syncope.apache.org. Tracked as SYNCOPE-709. Current implementation As reported, virtual attributes are attributes whose ownership is not of Syncope but of one or more external resources; such resources are said to be the linking resources for the given attribute. ... View page • Add comment • Like Stop watching space • Manage notifications This message was sent by Atlassian Confluence 5.8.4
[CONF] Apache Syncope > [DISCUSS] Virtual attributes management refactoring
Title: Message Title Francesco Chicchiricco edited a page [DISCUSS] Virtual attributes management refactoring ... values must be fetch when reading users (groups, any objects) via REST - if mapped effective read invocation on the underlying connectors is reduced by using cache virtual attributes are populated into users (group, any objects) exclusively by VirAttrHandler, only when strictly required user (group, any object) update is often problematic: virtual attributes to be removed and updated need explicit management in PropagationManager when the same attribute is mapped for different resources (linking or not), a list of values is generated and it is not clear where the ownerships come from Refactoring proposal ... when defining a virtual schema, it is mandatory to define the linking resource(s) ... virtual attributes are not assigned any more to users (groups, any objects) but, as long as an user (group, any object) is assigned the AnyTypeClass of which the virtual schema is part, it is also assigned the related virtual attribute mapping: linking resource(s) have, besides traditional mapping items, one or more linking mapping which derives from virtual schema definition (see above) virtual attributes can only be mapped for propagation to non-linking resources (as, because of linking mapping, are already mapped both in propagation and synchronization to linking resources) Syncope will autonomously decide when to read or to write (as part of propagation) virtual attributes' values from linking resources The overall virtual attribute management is greatly simplified; as an additional bonus, this proposal does not touch neither REST endpoints nor transfer (TO) or patch objects. View page • Add comment • Like Stop watching space • Manage notifications This message was sent by Atlassian Confluence 5.8.4
[CONF] Apache Syncope > [DISCUSS] Virtual attributes management refactoring
Title: Message Title Francesco Chicchiricco created a page [DISCUSS] Virtual attributes management refactoring This page contains topics supporting ongoing discussion at d...@syncope.apache.org. Current implementation As reported, virtual attributes are attributes whose ownership is not of Syncope but of one or more external resources; such resources are said to be the linking resources for the given attribute. A virtual attribute needs to be explicitly assigned, e.g. instantiated from a given virtual schema, to a given user (or group or any object). Virtual attributes can be part of mapping for one or more resources: in propagation -> to set value(s) on the linking resources or other resources in synchronization -> to set value(s) on Syncope from linking resources At operation level: values must be fetch when reading users (groups, any objects) via REST - if mapped effective read invocation on the underlying connectors is reduced by using cache virtual attributes are populated into users (group, any objects) exclusively by VirAttrHandler, only when strictly required user (group, any object) update is often problematic: virtual attributes to be removed and updated need explicit management in PropagationManager when the same attribute is mapped for different resources (linking or not), a list of values is generated and it is not clear where the ownerships come from Refactoring proposal When defining a virtual schema, it is mandatory to define the linking resource(s); virtual attributes are not assigned any more to users (groups, any objects) View page • Add comment • Like Stop watching space • Manage notifications This message was sent by Atlassian Confluence 5.8.4
syncope git commit: changed message error, SYNCOPE-708
Repository: syncope Updated Branches: refs/heads/master 80248d5bd -> 009a87e08 changed message error, SYNCOPE-708 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/009a87e0 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/009a87e0 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/009a87e0 Branch: refs/heads/master Commit: 009a87e08da8fd6222f6683bb5726220d7c2 Parents: 80248d5 Author: massi Authored: Wed Oct 14 11:56:59 2015 +0200 Committer: massi Committed: Wed Oct 14 11:56:59 2015 +0200 -- .../java/org/apache/syncope/fit/core/reference/LoggerITCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/009a87e0/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/LoggerITCase.java -- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/LoggerITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/LoggerITCase.java index 6655342..928365f 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/LoggerITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/LoggerITCase.java @@ -220,7 +220,7 @@ public class LoggerITCase extends AbstractITCase { public void issueSYNCOPE708() { try { loggerService.read(LoggerType.LOG, "notExists"); -fail("Read a not exists logger, it should go in exception"); +fail("Reading non-existing logger, it should go in exception"); } catch (final WebServiceException ex) { fail("Exception is WebServiceException but it should be SyncopeClientException"); } catch (final SyncopeClientException ex) {
syncope git commit: changed message error, SYNCOPE-708
Repository: syncope Updated Branches: refs/heads/1_2_X 5063ce6e1 -> 91cb526c6 changed message error, SYNCOPE-708 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/91cb526c Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/91cb526c Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/91cb526c Branch: refs/heads/1_2_X Commit: 91cb526c6ccb853d20677562e812d88fc53c252d Parents: 5063ce6 Author: massi Authored: Wed Oct 14 11:56:13 2015 +0200 Committer: massi Committed: Wed Oct 14 11:56:13 2015 +0200 -- .../test/java/org/apache/syncope/core/rest/LoggerTestITCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/91cb526c/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java -- diff --git a/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java index 8092098..025dc25 100644 --- a/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java +++ b/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java @@ -221,7 +221,7 @@ public class LoggerTestITCase extends AbstractTest { public void issueSYNCOPE708() { try { loggerService.read(LoggerType.LOG, "notExists"); -fail("Read a not exists logger, it should go in exception"); +fail("Reading non-existing logger, it should go in exception"); } catch (final WebServiceException ex) { fail("Exception is WebServiceException but it should be SyncopeClientException"); } catch (final SyncopeClientException ex) {
syncope git commit: Fixed SYNCOPE-708
Repository: syncope Updated Branches: refs/heads/1_2_X 876fde9aa -> 5063ce6e1 Fixed SYNCOPE-708 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5063ce6e Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5063ce6e Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5063ce6e Branch: refs/heads/1_2_X Commit: 5063ce6e1b6db266470e42e17cae244b789e1dc4 Parents: 876fde9 Author: massi Authored: Wed Oct 14 11:51:54 2015 +0200 Committer: massi Committed: Wed Oct 14 11:51:54 2015 +0200 -- .../core/rest/controller/LoggerController.java | 32 +--- .../core/services/LoggerServiceImpl.java| 15 + .../syncope/core/rest/LoggerTestITCase.java | 16 ++ 3 files changed, 53 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/5063ce6e/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java -- diff --git a/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java b/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java index f38d0b2..d077cd1 100644 --- a/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java +++ b/core/src/main/java/org/apache/syncope/core/rest/controller/LoggerController.java @@ -116,6 +116,31 @@ public class LoggerController extends AbstractTransactionalController throw sce; } +@PreAuthorize("hasRole('LOG_LIST')") +@Transactional(readOnly = true) +public LoggerTO readLog(final String name) { +for (final LoggerTO logger : listLogs()) { +if (logger.getName().equals(name)) { +return logger; +} +} +throw new NotFoundException("Logger " + name); +} + +@PreAuthorize("hasRole('AUDIT_LIST')") +@Transactional(readOnly = true) +public LoggerTO readAudit(final String name) { +for (final AuditLoggerName logger : listAudits()) { +if (logger.toLoggerName().equals(name)) { +final LoggerTO loggerTO = new LoggerTO(); +loggerTO.setName(logger.toLoggerName()); +loggerTO.setLevel(LoggerLevel.DEBUG); +return loggerTO; +} +} +throw new NotFoundException("Logger " + name); +} + private LoggerTO setLevel(final String name, final Level level, final LoggerType expectedType) { SyncopeLogger syncopeLogger = loggerDAO.find(name); if (syncopeLogger == null) { @@ -213,11 +238,10 @@ public class LoggerController extends AbstractTransactionalController try { final ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(); -final MetadataReaderFactory metadataReaderFactory = -new CachingMetadataReaderFactory(resourcePatternResolver); +final MetadataReaderFactory metadataReaderFactory += new CachingMetadataReaderFactory(resourcePatternResolver); -final String packageSearchPath = -ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +final String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath( SystemPropertyUtils.resolvePlaceholders(this.getClass().getPackage().getName())) + "/" + "**/*.class"; http://git-wip-us.apache.org/repos/asf/syncope/blob/5063ce6e/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java -- diff --git a/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java b/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java index 1308e1f..2b106d1 100644 --- a/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java +++ b/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java @@ -80,13 +80,16 @@ public class LoggerServiceImpl extends AbstractServiceImpl implements LoggerServ @Override public LoggerTO read(final LoggerType type, final String name) { -List logger = list(type); -for (LoggerTO l : logger) { -if (l.getName().equals(name)) { -return l; -} +switch (type) { +case LOG: +return controller.readLog(name); + +case AUDIT: +return controller.readAudit(name); + +default: +throw new BadRequestException(); } -throw new NotFoundException(); } @Override http://git
[1/2] syncope git commit: Fixed SYNCOPE-708
Repository: syncope Updated Branches: refs/heads/master 36cc7725f -> 80248d5bd Fixed SYNCOPE-708 Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/89b54dad Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/89b54dad Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/89b54dad Branch: refs/heads/master Commit: 89b54dad90942a9cf3a83bc9ccc7a19c14c4b914 Parents: 6852628 Author: massi Authored: Wed Oct 14 11:41:39 2015 +0200 Committer: massi Committed: Wed Oct 14 11:41:39 2015 +0200 -- .../syncope/common/lib/types/Entitlement.java | 4 +++ .../apache/syncope/core/logic/LoggerLogic.java | 26 .../rest/cxf/service/LoggerServiceImpl.java | 16 ++-- .../fit/core/reference/ConfigurationITCase.java | 1 - .../fit/core/reference/LoggerITCase.java| 16 5 files changed, 55 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/89b54dad/common/lib/src/main/java/org/apache/syncope/common/lib/types/Entitlement.java -- diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/Entitlement.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/Entitlement.java index 406b805..20b8347 100644 --- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/Entitlement.java +++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/Entitlement.java @@ -222,6 +222,8 @@ public final class Entitlement { public static final String REPORT_EXECUTE = "REPORT_EXECUTE"; +public static final String LOG_READ = "LOG_READ"; + public static final String LOG_LIST = "LOG_LIST"; public static final String LOG_SET_LEVEL = "LOG_SET_LEVEL"; @@ -230,6 +232,8 @@ public final class Entitlement { public static final String AUDIT_LIST = "AUDIT_LIST"; +public static final String AUDIT_READ = "AUDIT_READ"; + public static final String AUDIT_ENABLE = "AUDIT_ENABLE"; public static final String AUDIT_DISABLE = "AUDIT_DISABLE"; http://git-wip-us.apache.org/repos/asf/syncope/blob/89b54dad/core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java -- diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java index d7a4dd7..30e7374 100644 --- a/core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java +++ b/core/logic/src/main/java/org/apache/syncope/core/logic/LoggerLogic.java @@ -134,6 +134,32 @@ public class LoggerLogic extends AbstractTransactionalLogic { throw sce; } +@PreAuthorize("hasRole('" + Entitlement.LOG_READ + "') and authentication.details.domain == " ++ "T(org.apache.syncope.common.lib.SyncopeConstants).MASTER_DOMAIN") +@Transactional(readOnly = true) +public LoggerTO readLog(final String name) { +for (final LoggerTO logger : listLogs()) { +if (logger.getKey().equals(name)) { +return logger; +} +} +throw new NotFoundException("Logger " + name); +} + +@PreAuthorize("hasRole('" + Entitlement.AUDIT_READ + "')") +@Transactional(readOnly = true) +public LoggerTO readAudit(final String name) { +for (final AuditLoggerName logger : listAudits()) { +if (logger.toLoggerName().equals(name)) { +final LoggerTO loggerTO = new LoggerTO(); +loggerTO.setKey(logger.toLoggerName()); +loggerTO.setLevel(LoggerLevel.DEBUG); +return loggerTO; +} +} +throw new NotFoundException("Logger " + name); +} + private LoggerTO setLevel(final String name, final Level level, final LoggerType expectedType) { Logger syncopeLogger = loggerDAO.find(name); if (syncopeLogger == null) { http://git-wip-us.apache.org/repos/asf/syncope/blob/89b54dad/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/LoggerServiceImpl.java -- diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/LoggerServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/LoggerServiceImpl.java index 4379754..32ae12c 100644 --- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/LoggerServiceImpl.java +++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/LoggerServiceImpl.java @@ -21,7 +21,6 @@ package org.apache.syncope.core.rest.cxf.service; import java.text.ParseException; import java.util.List; import j
[2/2] syncope git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/syncope
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/syncope Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/80248d5b Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/80248d5b Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/80248d5b Branch: refs/heads/master Commit: 80248d5bd0cdd714f5b118ef23aa3a3b3c1df88f Parents: 89b54da 36cc772 Author: massi Authored: Wed Oct 14 11:41:59 2015 +0200 Committer: massi Committed: Wed Oct 14 11:41:59 2015 +0200 -- .../syncope/core/logic/ConfigurationLogic.java | 5 +- .../apache/syncope/core/logic/PolicyLogic.java | 30 +- deb/core/pom.xml| 6 + pom.xml | 34 +- src/main/asciidoc/docinfo-footer.html | 23 + src/main/asciidoc/getting-started.adoc | 59 +++ .../getting-started/docinfo-footer.html | 23 - .../getting-started/getting-started.adoc| 69 --- .../getting-started/images/architecture.png | Bin 62994 -> 0 bytes .../getting-started/images/architecture.xml | 20 - .../images/identityLifecycle.png| Bin 121230 -> 0 bytes .../asciidoc/getting-started/introduction.adoc | 114 - .../getting-started/systemRequirements.adoc | 50 --- src/main/asciidoc/images/architecture.png | Bin 0 -> 62994 bytes src/main/asciidoc/images/architecture.xml | 20 + src/main/asciidoc/images/identityLifecycle.png | Bin 0 -> 121230 bytes src/main/asciidoc/images/installer1.png | Bin 0 -> 160690 bytes src/main/asciidoc/images/installer10.png| Bin 0 -> 45440 bytes src/main/asciidoc/images/installer2.png | Bin 0 -> 53017 bytes src/main/asciidoc/images/installer3.png | Bin 0 -> 46889 bytes src/main/asciidoc/images/installer4.png | Bin 0 -> 38073 bytes src/main/asciidoc/images/installer5.png | Bin 0 -> 48416 bytes src/main/asciidoc/images/installer6.png | Bin 0 -> 39613 bytes src/main/asciidoc/images/installer7.png | Bin 0 -> 40130 bytes src/main/asciidoc/images/installer8.png | Bin 0 -> 41467 bytes src/main/asciidoc/images/installer9.png | Bin 0 -> 42059 bytes src/main/asciidoc/introduction.adoc | 114 + src/main/asciidoc/obtain.adoc | 431 +++ src/main/asciidoc/reference-guide.adoc | 148 +++ .../reference-guide/docinfo-footer.html | 23 - .../reference-guide/reference-guide.adoc| 148 --- src/main/asciidoc/systemRequirements.adoc | 51 +++ 32 files changed, 873 insertions(+), 495 deletions(-) --