src/com/shrewdify/diaroser/utils/ElementParser.java
public int checkValid(Hashtable<Integer, Avp> hs, String uri) throws NoSpaceException, UnsupportedEncodingException {
		String realm = new String(hs.get(Dictionary.ORIGIN_REALM).rawData);
		int authappid =bytesToInt(hs.get(Dictionary.AUTH_APPLICATION_ID).rawData);
		String uri1 = bytesToOctetString(hs.get(Dictionary.ORIGIN_HOST).rawData);
		if(realm.equals(Config.realm)){
			if(authappid == 4){
				if(uri1.equals(uri)){
					return 1;
				}
				else
					return -5;
			}
			else return -2;
		}
		return -1;
	}
/**
	 * 
	 * 
	 * @param hs
	 * @param uri
	 * @return
	 * @throws NoSpaceException
	 * @throws UnsupportedEncodingException
	 * 
	 * Check valid for the given data, it checks for valid Realm Name, Auth application Id, Orgin Host.
	 */


Check valid for the given data, it checks for valid Realm Name, Auth application Id, Orgin Host.
Check valid for the given data it checks for valid Realm Name Auth application Id Orgin Host .
public int checkValid(Hashtable<Integer, Avp> hs, String uri) throws NoSpaceException, UnsupportedEncodingException {
		String realm = new String(hs.get(Dictionary.ORIGIN_REALM).rawData);
		int authappid =bytesToInt(hs.get(Dictionary.AUTH_APPLICATION_ID).rawData);
		String uri1 = bytesToOctetString(hs.get(Dictionary.ORIGIN_HOST).rawData);
		if(realm.equals(Config.realm)){
			if(authappid == 4){
				if(uri1.equals(uri)){
					return 1;
				}
				else
					return -5;
			}
			else return -2;
		}
		return -1;
	}
public int checkValid ( Hashtable < Integer , Avp > hs , String uri ) throws NoSpaceException , UnsupportedEncodingException { String realm = new String ( hs . get ( Dictionary . ORIGIN_REALM ) . rawData ) ; int authappid = bytesToInt ( hs . get ( Dictionary . AUTH_APPLICATION_ID ) . rawData ) ; String uri1 = bytesToOctetString ( hs . get ( Dictionary . ORIGIN_HOST ) . rawData ) ; if ( realm . equals ( Config . realm ) ) { if ( authappid == 4 ) { if ( uri1 . equals ( uri ) ) { return 1 ; } else return - 5 ; } else return - 2 ; } return - 1 ; }