@Override protected Representation get() throws ResourceException { return new StringRepresentation( restValuesFactory.caApiURIs().toJSON(), MediaType.APPLICATION_JSON ); }
@Override public CaApiURIsValue caApiURIs() { Reference rootRef = restApi.apiRootRef(); ValueBuilder<CaApiURIsValue> caApiBuilder = vbf.newValueBuilder( CaApiURIsValue.class ); CaUriBuilder caUriBuilder = new CaUriBuilder( rootRef ); CaApiURIsValue caApi = caApiBuilder.prototype(); // API Root caApi.uri().set( rootRef.toString() ); // Tools caApi.cryptoInspectorUri().set( caUriBuilder.tools().cryptoInspector().build() ); // Domain caApi.cryptoStoreListUri().set( caUriBuilder.cryptoStore().build() ); caApi.caListUri().set( caUriBuilder.ca().build() ); caApi.x509ProfileListUri().set( caUriBuilder.x509Profile().build() ); caApi.x509ListUri().set( caUriBuilder.x509().build() ); caApi.escrowedKeyPairListUri().set( caUriBuilder.escrowedKeyPair().build() ); return caApiBuilder.newInstance(); }
@Override public Iterable<CryptoStoreValue> list( int start ) { String jsonCryptoStoreList = restClient.getJSON( restClient.fetchApiURIs().cryptoStoreListUri().get() ); RestListValue restList = vbf.newValueFromJSON( RestListValue.class, jsonCryptoStoreList ); return new RestListValueIterable<CryptoStoreValue>( restList ); }
@Override public Iterable<CAValue> list( int start ) { String jsonCaList = restClient.getJSON( restClient.fetchApiURIs().caListUri().get() ); RestListValue restList = vbf.newValueFromJSON( RestListValue.class, jsonCaList ); return new RestListValueIterable<CAValue>( restList ); }
@Override public Iterable<CryptoStoreValue> list( int start ) { String jsonCryptoStoreList = restClientService.getJSON( restClientService.fetchApiURIs().cryptoStoreListUri().get() ); RestListValue restList = valueBuilderFactory.newValueFromJSON( RestListValue.class, jsonCryptoStoreList ); return new RestListValueIterable<CryptoStoreValue>( restList ); }
@Override public CAValue create( CAFactoryParamsValue params ) { String jsonCa = restClient.postJSON( restClient.fetchApiURIs().caListUri().get(), params.toJSON() ); return vbf.newValueFromJSON( CAValue.class, jsonCa ); }
@Override public CryptoStoreValue create( CryptoStoreFactoryParamsValue params ) { String jsonCryptoStore = restClient.postJSON( restClient.fetchApiURIs().cryptoStoreListUri().get(), params.toJSON() ); return vbf.newValueFromJSON( CryptoStoreValue.class, jsonCryptoStore ); }