Codota Logo
MemoryNamedAccountCredentials.getObjects
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
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> T loadObject(String accountName, ObjectType objectType, String objectKey) throws IllegalArgumentException {
 MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);
 Object entry = credentials.getObjects().get(objectType).get(objectKey);
 if (entry == null) {
  throw new NotFoundException("No such object named " + objectKey);
 }
 return (T)entry;
}
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> T loadObject(String accountName, ObjectType objectType, String objectKey) throws IllegalArgumentException {
 MemoryNamedAccountCredentials credentials = getCredentials(accountName, objectType);
 Object entry = credentials.getObjects().get(objectType).get(objectKey);
 if (entry == null) {
  throw new NotFoundException("No such object named " + objectKey);
 }
 return (T)entry;
}
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.securityMemoryNamedAccountCredentialsgetObjects

Popular methods of MemoryNamedAccountCredentials

  • builder
  • getMetadata

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • BoxLayout (javax.swing)
  • JLabel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now