Revision 9512 org.gvsig.online/trunk/org.gvsig.online/org.gvsig.online.lib/org.gvsig.online.lib.impl/src/main/java/org/gvsig/online/lib/impl/OnlineManagerImpl.java
OnlineManagerImpl.java | ||
---|---|---|
35 | 35 |
import java.util.List; |
36 | 36 |
import java.util.Map; |
37 | 37 |
import java.util.Objects; |
38 |
import java.util.logging.Level; |
|
39 | 38 |
import org.apache.commons.lang3.StringUtils; |
40 | 39 |
import org.gvsig.fmap.dal.DALLocator; |
41 | 40 |
import org.gvsig.fmap.dal.DataManager; |
... | ... | |
59 | 58 |
import org.gvsig.online.lib.api.OnlineProject; |
60 | 59 |
import org.gvsig.online.lib.api.OnlineSite; |
61 | 60 |
import org.gvsig.online.lib.api.OnlineUserIdentificationRequester; |
61 |
import org.gvsig.online.lib.api.workingcopy.OnlineWorkingcopy; |
|
62 |
import org.gvsig.online.lib.api.workingcopy.OnlineWorkingcopyDescriptor; |
|
63 |
import org.gvsig.online.lib.api.workingcopy.WorkingArea; |
|
62 | 64 |
import org.gvsig.online.lib.impl.workspace.OnlineWorkingcopyDescriptorImpl; |
63 | 65 |
import org.gvsig.online.lib.impl.workspace.OnlineWorkspaceImpl; |
66 |
import org.gvsig.online.lib.impl.workspace.StoreProperties; |
|
67 |
import org.gvsig.online.lib.impl.workspace.WorkingAreaImpl; |
|
64 | 68 |
import org.gvsig.online.lib.impl.workspace.tables.EntitiesTable; |
65 | 69 |
import org.gvsig.online.lib.impl.workspace.tables.RemoteChangesTable; |
66 | 70 |
import org.gvsig.online.lib.impl.workspace.tables.VarsTable; |
... | ... | |
73 | 77 |
import org.gvsig.tools.util.ListBuilder; |
74 | 78 |
import org.slf4j.Logger; |
75 | 79 |
import org.slf4j.LoggerFactory; |
76 |
import org.gvsig.online.lib.api.workingcopy.OnlineWorkingcopy; |
|
77 |
import org.gvsig.online.lib.api.workingcopy.OnlineWorkingcopyDescriptor; |
|
78 |
import org.gvsig.online.lib.impl.workspace.StoreProperties; |
|
79 | 80 |
|
80 | 81 |
@SuppressWarnings("UseSpecificCatch") |
81 | 82 |
public class OnlineManagerImpl implements OnlineManager { |
... | ... | |
94 | 95 |
|
95 | 96 |
private OnlineUserIdentificationRequester userIdentificationRequester; |
96 | 97 |
private Map<String,OnlineWorkingcopyDescriptor> workspaces; |
97 |
private OnlineCodeGenerator codeGenerator; |
|
98 | 98 |
|
99 | 99 |
public OnlineManagerImpl() { |
100 | 100 |
this.workspaces = new HashMap<>(); |
101 |
this.codeGenerator = new RandomCodeGenerator(); |
|
102 | 101 |
this.userIdentificationRequester = null; |
103 | 102 |
} |
104 | 103 |
|
... | ... | |
142 | 141 |
DisposeUtils.disposeQuietly(workspace); |
143 | 142 |
} |
144 | 143 |
this.workspaces = new HashMap<>(); |
145 |
this.codeGenerator = new RandomCodeGenerator(); |
|
146 | 144 |
this.userIdentificationRequester = null; |
147 | 145 |
} |
148 | 146 |
|
... | ... | |
156 | 154 |
OnlineWorkingcopy workspace; |
157 | 155 |
params = wsexplorer.getParameters(); |
158 | 156 |
|
159 |
workspace = new OnlineWorkspaceImpl(wsexplorer, this.codeGenerator, label);
|
|
157 |
workspace = new OnlineWorkspaceImpl(wsexplorer, this.getCodeGenerator(), label);
|
|
160 | 158 |
workspace.setUserIdentificationRequester(this.userIdentificationRequester); |
161 | 159 |
this.registerWorkingcopy(workspace); |
162 | 160 |
dropExpiredCaches(); |
... | ... | |
487 | 485 |
// } |
488 | 486 |
// |
489 | 487 |
status.setTitle("vcsgis retrieving entities"); |
490 |
workspace = new OnlineWorkspaceImpl(wsexplorer, this.codeGenerator, project, label);
|
|
488 |
workspace = new OnlineWorkspaceImpl(wsexplorer, this.getCodeGenerator(), project, label);
|
|
491 | 489 |
if (workspace.getUserIdentificationRequester() == null) { |
492 | 490 |
workspace.setUserIdentificationRequester(this.userIdentificationRequester); |
493 | 491 |
} |
... | ... | |
569 | 567 |
} |
570 | 568 |
} |
571 | 569 |
|
572 |
workspace = new OnlineWorkspaceImpl(wsexplorer, this.codeGenerator, null);
|
|
570 |
workspace = new OnlineWorkspaceImpl(wsexplorer, this.getCodeGenerator(), null);
|
|
573 | 571 |
workspace.setUserIdentificationRequester(this.userIdentificationRequester); |
574 | 572 |
this.registerWorkingcopy(workspace); |
575 | 573 |
dropExpiredCaches(); |
... | ... | |
611 | 609 |
return site; |
612 | 610 |
} |
613 | 611 |
|
612 |
@Override |
|
613 |
public WorkingArea createWorkingArea() { |
|
614 |
return new WorkingAreaImpl(); |
|
615 |
} |
|
616 |
|
|
617 |
private OnlineCodeGenerator getCodeGenerator() { |
|
618 |
return new RandomCodeGenerator(); |
|
619 |
} |
|
614 | 620 |
|
621 |
|
|
615 | 622 |
} |
Also available in: Unified diff