/**
 * Copyright 2008-2009 DRIVER PROJECT (ICM UW)
 * Original author: Marek Horst
 *
 * 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 eu.dnetlib.common.ws.subscription;

/**
 * Service notification constants.
 * @author mhorst
 *
 */
public class NotificationConstants {

	public static final String SUBSCR_TOPIC_SEPARATOR	 		= "/";
	
	public static final String NOTIFICATION_TOPIC_SEPARATOR		= ".";
	
	public static final String ASTERISK							= "*";
	
	public static final int TERMINATION_TIME_INFINITE 			= 0;
	
	public static final String TOPIC_PREFIX_CREATE	 			= "CREATE";
	
	public static final String TOPIC_PREFIX_UPDATE	 			= "UPDATE";
	
	public static final String TOPIC_PREFIX_DELETE	 			= "DELETE";
	
	public static final String TOPIC_BLACKBOARD_LAST_RESPONSE	= "RESOURCE_PROFILE" + SUBSCR_TOPIC_SEPARATOR + "BODY" + SUBSCR_TOPIC_SEPARATOR + "BLACKBOARD" + SUBSCR_TOPIC_SEPARATOR + "LAST_RESPONSE";
	
//	mdformat related notifications
	public static final String MD_FORMAT_RESOURCE_TYPE 			= "MDFormatDSResourceType";
	
	public static final String SUBSCR_TOPIC_CREATE_MD_FORMAT 	= TOPIC_PREFIX_CREATE + SUBSCR_TOPIC_SEPARATOR + MD_FORMAT_RESOURCE_TYPE;
	
	public static final String TOPIC_CREATE_MD_FORMAT 			= TOPIC_PREFIX_CREATE + NOTIFICATION_TOPIC_SEPARATOR + MD_FORMAT_RESOURCE_TYPE;
	
	public static final String SUBSCR_TOPIC_UPDATE_MD_FORMAT 	= TOPIC_PREFIX_UPDATE + SUBSCR_TOPIC_SEPARATOR + MD_FORMAT_RESOURCE_TYPE;
	
	public static final String TOPIC_UPDATE_MD_FORMAT 			= TOPIC_PREFIX_UPDATE + NOTIFICATION_TOPIC_SEPARATOR + MD_FORMAT_RESOURCE_TYPE;
	
	public static final String SUBSCR_TOPIC_DELETE_MD_FORMAT 	= TOPIC_PREFIX_DELETE + SUBSCR_TOPIC_SEPARATOR + MD_FORMAT_RESOURCE_TYPE;
	
	public static final String TOPIC_DELETE_MD_FORMAT 			= TOPIC_PREFIX_DELETE + NOTIFICATION_TOPIC_SEPARATOR + MD_FORMAT_RESOURCE_TYPE;
	
//	collection related notifications
	public static final String COLLECTION_RESOURCE_TYPE 		= "CollectionDSResourceType";
	
	public static final String SUBSCR_TOPIC_CREATE_COLLECTION 	= TOPIC_PREFIX_CREATE + SUBSCR_TOPIC_SEPARATOR + COLLECTION_RESOURCE_TYPE;
	
	public static final String TOPIC_CREATE_COLLECTION 			= TOPIC_PREFIX_CREATE + NOTIFICATION_TOPIC_SEPARATOR + COLLECTION_RESOURCE_TYPE;
	
	public static final String SUBSCR_TOPIC_UPDATE_COLLECTION 	= TOPIC_PREFIX_UPDATE + SUBSCR_TOPIC_SEPARATOR + COLLECTION_RESOURCE_TYPE;
	
	public static final String TOPIC_UPDATE_COLLECTION 			= TOPIC_PREFIX_UPDATE + NOTIFICATION_TOPIC_SEPARATOR + COLLECTION_RESOURCE_TYPE;
	
	public static final String SUBSCR_TOPIC_DELETE_COLLECTION 	= TOPIC_PREFIX_DELETE + SUBSCR_TOPIC_SEPARATOR + COLLECTION_RESOURCE_TYPE;
	
	public static final String TOPIC_DELETE_COLLECTION 			= TOPIC_PREFIX_DELETE + NOTIFICATION_TOPIC_SEPARATOR + COLLECTION_RESOURCE_TYPE;
	
//	IndexService related notification
	public static final String RES_PROF_MAIN_EL_NAME 			= "RESOURCE_PROFILE";
	
