Obtain the IDs of profile and path as Identifiers

@param profileIdentifier actual ID or friendly name of profile
@param pathIdentifier    actual ID or friendly name of path
@return
@throws Exception
5173
public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
        Identifiers id = new Identifiers();

        Integer profileId = null;
        try {
            profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
        } catch (Exception e) {
            // this is OK for this since it isn't always needed
        }
        Integer pathId = convertPathIdentifier(pathIdentifier, profileId);

        id.setProfileId(profileId);
        id.setPathId(pathId);

        return id;
    }
446828
public void setPathToObjectIdentifiersList(java.util.Collection<PathToObjectIdentifiers> pathToObjectIdentifiersList) {
        if (pathToObjectIdentifiersList == null) {
            this.pathToObjectIdentifiersList = null;
            return;
        }

        this.pathToObjectIdentifiersList = new java.util.ArrayList<PathToObjectIdentifiers>(pathToObjectIdentifiersList);
    }
1016258
@SuppressWarnings("fallthrough")
    protected DCIdentifier identifier() throws ParseException {
        skipWhitespace();
        int pos = bp;

        if (isJavaIdentifierStart(ch)) {
            Name name = readJavaIdentifier();
            return m.at(pos).newIdentifierTree(name);
        }

        throw new ParseException("dc.identifier.expected");
    }
1263339
@RequestMapping(value = "api/profile/delete", method=RequestMethod.POST)
    public
    @ResponseBody
    HashMap<String, Object> removeFromList(Model model, @RequestParam String[] profileIdentifier) throws Exception {
        /* FOR EVERYTHING THAT NEEDS TO BE DELETED,
            DELETE IT.
         */
        logger.info("Want to remove the following ids: {}", Arrays.toString(profileIdentifier));
        for( int i = 0; i < profileIdentifier.length; i++ ) {
            removeFromList(model, profileIdentifier[i]);
        }

        return Utils.getJQGridJSON(profileService.findAllProfiles(), "profiles");
    }
373453
private static Node checkFollowedIdentifier(
			final HttpServletRequest request,
			final DeleteFollowResponse response) {
		final String followedId = request
				.getParameter(ProtocolConstants.Parameters.Delete.Follow.FOLLOWED_IDENTIFIER);
		if (followedId != null) {
			final Node followed = NeoUtils.getUserByIdentifier(followedId);
			if (followed != null) {
				return followed;
			}
			response.followedIdentifierInvalid(followedId);
		} else {
			response.followedIdentifierMissing();
		}

		return null;
	}
1331305
private int getPositionByIdentifier(long identifier) {
        int found = -1;
        if (mAccountHeaderBuilder.mProfiles != null && identifier != -1) {
            for (int i = 0; i < mAccountHeaderBuilder.mProfiles.size(); i++) {
                if (mAccountHeaderBuilder.mProfiles.get(i) != null) {
                    if (mAccountHeaderBuilder.mProfiles.get(i).getIdentifier() == identifier) {
                        found = i;
                        break;
                    }
                }
            }
        }
        return found;
    }
758884
public function isProfileAssignedToAnotherUser($curentUserId, $identifier, $provider)
    {
        $qb = $this->createQueryBuilder(null);
        $qb->field('_id')->notEqual($curentUserId)
            ->addAnd(
                $qb->expr()
                    ->addOr($qb->expr()->field('profiles.' . $provider . '.auth.identifier' )->equals($identifier))
                    ->addOr($qb->expr()->field('profile.identifier')->equals($identifier))
            );
        
        return $qb->count()
            ->getQuery()
            ->execute() > 0;
    }
344806
public void verifySamlProfileRequestIfNeeded(final RequestAbstractType profileRequest,
                                                 final MetadataResolver resolver,
                                                 final HttpServletRequest request,
                                                 final MessageContext context) throws Exception {

        val roleDescriptorResolver = getRoleDescriptorResolver(resolver, context, profileRequest);

        LOGGER.debug("Validating signature for [{}]", profileRequest.getClass().getName());

        val signature = profileRequest.getSignature();
        if (signature != null) {
            validateSignatureOnProfileRequest(profileRequest, signature, roleDescriptorResolver);
        } else {
            validateSignatureOnAuthenticationRequest(profileRequest, request, context, roleDescriptorResolver);
        }
    }
