Tabnine Logo
MemoryNamedAccountCredentials.getMetadata
Code IndexAdd Tabnine to your IDE (free)

How to use
getMetadata
method
in
com.netflix.kayenta.memory.security.MemoryNamedAccountCredentials

Best Java code snippets using com.netflix.kayenta.memory.security.MemoryNamedAccountCredentials.getMetadata (Showing top 8 results out of 315)

origin: spinnaker/kayenta

private MemoryNamedAccountCredentials getCredentials(String accountName, ObjectType objectType) {
 MemoryNamedAccountCredentials credentials = (MemoryNamedAccountCredentials)accountCredentialsRepository
  .getOne(accountName)
  .orElseThrow(() -> new IllegalArgumentException("Unable to resolve account " + accountName + "."));
 credentials.getObjects().putIfAbsent(objectType, new ConcurrentHashMap<>());
 credentials.getMetadata().putIfAbsent(objectType, new ConcurrentHashMap<>());
 return credentials;
}
origin: spinnaker/kayenta

@Override
public void deleteObject(String accountName, ObjectType objectType, String objectKey) {
 MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);
 Object oldValue = credentials.getObjects().get(objectType).remove(objectKey);
 credentials.getMetadata().get(objectType).remove(objectKey);
 if (oldValue == null) {
  throw new IllegalArgumentException("Does not exist");
 }
}
origin: spinnaker/kayenta

@Override
public <T> void storeObject(String accountName, ObjectType objectType, String objectKey, T obj, String filename, boolean isAnUpdate) {
 MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);
 long currentTimestamp = System.currentTimeMillis();
 Map<String, Object> objectMetadataMap = new HashMap<>();
 objectMetadataMap.put("id", objectKey);
 objectMetadataMap.put("updatedTimestamp", currentTimestamp);
 objectMetadataMap.put("updatedTimestampIso", Instant.ofEpochMilli(currentTimestamp).toString());
 if (objectType == ObjectType.CANARY_CONFIG) {
  CanaryConfig canaryConfig = (CanaryConfig)obj;
  checkForDuplicateCanaryConfig(accountName, objectType, canaryConfig, objectKey);
  objectMetadataMap.put("name", canaryConfig.getName());
  objectMetadataMap.put("applications", canaryConfig.getApplications());
 }
 credentials.getObjects().get(objectType).put(objectKey, obj);
 credentials.getMetadata().get(objectType).put(objectKey, objectMetadataMap);
}
origin: spinnaker/kayenta

 @Override
 public List<Map<String, Object>> listObjectKeys(String accountName, ObjectType objectType, List<String> applications, boolean skipIndex) {
  MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);

  boolean filterOnApplications = applications != null && applications.size() > 0;
  List<Map<String, Object>> result = new ArrayList<>();

  for (Map.Entry<String, Object> entry : credentials.getObjects().get(objectType).entrySet()) {
   String entryKey = entry.getKey();
   if (objectType == ObjectType.CANARY_CONFIG) {
    if (filterOnApplications) {
     CanaryConfig canaryConfig = (CanaryConfig)entry.getValue();

     if (CanaryConfigIndex.haveCommonElements(applications, canaryConfig.getApplications())) {
      result.add(credentials.getMetadata().get(objectType).get(entryKey));
     }
    } else {
     result.add(credentials.getMetadata().get(objectType).get(entryKey));
    }
   } else {
    result.add(credentials.getMetadata().get(objectType).get(entryKey));
   }
  }

  return result;
 }
}
origin: com.netflix.kayenta/kayenta-objectstore-memory

@Override
public void deleteObject(String accountName, ObjectType objectType, String objectKey) {
 MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);
 Object oldValue = credentials.getObjects().get(objectType).remove(objectKey);
 credentials.getMetadata().get(objectType).remove(objectKey);
 if (oldValue == null) {
  throw new IllegalArgumentException("Does not exist");
 }
}
origin: com.netflix.kayenta/kayenta-objectstore-memory

private MemoryNamedAccountCredentials getCredentials(String accountName, ObjectType objectType) {
 MemoryNamedAccountCredentials credentials = (MemoryNamedAccountCredentials)accountCredentialsRepository
  .getOne(accountName)
  .orElseThrow(() -> new IllegalArgumentException("Unable to resolve account " + accountName + "."));
 credentials.getObjects().putIfAbsent(objectType, new ConcurrentHashMap<>());
 credentials.getMetadata().putIfAbsent(objectType, new ConcurrentHashMap<>());
 return credentials;
}
origin: com.netflix.kayenta/kayenta-objectstore-memory

@Override
public <T> void storeObject(String accountName, ObjectType objectType, String objectKey, T obj, String filename, boolean isAnUpdate) {
 MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);
 long currentTimestamp = System.currentTimeMillis();
 Map<String, Object> objectMetadataMap = new HashMap<>();
 objectMetadataMap.put("id", objectKey);
 objectMetadataMap.put("updatedTimestamp", currentTimestamp);
 objectMetadataMap.put("updatedTimestampIso", Instant.ofEpochMilli(currentTimestamp).toString());
 if (objectType == ObjectType.CANARY_CONFIG) {
  CanaryConfig canaryConfig = (CanaryConfig)obj;
  checkForDuplicateCanaryConfig(accountName, objectType, canaryConfig, objectKey);
  objectMetadataMap.put("name", canaryConfig.getName());
  objectMetadataMap.put("applications", canaryConfig.getApplications());
 }
 credentials.getObjects().get(objectType).put(objectKey, obj);
 credentials.getMetadata().get(objectType).put(objectKey, objectMetadataMap);
}
origin: com.netflix.kayenta/kayenta-objectstore-memory

 @Override
 public List<Map<String, Object>> listObjectKeys(String accountName, ObjectType objectType, List<String> applications, boolean skipIndex) {
  MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);

  boolean filterOnApplications = applications != null && applications.size() > 0;
  List<Map<String, Object>> result = new ArrayList<>();

  for (Map.Entry<String, Object> entry : credentials.getObjects().get(objectType).entrySet()) {
   String entryKey = entry.getKey();
   if (objectType == ObjectType.CANARY_CONFIG) {
    if (filterOnApplications) {
     CanaryConfig canaryConfig = (CanaryConfig)entry.getValue();

     if (CanaryConfigIndex.haveCommonElements(applications, canaryConfig.getApplications())) {
      result.add(credentials.getMetadata().get(objectType).get(entryKey));
     }
    } else {
     result.add(credentials.getMetadata().get(objectType).get(entryKey));
    }
   } else {
    result.add(credentials.getMetadata().get(objectType).get(entryKey));
   }
  }

  return result;
 }
}
com.netflix.kayenta.memory.securityMemoryNamedAccountCredentialsgetMetadata

Popular methods of MemoryNamedAccountCredentials

  • builder
  • getObjects

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Path (java.nio.file)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Table (org.hibernate.mapping)
    A relational table
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now