Package org.wso2.carbon.user.core.claim

Examples of org.wso2.carbon.user.core.claim.ClaimManager


     */
    public void removeClaimMapping(String dialectUri, String claimUri)
            throws Exception {
        ClaimMapping mapping = null;
        Claim claim = null;
        ClaimManager claimManager = null;
        try {
            UserRealm realm = getRealm();
            claimManager = realm.getClaimManager();
            if (claimManager != null) {
                // There can be cases - we get a request for an external user store - where we don'
                // have a claims administrator.
                claim = new Claim();
                claim.setClaimUri(claimUri);
                claim.setDialectURI(dialectUri);
                mapping = new ClaimMapping(claim, null);
                claimManager.deleteClaimMapping(mapping);
            }
        } catch (UserStoreException e) {
            log.error("Error occurred while removing new claim mapping", e);
            getException("Error occurred while removing new claim mapping", e);
        }
View Full Code Here


     *
     * @param mappings
     */
    public void addNewClaimDialect(ClaimDialect mappings) throws Exception {
        ClaimMapping[] mapping = null;
        ClaimManager claimManager = null;
        try {
            UserRealm realm = getRealm();
            claimManager = realm.getClaimManager();
            if (claimManager != null) {
                mapping = mappings.getClaimMapping();
                for (int i = 0; i < mapping.length; i++) {
                    claimManager.addNewClaimMapping(mapping[i]);
                }
            }
        } catch (UserStoreException e) {
            log.error("Error occurred while removing new claim mapping", e);
            getException("Error occurred while removing new claim mapping", e);
View Full Code Here

     * @throws Exception
     */
    public void removeClaimDialect(String dialectUri) throws Exception {
        Claim[] claims = null;
        ClaimMapping mapping = null;
        ClaimManager claimManager = null;
        try {
            UserRealm realm = getRealm();
            claimManager = realm.getClaimManager();
            if (claimManager != null) {
                claims = (Claim[]) claimManager.getAllClaims(dialectUri);
                for (int i = 0; i < claims.length; i++) {
                    mapping = new ClaimMapping(claims[i], null);
                    claimManager.deleteClaimMapping(mapping);
                }
            }
        } catch (UserStoreException e) {
            log.error("Error occurred while removing new claim dialect", e);
            getException("Error occurred while removing new claim dialect", e);
View Full Code Here

     * @return
     * @throws IdentityException
     */
    public Claim[] getAllSupportedClaims(UserRealm realm) throws IdentityException {
        try {
            ClaimManager claimAdmin = realm.getClaimManager();
            return (Claim[]) claimAdmin.getAllSupportClaimsByDefault();
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            log.error("Error occurred while loading supported claims", e);
            getException("Error occurred while loading supported claima", e);
        }

View Full Code Here

     * @throws IdentityException
     */
    public Claim[] getAllSupportedClaims(String dialectUri,UserRealm realm)
            throws IdentityException {
        Claim[] claims = new Claim[0];
        ClaimManager claimAdmin;
        ArrayList<Claim> requiredClaims = null;

        try {

            claimAdmin = realm.getClaimManager();
            claims = (Claim[]) claimAdmin.getAllClaims(dialectUri);
            requiredClaims = new ArrayList<Claim>();
            for (int i = 0; i < claims.length; i++) {
                if (claims[i].isSupportedByDefault()) {
                    requiredClaims.add(claims[i]);
                }
View Full Code Here

     */
    public ClaimConfigurationDTO[] getProfileConfiguration(String dialect, String profileConfig)
            throws ProfileManagementException {
        UserRealm realm = null;
        ProfileConfigurationManager profileManager = null;
        ClaimManager claimManager = null;
        ProfileConfiguration profileConfiguration = null;
        ClaimConfigurationDTO claim = null;
        List<ClaimConfigurationDTO> claimList = null;
        List<String> hiddenClaims = null;
        List<String> overriddenClaims = null;
        List<String> inheritedClaims = null;
        Claim[] definedClaims = null;
        List<String> definedClaimsList = null;

        validateInputParameters(new String[] { dialect, profileConfig });

        try {
            realm = getRealm();
            profileManager = realm.getProfileConfigurationManager();

            if (profileManager == null) {
                String message = "No profile configurations defined";
                if (log.isDebugEnabled()) {
                    log.debug(message);
                }
                return null;
            }

            claimManager = realm.getClaimManager();

            if (claimManager == null) {
                String message = "No claim configurations defined";
                if (log.isDebugEnabled()) {
                    log.debug(message);
                }
                throw new ProfileManagementException(message);
            }

            definedClaimsList = new ArrayList<String>();
            definedClaims = (Claim[]) claimManager.getAllClaims(dialect);

            for (int i = 0; i < definedClaims.length; i++) {
                definedClaimsList.add(definedClaims[i].getClaimUri());
            }

View Full Code Here

     *
     * @return
     * @throws Exception
     */
    private String[] getAllClaimDailects() throws Exception {
        ClaimManager claimsManager;
        UserRealm realm;
        Claim[] claims;
        List<String> dialects;

        realm = getRealm();
        claimsManager = realm.getClaimManager();

        if (claimsManager == null) {
            String message = "No claim configurations defined";
            if (log.isDebugEnabled()) {
                log.debug(message);
            }
            return null;
        }

        claims = (Claim[]) claimsManager.getAllClaims();
        dialects = new ArrayList<String>();

        for (int i = 0; i < claims.length; i++) {
            if (!dialects.contains(claims[i].getDialectURI())) {
                dialects.add(claims[i].getDialectURI());
View Full Code Here

     * @throws ProfileManagementException
     */
    public ClaimConfigurationDTO[] getClaimConfigurations(String dialect)
            throws ProfileManagementException {
        UserRealm realm = null;
        ClaimManager claimsManager = null;
        Claim[] claims = null;
        List<ClaimConfigurationDTO> claimList = null;

        validateInputParameters(new String[] { dialect });

        try {
            realm = getRealm();
            claimsManager = realm.getClaimManager();

            if (claimsManager == null) {
                String message = "No claim configurations defined";
                if (log.isDebugEnabled()) {
                    log.debug(message);
                }
                throw null;
            }

            claims = (Claim[]) claimsManager.getAllClaims(dialect);
            claimList = new ArrayList<ClaimConfigurationDTO>();

            for (int i = 0; i < claims.length; i++) {
                ClaimConfigurationDTO claim = new ClaimConfigurationDTO();
                claim.setClaimUri(claims[i].getClaimUri());
View Full Code Here

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here

TOP

Related Classes of org.wso2.carbon.user.core.claim.ClaimManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.