Return-Path: X-Original-To: apmail-ace-commits-archive@www.apache.org Delivered-To: apmail-ace-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 67C60180C8 for ; Fri, 19 Feb 2016 08:36:19 +0000 (UTC) Received: (qmail 84824 invoked by uid 500); 19 Feb 2016 08:36:19 -0000 Delivered-To: apmail-ace-commits-archive@ace.apache.org Received: (qmail 84796 invoked by uid 500); 19 Feb 2016 08:36:19 -0000 Mailing-List: contact commits-help@ace.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ace.apache.org Delivered-To: mailing list commits@ace.apache.org Received: (qmail 84784 invoked by uid 99); 19 Feb 2016 08:36:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Feb 2016 08:36:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BDD18C13E4 for ; Fri, 19 Feb 2016 08:36:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.794 X-Spam-Level: * X-Spam-Status: No, score=1.794 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.006] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id jcm8uMS7OrXe for ; Fri, 19 Feb 2016 08:36:14 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 1F5315FB1B for ; Fri, 19 Feb 2016 08:36:14 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 697F2E02E4 for ; Fri, 19 Feb 2016 08:36:13 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 5E7683A0185 for ; Fri, 19 Feb 2016 08:36:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1731198 [2/2] - in /ace/trunk: build/ org.apache.ace.authentication.itest/ org.apache.ace.authentication.itest/src/org/apache/ace/it/authentication/ org.apache.ace.client.repository.itest/ org.apache.ace.client.repository/ org.apache.ace.c... Date: Fri, 19 Feb 2016 08:36:12 -0000 To: commits@ace.apache.org From: jawi@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160219083613.5E7683A0185@svn01-us-west.apache.org> Added: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/RepositoryUser.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/RepositoryUser.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/RepositoryUser.java (added) +++ ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/RepositoryUser.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,134 @@ +/* + * 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.ace.useradmin.repository; + +import java.io.IOException; +import java.util.Dictionary; +import java.util.Enumeration; +import java.util.concurrent.atomic.AtomicLong; + +import org.apache.ace.repository.ext.CachedRepository; +import org.osgi.service.useradmin.User; + +/** + * Wrapper for {@link User} that prevents changes to the user when the store is out of sync with the main repository + */ +public class RepositoryUser implements User { + + private User m_delegate; + private CachedRepository m_cachedRepository; + private AtomicLong m_version; + + public RepositoryUser(User user, CachedRepository cachedRepository, AtomicLong version) { + m_delegate = user; + m_cachedRepository = cachedRepository; + m_version = version; + } + + @Override + public String getName() { + return m_delegate.getName(); + } + + @Override + public int getType() { + return m_delegate.getType(); + } + + @SuppressWarnings("rawtypes") + @Override + public Dictionary getProperties() { + return new RepoProperties(m_delegate.getProperties()); + } + + @SuppressWarnings("rawtypes") + @Override + public Dictionary getCredentials() { + return new RepoProperties(m_delegate.getCredentials()); + } + + @Override + public boolean hasCredential(String key, Object value) { + return m_delegate.hasCredential(key, value); + } + + @SuppressWarnings("rawtypes") + private class RepoProperties extends Dictionary { + + private Dictionary m_delegate; + + public RepoProperties(Dictionary dictionary) { + this.m_delegate = dictionary; + + } + + @Override + public int size() { + return m_delegate.size(); + } + + @Override + public boolean isEmpty() { + return m_delegate.isEmpty(); + } + + @Override + public Enumeration keys() { + return m_delegate.keys(); + } + + @Override + public Enumeration elements() { + return m_delegate.elements(); + } + + @Override + public Object get(Object key) { + return m_delegate.get(key); + } + + @SuppressWarnings("unchecked") + @Override + public Object put(Object key, Object value) { + checkRepoUpToDate(); + return m_delegate.put(key, value); + } + + @Override + public Object remove(Object key) { + checkRepoUpToDate(); + return m_delegate.remove(key); + } + + } + + protected void checkRepoUpToDate() { + try { + if (!m_cachedRepository.isCurrent()) { + throw new IllegalStateException("Repository out of date, refresh first"); + } + if (m_version.get() != m_cachedRepository.getMostRecentVersion()) { + throw new IllegalStateException("User out of date, refresh first"); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} Propchange: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/RepositoryUser.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/GroupDTO.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/GroupDTO.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/GroupDTO.java (added) +++ ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/GroupDTO.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,41 @@ +/* + * 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.ace.useradmin.repository.xstream; + +import java.util.List; +import java.util.Properties; + +import org.osgi.service.useradmin.Group; +import org.osgi.service.useradmin.Role; + +public class GroupDTO extends RoleDTO { + + protected GroupDTO() { + // Only used for XStream deserialization + super(Role.GROUP); + } + + public GroupDTO(String name, Properties properties, Properties credentials, List memberOf) { + super(Role.GROUP, name, properties, credentials, memberOf); + } + + public GroupDTO(Group group, List memberOf) { + this(group.getName(), toProperties(group.getProperties()), toProperties(group.getCredentials()), memberOf); + } +} \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/GroupDTO.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/PropertiesConverter.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/PropertiesConverter.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/PropertiesConverter.java (added) +++ ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/PropertiesConverter.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,72 @@ +/* + * 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.ace.useradmin.repository.xstream; + +import java.util.Enumeration; +import java.util.Properties; + +import com.thoughtworks.xstream.converters.Converter; +import com.thoughtworks.xstream.converters.MarshallingContext; +import com.thoughtworks.xstream.converters.UnmarshallingContext; +import com.thoughtworks.xstream.io.HierarchicalStreamReader; +import com.thoughtworks.xstream.io.HierarchicalStreamWriter; + +public class PropertiesConverter implements Converter { + + @Override + public boolean canConvert(@SuppressWarnings("rawtypes") Class clazz) { + return Properties.class.isAssignableFrom(clazz); + } + + @Override + public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { + Properties properties = new Properties(); + + while (reader.hasMoreChildren()) { + reader.moveDown(); + properties.put(reader.getNodeName(), reader.getValue()); + reader.moveUp(); + } + + return properties; + } + + @Override + public void marshal(Object propertiesObject, HierarchicalStreamWriter writer, MarshallingContext context) { + if (propertiesObject == null ){ + return; + } + + Properties properties = (Properties) propertiesObject; + if (properties.isEmpty()){ + return; + } + + Enumeration propertyNames = properties.propertyNames(); + while (propertyNames.hasMoreElements()) { + String name = (String) propertyNames.nextElement(); + String value = (String) properties.getProperty(name); + + writer.startNode(name); + writer.setValue(value); + writer.endNode(); + + } + } +} \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/PropertiesConverter.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/RoleDTO.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/RoleDTO.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/RoleDTO.java (added) +++ ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/RoleDTO.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,55 @@ +/* + * 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.ace.useradmin.repository.xstream; + +import java.util.Dictionary; +import java.util.Enumeration; +import java.util.List; +import java.util.Properties; + +public abstract class RoleDTO { + public final int type; + public final String name; + public final Properties properties; + public final Properties credentials; + public final List memberOf; + + protected RoleDTO(int type) { + this(type, null, null, null, null); + } + + protected RoleDTO(int type, String name, Properties properties, Properties credentials, List memberOf) { + this.type = type; + this.properties = properties; + this.credentials = credentials; + this.name = name; + this.memberOf = memberOf; + } + + @SuppressWarnings("rawtypes") + static Properties toProperties(Dictionary dict) { + Properties properties = new Properties(); + Enumeration keys = dict.keys(); + while (keys.hasMoreElements()) { + Object key = (Object) keys.nextElement(); + properties.put(key, dict.get(key)); + } + return properties; + } +} \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/RoleDTO.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/UserDTO.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/UserDTO.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/UserDTO.java (added) +++ ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/UserDTO.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,42 @@ +/* + * 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.ace.useradmin.repository.xstream; + +import java.util.List; +import java.util.Properties; + +import org.osgi.service.useradmin.Role; +import org.osgi.service.useradmin.User; + +public class UserDTO extends RoleDTO { + + protected UserDTO() { + // Only used for XStream deserialization + super(Role.USER); + } + + public UserDTO(String name, Properties properties, Properties credentials, List memberOf) { + super(Role.USER, name, properties, credentials, memberOf); + } + + public UserDTO(User user, List memberOf) { + this(user.getName(), toProperties(user.getProperties()), toProperties(user.getCredentials()), memberOf); + } + +} \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/UserDTO.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/XStreamFactory.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/XStreamFactory.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/XStreamFactory.java (added) +++ ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/XStreamFactory.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,41 @@ +/* + * 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.ace.useradmin.repository.xstream; + +import com.thoughtworks.xstream.XStream; + +public class XStreamFactory { + + private XStreamFactory() { + // Not used + } + + public static XStream getInstance() { + XStream xStream = new XStream(); + xStream.alias("group", GroupDTO.class); + xStream.alias("user", UserDTO.class); + xStream.useAttributeFor(RoleDTO.class, "name"); + xStream.addImplicitCollection(RoleDTO.class, "memberOf", "memberof", String.class); + + xStream.registerConverter(new PropertiesConverter(), 10); + xStream.omitField(RoleDTO.class, "type"); + return xStream; + } + +} Propchange: ace/trunk/org.apache.ace.useradmin/src/org/apache/ace/useradmin/repository/xstream/XStreamFactory.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/test/aceDefault.xml URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/test/aceDefault.xml?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/test/aceDefault.xml (added) +++ ace/trunk/org.apache.ace.useradmin/test/aceDefault.xml Fri Feb 19 08:36:10 2016 @@ -0,0 +1,311 @@ + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + permissionGroup + + + + + userGroup + + createArtifact + updateArtifact + removeArtifact + viewArtifact + editArtifact + createFeature + removeFeature + associateArtifactToFeature + associateFeatureToDistribution + removeArtifactToFeatureAssociation + removeFeatureToDistributionAssociation + viewFeature + editFeature + viewDistribution + editDistribution + createDistribution + removeDistribution + associateDistributionToTarget + viewTarget + editTarget + createTarget + removeTarget + approveTarget + registerTarget + removeDistributionToTargetAssociation + mock + editUsers + + + + userGroup + + viewArtifact + viewFeature + viewDistribution + viewTarget + approveTarget + + + + userGroup + + viewArtifact + viewFeature + viewDistribution + editDistribution + createDistribution + removeDistribution + associateDistributionToTarget + viewTarget + removeDistributionToTargetAssociation + + + + userGroup + + createArtifact + updateArtifact + removeArtifact + viewArtifact + editArtifact + createFeature + removeFeature + associateArtifactToFeature + associateFeatureToDistribution + removeArtifactToFeatureAssociation + removeFeatureToDistributionAssociation + viewFeature + editFeature + viewDistribution + viewTarget + + + + userGroup + + viewArtifact + viewFeature + viewDistribution + viewTarget + editTarget + createTarget + removeTarget + registerTarget + + + + userGroup + + createArtifact + updateArtifact + removeArtifact + viewArtifact + editArtifact + createFeature + removeFeature + associateArtifactToFeature + associateFeatureToDistribution + removeArtifactToFeatureAssociation + removeFeatureToDistributionAssociation + viewFeature + editFeature + viewDistribution + editDistribution + createDistribution + removeDistribution + associateDistributionToTarget + viewTarget + editTarget + createTarget + removeTarget + approveTarget + registerTarget + removeDistributionToTargetAssociation + mock + + + + d + + + f + + TestGroup + + + + lm + + + lm + + Distribution Manager + + + + go + + + go + + Target Operator + + + + rm + + + rm + + Release Manager + + + + gm + + + gm + + Target Manager + + + + elm + + + elm + + External Distribution Manager + + \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/test/aceDefault.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ace/trunk/org.apache.ace.useradmin/test/aceDefault.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ace/trunk/org.apache.ace.useradmin/test/current.xml URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/test/current.xml?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/test/current.xml (added) +++ ace/trunk/org.apache.ace.useradmin/test/current.xml Fri Feb 19 08:36:10 2016 @@ -0,0 +1 @@ + permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup permissionGroup userGroup createArtifact updateArtifact removeArtifact viewArtifact editArtifact createFeature removeFeature assoc iateArtifactToFeature associateFeatureToDistribution removeArtifactToFeatureAssociation removeFeatureToDistributionAssociation viewFeature editFeature viewDistribution editDistribution createDistribution removeDistribution associateDistributionToTarget viewTarget editTarget createTarget removeTarget approveTarget registerTarget removeDistributionToTargetAssociation mock editUsers userGroup viewArtifact viewFeature viewDistribution viewTarget approveTarget userGroup viewArtifact viewFeature viewDistribution editDistribution createDistribution removeDistribution associateDistributionToTarget viewTarget removeDistributionToTargetAssociation userGroup createArtifact updateArtifact removeArtifact viewArtifact editArtifact createFeature removeFeature associateArtifactToFeature associateFeatureToDistribution removeArtifactToFeatureAssociatio n removeFeatureToDistributionAssociation viewFeature editFeature viewDistribution viewTarget userGroup viewArtifact viewFeature viewDistribution viewTarget editTarget createTarget removeTarget registerTarget userGroup createArtifact updateArtifact removeArtifact viewArtifact editArtifact createFeature removeFeature associateArtifactToFeature associateFeatureTo Distribution removeArtifactToFeatureAssociation removeFeatureToDistributionAssociation viewFeature editFeature viewDistribution editDistribution createDistribution removeDistribution associateDistributionToTarget viewTarget editTarget createTarget removeTarget approveTarget registerTarget removeDistributionToTargetAssociation mock d f TestGroup lm lm Distribution Manager go go Target Operator rm rm Release Manager gm gm Target Manager elm elm External Distribution Manager \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/test/current.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ace/trunk/org.apache.ace.useradmin/test/current.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ace/trunk/org.apache.ace.useradmin/test/org/apache/ace/useradmin/repository/xstream/XStreamTest.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/test/org/apache/ace/useradmin/repository/xstream/XStreamTest.java?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/test/org/apache/ace/useradmin/repository/xstream/XStreamTest.java (added) +++ ace/trunk/org.apache.ace.useradmin/test/org/apache/ace/useradmin/repository/xstream/XStreamTest.java Fri Feb 19 08:36:10 2016 @@ -0,0 +1,99 @@ +/* + * 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.ace.useradmin.repository.xstream; + +import static org.testng.Assert.assertEquals; + +import java.io.File; +import java.io.FileReader; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Reader; +import java.io.StringWriter; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Properties; + +import org.testng.annotations.Test; + +import com.thoughtworks.xstream.XStream; + +public class XStreamTest { + + @Test + public void testRead() throws Exception { + XStream xStream = XStreamFactory.getInstance(); + + Reader reader = new FileReader(new File("test/valid.xml")); + ObjectInputStream objectInputStream = xStream.createObjectInputStream(reader); + GroupDTO testgroup = (GroupDTO) objectInputStream.readObject(); + assertEquals(testgroup.name, "testgroup"); + assertEquals(testgroup.properties.get("type"), "testGroupType"); + assertEquals(testgroup.properties.get("other"), "otherTestProperty"); + + GroupDTO testgroup2 = (GroupDTO) objectInputStream.readObject(); + assertEquals(testgroup2.name, "testgroup2"); + assertEquals(testgroup2.properties.get("type"), "otherGroupType"); + assertEquals(testgroup2.memberOf, Arrays.asList("testgroup")); + + UserDTO testuser = (UserDTO) objectInputStream.readObject(); + assertEquals(testuser.name, "testuser"); + assertEquals(testuser.properties.get("username"), "testuser"); + assertEquals(testuser.credentials.get("password"), "test"); + assertEquals(testuser.memberOf, Arrays.asList("testgroup2")); + + } + + @Test + public void testWrite() throws Exception { + XStream xStream = XStreamFactory.getInstance(); + + StringWriter sw = new StringWriter(); + ObjectOutputStream objectOutputStream = xStream.createObjectOutputStream(sw, "roles"); + + objectOutputStream.writeObject( + new GroupDTO("testgroup", properties("type", "testGroupType", "other", "otherTestProperty"), null, null)); + objectOutputStream.writeObject( + new GroupDTO("testgroup2", properties("type", "otherGroupType"), null, Arrays.asList("testgroup"))); + objectOutputStream.writeObject( + new UserDTO("testuser", properties("username", "testuser"), properties("password", "test"), Arrays.asList("testgroup2"))); + + objectOutputStream.flush(); + objectOutputStream.close(); + + String outputString = sw.toString(); + + byte[] encoded = Files.readAllBytes(Paths.get("test/valid.xml")); + String validXmlFileString = new String(encoded); + + assertEquals(outputString, validXmlFileString); + } + + + + private static Properties properties(String... pairs) { + Properties properties = new Properties(); + for (int i = 0; i < pairs.length - 1; i += 2){ + properties.put(pairs[i], pairs[i +1]); + } + return properties; + } + +} Propchange: ace/trunk/org.apache.ace.useradmin/test/org/apache/ace/useradmin/repository/xstream/XStreamTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: ace/trunk/org.apache.ace.useradmin/test/valid.xml URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin/test/valid.xml?rev=1731198&view=auto ============================================================================== --- ace/trunk/org.apache.ace.useradmin/test/valid.xml (added) +++ ace/trunk/org.apache.ace.useradmin/test/valid.xml Fri Feb 19 08:36:10 2016 @@ -0,0 +1,23 @@ + + + + otherTestProperty + testGroupType + + + + + otherGroupType + + testgroup + + + + testuser + + + test + + testgroup2 + + \ No newline at end of file Propchange: ace/trunk/org.apache.ace.useradmin/test/valid.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ace/trunk/org.apache.ace.useradmin/test/valid.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ace/trunk/run-client/client.bndrun URL: http://svn.apache.org/viewvc/ace/trunk/run-client/client.bndrun?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-client/client.bndrun (original) +++ ace/trunk/run-client/client.bndrun Fri Feb 19 08:36:10 2016 @@ -4,7 +4,6 @@ -runee: JavaSE-1.7 -runbundles: org.apache.felix.dependencymanager,\ org.apache.felix.useradmin,\ - org.apache.felix.useradmin.filestore,\ org.apache.felix.log,\ org.apache.felix.prefs,\ org.apache.felix.configadmin,\ @@ -28,7 +27,6 @@ org.apache.ace.client.repository.impl;version=latest,\ org.apache.ace.client.rest;version=latest,\ org.apache.ace.client.workspace;version=latest,\ - org.apache.ace.configurator.useradmin.task;version=latest,\ org.apache.ace.configurator.impl;version=latest,\ org.apache.ace.connectionfactory;version=latest,\ org.apache.ace.consolelogger;version=latest,\ @@ -49,6 +47,7 @@ org.apache.ace.log.server.ui;version=latest,\ org.apache.ace.tageditor;version=latest,\ org.apache.ace.target.mgmt.ui;version=latest,\ + org.apache.ace.useradmin.repository;version=latest,\ org.apache.ace.useradmin.ui;version=latest,\ org.apache.ace.webui.vaadin;version=latest,\ org.apache.ace.gogo;version=latest,\ Modified: ace/trunk/run-client/conf/org.apache.ace.scheduler.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-client/conf/org.apache.ace.scheduler.cfg?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-client/conf/org.apache.ace.scheduler.cfg (original) +++ ace/trunk/run-client/conf/org.apache.ace.scheduler.cfg Fri Feb 19 08:36:10 2016 @@ -1,5 +1,4 @@ # Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2 (http://www.apache.org/licenses/LICENSE-2.0). auditlog = 2000 -org.apache.ace.configurator.useradmin.task.UpdateUserAdminTask = 2000 org.apache.ace.log.server.task.LogSyncTask = 2000 Added: ace/trunk/run-client/conf/org.apache.ace.useradmin.repository.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-client/conf/org.apache.ace.useradmin.repository.cfg?rev=1731198&view=auto ============================================================================== --- ace/trunk/run-client/conf/org.apache.ace.useradmin.repository.cfg (added) +++ ace/trunk/run-client/conf/org.apache.ace.useradmin.repository.cfg Fri Feb 19 08:36:10 2016 @@ -0,0 +1,3 @@ +repositoryname=user +repositoryCustomer=apache +repositoryLocation=http://${org.apache.ace.server}/repository \ No newline at end of file Added: ace/trunk/run-obr/conf/org.apache.ace.connectionfactory/repository.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-obr/conf/org.apache.ace.connectionfactory/repository.cfg?rev=1731198&view=auto ============================================================================== --- ace/trunk/run-obr/conf/org.apache.ace.connectionfactory/repository.cfg (added) +++ ace/trunk/run-obr/conf/org.apache.ace.connectionfactory/repository.cfg Fri Feb 19 08:36:10 2016 @@ -0,0 +1,7 @@ +# Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2 (http://www.apache.org/licenses/LICENSE-2.0). + +authentication.baseURL = http://${org.apache.ace.server}/repository/ +authentication.type = none +#authentication.user.name = d +#authentication.user.password = f + Added: ace/trunk/run-obr/conf/org.apache.ace.useradmin.repository.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-obr/conf/org.apache.ace.useradmin.repository.cfg?rev=1731198&view=auto ============================================================================== --- ace/trunk/run-obr/conf/org.apache.ace.useradmin.repository.cfg (added) +++ ace/trunk/run-obr/conf/org.apache.ace.useradmin.repository.cfg Fri Feb 19 08:36:10 2016 @@ -0,0 +1,3 @@ +repositoryname=user +repositoryCustomer=apache +repositoryLocation=http://${org.apache.ace.server}/repository \ No newline at end of file Modified: ace/trunk/run-obr/obr.bndrun URL: http://svn.apache.org/viewvc/ace/trunk/run-obr/obr.bndrun?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-obr/obr.bndrun (original) +++ ace/trunk/run-obr/obr.bndrun Fri Feb 19 08:36:10 2016 @@ -12,14 +12,19 @@ org.apache.felix.http.servlet-api,\ org.apache.felix.http.jetty,\ org.apache.felix.useradmin,\ - org.apache.felix.useradmin.filestore,\ org.apache.ace.http.listener;version=latest,\ org.apache.ace.configurator.impl;version=latest,\ org.apache.ace.obr.metadata;version=latest,\ org.apache.ace.obr.storage;version=latest,\ org.apache.ace.authentication.api;version=latest,\ org.apache.ace.authentication.impl;version=latest,\ + org.apache.ace.authentication.processor.basicauth;version=latest,\ + org.apache.ace.authentication.processor.password;version=latest,\ org.apache.ace.obr.servlet;version=latest,\ + org.apache.ace.useradmin.repository;version=latest,\ + org.apache.ace.connectionfactory;version=latest,\ + org.apache.ace.range.api;version=latest,\ + org.apache.ace.repository.api;version=latest,\ osgi.cmpn -runrepos: Workspace,\ @@ -28,5 +33,6 @@ org.apache.felix.eventadmin.Timeout=0,\ org.osgi.service.http.port=8082,\ org.apache.felix.log.maxSize=1000,\ + org.apache.ace.server=localhost:8080,\ launch.keep=true,\ launch.storage.dir=bundle-cache Added: ace/trunk/run-relay/conf/org.apache.ace.useradmin.repository.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-relay/conf/org.apache.ace.useradmin.repository.cfg?rev=1731198&view=auto ============================================================================== --- ace/trunk/run-relay/conf/org.apache.ace.useradmin.repository.cfg (added) +++ ace/trunk/run-relay/conf/org.apache.ace.useradmin.repository.cfg Fri Feb 19 08:36:10 2016 @@ -0,0 +1,3 @@ +repositoryname=user +repositoryCustomer=apache +repositoryLocation=http://${org.apache.ace.server}/repository \ No newline at end of file Modified: ace/trunk/run-relay/relay.bndrun URL: http://svn.apache.org/viewvc/ace/trunk/run-relay/relay.bndrun?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-relay/relay.bndrun (original) +++ ace/trunk/run-relay/relay.bndrun Fri Feb 19 08:36:10 2016 @@ -4,7 +4,6 @@ -runee: JavaSE-1.7 -runbundles: org.apache.felix.dependencymanager,\ org.apache.felix.useradmin,\ - org.apache.felix.useradmin.filestore,\ org.apache.felix.log,\ org.apache.felix.prefs,\ org.apache.felix.configadmin,\ @@ -40,7 +39,8 @@ org.apache.ace.repository.impl;version=latest,\ org.apache.ace.repository.servlets;version=latest,\ org.apache.ace.repository.task;version=latest,\ - org.apache.ace.scheduler.impl;version=latest + org.apache.ace.scheduler.impl;version=latest,\ + org.apache.ace.useradmin.repository;version=latest -runrepos: Workspace,\ Release -runproperties: org.apache.felix.log.storeDebug=true,\ Modified: ace/trunk/run-server-allinone/conf/org.apache.ace.scheduler.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-server-allinone/conf/org.apache.ace.scheduler.cfg?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-server-allinone/conf/org.apache.ace.scheduler.cfg (original) +++ ace/trunk/run-server-allinone/conf/org.apache.ace.scheduler.cfg Fri Feb 19 08:36:10 2016 @@ -1,4 +1,3 @@ # Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2 (http://www.apache.org/licenses/LICENSE-2.0). auditlog = 2000 -org.apache.ace.configurator.useradmin.task.UpdateUserAdminTask = 2000 Added: ace/trunk/run-server-allinone/conf/org.apache.ace.useradmin.repository.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-server-allinone/conf/org.apache.ace.useradmin.repository.cfg?rev=1731198&view=auto ============================================================================== --- ace/trunk/run-server-allinone/conf/org.apache.ace.useradmin.repository.cfg (added) +++ ace/trunk/run-server-allinone/conf/org.apache.ace.useradmin.repository.cfg Fri Feb 19 08:36:10 2016 @@ -0,0 +1,3 @@ +repositoryname=user +repositoryCustomer=apache +repositoryLocation=http://${org.apache.ace.server}/repository \ No newline at end of file Modified: ace/trunk/run-server-allinone/server-allinone.bndrun URL: http://svn.apache.org/viewvc/ace/trunk/run-server-allinone/server-allinone.bndrun?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-server-allinone/server-allinone.bndrun (original) +++ ace/trunk/run-server-allinone/server-allinone.bndrun Fri Feb 19 08:36:10 2016 @@ -4,7 +4,6 @@ -runee: JavaSE-1.7 -runbundles: org.apache.felix.dependencymanager,\ org.apache.felix.useradmin,\ - org.apache.felix.useradmin.filestore,\ org.apache.felix.log,\ org.apache.felix.prefs,\ org.apache.felix.configadmin,\ @@ -28,7 +27,6 @@ org.apache.ace.client.repository.impl;version=latest,\ org.apache.ace.client.rest;version=latest,\ org.apache.ace.client.workspace;version=latest,\ - org.apache.ace.configurator.useradmin.task;version=latest,\ org.apache.ace.configurator.impl;version=latest,\ org.apache.ace.connectionfactory;version=latest,\ org.apache.ace.consolelogger;version=latest,\ @@ -55,6 +53,7 @@ org.apache.ace.scheduler.impl;version=latest,\ org.apache.ace.tageditor;version=latest,\ org.apache.ace.target.mgmt.ui;version=latest,\ + org.apache.ace.useradmin.repository;version=latest,\ org.apache.ace.useradmin.ui;version=latest,\ org.apache.ace.verifier.impl;version=latest,\ org.apache.ace.verifier.ui;version=latest,\ Modified: ace/trunk/run-server/conf/org.apache.ace.scheduler.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-server/conf/org.apache.ace.scheduler.cfg?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-server/conf/org.apache.ace.scheduler.cfg (original) +++ ace/trunk/run-server/conf/org.apache.ace.scheduler.cfg Fri Feb 19 08:36:10 2016 @@ -1,4 +1,3 @@ # Licensed to the Apache Software Foundation (ASF) under the terms of ASLv2 (http://www.apache.org/licenses/LICENSE-2.0). auditlog = 2000 -org.apache.ace.configurator.useradmin.task.UpdateUserAdminTask = 2000 Added: ace/trunk/run-server/conf/org.apache.ace.useradmin.repository.cfg URL: http://svn.apache.org/viewvc/ace/trunk/run-server/conf/org.apache.ace.useradmin.repository.cfg?rev=1731198&view=auto ============================================================================== --- ace/trunk/run-server/conf/org.apache.ace.useradmin.repository.cfg (added) +++ ace/trunk/run-server/conf/org.apache.ace.useradmin.repository.cfg Fri Feb 19 08:36:10 2016 @@ -0,0 +1,3 @@ +repositoryname=user +repositoryCustomer=apache +repositoryLocation=http://${org.apache.ace.server}/repository \ No newline at end of file Modified: ace/trunk/run-server/server.bndrun URL: http://svn.apache.org/viewvc/ace/trunk/run-server/server.bndrun?rev=1731198&r1=1731197&r2=1731198&view=diff ============================================================================== --- ace/trunk/run-server/server.bndrun (original) +++ ace/trunk/run-server/server.bndrun Fri Feb 19 08:36:10 2016 @@ -4,7 +4,6 @@ -runee: JavaSE-1.7 -runbundles: org.apache.felix.dependencymanager,\ org.apache.felix.useradmin,\ - org.apache.felix.useradmin.filestore,\ org.apache.felix.log,\ org.apache.felix.prefs,\ org.apache.felix.configadmin,\ @@ -20,7 +19,7 @@ org.apache.ace.authentication.impl;version=latest,\ org.apache.ace.authentication.processor.basicauth;version=latest,\ org.apache.ace.authentication.processor.password;version=latest,\ - org.apache.ace.configurator.useradmin.task;version=latest,\ + org.apache.ace.useradmin.repository;version=latest,\ org.apache.ace.configurator.impl;version=latest,\ org.apache.ace.connectionfactory;version=latest,\ org.apache.ace.deployment.provider.api;version=latest,\