public LinksBuilder( ValueBuilderFactory vbf ) { this.vbf = vbf; linksBuilder = vbf.newValueBuilder( Links.class ); linkBuilder = vbf.newValueBuilder( Link.class ); }
@Override public CAValue get( String uri ) { String jsonCa = restClient.getJSON( uri ); return vbf.newValueFromJSON( CAValue.class, jsonCa ); }
public T addLink( Link link ) { linksBuilder.prototype().links().get().add( link ); linkBuilder = vbf.newValueBuilderWithPrototype( link ); return (T) this; }
public QueryBuilder( ValueBuilderFactory vbf ) { queryBuilder = vbf.newValueBuilder( TableQuery.class ); }
@Override public CryptoStoreValue get( String uri ) { String jsonCryptoStore = restClient.getJSON( uri ); return vbf.newValueFromJSON( CryptoStoreValue.class, jsonCryptoStore ); }
public TableBuilder(ValueBuilderFactory vbf) { this.vbf = vbf; tableBuilder = vbf.newValueBuilder(Table.class); }
@Override public CaApiURIsValue fetchApiURIs() { String jsonApi = getJSON( API_URI ); return valueBuilderFactory.newValueFromJSON( CaApiURIsValue.class, jsonApi ); }
public TableBuilder row() { if (rowBuilder != null) endRow(); rowBuilder = vbf.newValueBuilder(Row.class); return this; }
@Override public CaApiURIsValue fetchApiURIs() { String jsonApi = getJSON( API_URI ); return valueBuilderFactory.newValueFromJSON( CaApiURIsValue.class, jsonApi ); }
public TableBuilder(ValueBuilderFactory vbf, Map<String, TableBuilderFactory.Column> columns, TableQuery tableQuery) { this.vbf = vbf; this.columns = columns; this.tableQuery = tableQuery; tableBuilder = vbf.newValueBuilder(Table.class); if (tableQuery.select().equals("*")) { for (TableBuilderFactory.Column column : columns.values()) { column(column.getId(), column.getLabel(), column.getType()); } } else { for (String columnName : tableQuery.select().split("[, ]")) { TableBuilderFactory.Column column = columns.get(columnName.trim()); if (column != null) column(column.getId(), column.getLabel(), column.getType()); } } }
@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 RestListValue newListRepresentationValue( Reference listRef, int start, Iterable<RestValue> items ) { ValueBuilder<RestListValue> builder = vbf.newValueBuilder( RestListValue.class ); RestListValue listRepresentation = builder.prototype(); listRepresentation.uri().set( listRef.toString() ); listRepresentation.start().set( start ); for ( RestValue eachItem : items ) { listRepresentation.items().get().add( eachItem ); } return builder.newInstance(); }
@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 ); }
public TableBuilder cell(Object v, String f) { ValueBuilder<Cell> cellBuilder = vbf.newValueBuilder(Cell.class); cellBuilder.prototype().v().set(v); cellBuilder.prototype().f().set(f); rowBuilder.prototype().c().get().add(cellBuilder.newInstance()); return this; }
@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 ); }
profile.netscapeCertComment().set( comment ); if ( keyUsages != null ) { profile.keyUsages().set( vbf.newValueBuilder( KeyUsagesValue.class ). withPrototype( keyUsages ).newInstance() ); profile.extendedKeyUsages().set( vbf.newValueBuilder( ExtendedKeyUsagesValue.class ). withPrototype( extendedKeyUsages ).newInstance() ); profile.netscapeCertTypes().set( vbf.newValueBuilder( NetscapeCertTypesValue.class ). withPrototype( netscapeCertTypes ).newInstance() ); profile.basicConstraints().set( vbf.newValueBuilder( BasicConstraintsValue.class ). withPrototype( basicConstraints ).newInstance() ); profile.nameConstraints().set( vbf.newValueBuilder( NameConstraintsValue.class ). withPrototype( nameConstraints ).newInstance() );
@Override public CAValue create( CAFactoryParamsValue params ) { String jsonCa = restClient.postJSON( restClient.fetchApiURIs().caListUri().get(), params.toJSON() ); return vbf.newValueFromJSON( CAValue.class, jsonCa ); }
public TableBuilder column(String id, String label, String type) { ValueBuilder<Column> builder = vbf.newValueBuilder(Column.class); builder.prototype().id().set(id); if (tableQuery != null && tableQuery.label() != null) { // TODO Fix label selection } builder.prototype().label().set(label); builder.prototype().columnType().set(type); tableBuilder.prototype().cols().get().add(builder.newInstance()); return this; }
@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 ); }
ValueBuilder<TransactionApplicationEvents> builder = vbf.newValueBuilder( TransactionApplicationEvents.class ); Iterables.addAll( builder.prototype().events().get(), events ); builder.prototype().timestamp().set( getCurrentTimestamp() );