public static GetRepositoryItem parse( Map<String, String> normalizedKVPParams ) { Version version = Version.parseVersion( KVPUtils.getRequired( normalizedKVPParams, "VERSION" ) ); if ( VERSION_202.equals( version ) || VERSION_100.equals( version ) ) { return new GetRepositoryItem( KVPUtils.getRequired( normalizedKVPParams, "ID" ) ); } else { String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 ) + Version.getVersionsString( VERSION_100 ) ); throw new InvalidParameterValueException( msg ); } }
@Override protected Version getServiceVersion() { return new Version( 1, 3, 0 ); }
private static Version parseVersion( Map<String, String> kvp ) throws OWSException { String version = KVPUtils.getRequired( kvp, "VERSION" ); if ( !Version.parseVersion( version ).equals( VERSION_100 ) ) { throw new OWSException( "Version must be: " + VERSION_100.toString(), OWSException.INVALID_PARAMETER_VALUE ); } return VERSION_100; } }
public TransactionXmlReader createReader( Version version ) { if ( VERSION_100.equals( version ) ) { return new TransactionXmlReader100(); } else if ( VERSION_110.equals( version ) ) { return new TransactionXmlReader110(); } else if ( VERSION_200.equals( version ) ) { return new TransactionXmlReader200(); } String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_100, VERSION_110, VERSION_200 ) ); throw new InvalidParameterValueException( msg ); }
/** * Returns the old-style version information (used by pre-OWS GetCapabilities requests, see section D.11 of OGC * 06-121r3). * * @return old-style version information, may be <code>null</code> (if this is an OWS-style request or an pre-OWS * request without version specification) * @throws InvalidParameterValueException * if any of the versions is not syntactically correct */ public Version getVersionAsVersion() throws InvalidParameterValueException { return Version.parseVersion( version ); }
/** * Constructs a new <code>GetCapabilities</code> request that specifies the requested version in a pre-OWS fashion * (see section D.11 of OGC 06-121r3). * * @param version * old-style version information, may be <code>null</code> */ public GetCapabilities( Version version ) { if ( version != null ) { this.version = version.toString(); } }
Version versionConstraint = Version.parseVersion( constraintStringVersion ); if ( versionConstraint.equals( new Version( 1, 1, 0 ) ) ) { } else if ( versionConstraint.equals( new Version( 1, 0, 0 ) ) ) { constraint = Filter100XMLDecoder.parse( xmlStream ); } else { String msg = Messages.get( "CSW_FILTER_VERSION_NOT_SPECIFIED", versionConstraint, Version.getVersionsString( new Version( 1, 1, 0 ) ), Version.getVersionsString( new Version( 1, 0, 0 ) ) ); LOG.info( msg ); throw new InvalidParameterValueException( msg );
if ( versionConstraintUpdate.equals( new Version( 1, 1, 0 ) ) ) { constraintUpdate = Filter110XMLDecoder.parse( xmlStream ); } else if ( versionConstraintUpdate.equals( new Version( 1, 0, 0 ) ) ) { constraintUpdate = Filter100XMLDecoder.parse( xmlStream ); } else { String msg = Messages.get( "CSW_FILTER_VERSION_NOT_SPECIFIED", versionConstraintUpdate, Version.getVersionsString( new Version( 1, 1, 0 ) ), Version.getVersionsString( new Version( 1, 0, 0 ) ) ); LOG.info( msg ); throw new InvalidParameterValueException( msg );
Version v = null; try { v = Version.parseVersion( version ); } catch ( InvalidParameterValueException n ) { if ( v.compareTo( new Version( 2, 1, 2 ) ) <= 0 ) { result = GML_2; } else if ( v.compareTo( new Version( 3, 0, 1 ) ) <= 0 ) { result = GML_30; } else if ( v.compareTo( new Version( 3, 1, 1 ) ) <= 0 ) { result = GML_31; } else if ( v.compareTo( new Version( 3, 2, 1 ) ) <= 0 ) { result = GML_32;
@Override public Version checkVersion( Version version ) { if ( VERSION_100.equals( version ) ) return VERSION_202; return version; }
appendKVP( sb, "VERSION", version.toString() ); appendKVP( sb, "REQUEST", "DescribeFeatureType" ); if ( request.getOutputFormat() != null ) { if ( !version.equals( VERSION_100 ) && nsBindings.size() > 0 ) { StringBuffer namespaceList = new StringBuffer(); for ( String namespace : nsBindings.keySet() ) {
protected WMSCapabilitiesAdapter getCapabilitiesAdapter( OMElement root, String version ) throws IOException { if ( version != null ) { wmsVersion = Version.parseVersion( version ); } else { LOG.warn( "No version attribute in WMS capabilities document. Defaulting to 1.1.1." ); wmsVersion = VERSION_111; } if ( VERSION_111.equals( wmsVersion ) ) { return new WMS111CapabilitiesAdapter( root ); } else if ( VERSION_130.equals( wmsVersion ) ) { return new WMS130CapabilitiesAdapter( root ); } throw new IllegalArgumentException( get( "WMSCLIENT.WRONG_VERSION_CAPABILITIES", getIdentification().getServiceTypeVersion(), VERSION_111 + ", " + VERSION_130 ) ); }
Version acceptableVersion = null; try { acceptableVersion = Version.parseVersion( acceptableVersionString ); } catch ( InvalidParameterValueException e ) { throw new OWSException( "Version negotiation failed. Specified accept version: '" String versionsString = Version.getVersionsString( request.getAcceptVersionsAsVersions().toArray( new Version[request.getAcceptVersions().size()] ) ); throw new OWSException( "Version negotiation failed. No support for version(s): " + versionsString, OWSException.VERSION_NEGOTIATION_FAILED ); } else { Version lowestOfferedVersion = offeredVersions.first(); if ( requestedVersion.compareTo( lowestOfferedVersion ) < 0 ) { if ( offeredVersion.compareTo( requestedVersion ) > 0 ) { break;
private WFSVersion( String ogcVersion, String ns ) { this.ogcVersion = Version.parseVersion( ogcVersion ); this.ns = ns; }
/** * Returns the offered protocol versions. * * @return the offered protocol versions */ public List<String> getOfferedVersions() { List<String> versions = new ArrayList<String>( offeredVersions.size() ); for ( Version version : offeredVersions ) { versions.add( version.toString() ); } return versions; }
if ( versionConstraint.equals( new Version( 1, 1, 0 ) ) ) { } else if ( versionConstraint.equals( new Version( 1, 0, 0 ) ) ) { constraint = Filter100XMLDecoder.parse( xmlStream ); } else { String msg = Messages.get( "CSW_FILTER_VERSION_NOT_SPECIFIED", versionConstraint, Version.getVersionsString( new Version( 1, 1, 0 ) ), Version.getVersionsString( new Version( 1, 0, 0 ) ) ); LOG.info( msg ); throw new InvalidParameterValueException( msg );
@Override public String getGetRecordByIdSchemaLocation( Version version ) { if ( VERSION_202.equals( version ) ) { return CSW_202_NS + " " + CSW_202_DISCOVERY_SCHEMA; } return null; }