diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/GroupClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/GroupClientHandler.java new file mode 100644 index 0000000000..93fe52cc8d --- /dev/null +++ b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/GroupClientHandler.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2010, Sebastian Sdorra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of SCM-Manager; nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://bitbucket.org/sdorra/scm-manager + * + */ + + + +package sonia.scm.client; + +//~--- non-JDK imports -------------------------------------------------------- + +import sonia.scm.group.Group; + +/** + * + * @author Sebastian Sdorra + */ +public interface GroupClientHandler extends ClientHandler {} diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java index c1f21e841b..7523460478 100644 --- a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java +++ b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/ScmClientSession.java @@ -36,7 +36,6 @@ package sonia.scm.client; //~--- non-JDK imports -------------------------------------------------------- import sonia.scm.ScmState; -import sonia.scm.group.Group; import sonia.scm.user.User; //~--- JDK imports ------------------------------------------------------------ @@ -65,7 +64,7 @@ public interface ScmClientSession extends Closeable * * @return */ - public ClientHandler getGroupHandler(); + public GroupClientHandler getGroupHandler(); /** * Method description @@ -89,5 +88,5 @@ public interface ScmClientSession extends Closeable * * @return */ - public ClientHandler getUserHandler(); + public UserClientHandler getUserHandler(); } diff --git a/scm-clients/scm-client-api/src/main/java/sonia/scm/client/UserClientHandler.java b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/UserClientHandler.java new file mode 100644 index 0000000000..59192ba5a7 --- /dev/null +++ b/scm-clients/scm-client-api/src/main/java/sonia/scm/client/UserClientHandler.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2010, Sebastian Sdorra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of SCM-Manager; nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://bitbucket.org/sdorra/scm-manager + * + */ + + + +package sonia.scm.client; + +//~--- non-JDK imports -------------------------------------------------------- + +import sonia.scm.user.User; + +/** + * + * @author Sebastian Sdorra + */ +public interface UserClientHandler extends ClientHandler {} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java index be362612e4..c9ea432b31 100644 --- a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java +++ b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyClientSession.java @@ -39,8 +39,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sonia.scm.ScmState; -import sonia.scm.group.Group; -import sonia.scm.user.User; //~--- JDK imports ------------------------------------------------------------ @@ -113,9 +111,9 @@ public class JerseyClientSession implements ScmClientSession * @return */ @Override - public ClientHandler getGroupHandler() + public GroupClientHandler getGroupHandler() { - throw new UnsupportedOperationException("Not supported yet."); + return new JerseyGroupClientHandler(this); } /** @@ -160,9 +158,9 @@ public class JerseyClientSession implements ScmClientSession * @return */ @Override - public ClientHandler getUserHandler() + public UserClientHandler getUserHandler() { - throw new UnsupportedOperationException("Not supported yet."); + return new JerseyUserClientHandler(this); } //~--- fields --------------------------------------------------------------- diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyGroupClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyGroupClientHandler.java new file mode 100644 index 0000000000..ded3967637 --- /dev/null +++ b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyGroupClientHandler.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2010, Sebastian Sdorra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of SCM-Manager; nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://bitbucket.org/sdorra/scm-manager + * + */ + + + +package sonia.scm.client; + +//~--- non-JDK imports -------------------------------------------------------- + +import sonia.scm.group.Group; + +//~--- JDK imports ------------------------------------------------------------ + +import java.util.List; + +/** + * + * @author Sebastian Sdorra + */ +public class JerseyGroupClientHandler implements GroupClientHandler +{ + + /** + * Constructs ... + * + * + * @param session + */ + public JerseyGroupClientHandler(JerseyClientSession session) + { + this.session = session; + } + + //~--- methods -------------------------------------------------------------- + + /** + * Method description + * + * + * @param item + */ + @Override + public void create(Group item) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @param id + */ + @Override + public void delete(String id) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @param item + */ + @Override + public void delete(Group item) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @param item + */ + @Override + public void modify(Group item) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + //~--- get methods ---------------------------------------------------------- + + /** + * Method description + * + * + * @param id + * + * @return + */ + @Override + public Group get(String id) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @return + */ + @Override + public List getAll() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + //~--- fields --------------------------------------------------------------- + + /** Field description */ + private JerseyClientSession session; +} diff --git a/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyUserClientHandler.java b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyUserClientHandler.java new file mode 100644 index 0000000000..f3ee4b780d --- /dev/null +++ b/scm-clients/scm-client-impl/src/main/java/sonia/scm/client/JerseyUserClientHandler.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2010, Sebastian Sdorra + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of SCM-Manager; nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://bitbucket.org/sdorra/scm-manager + * + */ + + + +package sonia.scm.client; + +//~--- non-JDK imports -------------------------------------------------------- + +import sonia.scm.user.User; + +//~--- JDK imports ------------------------------------------------------------ + +import java.util.List; + +/** + * + * @author Sebastian Sdorra + */ +public class JerseyUserClientHandler implements UserClientHandler +{ + + /** + * Constructs ... + * + * + * @param session + */ + public JerseyUserClientHandler(JerseyClientSession session) + { + this.session = session; + } + + //~--- methods -------------------------------------------------------------- + + /** + * Method description + * + * + * @param item + */ + @Override + public void create(User item) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @param id + */ + @Override + public void delete(String id) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @param item + */ + @Override + public void delete(User item) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @param item + */ + @Override + public void modify(User item) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + //~--- get methods ---------------------------------------------------------- + + /** + * Method description + * + * + * @param id + * + * @return + */ + @Override + public User get(String id) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * Method description + * + * + * @return + */ + @Override + public List getAll() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + //~--- fields --------------------------------------------------------------- + + /** Field description */ + private JerseyClientSession session; +}