1 package com.atlassian.user.configuration;
2
3 import com.atlassian.user.repository.RepositoryIdentifier;
4 import com.atlassian.user.UserManager;
5 import com.atlassian.user.GroupManager;
6 import com.atlassian.user.search.query.EntityQueryParser;
7 import com.atlassian.user.security.authentication.Authenticator;
8 import com.atlassian.user.security.password.PasswordEncryptor;
9 import com.atlassian.user.properties.PropertySetFactory;
10
11 public class DefaultRepositoryAccessor implements RepositoryAccessor
12 {
13 private UserManager userManager;
14 private GroupManager groupManager;
15 private RepositoryIdentifier repository;
16 private PropertySetFactory propertySetFactory;
17 private Authenticator authenticator;
18 private PasswordEncryptor encryptor;
19 private EntityQueryParser entityQueryParser;
20
21 public UserManager getUserManager()
22 {
23 return userManager;
24 }
25
26 public GroupManager getGroupManager()
27 {
28 return groupManager;
29 }
30
31 public RepositoryIdentifier getIdentifier()
32 {
33 return repository;
34 }
35
36 public PropertySetFactory getPropertySetFactory()
37 {
38 return propertySetFactory;
39 }
40
41 public Authenticator getAuthenticator()
42 {
43 return authenticator;
44 }
45
46 public PasswordEncryptor getPasswordEncryptor()
47 {
48 return encryptor;
49 }
50
51 public void setPasswordEncryptor(PasswordEncryptor encryptor)
52 {
53 this.encryptor = encryptor;
54 }
55
56 public void setUserManager(UserManager userManager)
57 {
58 this.userManager = userManager;
59 }
60
61 public void setGroupManager(GroupManager groupManager)
62 {
63 this.groupManager = groupManager;
64 }
65
66 public void setRepository(RepositoryIdentifier repository)
67 {
68 this.repository = repository;
69 }
70
71 public void setPropertySetFactory(PropertySetFactory propertySetFactory)
72 {
73 this.propertySetFactory = propertySetFactory;
74 }
75
76 public void setAuthenticator(Authenticator authenticator)
77 {
78 this.authenticator = authenticator;
79 }
80
81 public EntityQueryParser getEntityQueryParser()
82 {
83 return entityQueryParser;
84 }
85
86 public void setEntityQueryParser(EntityQueryParser entityQueryParser)
87 {
88 this.entityQueryParser = entityQueryParser;
89 }
90
91 public boolean equals(Object o)
92 {
93 if (this == o) return true;
94 if (o == null || !(o instanceof RepositoryAccessor)) return false;
95
96 RepositoryAccessor that = (RepositoryAccessor) o;
97
98 return !(repository != null ? !repository.equals(that.getIdentifier()) : that.getIdentifier() != null);
99 }
100
101 public int hashCode()
102 {
103 return (repository != null ? repository.hashCode() : 0);
104 }
105 }