	public static final String RES_PROF_BODY_EL_NAME 			= "BODY";
	
	public static final String RES_PROF_STATUS_EL_NAME 			= "STATUS";
	
	public static final String RES_PROF_INDEX_READ_ONLY_EL_NAME = "READ_ONLY";
	
	
	
	public static final String INDEX_SERVICE_RESOURCE_TYPE 		= "IndexServiceResourceType";
	
	public static final String PREFIX_SUBSCR_TOPIC_UPDATE_INDEX_SERVICE= TOPIC_PREFIX_UPDATE + SUBSCR_TOPIC_SEPARATOR + 
																INDEX_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR;
	
	public static final String PREFIX_TOPIC_UPDATE_INDEX_SERVICE= TOPIC_PREFIX_UPDATE + NOTIFICATION_TOPIC_SEPARATOR + 
																INDEX_SERVICE_RESOURCE_TYPE + NOTIFICATION_TOPIC_SEPARATOR;
	
//	FIXME add to suffixes: 
//	 + SUBSCR_TOPIC_SEPARATOR +	RES_PROF_INDEX_READ_ONLY_EL_NAME
//	and:
//	 + NOTIFICATION_TOPIC_SEPARATOR + RES_PROF_INDEX_READ_ONLY_EL_NAME
//	currently subscribing to READ_ONLY doesn't work
	public static final String SUFFIX_SUBSCR_TOPIC_UPDATE_INDEX_SERVICE_STATUS	= SUBSCR_TOPIC_SEPARATOR + 
																RES_PROF_MAIN_EL_NAME + SUBSCR_TOPIC_SEPARATOR +
																RES_PROF_BODY_EL_NAME + SUBSCR_TOPIC_SEPARATOR +
																RES_PROF_STATUS_EL_NAME;
	
	public static final String SUFFIX_TOPIC_UPDATE_INDEX_SERVICE_STATUS= NOTIFICATION_TOPIC_SEPARATOR + 
																RES_PROF_MAIN_EL_NAME + NOTIFICATION_TOPIC_SEPARATOR +
																RES_PROF_BODY_EL_NAME + NOTIFICATION_TOPIC_SEPARATOR +
																RES_PROF_STATUS_EL_NAME;
	
	// Harvesting Services related
	public static final String HARVESTING_SERVICE_RESOURCE_TYPE 	= "HarvestingServiceResourceType";
	public static final String HARVESTING_INSTANCE_RESOURCE_TYPE 	= "HarvestingInstanceDSResourceType";
	
	public static final String PREFIX_SUBSCR_TOPIC_UPDATE_HARVESTING_SERVICE_LASTRESPONSE = TOPIC_PREFIX_UPDATE + SUBSCR_TOPIC_SEPARATOR + 
		HARVESTING_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR + ASTERISK + SUBSCR_TOPIC_SEPARATOR + TOPIC_BLACKBOARD_LAST_RESPONSE;
	public static final String PREFIX_SUBSCR_TOPIC_CREATE_HARVESTING_SERVICE= TOPIC_PREFIX_CREATE + SUBSCR_TOPIC_SEPARATOR + 
		HARVESTING_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR;
	public static final String PREFIX_SUBSCR_TOPIC_DELETE_HARVESTING_SERVICE= TOPIC_PREFIX_DELETE + SUBSCR_TOPIC_SEPARATOR + 
		HARVESTING_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR;

	// Transformation Service related
	public static final String TRANSFORMATION_SERVICE_RESOURCE_TYPE	= "TransformationServiceResourceType";
	
	public static final String PREFIX_SUBSCR_TOPIC_UPDATE_TRANSFORMATION_SERVICE= TOPIC_PREFIX_UPDATE + SUBSCR_TOPIC_SEPARATOR + 
	TRANSFORMATION_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR;
	public static final String PREFIX_SUBSCR_TOPIC_CREATE_TRANSFORMATION_SERVICE= TOPIC_PREFIX_CREATE + SUBSCR_TOPIC_SEPARATOR + 
	TRANSFORMATION_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR;
	public static final String PREFIX_SUBSCR_TOPIC_DELETE_TRANSFORMATION_SERVICE= TOPIC_PREFIX_DELETE + SUBSCR_TOPIC_SEPARATOR + 
	TRANSFORMATION_SERVICE_RESOURCE_TYPE + SUBSCR_TOPIC_SEPARATOR;
	
}
