public static SiteIdentifier single (final int siteId, final String siteString) {
        return new SiteIdentifier() {
            public int identifySite (HttpServletRequest req) {
                return siteId;
            }
            public String getSiteString (int siteId) {
                return siteString;
            }
            public int getSiteId (String siteString) {
                return siteId;
            }
            public Iterator<Site> enumerateSites () {
                return Collections.singletonList(new Site(siteId, siteString)).iterator();
            }
        };
    }
public static SiteIdentifier single ( final int siteId , final String siteString ) { return new SiteIdentifier ( ) { public int identifySite ( HttpServletRequest req ) { return siteId ; } public String getSiteString ( int siteId ) { return siteString ; } public int getSiteId ( String siteString ) { return siteId ; } public Iterator < Site > enumerateSites ( ) { return Collections . singletonList ( new Site ( siteId , siteString ) ) . iterator ( ) ; } } ; }
Returns a site identifier that returns the specified site always.