407857
private static Node checkUserIdentifier(final HttpServletRequest request,
			final DeleteFollowResponse response) {
		final String userId = request
				.getParameter(ProtocolConstants.Parameters.Delete.Follow.USER_IDENTIFIER);
		if (userId != null) {
			final Node user = NeoUtils.getUserByIdentifier(userId);
			if (user != null) {
				return user;
			}
			response.userIdentifierInvalid(userId);
		} else {
			response.userIdentifierMissing();
		}

		return null;
	}
519307
@Override
    public String getIdentity() {
        return protocol + Constants.PROTOCOL_SEPARATOR + host + ":" + port +
                "/" + getParameter(URLParamType.group.getName(), URLParamType.group.getValue()) + "/" +
                getPath() + "/" + getParameter(URLParamType.version.getName(), URLParamType.version.getValue()) +
                "/" + getParameter(URLParamType.nodeType.getName(), URLParamType.nodeType.getValue());
    }
682505
public static void populateAuthentication(final LinkedHashMap<String, CommonProfile> profiles) {
        if (profiles != null && profiles.size() > 0) {
            final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles);
            try {
                if (IS_FULLY_AUTHENTICATED_AUTHORIZER.isAuthorized(null, listProfiles)) {
                    SecurityContextHolder.getContext().setAuthentication(new Pac4jAuthenticationToken(listProfiles));
                } else if (IS_REMEMBERED_AUTHORIZER.isAuthorized(null, listProfiles)) {
                    SecurityContextHolder.getContext().setAuthentication(new Pac4jRememberMeAuthenticationToken(listProfiles));
                }
            } catch (final HttpAction e) {
                throw new TechnicalException(e);
            }
        }
    }
265967
@Override
  public List<NameAssignment> lookup(final Iterable<Identifier> identifiers) {
    LOG.log(Level.FINE, "identifiers");
    final List<NameAssignment> nas = new ArrayList<>();
    for (final Identifier id : identifiers) {
      final InetSocketAddress addr = idToAddrMap.get(id);
      LOG.log(Level.FINEST, "id : {0} addr: {1}", new Object[]{id, addr});
      if (addr != null) {
        nas.add(new NameAssignmentTuple(id, addr));
      }
    }
    return nas;
  }
657474
public List<Integer> getPathOrder(int profileId) {
        ArrayList<Integer> pathOrder = new ArrayList<Integer>();
        PreparedStatement queryStatement = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            queryStatement = sqlConnection.prepareStatement(
                "SELECT * FROM "
                    + Constants.DB_TABLE_PATH + " WHERE "
                    + Constants.GENERIC_PROFILE_ID + " = ? "
                    + " ORDER BY " + Constants.PATH_PROFILE_PATH_ORDER + " ASC"
            );
            queryStatement.setInt(1, profileId);
            results = queryStatement.executeQuery();
            while (results.next()) {
                pathOrder.add(results.getInt(Constants.GENERIC_ID));
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (queryStatement != null) {
                    queryStatement.close();
                }
            } catch (Exception e) {
            }
        }
        logger.info("pathOrder = {}", pathOrder);
        return pathOrder;
    }
383542
@Override
	protected Set<String> getInheritanceIdentifiers() {

		final Set<String> identifiers = new HashSet<>();

		identifiers.add("rdfs:subClassOf");
		identifiers.add("rdfs:subPropertyOf");

		return identifiers;
	}
697353
public static IRI getDefaultProfile(final RDFSyntax syntax, final String identifier) {
        return getDefaultProfile(syntax, rdf.createIRI(identifier));
    }
1239391
public void verifySamlProfileRequestIfNeeded(final RequestAbstractType profileRequest,
                                                 final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                                 final HttpServletRequest request,
                                                 final MessageContext context) throws Exception {

        verifySamlProfileRequestIfNeeded(profileRequest, adaptor.getMetadataResolver(), request, context);
    }
68946
@RequestMapping(value = "/api/path/{pathIdentifier}", method = RequestMethod.GET)
    @ResponseBody
    public EndpointOverride getPath(Model model,
                                    @PathVariable String pathIdentifier,
                                    @RequestParam(required = false) String profileIdentifier,
                                    @RequestParam(value = "typeFilter[]", required = false) String[] typeFilter,
                                    @RequestParam(value = "clientUUID", defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
        Identifiers identifiers = ControllerUtils.convertProfileAndPathIdentifier(profileIdentifier, pathIdentifier);

        return PathOverrideService.getInstance().getPath(identifiers.getPathId(), clientUUID, typeFilter);
    }