MCPcopy Create free account
hub / github.com/ddf-project/DDF / setDDFName

Method setDDFName

core/src/main/java/io/ddf/DDFCache.java:173–198  ·  view source on GitHub ↗
(DDF ddf, String name)

Source from the content-addressed store, hash-verified

171 }
172
173 public void setDDFName(DDF ddf, String name) throws DDFException {
174 Lock lock = uuidLocks.get(ddf.getUUID());
175 try {
176 if(lock.tryLock(120, TimeUnit.SECONDS)) {
177 try {
178 if (!Strings.isNullOrEmpty(name)) {
179 if (!Strings.isNullOrEmpty(ddf.getName())) {
180 this.mUris.remove(ddf.getUri());
181 }
182 ddf.setName(name);
183 mDDFCache.invalidate(ddf.getUUID());
184 mDDFwithNameCache.put(ddf.getUUID(), ddf);
185 this.mUris.put(ddf.getUri(), ddf.getUUID());
186 } else {
187 throw new DDFException(String.format("DDF's name cannot be null or empty"));
188 }
189 } finally {
190 lock.unlock();
191 }
192 } else {
193 throw new DDFException("Timeout setting DDF name");
194 }
195 } catch (Exception e) {
196 throw new DDFException(e);
197 }
198 }
199
200 public synchronized void setDDFUUID(DDF ddf, UUID uuid) throws DDFException {
201 if (this.containsDDF(uuid)) {

Callers 7

testLoadingMethod · 0.45
testMutableDDFBugMethod · 0.45
getTestDDFMethod · 0.45
initializeMethod · 0.45
createDDFWrapperMethod · 0.45
duplicateMethod · 0.45

Calls 7

putMethod · 0.80
getMethod · 0.65
getUUIDMethod · 0.65
getNameMethod · 0.65
removeMethod · 0.65
getUriMethod · 0.65
setNameMethod · 0.65

Tested by 4

testLoadingMethod · 0.36
testMutableDDFBugMethod · 0.36
getTestDDFMethod · 0.36