code: @Override
      public boolean contains(String policyName)
      throws PolicyStoreException {
  
          // search for policy - active and inactive
          String pid = this.getPID(policyName);
  
          ObjectProfile objectProfile = null;
          try {
              objectProfile =
                  this.apiAService.getObjectProfile(getContext(), pid, null);
          } catch (ObjectNotInLowlevelStorageException e) {
          } catch (ServerException e) {
              throw new PolicyStoreException("Add: error getting object profile for "
                                                   + pid
                                                   + " - "
                                                   + e.getMessage(),
                                                   e);
  
          }
  
          if (objectProfile == null) {
              // no object found
              return false;
          } else {
              if (objectProfile.objectState.equals("A")
                      || objectProfile.objectState.equals("I")) {
                  // active or inactive object found - policy exists
                  return true;
              } else {
                  // deleted object - policy does not exist
                  return false;
              }
          }
      }
docs: Check if the policy identified by policyName exists.
  
  @param policyName
  @return true iff the policy store contains a policy identified as
  policyName
  @throws PolicyStoreException