/*
 * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.wso2.carbon.identity.claim.metadata.mgt.util;

import org.wso2.carbon.user.core.UserCoreConstants;

/**
 * Holds the claim metadata related constants
 */
public class ClaimConstants {

    public static final String LOCAL_CLAIM_DIALECT_URI = UserCoreConstants.DEFAULT_CARBON_DIALECT;

    public static final String DIALECT_PROPERTY = "Dialect";
    public static final String DISPLAY_NAME_PROPERTY = "DisplayName";
    public static final String ATTRIBUTE_ID_PROPERTY = "AttributeID";
    public static final String DESCRIPTION_PROPERTY = "Description";
    public static final String REQUIRED_PROPERTY = "Required";
    public static final String DISPLAY_ORDER_PROPERTY = "DisplayOrder";
    public static final String SUPPORTED_BY_DEFAULT_PROPERTY = "SupportedByDefault";
    public static final String REGULAR_EXPRESSION_PROPERTY = "RegEx";
    public static final String READ_ONLY_PROPERTY = "ReadOnly";
    public static final String CLAIM_URI_PROPERTY = "ClaimURI";

    public static final String DEFAULT_ATTRIBUTE = "DefaultAttribute";
    public static final String MAPPED_LOCAL_CLAIM_PROPERTY = "MappedLocalClaim";

    /**
     * Enum for error messages.
     */
    public enum ErrorMessage {

        ERROR_CODE_EMPTY_CLAIM_DIALECT("500026",
                "Claim dialect cannot be empty"),
        ERROR_CODE_EMPTY_LOCAL_CLAIM_URI("500027",
                "Local claim URI cannot be empty"),
        ERROR_CODE_EMPTY_MAPPED_ATTRIBUTES_IN_LOCAL_CLAIM("500028",
                "Mapped attribute of the claim dialect URI : %s and Claim URI : %s cannot be empty"),
        ERROR_CODE_LOCAL_CLAIM_HAS_MAPPED_EXTERNAL_CLAIM("500029",
                "Cannot remove local claim %s while having associations with external claims."),
        ERROR_CODE_EMPTY_EXTERNAL_CLAIM_URI("500030",
                "External claim URI cannot be empty"),
        ERROR_CODE_INVALID_EXTERNAL_CLAIM_DIALECT("500031",
                "Invalid external claim dialect " + LOCAL_CLAIM_DIALECT_URI),
        ERROR_CODE_EMPTY_EXTERNAL_DIALECT_URI("500032",
                "External dialect URI cannot be empty"),
        ERROR_CODE_MAPPED_TO_EMPTY_LOCAL_CLAIM_URI("500033",
                "Mapped local claim URI cannot be empty")
        ;

        private final String code;
        private final String message;

        ErrorMessage(String code, String message) {

            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public String getMessage() {
            return message;
        }
    }
}

@@ -1894,14 +1894,14 @@
 CT(%22
-500026
+100001
 %22,%0A 
@@ -1995,14 +1995,14 @@
 RI(%22
-5
+10
 0002
-7
 %22,%0A 
@@ -2115,14 +2115,14 @@
 IM(%22
-500028
+100003
 %22,%0A 
@@ -2284,14 +2284,14 @@
 IM(%22
-500029
+100004
 %22,%0A 
@@ -2435,14 +2435,14 @@
 RI(%22
-500030
+100005
 %22,%0A 
@@ -2550,14 +2550,14 @@
 CT(%22
-500031
+100006
 %22,%0A 
@@ -2684,14 +2684,14 @@
 RI(%22
-500032
+100007
 %22,%0A 
@@ -2802,14 +2802,14 @@
 RI(%22
-500033
+100008
 %22,%0A 
@@ -2864,25 +2864,16 @@
  empty%22)
-%0A        
 ;%0A%0A     

Change claim metadata management error codes