11
11
import com .github .onsdigital .zebedee .model .Collection ;
12
12
import com .github .onsdigital .zebedee .model .Collections ;
13
13
import com .github .onsdigital .zebedee .model .Content ;
14
+ import com .github .onsdigital .zebedee .model .PublishedContent ;
14
15
import com .github .onsdigital .zebedee .model .ZebedeeCollectionReader ;
15
16
import com .github .onsdigital .zebedee .model .encryption .EncryptionKeyFactory ;
16
17
import com .github .onsdigital .zebedee .model .publishing .PublishedCollections ;
19
20
import com .github .onsdigital .zebedee .service .DatasetService ;
20
21
import com .github .onsdigital .zebedee .service .ImageService ;
21
22
import com .github .onsdigital .zebedee .service .KafkaService ;
22
- import com .github .onsdigital .zebedee .service .ServiceStore ;
23
- import com .github .onsdigital .zebedee .service .ServiceStoreImpl ;
23
+ import com .github .onsdigital .zebedee .servicetokens .store .ServiceStore ;
24
24
import com .github .onsdigital .zebedee .session .model .Session ;
25
25
import com .github .onsdigital .zebedee .session .service .Sessions ;
26
26
import com .github .onsdigital .zebedee .teams .service .TeamsService ;
36
36
import java .nio .file .Paths ;
37
37
import java .util .Optional ;
38
38
39
+ import static com .github .onsdigital .zebedee .ZebedeeConfiguration .COLLECTIONS ;
39
40
import static com .github .onsdigital .zebedee .configuration .Configuration .isVerificationEnabled ;
40
41
import static com .github .onsdigital .zebedee .exceptions .DeleteContentRequestDeniedException .beingEditedByAnotherCollectionError ;
41
42
import static com .github .onsdigital .zebedee .exceptions .DeleteContentRequestDeniedException .beingEditedByThisCollectionError ;
44
45
import static com .github .onsdigital .zebedee .logging .CMSLogEvent .info ;
45
46
46
47
public class Zebedee {
47
- public static final String PUBLISHED = "master" ;
48
- public static final String COLLECTIONS = "collections" ;
49
- public static final String PUBLISHED_COLLECTIONS = "publish-log" ;
50
- public static final String ZEBEDEE = "zebedee" ;
51
- public static final String USERS = "users" ;
52
- public static final String SESSIONS = "sessions" ;
53
- public static final String PERMISSIONS = "permissions" ;
54
- public static final String TEAMS = "teams" ;
55
- public static final String LAUNCHPAD = "launchpad" ;
56
- public static final String APPLICATION_KEYS = "application-keys" ;
57
- public static final String SERVICES = "services" ;
58
- public static final String KEYRING = "keyring" ;
59
-
60
- private final Path publishedCollectionsPath ;
61
- private final Path collectionsPath ;
62
- private final Path usersPath ;
63
- private final Path sessionsPath ;
64
- private final Path permissionsPath ;
65
- private final Path teamsPath ;
66
- private final Path redirectPath ;
67
- private final Path servicePath ;
68
- private final Path keyRingPath ;
69
-
70
48
private final VerificationAgent verificationAgent ;
71
49
private final PublishedCollections publishedCollections ;
72
50
private final Collections collections ;
73
- private final Content published ;
51
+ private final PublishedContent published ;
74
52
private final CollectionKeyCache schedulerKeyCache ;
75
- private final Path publishedContentPath ;
76
- private final Path path ;
77
53
private final PermissionsService permissionsService ;
78
54
private final CollectionKeyring collectionKeyring ;
79
55
private final EncryptionKeyFactory encryptionKeyFactory ;
@@ -85,18 +61,19 @@ public class Zebedee {
85
61
private final DatasetService datasetService ;
86
62
private final ImageService imageService ;
87
63
private final KafkaService kafkaService ;
88
- private final ServiceStoreImpl serviceStoreImpl ;
64
+ private final ServiceStore serviceStore ;
89
65
private final StartUpNotifier startUpNotifier ;
90
66
private final Notifier slackNotifier ;
91
67
68
+ private final Path path ;
69
+
92
70
/**
93
71
* Create a new instance of Zebedee setting.
94
72
*
95
73
* @param cfg {@link ZebedeeConfiguration} contains the set up to use for this instance.
96
74
*/
97
75
public Zebedee (ZebedeeConfiguration cfg ) {
98
76
this .path = cfg .getZebedeePath ();
99
- this .publishedContentPath = cfg .getPublishedContentPath ();
100
77
this .sessions = cfg .getSessions ();
101
78
this .schedulerKeyCache = cfg .getSchedulerKeyringCache ();
102
79
this .permissionsService = cfg .getPermissionsService ();
@@ -106,23 +83,14 @@ public Zebedee(ZebedeeConfiguration cfg) {
106
83
this .publishedCollections = cfg .getPublishCollections ();
107
84
this .teamsService = cfg .getTeamsService ();
108
85
this .usersService = cfg .getUsersService ();
109
- this .verificationAgent = cfg .getVerificationAgent (isVerificationEnabled (), this );
86
+ this .verificationAgent = cfg .getVerificationAgent ();
110
87
this .datasetService = cfg .getDatasetService ();
111
88
this .imageService = cfg .getImageService ();
112
89
this .kafkaService = cfg .getKafkaService ();
113
- this .serviceStoreImpl = cfg .getServiceStore ();
90
+ this .serviceStore = cfg .getServiceStore ();
114
91
this .collectionKeyring = cfg .getCollectionKeyring ();
115
92
this .encryptionKeyFactory = cfg .getEncryptionKeyFactory ();
116
93
117
- this .collectionsPath = cfg .getCollectionsPath ();
118
- this .publishedCollectionsPath = cfg .getPublishedCollectionsPath ();
119
- this .usersPath = cfg .getUsersPath ();
120
- this .sessionsPath = cfg .getSessionsPath ();
121
- this .permissionsPath = cfg .getPermissionsPath ();
122
- this .teamsPath = cfg .getTeamsPath ();
123
- this .redirectPath = cfg .getRedirectPath ();
124
- this .servicePath = cfg .getServicePath ();
125
- this .keyRingPath = cfg .getKeyRingPath ();
126
94
this .startUpNotifier = cfg .getStartUpNotifier ();
127
95
this .slackNotifier = cfg .getSlackNotifier ();
128
96
}
@@ -325,11 +293,7 @@ public PermissionsService getPermissionsService() {
325
293
return this .permissionsService ;
326
294
}
327
295
328
- public Path getPublishedContentPath () {
329
- return this .publishedContentPath ;
330
- }
331
-
332
- public Content getPublished () {
296
+ public PublishedContent getPublished () {
333
297
return this .published ;
334
298
}
335
299
@@ -374,15 +338,7 @@ public KafkaService getKafkaService() {
374
338
}
375
339
376
340
public ServiceStore getServiceStore () {
377
- return serviceStoreImpl ;
378
- }
379
-
380
- public Path getServicePath () {
381
- return servicePath ;
382
- }
383
-
384
- public Path getKeyRingPath () {
385
- return keyRingPath ;
341
+ return serviceStore ;
386
342
}
387
343
388
344
public CollectionKeyring getCollectionKeyring () {
0 commit comments