Skip to content

Commit b303c9c

Browse files
committed
Replaced all occurrence of "domain" to "entity" (with domains becoming entities)
1 parent 240b59f commit b303c9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+800
-738
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<workingSetManager>
3+
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1457272715817_0" label="Window Working Set" name="Aggregate for window 1457272715816"/>
4+
</workingSetManager>

data-hub/src/main/java/com/marklogic/hub/DomainManager.java renamed to data-hub/src/main/java/com/marklogic/hub/EntityManager.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,25 @@
2929
import com.marklogic.client.extensions.ResourceServices.ServiceResultIterator;
3030
import com.marklogic.client.io.DOMHandle;
3131
import com.marklogic.client.util.RequestParameters;
32-
import com.marklogic.hub.domain.Domain;
33-
import com.marklogic.hub.domain.DomainImpl;
32+
import com.marklogic.hub.entity.Entity;
33+
import com.marklogic.hub.entity.EntityImpl;
3434

35-
public class DomainManager extends ResourceManager {
36-
static final public String NAME = "domain";
35+
public class EntityManager extends ResourceManager {
36+
static final public String NAME = "entity";
3737
private DatabaseClient client;
3838

39-
public DomainManager(DatabaseClient client) {
39+
public EntityManager(DatabaseClient client) {
4040
super();
4141
this.client = client;
4242
this.client.init(NAME, this);
4343
}
4444

4545
/**
46-
* Retrieves a list of domains from the Server
47-
* @return a list of domains
46+
* Retrieves a list of entities from the Server
47+
*
48+
* @return a list of entities
4849
*/
49-
public List<Domain> getDomains() {
50+
public List<Entity> getEntities() {
5051
RequestParameters params = new RequestParameters();
5152
ServiceResultIterator resultItr = this.getServices().get(params);
5253
if (resultItr == null || ! resultItr.hasNext()) {
@@ -57,42 +58,44 @@ public List<Domain> getDomains() {
5758
Document parent = res.getContent(handle).get();
5859
NodeList children = parent.getDocumentElement().getChildNodes();
5960

60-
ArrayList<Domain> domains = null;
61+
ArrayList<Entity> entities = null;
6162
if (children.getLength() > 0) {
62-
domains = new ArrayList<Domain>();
63+
entities = new ArrayList<Entity>();
6364
}
6465

6566
Node node;
6667
for (int i = 0; i < children.getLength(); i++) {
6768
node = children.item(i);
6869
if (node.getNodeType() == Node.ELEMENT_NODE) {
69-
domains.add(domainFromXml((Element)children.item(i)));
70+
entities.add(entityFromXml((Element) children.item(i)));
7071
}
7172
}
72-
return domains;
73+
return entities;
7374
}
7475

7576
/**
76-
* Retrieve a named domain
77-
* @param domainName - the name of the domain to retrieve
78-
* @return a domain
77+
* Retrieve a named entity
78+
*
79+
* @param entityName
80+
* - the name of the entity to retrieve
81+
* @return a entity
7982
*/
80-
public Domain getDomain(String domainName) {
83+
public Entity getEntity(String entityName) {
8184
RequestParameters params = new RequestParameters();
82-
params.add("domain-name", domainName);
85+
params.add("entity-name", entityName);
8386
ServiceResultIterator resultItr = this.getServices().get(params);
8487
if (resultItr == null || ! resultItr.hasNext()) {
8588
return null;
8689
}
8790
ServiceResult res = resultItr.next();
8891
DOMHandle handle = new DOMHandle();
8992
Document parent = res.getContent(handle).get();
90-
return new DomainImpl(parent.getDocumentElement());
93+
return new EntityImpl(parent.getDocumentElement());
9194
}
9295

9396

94-
private Domain domainFromXml(Element doc) {
95-
Domain d = new DomainImpl(doc);
97+
private Entity entityFromXml(Element doc) {
98+
Entity d = new EntityImpl(doc);
9699
return d;
97100
}
98101
}

data-hub/src/main/java/com/marklogic/hub/FlowManager.java

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,14 @@ protected void initializeDefaultSpringBatchComponents() {
116116

117117
/**
118118
* Retrieves a list of flows installed on the MarkLogic server
119-
* @param domainName - the domain from which to fetch the flows
120-
* @return - a list of flows for the given domain
119+
*
120+
* @param entityName
121+
* - the entity from which to fetch the flows
122+
* @return - a list of flows for the given entity
121123
*/
122-
public List<Flow> getFlows(String domainName) {
124+
public List<Flow> getFlows(String entityName) {
123125
RequestParameters params = new RequestParameters();
124-
params.add("domain-name", domainName);
126+
params.add("entity-name", entityName);
125127
ServiceResultIterator resultItr = this.getServices().get(params);
126128
if (resultItr == null || ! resultItr.hasNext()) {
127129
return null;
@@ -147,18 +149,21 @@ public List<Flow> getFlows(String domainName) {
147149
}
148150

149151
/**
150-
* Retrieves a named flow from a given domain
151-
* @param domainName - the domain that the flow belongs to
152-
* @param flowName - the name of the flow to get
152+
* Retrieves a named flow from a given entity
153+
*
154+
* @param entityName
155+
* - the entity that the flow belongs to
156+
* @param flowName
157+
* - the name of the flow to get
153158
* @return the flow
154159
*/
155-
public Flow getFlow(String domainName, String flowName) {
156-
return getFlow(domainName, flowName, null);
160+
public Flow getFlow(String entityName, String flowName) {
161+
return getFlow(entityName, flowName, null);
157162
}
158163

159-
public Flow getFlow(String domainName, String flowName, FlowType flowType) {
164+
public Flow getFlow(String entityName, String flowName, FlowType flowType) {
160165
RequestParameters params = new RequestParameters();
161-
params.add("domain-name", domainName);
166+
params.add("entity-name", entityName);
162167
params.add("flow-name", flowName);
163168
if (flowType != null) {
164169
params.add("flow-type", flowType.toString());
@@ -206,7 +211,8 @@ public void runFlow(Flow flow, int batchSize, JobExecutionListener listener) {
206211
.<String, String> chunk(batchSize)
207212
.reader(reader).writer(writer).build();
208213

209-
String jobName = flow.getDomainName() + ":" + flow.getType() + ":" + flow.getName() + "-" + System.currentTimeMillis();
214+
String jobName = flow.getEntityName() + ":" + flow.getType() + ":"
215+
+ flow.getName() + "-" + System.currentTimeMillis();
210216
SimpleJobBuilder builder = jobBuilderFactory.get(jobName).start(step);
211217
if (listener != null) {
212218
builder = builder.listener(listener);
@@ -224,12 +230,16 @@ public void runFlow(Flow flow, int batchSize, JobExecutionListener listener) {
224230
public void runInputFlow(Flow flow, HubConfig config) {
225231
try {
226232
Mlcp mlcp = new Mlcp(config.getHost(), config.getStagingPort(), config.getAdminUsername(), config.getAdminPassword());
227-
SourceOptions sourceOptions = new SourceOptions(flow.getDomainName(), flow.getName(), FlowType.INPUT.toString());
233+
SourceOptions sourceOptions = new SourceOptions(
234+
flow.getEntityName(), flow.getName(),
235+
FlowType.INPUT.toString());
228236
mlcp.addSourceDirectory(config.getModulesPath(), sourceOptions);
229237
mlcp.loadContent();
230238
}
231239
catch (IOException e) {
232-
LOGGER.error("Error encountered while trying to run flow: " + flow.getDomainName() + " > " + flow.getName(), e);
240+
LOGGER.error(
241+
"Error encountered while trying to run flow: "
242+
+ flow.getEntityName() + " > " + flow.getName(), e);
233243
}
234244
}
235245

data-hub/src/main/java/com/marklogic/hub/Mlcp.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,20 @@ public List<String> getMlcpArguments() throws IOException {
152152
}
153153

154154
public static class SourceOptions {
155-
private String domainName;
155+
private String entityName;
156156
private String flowName;
157157
private String flowType;
158158
private String inputFileType;
159159
private String inputFilePattern;
160160

161-
public SourceOptions(String domainName, String flowName, String flowType) {
162-
this.domainName = domainName;
161+
public SourceOptions(String entityName, String flowName, String flowType) {
162+
this.entityName = entityName;
163163
this.flowName = flowName;
164164
this.flowType = flowType;
165165
}
166166

167-
public String getDomainName() {
168-
return domainName;
167+
public String getEntityName() {
168+
return entityName;
169169
}
170170

171171
public String getFlowName() {
@@ -193,7 +193,9 @@ public void setInputFilePattern(String inputFilePattern) {
193193
}
194194

195195
protected String getTransformParams() {
196-
return String.format("<params><domain-name>%s</domain-name><flow-name>%s</flow-name><flow-type>%s</flow-type></params>", domainName, flowName, flowType);
196+
return String
197+
.format("<params><entity-name>%s</entity-name><flow-name>%s</flow-name><flow-type>%s</flow-type></params>",
198+
entityName, flowName, flowType);
197199
}
198200
}
199201
}

data-hub/src/main/java/com/marklogic/hub/Scaffolding.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,37 @@
2727
import org.slf4j.LoggerFactory;
2828

2929
import com.marklogic.client.io.Format;
30-
import com.marklogic.hub.flow.Flow;
3130
import com.marklogic.hub.flow.FlowType;
3231
import com.marklogic.hub.flow.SimpleFlow;
3332

3433
public class Scaffolding {
3534

3635
static final private Logger LOGGER = LoggerFactory.getLogger(Scaffolding.class);
3736

38-
public static File getDomainDir(File userlandDir, String domainName) {
39-
File domainsDir = new File(userlandDir, "domains");
40-
File domainDir = new File(domainsDir, domainName);
41-
return domainDir;
37+
public static File getEntityDir(File userlandDir, String entityName) {
38+
File entitiesDir = new File(userlandDir, "entities");
39+
File entityDir = new File(entitiesDir, entityName);
40+
return entityDir;
4241
}
4342

44-
public static File getFlowDir(File userlandDir, String domainName, String flowName, FlowType flowType) {
45-
File domainDir = getDomainDir(userlandDir, domainName);
46-
File typeDir = new File(domainDir, flowType.toString());
43+
public static File getFlowDir(File userlandDir, String entityName,
44+
String flowName, FlowType flowType) {
45+
File entityDir = getEntityDir(userlandDir, entityName);
46+
File typeDir = new File(entityDir, flowType.toString());
4747
File flowDir = new File(typeDir, flowName);
4848
return flowDir;
4949
}
5050

51-
public static void createDomain(String domainName, File userlandPath) {
52-
File domainDir = getDomainDir(userlandPath, domainName);
53-
domainDir.mkdirs();
51+
public static void createEntity(String entityName, File userlandPath) {
52+
File entityDir = getEntityDir(userlandPath, entityName);
53+
entityDir.mkdirs();
5454
}
5555

56-
public static void createFlow(String domainName, String flowName, FlowType flowType, PluginFormat pluginFormat, Format dataFormat, File userlandDir)
56+
public static void createFlow(String entityName, String flowName,
57+
FlowType flowType, PluginFormat pluginFormat, Format dataFormat,
58+
File userlandDir)
5759
throws IOException {
58-
File flowDir = getFlowDir(userlandDir, domainName, flowName, flowType);
60+
File flowDir = getFlowDir(userlandDir, entityName, flowName, flowType);
5961

6062
if (flowType.equals(FlowType.CONFORMANCE)) {
6163
File collectorDir = new File(flowDir, "collector");
@@ -79,7 +81,8 @@ public static void createFlow(String domainName, String flowName, FlowType flowT
7981
writeFile("scaffolding/" + flowType + "/" + pluginFormat + "/triples." + pluginFormat,
8082
Paths.get(triplesDir.getPath(), "triples." + pluginFormat));
8183

82-
SimpleFlow flow = new SimpleFlow(domainName, flowName, flowType, dataFormat);
84+
SimpleFlow flow = new SimpleFlow(entityName, flowName, flowType,
85+
dataFormat);
8386
flow.serialize();
8487
File flowFile = new File(flowDir, flowName + ".xml");
8588
try(PrintWriter out = new PrintWriter(flowFile)) {

data-hub/src/main/java/com/marklogic/hub/domain/AbstractDomain.java renamed to data-hub/src/main/java/com/marklogic/hub/entity/AbstractEntity.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.marklogic.hub.domain;
16+
package com.marklogic.hub.entity;
1717

1818
import java.util.ArrayList;
1919
import java.util.List;
@@ -26,18 +26,18 @@
2626
import com.marklogic.hub.flow.Flow;
2727

2828
/**
29-
* Abstract Base class for Domains
29+
* Abstract Base class for entities
3030
*/
31-
public abstract class AbstractDomain implements Domain {
31+
public abstract class AbstractEntity implements Entity {
3232

3333
private String name;
3434
private ArrayList<Flow> flows = new ArrayList<Flow>();
3535

36-
public AbstractDomain(Element xml) {
36+
public AbstractEntity(Element xml) {
3737
deserialize(xml);
3838
}
3939

40-
public AbstractDomain(String name) {
40+
public AbstractEntity(String name) {
4141
this.name = name;
4242
}
4343

@@ -65,7 +65,7 @@ private void deserialize(Node xml) {
6565
}
6666

6767
/**
68-
* Returns the name of the Domain
68+
* Returns the name of the Entity
6969
*/
7070
@Override
7171
public String getName() {
@@ -74,7 +74,7 @@ public String getName() {
7474
}
7575

7676
/**
77-
* Serializes the domain to an XML string
77+
* Serializes the entity to an XML string
7878
*/
7979
@Override
8080
public String serialize() {
@@ -83,7 +83,7 @@ public String serialize() {
8383
}
8484

8585
/**
86-
* Returns the domain's flows
86+
* Returns the entity's flows
8787
*/
8888
@Override
8989
public List<Flow> getFlows() {

data-hub/src/main/java/com/marklogic/hub/domain/Domain.java renamed to data-hub/src/main/java/com/marklogic/hub/entity/Entity.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,33 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.marklogic.hub.domain;
16+
package com.marklogic.hub.entity;
1717

1818
import java.util.List;
1919

2020
import com.marklogic.hub.flow.Flow;
2121

2222
/**
23-
* A domain object. The data hub groups data by domains.
23+
* A entity object. The data hub groups data by entities.
2424
*/
25-
public interface Domain {
25+
public interface Entity {
2626
/**
27-
* Gets the Domain name
28-
* @return the domain name
27+
* Gets the Entity name
28+
*
29+
* @return the entity name
2930
*/
3031
String getName();
3132

3233
/**
33-
* Serializes the Domain as an XML string
34+
* Serializes the Entity as an XML string
35+
*
3436
* @return the serialized XML string
3537
*/
3638
String serialize();
3739

3840
/**
39-
* Returns all flows registered to the domain
41+
* Returns all flows registered to the entity
42+
*
4043
* @return a list of flows
4144
*/
4245
List<Flow> getFlows();

data-hub/src/main/java/com/marklogic/hub/domain/DomainImpl.java renamed to data-hub/src/main/java/com/marklogic/hub/entity/EntityImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.marklogic.hub.domain;
16+
package com.marklogic.hub.entity;
1717

1818
import org.w3c.dom.Element;
1919

2020
/**
21-
* An implementation of the Domain base class
21+
* An implementation of the Entity base class
2222
*/
23-
public class DomainImpl extends AbstractDomain {
23+
public class EntityImpl extends AbstractEntity {
2424

25-
public DomainImpl(Element xml) {
25+
public EntityImpl(Element xml) {
2626
super(xml);
2727
}
2828

29-
public DomainImpl(String name) {
29+
public EntityImpl(String name) {
3030
super(name);
3131
}
3232

0 commit comments

Comments
 (0)