/** * Sets origin ID from a string. * * @param id id * @return this builder */ public Builder id(String id) { this.originId = Id.id(id); return this; }
/** * Sets origin ID from a string. * * @param id id * @return this builder */ public Builder id(String id) { this.originId = Id.id(id); return this; }
/** * Sets the ID of the application the origin belongs to from a string. * * @param applicationId application ID * @return this builder */ public Builder applicationId(String applicationId) { this.applicationId = Id.id(applicationId); return this; }
/** * Sets the ID of the application the origin belongs to from a string. * * @param applicationId application ID * @return this builder */ public Builder applicationId(String applicationId) { this.applicationId = Id.id(applicationId); return this; }
/** * Sets an ID. * * @param id an ID * @return this builder */ public Builder id(String id) { return id(Id.id(id)); }
/** * Sets an ID. * * @param id an ID * @return this builder */ public Builder id(String id) { return id(Id.id(id)); }
@Override public Id id() { return Id.id(key); }
Origin(String originId, String host) { this.originId = Id.id(originId); this.host = HostAndPort.fromString(host); this.hostAsString = this.host.toString(); this.applicationId = GENERIC_APP; this.hashCode = Objects.hash(this.host, this.originId); }
Origin(String originId, String host) { HostAndPort hostAndPort = HostAndPort.fromString(host); this.originId = Id.id(originId); this.host = hostAndPort.getHostText(); this.port = hostAndPort.getPort(); this.hostAsString = hostAndPort.toString(); this.applicationId = GENERIC_APP; this.hashCode = Objects.hash(this.host, this.originId); }
OriginsSnapshot(String appId, Collection<Origin> activeOrigins, Collection<Origin> inactiveOrigins, Collection<Origin> disabledOrigins) { this.appId = id(appId); this.activeOrigins = withAppId(activeOrigins, appId); this.inactiveOrigins = withAppId(inactiveOrigins, appId); this.disabledOrigins = withAppId(disabledOrigins, appId); mapOriginsById(); }
OriginsSnapshot(String appId, Collection<Origin> activeOrigins, Collection<Origin> inactiveOrigins, Collection<Origin> disabledOrigins) { this.appId = id(appId); this.activeOrigins = withAppId(activeOrigins, appId); this.inactiveOrigins = withAppId(inactiveOrigins, appId); this.disabledOrigins = withAppId(disabledOrigins, appId); mapOriginsById(); }
if (!originsInventorySnapshotMap.containsKey(id(appId))) { return response(BAD_REQUEST) .body(format(INVALID_APP_ID_FORMAT, appId), UTF_8) if (!validOriginId(id(appId), id(originId))) { return response(BAD_REQUEST) .body(format(INVALID_ORIGIN_ID_FORMAT, originId, appId), UTF_8) Object originCommand = newOriginCommand(cmd, id(appId), id(originId)); eventBus.post(originCommand);